From 1038985c8ecbd2f14042f11aee51803c7ec8740d Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Thu, 25 Oct 2018 17:01:18 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E5=B0=8F=E7=A8=8B=E5=BA=8F=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E8=B0=83=E6=9F=A5=E8=BF=94=E5=9B=9E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/questionnaire/questionnaire.js | 26 +++--- components/questionnaire/questionnaire.wxml | 3 +- components/questionnaire/questionnaire.wxss | 10 ++- pages/coupon/detail/index.js | 89 +++++++++++++++------ pages/coupon/detail/index.wxml | 2 +- pages/coupon/detail/index.wxss | 3 + 6 files changed, 90 insertions(+), 43 deletions(-) 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 @@ -