@@ -59,7 +59,7 @@ Page({ | |||||
console.log(this.data.flag); | console.log(this.data.flag); | ||||
util.barcode("barcode" + this.data.flag, quancode, 500, 100); | util.barcode("barcode" + this.data.flag, quancode, 500, 100); | ||||
util.qrcode("qrcode" + this.data.flag, quancode, 350, 400); | |||||
util.qrcode("qrcode" + this.data.flag, quancode, 350, 350); | |||||
this.setData({ | this.setData({ | ||||
flag: this.data.flag | flag: this.data.flag | ||||
}); | }); | ||||
@@ -82,8 +82,20 @@ Page({ | |||||
that.setData({ | that.setData({ | ||||
data: res.data | data: res.data | ||||
}); | }); | ||||
//createDate 创建时间 | |||||
//paymentTime 支付时间 | |||||
var createDate = util.fmtDate(res.data.createDate); | |||||
// var paymentTime = util.fmtDate(res.data.paymentTime); | |||||
console.log(createDate); | |||||
that.setData({ | |||||
createDate:createDate, | |||||
// paymentTime:util.timechuo(paymentTime), | |||||
}) | |||||
}); | }); | ||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
*/ | */ | ||||
@@ -19,19 +19,15 @@ | |||||
<text>购买数量:</text>1件 | <text>购买数量:</text>1件 | ||||
</view> --> | </view> --> | ||||
<view> | <view> | ||||
<text>下单时间:</text>{{data.paymentTime}}</view> | |||||
<text>下单时间:</text>{{createDate}}</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class='classif'> | <view class='classif'> | ||||
<view> | |||||
<text>有效期:</text> | |||||
<text>2018-07-10 至 2018-07-10</text> | |||||
</view> | |||||
<view> | |||||
<view class="clearfix"> | |||||
<text>适用门店</text> | <text>适用门店</text> | ||||
<text class='iconfont icon-right'></text> | |||||
<text class="fr">{{data.merchantName}}</text> | |||||
</view> | </view> | ||||
<view wx:if="{{data.orderStatus==1}}" data-quancode="{{data.id}}" bindtap="powerDrawer" data-statu="open"> | <view wx:if="{{data.orderStatus==1}}" data-quancode="{{data.id}}" bindtap="powerDrawer" data-statu="open"> | ||||
<view> | <view> | ||||
@@ -44,7 +40,7 @@ | |||||
</view> | </view> | ||||
<view> | <view> | ||||
<text>下单时间</text> | <text>下单时间</text> | ||||
<text>{{data.paymentTime}}</text> | |||||
<text>{{createDate}}</text> | |||||
</view> | </view> | ||||
<view> | <view> | ||||
<text>订单编号</text> | <text>订单编号</text> | ||||
@@ -52,7 +48,7 @@ | |||||
</view> | </view> | ||||
<view> | <view> | ||||
<text>订单金额</text> | <text>订单金额</text> | ||||
<text>¥{{data.salePrice/100}}</text> | |||||
<text class="jine">¥{{data.salePrice/100}}</text> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -63,11 +59,11 @@ | |||||
<view animation="{{animationData}}" class="drawer_box" wx:if="{{showModalStatus}}"> | <view animation="{{animationData}}" class="drawer_box" wx:if="{{showModalStatus}}"> | ||||
<view class="panel"> | <view class="panel"> | ||||
<view class="barcode"> | <view class="barcode"> | ||||
<canvas canvas-id="barcode{{flag}}" /> | |||||
<canvas canvas-id="barcode{{flag+1}}" /> | |||||
</view> | </view> | ||||
<view class="qrcode"> | <view class="qrcode"> | ||||
<canvas canvas-id="qrcode{{flag}}" /> | |||||
<canvas canvas-id="qrcode{{flag+1}}" /> | |||||
</view> | </view> | ||||
<view class="barnum"><text>兑换码:</text>{{data.id}}</view> | <view class="barnum"><text>兑换码:</text>{{data.id}}</view> | ||||
</view> | </view> | ||||
</view> | |||||
</view> |
@@ -47,6 +47,7 @@ | |||||
.logo image { | .logo image { | ||||
width: 100%; | width: 100%; | ||||
height: 100%; | height: 100%; | ||||
border-radius:16rpx; | |||||
} | } | ||||
.info view:nth-child(1) { | .info view:nth-child(1) { | ||||
@@ -244,6 +245,7 @@ radio { | |||||
-webkit-box-flex: 1; | -webkit-box-flex: 1; | ||||
box-flex: 1; | box-flex: 1; | ||||
} | } | ||||
.fl { | .fl { | ||||
float: left; | float: left; | ||||
} | } | ||||
@@ -251,7 +253,13 @@ radio { | |||||
float: right; | float: right; | ||||
} | } | ||||
.clearfix:after { | |||||
content: "."; | |||||
display: block; | |||||
height: 0; | |||||
clear: both; | |||||
visibility: hidden; | |||||
} | |||||
.panel { | .panel { | ||||
width: 600rpx; | width: 600rpx; | ||||
border-radius: 10rpx; | border-radius: 10rpx; | ||||
@@ -297,7 +305,7 @@ radio { | |||||
} | } | ||||
.qrcode { | .qrcode { | ||||
height: 370rpx; | |||||
height: 340rpx; | |||||
display: flex; | display: flex; | ||||
flex-direction: column; | flex-direction: column; | ||||
justify-content: flex-end; | justify-content: flex-end; | ||||
@@ -306,5 +314,9 @@ radio { | |||||
.qrcode > canvas { | .qrcode > canvas { | ||||
width: 350rpx; | width: 350rpx; | ||||
height: 400rpx; | |||||
height: 350rpx; | |||||
} | |||||
.jine{ | |||||
color: #f96563!important; | |||||
font-size: 36rpx!important; | |||||
} | } |
@@ -11,7 +11,7 @@ | |||||
"newFeature": true | "newFeature": true | ||||
}, | }, | ||||
"compileType": "miniprogram", | "compileType": "miniprogram", | ||||
"libVersion": "2.2.2", | |||||
"libVersion": "2.2.4", | |||||
"appid": "wx8eb8275b78db4ede", | "appid": "wx8eb8275b78db4ede", | ||||
"projectname": "%E5%AF%8C%E8%8C%82%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95", | "projectname": "%E5%AF%8C%E8%8C%82%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95", | ||||
"isGameTourist": false, | "isGameTourist": false, | ||||
@@ -76,9 +76,29 @@ function fmtDate(obj) { | |||||
d.substring(d.length - 2, d.length) | d.substring(d.length - 2, d.length) | ||||
); | ); | ||||
} | } | ||||
function timechuo(startTime) { | |||||
var s1 = new Date(startTime.replace(/-/g, "/")); | |||||
var s2 = new Date(); | |||||
var runTime = parseInt((s1.getTime() - s2.getTime()) / 1000); | |||||
var year = Math.floor(runTime / 86400 / 365); | |||||
var runTime = runTime % (86400 * 365); | |||||
var month = Math.floor(runTime / 86400 / 30); | |||||
var runTime = runTime % (86400 * 30); | |||||
var day = Math.floor(runTime / 86400); | |||||
var runTime = runTime % 86400; | |||||
var hour = Math.floor(runTime / 3600); | |||||
var runTime = runTime % 3600; | |||||
var minute = Math.floor(runTime / 60); | |||||
var runTime = runTime % 60; | |||||
var second = runTime; | |||||
console.log(month, day, hour, minute, second); | |||||
return (day+"天"+hour+"小时"+minute+"分钟") | |||||
} | |||||
module.exports = { | module.exports = { | ||||
formatTime: formatTime, | formatTime: formatTime, | ||||
barcode: barc, | barcode: barc, | ||||
qrcode: qrc, | qrcode: qrc, | ||||
fmtDate: fmtDate | |||||
fmtDate: fmtDate, | |||||
timechuo:timechuo | |||||
}; | }; |