|
|
|
@@ -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({ |
|
|
|
|