ソースを参照

upload

newEdition
HolyKnightIX 2年前
コミット
302aa80463
3個のファイルの変更54行の追加36行の削除
  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 ファイルの表示

@@ -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
}) })


+ 12
- 12
pages/couponorder/detail/index.wxml ファイルの表示

@@ -1,6 +1,6 @@
<navbar home back text="使用优惠券"></navbar> <navbar home back text="使用优惠券"></navbar>
<view style="height:{{navigationBarHeight}} "></view> <view style="height:{{navigationBarHeight}} "></view>
<view class='box' >
<view class='box'>
<view class="container page" wx:if="{{data.merchantVoList}}"> <view class="container page" wx:if="{{data.merchantVoList}}">
<view class="coupon_detail clearfix"> <view class="coupon_detail clearfix">
<view class="fl wmfl"> <view class="fl wmfl">
@@ -51,20 +51,20 @@
<image class="updataRqCode" mode='widthFix' src="{{upDataRqUrlF}}"></image> <image class="updataRqCode" mode='widthFix' src="{{upDataRqUrlF}}"></image>
<view class="upDataRq">点一点刷新二维码</view> <view class="upDataRq">点一点刷新二维码</view>
</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="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> </view>
</view> </view>
<!-- 适用门店 --> <!-- 适用门店 -->
<store merchantVoList="{{data.merchantVoList}}"></store>
<store merchantVoList="{{data.merchantVoList}}"></store>
<!-- <view class='applyshop'>适用门店</view> <!-- <view class='applyshop'>适用门店</view>
<view class='posi' style='overflow:{{hidden}};height:{{height}}'> <view class='posi' style='overflow:{{hidden}};height:{{height}}'>
<view class='posi_logo' wx:for="{{data.merchantVoList}}" wx:key="index"> <view class='posi_logo' wx:for="{{data.merchantVoList}}" wx:key="index">
@@ -118,10 +118,10 @@
<view> <view>
<text>购买须知</text> <text>购买须知</text>
</view> </view>
<view wx:if="{{curHtml==''}}">
<view wx:if="{{contentType==0}}">
<text><text class='spot'></text>{{data.remark}}</text> <text><text class='spot'></text>{{data.remark}}</text>
</view> </view>
<view wx:if="{{curHtml!=''}}">
<view wx:else>
<rich-text nodes="{{curHtml}}"></rich-text> <rich-text nodes="{{curHtml}}"></rich-text>
</view> </view>
</view> </view>


+ 1
- 2
pages/dateLsit/dateLsit.wxss ファイルの表示

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


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

読み込み中…
キャンセル
保存