Commit ee0aff02 authored by 李维's avatar 李维

修改更新按钮的业务逻辑

parent 8ff370a0
......@@ -213,6 +213,15 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initCheckPannel();
this.initSlider();
this.switchQuestion(0, 0);
this.showHideMore(false)
window.addEventListener("message", (e)=> {
let msgData = e.data;
if(msgData.action === "is_show_more") {
const data = JSON.parse(msgData.data);
this.showHideMore(data.isShowMore)
}
})
}
cleanGameVar(){
......@@ -671,7 +680,7 @@ export class PlayComponent implements OnInit, OnDestroy {
break;
}
}
container.activeStatus = false
container.active = (status=false) => {
container.activeStatus = status
......@@ -988,7 +997,7 @@ export class PlayComponent implements OnInit, OnDestroy {
})
btnMore.ref.addChild(textSubmit.ref)
let btnMoreShadow = this.g_cartoon.createCartoonElementImageFunc("btn_submit_shadow", "btn_submit_shadow", (w, h)=>{
let btnMoreShadow = this.g_cartoon.createCartoonElementImageFunc("btn_submit_shadow_more", "btn_submit_shadow", (w, h)=>{
return {
sx: 941 / w,
sy: 216 / h,
......@@ -1006,8 +1015,23 @@ export class PlayComponent implements OnInit, OnDestroy {
this.subscribeMapDownEvent(btnMore.id, async ()=>{
this.g_cartoon.playAudio("sm_moreinfo")
await this.buttonPressAnimation(btnMore.id, btnMoreShadow.id)
let resultDataStr = []
this.m_blockGroup.forEach(group => {
let rightLetters = "";
let currentLetters = "";
group.forEach(block => {
rightLetters += block.getRightLetter();
currentLetters += block.getContentText();
});
resultDataStr.push({
rightLetters, currentLetters
})
});
console.log(JSON.stringify(resultDataStr))
window.parent.postMessage( {action: 'temp_send_result', data: JSON.stringify(resultDataStr)}, "*")
this.g_enableMapDown = true;
})
// 滚动面板
let scrollContent = this.g_cartoon.createCartoonElementShapeRect("check_scroll_pannel", 880, 985 * 5, "#FFFFFF");
scrollContent.ref.y = -985 / 2
......@@ -1065,6 +1089,18 @@ export class PlayComponent implements OnInit, OnDestroy {
})
}
showHideMore(status) {
let btn = this.g_cartoon.getCartoonElement("button_more_info")
let btnShadow = this.g_cartoon.getCartoonElement("btn_submit_shadow_more")
if(status) {
btn.ref.scaleX = btn.initScaleX;
btnShadow.ref.scaleX = btnShadow.initScaleX;
} else {
btn.ref.scaleX = 0;
btnShadow.ref.scaleX = 0;
}
}
initSlider() {
const updateSlider = (len) => {
let top = this.g_cartoon.getCartoonElement("slider-top");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment