@@ -8,7 +8,6 @@ Component({ | |||||
} | } | ||||
}, | }, | ||||
data: { | data: { | ||||
flag: false, | |||||
widthScreen: null, | widthScreen: null, | ||||
moveData: null, | moveData: null, | ||||
rotateData: null, | rotateData: null, | ||||
@@ -16,12 +15,15 @@ Component({ | |||||
scaleData: null, | scaleData: null, | ||||
skewData: null, | skewData: null, | ||||
matrixData: null, | matrixData: null, | ||||
zindex:null, | |||||
}, | }, | ||||
methods:{ | methods:{ | ||||
close:function(){ | close:function(){ | ||||
this.alphaClick(); | this.alphaClick(); | ||||
this.queueClick(); | this.queueClick(); | ||||
// 子组件向父组件传值 | |||||
// 传值到 coupon=>detail页面 | |||||
var myEvent = "questions"; | |||||
this.triggerEvent('myevent', myEvent); | |||||
}, | }, | ||||
/** | /** | ||||
* 点击提交问题 | * 点击提交问题 | ||||
@@ -32,30 +34,22 @@ Component({ | |||||
console.log(e.target.dataset.question) | console.log(e.target.dataset.question) | ||||
this.alphaClick(); | this.alphaClick(); | ||||
this.queueClick(); | this.queueClick(); | ||||
// 子组件向父组件传值 | |||||
// 传值到 coupon=>detail页面 | |||||
var myEvent1 = "questions"; | |||||
this.triggerEvent('myevent1', myEvent1); | |||||
}, | }, | ||||
queueClick: function () { | queueClick: function () { | ||||
let that = this; | let that = this; | ||||
var animation = wx.createAnimation({}); | 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()}) | that.setData({ queueData: animation.export()}) | ||||
setTimeout(function () { | |||||
that.setData({ | |||||
flag: true | |||||
}) | |||||
}, 1000) | |||||
}, | }, | ||||
alphaClick: function (even) { | alphaClick: function (even) { | ||||
let that = this; | let that = this; | ||||
var animation = wx.createAnimation({}) | var animation = wx.createAnimation({}) | ||||
animation.opacity(0).step({ duration: 1000 }) | |||||
animation.opacity(0).step({ duration: 1500 }) | |||||
that.setData({ alphaData: animation.export()}); | 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}}"> | <view class='con' animation="{{queueData}}"> | ||||
<image class='close' mode='widthFix' src="./../../assets/img/closed.png" bindtap="close"></image> | <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='image' src="./../../assets/img/headbg.png" mode='widthFix'></image> | ||||
<image class='img image' src="./../../assets/img/ques_bg.png" mode='widthFix'></image> | <image class='img image' src="./../../assets/img/ques_bg.png" mode='widthFix'></image> | ||||
<view class='question' bindtap="formSubmit"> | <view class='question' bindtap="formSubmit"> | ||||
@@ -26,7 +26,7 @@ | |||||
} | } | ||||
.img { | .img { | ||||
margin-top: -48rpx; | |||||
margin-top: -50rpx; | |||||
} | } | ||||
.question { | .question { | ||||
@@ -67,7 +67,13 @@ | |||||
} | } | ||||
.close{ | .close{ | ||||
position: relative; | position: relative; | ||||
z-index: 1000000000000000; | |||||
z-index: 10000; | |||||
display: block; | display: block; | ||||
width: 70rpx; | width: 70rpx; | ||||
} | |||||
.ques_gou{ | |||||
position: absolute; | |||||
width: 20rpx; | |||||
top: 160rpx; | |||||
left: 23rpx; | |||||
} | } |
@@ -6,28 +6,34 @@ const util = require("../../../utils/util"); | |||||
Page({ | Page({ | ||||
data: { | data: { | ||||
data: {}, | data: {}, | ||||
questions:null, | |||||
display:"none", | |||||
carList: [], | carList: [], | ||||
couponChannelId: null, | couponChannelId: null, | ||||
couponId: null, | couponId: null, | ||||
orderId: "", | orderId: "", | ||||
hour: "", | |||||
hour: null, | |||||
minute: "", | minute: "", | ||||
tempFilePaths: '', | |||||
tempFilePaths: null, | |||||
userInfo: {}, | userInfo: {}, | ||||
hasUserInfo: false, | hasUserInfo: false, | ||||
canIUse: wx.canIUse('button.open-type.getUserInfo'), | canIUse: wx.canIUse('button.open-type.getUserInfo'), | ||||
id: '', | |||||
id: null, | |||||
result: [], | result: [], | ||||
end_time: '', | |||||
end_time: null, | |||||
clock: "已经截止", | clock: "已经截止", | ||||
questionnaire: { | questionnaire: { | ||||
title: "问题1" , | |||||
title: "小主,您有娃吗 ?" , | |||||
questions: [ | questions: [ | ||||
{ ques: "小主,您有喜欢的小鲜肉吗?" }, | |||||
{ ques: "小主,您有娃吗?" }] | |||||
{ ques: "有" }, | |||||
{ ques: "木有" }] | |||||
}, | }, | ||||
}, | }, | ||||
onShow:function(){ | |||||
this.setData({ | |||||
display:"none", | |||||
}) | |||||
}, | |||||
phone: function () { | phone: function () { | ||||
let that = this; | let that = this; | ||||
console.log(that.data); | 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) { | countdown(end_time) { | ||||
let that = this; | let that = this; | ||||
var EndTime = end_time; | var EndTime = end_time; | ||||
@@ -45,7 +69,6 @@ Page({ | |||||
var total_micro_second = EndTime - NowTime || []; | var total_micro_second = EndTime - NowTime || []; | ||||
// 渲染倒计时时钟 | // 渲染倒计时时钟 | ||||
let obj = that.dateformat(total_micro_second); | let obj = that.dateformat(total_micro_second); | ||||
if (total_micro_second>0){ | if (total_micro_second>0){ | ||||
that.setData({ | that.setData({ | ||||
clock: obj, | clock: obj, | ||||
@@ -127,8 +150,8 @@ Page({ | |||||
}); | }); | ||||
if (res.data.validType == 1) { | if (res.data.validType == 1) { | ||||
that.setData({ | 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 { | } else { | ||||
that.setData({ | that.setData({ | ||||
@@ -161,7 +184,7 @@ Page({ | |||||
/** | /** | ||||
* 发起支付 | * 发起支付 | ||||
*/ | */ | ||||
orderFunc() { | |||||
orderFunc(flag) { | |||||
var that = this; | var that = this; | ||||
wx.showLoading({ | wx.showLoading({ | ||||
title: "加载中..." | title: "加载中..." | ||||
@@ -278,8 +301,6 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
console.log(res); | |||||
console.log("点击领取卡券一直在loading"); | |||||
if (typeof (res) != "undefined") { | if (typeof (res) != "undefined") { | ||||
console.log("", res); | console.log("", res); | ||||
let orderId = "" + res.data.id; | let orderId = "" + res.data.id; | ||||
@@ -358,20 +379,42 @@ Page({ | |||||
}); | }); | ||||
} else { | } else { | ||||
// 免费券 | // 免费券 | ||||
/** | |||||
* @Meo | |||||
* 功能:用户问卷调查功能 | |||||
*/ | |||||
console.log(that.data.data.type); | |||||
that.setData({ | |||||
display:"block", | |||||
}) | |||||
that.payOrderUpdate(orderId, "0", 1); | that.payOrderUpdate(orderId, "0", 1); | ||||
wx.setStorage({ | wx.setStorage({ | ||||
key: 'couponNum', | key: 'couponNum', | ||||
data: "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) { | if (that.data.data.type == 5) { | ||||
setTimeout(() => { | setTimeout(() => { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
@@ -90,4 +90,4 @@ | |||||
</view> | </view> | ||||
</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; | color: #fff; | ||||
font-weight:bold; | font-weight:bold; | ||||
background: #ff4949; | background: #ff4949; | ||||
} | |||||
.ques{ | |||||
display: none; | |||||
} | } |