@@ -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(){ | |||
} | |||
}); |
@@ -1,6 +1,7 @@ | |||
<view class="b1" hidden="{{flag}}" style='z-index:{{zindex}};' animation="{{alphaData}}"> | |||
<view class="b1" animation="{{alphaData}}"> | |||
<view class='con' animation="{{queueData}}"> | |||
<image class='close' mode='widthFix' src="./../../assets/img/closed.png" bindtap="close"></image> | |||
<image class='ques_gou' mode='widthFix' src="./../../assets/img/ques_gou.png"></image> | |||
<image class='image' src="./../../assets/img/headbg.png" mode='widthFix'></image> | |||
<image class='img image' src="./../../assets/img/ques_bg.png" mode='widthFix'></image> | |||
<view class='question' bindtap="formSubmit"> | |||
@@ -26,7 +26,7 @@ | |||
} | |||
.img { | |||
margin-top: -48rpx; | |||
margin-top: -50rpx; | |||
} | |||
.question { | |||
@@ -67,7 +67,13 @@ | |||
} | |||
.close{ | |||
position: relative; | |||
z-index: 1000000000000000; | |||
z-index: 10000; | |||
display: block; | |||
width: 70rpx; | |||
} | |||
.ques_gou{ | |||
position: absolute; | |||
width: 20rpx; | |||
top: 160rpx; | |||
left: 23rpx; | |||
} |
@@ -6,28 +6,34 @@ const util = require("../../../utils/util"); | |||
Page({ | |||
data: { | |||
data: {}, | |||
questions:null, | |||
display:"none", | |||
carList: [], | |||
couponChannelId: null, | |||
couponId: null, | |||
orderId: "", | |||
hour: "", | |||
hour: null, | |||
minute: "", | |||
tempFilePaths: '', | |||
tempFilePaths: null, | |||
userInfo: {}, | |||
hasUserInfo: false, | |||
canIUse: wx.canIUse('button.open-type.getUserInfo'), | |||
id: '', | |||
id: null, | |||
result: [], | |||
end_time: '', | |||
end_time: null, | |||
clock: "已经截止", | |||
questionnaire: { | |||
title: "问题1" , | |||
title: "小主,您有娃吗 ?" , | |||
questions: [ | |||
{ ques: "小主,您有喜欢的小鲜肉吗?" }, | |||
{ ques: "小主,您有娃吗?" }] | |||
{ ques: "有" }, | |||
{ ques: "木有" }] | |||
}, | |||
}, | |||
onShow:function(){ | |||
this.setData({ | |||
display:"none", | |||
}) | |||
}, | |||
phone: function () { | |||
let that = this; | |||
console.log(that.data); | |||
@@ -38,6 +44,24 @@ Page({ | |||
} | |||
}, | |||
/** | |||
* @Meo | |||
* 问卷调查组件传递的值 | |||
*/ | |||
close: function (e) { | |||
console.log(e.detail); | |||
let that = this; | |||
if (e.detail == 'questions') { | |||
this.orderFunc("questions"); | |||
} | |||
}, | |||
formSubmit:function(e){ | |||
console.log(e.detail); | |||
let that = this; | |||
if (e.detail == 'questions') { | |||
this.orderFunc("questions"); | |||
} | |||
}, | |||
countdown(end_time) { | |||
let that = this; | |||
var EndTime = end_time; | |||
@@ -45,7 +69,6 @@ Page({ | |||
var total_micro_second = EndTime - NowTime || []; | |||
// 渲染倒计时时钟 | |||
let obj = that.dateformat(total_micro_second); | |||
if (total_micro_second>0){ | |||
that.setData({ | |||
clock: obj, | |||
@@ -127,8 +150,8 @@ Page({ | |||
}); | |||
if (res.data.validType == 1) { | |||
that.setData({ | |||
validStartDate: util.formatTime(res.data.validStartDate, "yyyy-MM-dddd"), | |||
validEndDate: util.formatTime(res.data.validEndDate, "yyyy-MM-dddd"), | |||
validStartDate: util.formatTime(res.data.validStartDate, "yyyy-MM-dd"), | |||
validEndDate: util.formatTime(res.data.validEndDate, "yyyy-MM-dd"), | |||
}); | |||
} else { | |||
that.setData({ | |||
@@ -161,7 +184,7 @@ Page({ | |||
/** | |||
* 发起支付 | |||
*/ | |||
orderFunc() { | |||
orderFunc(flag) { | |||
var that = this; | |||
wx.showLoading({ | |||
title: "加载中..." | |||
@@ -278,8 +301,6 @@ Page({ | |||
} | |||
}) | |||
.then(res => { | |||
console.log(res); | |||
console.log("点击领取卡券一直在loading"); | |||
if (typeof (res) != "undefined") { | |||
console.log("", res); | |||
let orderId = "" + res.data.id; | |||
@@ -358,20 +379,42 @@ Page({ | |||
}); | |||
} else { | |||
// 免费券 | |||
/** | |||
* @Meo | |||
* 功能:用户问卷调查功能 | |||
*/ | |||
console.log(that.data.data.type); | |||
that.setData({ | |||
display:"block", | |||
}) | |||
that.payOrderUpdate(orderId, "0", 1); | |||
wx.setStorage({ | |||
key: 'couponNum', | |||
data: "couponNum" | |||
}) | |||
setTimeout(function () { | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
that.data.orderId | |||
}` | |||
}); | |||
}, 1000) | |||
//////////////////////////停车券 | |||
console.log(that.data.data.type) | |||
if (flag =='questions'){ | |||
setTimeout(function () { | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
that.data.orderId | |||
}` | |||
}); | |||
}, 1500) | |||
}else{ | |||
// setTimeout(function () { | |||
// wx.navigateTo({ | |||
// url: `/pages/order/detail/index?orderId=${ | |||
// that.data.orderId | |||
// }` | |||
// }); | |||
// }, 1000) | |||
} | |||
/** | |||
* @Meo | |||
* type | |||
* 5 停车券 | |||
*/ | |||
if (that.data.data.type == 5) { | |||
setTimeout(() => { | |||
wx.switchTab({ | |||
@@ -90,4 +90,4 @@ | |||
</view> | |||
</view> | |||
<!-- 问卷调查 --> | |||
<questionnaire questionnaire="{{questionnaire}}" bind:myevent="" /> | |||
<questionnaire wx:if="{{display=='block'}}" questionnaire="{{questionnaire}}" bind:myevent="close" bind:myevent1="formSubmit" /> |
@@ -345,4 +345,7 @@ page { | |||
color: #fff; | |||
font-weight:bold; | |||
background: #ff4949; | |||
} | |||
.ques{ | |||
display: none; | |||
} |