Commit ee0aff02 authored by 李维's avatar 李维

修改更新按钮的业务逻辑

parent 8ff370a0
...@@ -213,6 +213,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -213,6 +213,15 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initCheckPannel(); this.initCheckPannel();
this.initSlider(); this.initSlider();
this.switchQuestion(0, 0); 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(){ cleanGameVar(){
...@@ -671,7 +680,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -671,7 +680,7 @@ export class PlayComponent implements OnInit, OnDestroy {
break; break;
} }
} }
container.activeStatus = false container.activeStatus = false
container.active = (status=false) => { container.active = (status=false) => {
container.activeStatus = status container.activeStatus = status
...@@ -988,7 +997,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -988,7 +997,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}) })
btnMore.ref.addChild(textSubmit.ref) 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 { return {
sx: 941 / w, sx: 941 / w,
sy: 216 / h, sy: 216 / h,
...@@ -1006,8 +1015,23 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1006,8 +1015,23 @@ export class PlayComponent implements OnInit, OnDestroy {
this.subscribeMapDownEvent(btnMore.id, async ()=>{ this.subscribeMapDownEvent(btnMore.id, async ()=>{
this.g_cartoon.playAudio("sm_moreinfo") this.g_cartoon.playAudio("sm_moreinfo")
await this.buttonPressAnimation(btnMore.id, btnMoreShadow.id) 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; this.g_enableMapDown = true;
}) })
// 滚动面板 // 滚动面板
let scrollContent = this.g_cartoon.createCartoonElementShapeRect("check_scroll_pannel", 880, 985 * 5, "#FFFFFF"); let scrollContent = this.g_cartoon.createCartoonElementShapeRect("check_scroll_pannel", 880, 985 * 5, "#FFFFFF");
scrollContent.ref.y = -985 / 2 scrollContent.ref.y = -985 / 2
...@@ -1065,6 +1089,18 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -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() { initSlider() {
const updateSlider = (len) => { const updateSlider = (len) => {
let top = this.g_cartoon.getCartoonElement("slider-top"); 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