diff --git a/components/questionnaire/questionnaire.js b/components/questionnaire/questionnaire.js index ade820b..cc1449a 100644 --- a/components/questionnaire/questionnaire.js +++ b/components/questionnaire/questionnaire.js @@ -8,7 +8,6 @@ Component({ } }, data: { - flag: false, widthScreen: null, moveData: null, rotateData: null, @@ -16,12 +15,15 @@ Component({ scaleData: null, skewData: null, matrixData: null, - zindex:null, }, methods:{ close:function(){ this.alphaClick(); this.queueClick(); + // 子组件向父组件传值 + // 传值到 coupon=>detail页面 + var myEvent = "questions"; + this.triggerEvent('myevent', myEvent); }, /** * 点击提交问题 @@ -32,30 +34,22 @@ Component({ console.log(e.target.dataset.question) this.alphaClick(); this.queueClick(); + // 子组件向父组件传值 + // 传值到 coupon=>detail页面 + var myEvent1 = "questions"; + this.triggerEvent('myevent1', myEvent1); }, queueClick: function () { let that = this; var animation = wx.createAnimation({}); - animation.translate((this.data.widthScreen - 0), 0).scale(0).opacity(0.5).step({ duration: 1000 }) + animation.translate((this.data.widthScreen - 0), 0).scale(0).opacity(0.5).step({ duration: 1500 }) that.setData({ queueData: animation.export()}) - setTimeout(function () { - that.setData({ - flag: true - }) - }, 1000) }, alphaClick: function (even) { let that = this; var animation = wx.createAnimation({}) - animation.opacity(0).step({ duration: 1000 }) + animation.opacity(0).step({ duration: 1500 }) that.setData({ alphaData: animation.export()}); - setTimeout(function(){ - that.setData({ - flag:true - }) - },1000) } }, - onLoad(){ - } }); \ No newline at end of file diff --git a/components/questionnaire/questionnaire.wxml b/components/questionnaire/questionnaire.wxml index dc83d12..1527beb 100644 --- a/components/questionnaire/questionnaire.wxml +++ b/components/questionnaire/questionnaire.wxml @@ -1,6 +1,7 @@ -