|
@@ -29,25 +29,26 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
createDate: "", |
|
|
createDate: "", |
|
|
expiredTime: "", |
|
|
expiredTime: "", |
|
|
validStartDate:"", |
|
|
|
|
|
validEndDate:"", |
|
|
|
|
|
|
|
|
validStartDate: "", |
|
|
|
|
|
validEndDate: "", |
|
|
updateDate: "", |
|
|
updateDate: "", |
|
|
//存储计时器 |
|
|
//存储计时器 |
|
|
setInter: "", |
|
|
setInter: "", |
|
|
staticGamedata: {}, |
|
|
staticGamedata: {}, |
|
|
showIf: false, |
|
|
showIf: false, |
|
|
curHtml: '', |
|
|
curHtml: '', |
|
|
showhieRq:false, |
|
|
|
|
|
dynamicRq:"", |
|
|
|
|
|
expiredSeconds:0, |
|
|
|
|
|
templTiem:"" |
|
|
|
|
|
|
|
|
showhieRq: false, |
|
|
|
|
|
dynamicRq: "", |
|
|
|
|
|
expiredSeconds: 0, |
|
|
|
|
|
templTiem: "", |
|
|
|
|
|
contentType: "" |
|
|
}, |
|
|
}, |
|
|
onUnload:function(){ |
|
|
|
|
|
|
|
|
onUnload: function () { |
|
|
let that = this; |
|
|
let that = this; |
|
|
clearInterval(that.data.setInter); |
|
|
clearInterval(that.data.setInter); |
|
|
clearInterval(that.data.templTiem); |
|
|
clearInterval(that.data.templTiem); |
|
|
}, |
|
|
}, |
|
|
onHide:function(){ |
|
|
|
|
|
|
|
|
onHide: function () { |
|
|
let that = this; |
|
|
let that = this; |
|
|
clearInterval(that.data.setInter); |
|
|
clearInterval(that.data.setInter); |
|
|
clearInterval(that.data.templTiem); |
|
|
clearInterval(that.data.templTiem); |
|
@@ -92,7 +93,7 @@ Page({ |
|
|
// }) |
|
|
// }) |
|
|
// }, 200) |
|
|
// }, 200) |
|
|
// }, |
|
|
// }, |
|
|
setRq(){ |
|
|
|
|
|
|
|
|
setRq() { |
|
|
let _this = this |
|
|
let _this = this |
|
|
_this.setData({ |
|
|
_this.setData({ |
|
|
showhieRq: false, |
|
|
showhieRq: false, |
|
@@ -113,10 +114,10 @@ Page({ |
|
|
TYPE: "couponorder", |
|
|
TYPE: "couponorder", |
|
|
ID: _this.data.dynamicRq |
|
|
ID: _this.data.dynamicRq |
|
|
}) |
|
|
}) |
|
|
if (res.data.expiredSeconds==0){ |
|
|
|
|
|
|
|
|
if (res.data.expiredSeconds == 0) { |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
|
let inre = setInterval(() => { |
|
|
let inre = setInterval(() => { |
|
|
if (_this.data.expiredSeconds > 1) { |
|
|
if (_this.data.expiredSeconds > 1) { |
|
|
_this.setData({ |
|
|
_this.setData({ |
|
@@ -137,7 +138,7 @@ Page({ |
|
|
} |
|
|
} |
|
|
// util.qrcode("qrcode", url, 350, 350); |
|
|
// util.qrcode("qrcode", url, 350, 350); |
|
|
_this.createQrCode(url, "qrcode", 350, 350); |
|
|
_this.createQrCode(url, "qrcode", 350, 350); |
|
|
}).catch(err=>{ |
|
|
|
|
|
|
|
|
}).catch(err => { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: err.message, |
|
|
title: err.message, |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
@@ -176,7 +177,7 @@ Page({ |
|
|
codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14), |
|
|
codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14), |
|
|
couponorderstatus: options.couponorderstatus |
|
|
couponorderstatus: options.couponorderstatus |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
|
options.quancode && |
|
|
options.quancode && |
|
|
that.data.couponorderstatus == 0 |
|
|
that.data.couponorderstatus == 0 |
|
@@ -185,13 +186,31 @@ Page({ |
|
|
that.setRq()//动态二维码 //这个方法必须在拿到 options.quancode 后调用 |
|
|
that.setRq()//动态二维码 //这个方法必须在拿到 options.quancode 后调用 |
|
|
that.getHtml(options.quancode); |
|
|
that.getHtml(options.quancode); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取购买须知 |
|
|
|
|
|
Http.get({ |
|
|
|
|
|
url: config.api.couponOrderDetail, |
|
|
|
|
|
data: { |
|
|
|
|
|
couponOrderId: options.quancode |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
console.log(res.data, 'res.data'); |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
contentType: res.data.contentType, |
|
|
|
|
|
data: { |
|
|
|
|
|
remark: res.data.resmark |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
}) |
|
|
//获得优惠券的详情 |
|
|
//获得优惠券的详情 |
|
|
that.data.setInter = setInterval(function () { |
|
|
that.data.setInter = setInterval(function () { |
|
|
if ( |
|
|
if ( |
|
|
options.quancode && |
|
|
options.quancode && |
|
|
that.data.couponorderstatus == 0 |
|
|
that.data.couponorderstatus == 0 |
|
|
) { |
|
|
) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.couponOrderDetail, |
|
|
url: config.api.couponOrderDetail, |
|
|
data: { |
|
|
data: { |
|
@@ -228,7 +247,7 @@ Page({ |
|
|
pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd hh:mm:ss"), |
|
|
pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd hh:mm:ss"), |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
.catch(err => { |
|
|
.catch(err => { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
@@ -240,7 +259,7 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, 2000); |
|
|
}, 2000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 页面需要初始渲染的效果 |
|
|
* 页面需要初始渲染的效果 |
|
|
*/ |
|
|
*/ |
|
@@ -248,7 +267,7 @@ Page({ |
|
|
url: config.api.couponOrderDetail, |
|
|
url: config.api.couponOrderDetail, |
|
|
data: { |
|
|
data: { |
|
|
couponOrderId: options.quancode |
|
|
couponOrderId: options.quancode |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
couponorderstatus: res.data.couponOrderStatus, |
|
|
couponorderstatus: res.data.couponOrderStatus, |
|
@@ -259,13 +278,13 @@ Page({ |
|
|
updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"), |
|
|
updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"), |
|
|
createDate: util.formatTime(that.data.data.createDate, "yyyy-MM-dd hh:mm:ss") |
|
|
createDate: util.formatTime(that.data.data.createDate, "yyyy-MM-dd hh:mm:ss") |
|
|
}); |
|
|
}); |
|
|
if (that.data.data.validStartDate && that.data.data.validEndDate){ |
|
|
|
|
|
|
|
|
if (that.data.data.validStartDate && that.data.data.validEndDate) { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
validStartDate: util.formatTime(that.data.data.validStartDate, "yyyy-MM-dd hh:mm:ss"), |
|
|
validStartDate: util.formatTime(that.data.data.validStartDate, "yyyy-MM-dd hh:mm:ss"), |
|
|
validEndDate: util.formatTime(that.data.data.validEndDate, "yyyy-MM-dd hh:mm:ss") |
|
|
validEndDate: util.formatTime(that.data.data.validEndDate, "yyyy-MM-dd hh:mm:ss") |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
.catch(err => { |
|
|
.catch(err => { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
@@ -291,13 +310,13 @@ Page({ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
upDataRq(){ |
|
|
|
|
|
|
|
|
upDataRq() { |
|
|
console.log(1123) |
|
|
console.log(1123) |
|
|
}, |
|
|
}, |
|
|
createQrCode: function (url, canvasId, cavW, cavH) { |
|
|
createQrCode: function (url, canvasId, cavW, cavH) { |
|
|
//调用插件中的draw方法,绘制二维码图片 |
|
|
//调用插件中的draw方法,绘制二维码图片 |
|
|
let that = this; |
|
|
let that = this; |
|
|
QR.api.draw(url, canvasId, cavW, cavH, function (res) { |
|
|
|
|
|
|
|
|
QR.api.draw(url, canvasId, cavW, cavH, function (res) { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
tempFilePath: res |
|
|
tempFilePath: res |
|
|
}) |
|
|
}) |
|
|