Explorar el Código

upload

newEdition
HolyKnightIX hace 2 años
padre
commit
302aa80463
Se han modificado 3 ficheros con 54 adiciones y 36 borrados
  1. +41
    -22
      pages/couponorder/detail/index.js
  2. +12
    -12
      pages/couponorder/detail/index.wxml
  3. +1
    -2
      pages/dateLsit/dateLsit.wxss

+ 41
- 22
pages/couponorder/detail/index.js Ver fichero

@@ -29,25 +29,26 @@ Page({
},
createDate: "",
expiredTime: "",
validStartDate:"",
validEndDate:"",
validStartDate: "",
validEndDate: "",
updateDate: "",
//存储计时器
setInter: "",
staticGamedata: {},
showIf: false,
curHtml: '',
showhieRq:false,
dynamicRq:"",
expiredSeconds:0,
templTiem:""
showhieRq: false,
dynamicRq: "",
expiredSeconds: 0,
templTiem: "",
contentType: ""
},
onUnload:function(){
onUnload: function () {
let that = this;
clearInterval(that.data.setInter);
clearInterval(that.data.templTiem);
},
onHide:function(){
onHide: function () {
let that = this;
clearInterval(that.data.setInter);
clearInterval(that.data.templTiem);
@@ -92,7 +93,7 @@ Page({
// })
// }, 200)
// },
setRq(){
setRq() {
let _this = this
_this.setData({
showhieRq: false,
@@ -113,10 +114,10 @@ Page({
TYPE: "couponorder",
ID: _this.data.dynamicRq
})
if (res.data.expiredSeconds==0){
if (res.data.expiredSeconds == 0) {

} else {

}else{
let inre = setInterval(() => {
if (_this.data.expiredSeconds > 1) {
_this.setData({
@@ -137,7 +138,7 @@ Page({
}
// util.qrcode("qrcode", url, 350, 350);
_this.createQrCode(url, "qrcode", 350, 350);
}).catch(err=>{
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
@@ -176,7 +177,7 @@ Page({
codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14),
couponorderstatus: options.couponorderstatus
});
if (
options.quancode &&
that.data.couponorderstatus == 0
@@ -185,13 +186,31 @@ Page({
that.setRq()//动态二维码 //这个方法必须在拿到 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 () {
if (
options.quancode &&
that.data.couponorderstatus == 0
) {
Http.get({
url: config.api.couponOrderDetail,
data: {
@@ -228,7 +247,7 @@ Page({
pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd hh:mm:ss"),
})
}
})
.catch(err => {
wx.showToast({
@@ -240,7 +259,7 @@ Page({
})
}
}, 2000);
/**
* 页面需要初始渲染的效果
*/
@@ -248,7 +267,7 @@ Page({
url: config.api.couponOrderDetail,
data: {
couponOrderId: options.quancode
}
}
}).then(res => {
that.setData({
couponorderstatus: res.data.couponOrderStatus,
@@ -259,13 +278,13 @@ Page({
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")
});
if (that.data.data.validStartDate && that.data.data.validEndDate){
if (that.data.data.validStartDate && that.data.data.validEndDate) {
that.setData({
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")
})
}
})
.catch(err => {
wx.showToast({
@@ -291,13 +310,13 @@ Page({
}
})
},
upDataRq(){
upDataRq() {
console.log(1123)
},
createQrCode: function (url, canvasId, cavW, cavH) {
//调用插件中的draw方法,绘制二维码图片
let that = this;
QR.api.draw(url, canvasId, cavW, cavH, function (res) {
QR.api.draw(url, canvasId, cavW, cavH, function (res) {
that.setData({
tempFilePath: res
})


+ 12
- 12
pages/couponorder/detail/index.wxml Ver fichero

@@ -1,6 +1,6 @@
<navbar home back text="使用优惠券"></navbar>
<view style="height:{{navigationBarHeight}} "></view>
<view class='box' >
<view class='box'>
<view class="container page" wx:if="{{data.merchantVoList}}">
<view class="coupon_detail clearfix">
<view class="fl wmfl">
@@ -51,20 +51,20 @@
<image class="updataRqCode" mode='widthFix' src="{{upDataRqUrlF}}"></image>
<view class="upDataRq">点一点刷新二维码</view>
</view>
<view class="coedTiem" wx:if="{{!showhieRq&&expiredSeconds>1}}">二维码在
<text style="color:red">{{expiredSeconds}}s</text>
后失效
</view>
<view class="coedTiem" wx:if="{{!showhieRq&&expiredSeconds>1}}">二维码在
<text style="color:red">{{expiredSeconds}}s</text>
后失效
</view>
<view class="barnum">
<view class="barnumtext">{{showIdFalg?code:codeS}}</view>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
<view class="barnumtext">{{showIdFalg?code:codeS}}</view>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
</view>
</view>
</view>
<!-- 适用门店 -->
<store merchantVoList="{{data.merchantVoList}}"></store>
<store merchantVoList="{{data.merchantVoList}}"></store>
<!-- <view class='applyshop'>适用门店</view>
<view class='posi' style='overflow:{{hidden}};height:{{height}}'>
<view class='posi_logo' wx:for="{{data.merchantVoList}}" wx:key="index">
@@ -118,10 +118,10 @@
<view>
<text>购买须知</text>
</view>
<view wx:if="{{curHtml==''}}">
<view wx:if="{{contentType==0}}">
<text><text class='spot'></text>{{data.remark}}</text>
</view>
<view wx:if="{{curHtml!=''}}">
<view wx:else>
<rich-text nodes="{{curHtml}}"></rich-text>
</view>
</view>


+ 1
- 2
pages/dateLsit/dateLsit.wxss Ver fichero

@@ -21,7 +21,6 @@
font-size: 32rpx;
font-weight: 700;
margin-left: 10rpx;
height: 60rpx;
line-height: 60rpx;
}

@@ -55,4 +54,4 @@
height: 60rpx;
line-height: 60rpx;
color: rgba(0, 0, 0, 0.3);
}
}

Cargando…
Cancelar
Guardar