From e91b07d299de67faa0496022738ea818c8f18b42 Mon Sep 17 00:00:00 2001
From: meo <958484406@qq.com>
Date: Tue, 28 Aug 2018 16:37:05 +0800
Subject: [PATCH] =?UTF-8?q?[=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85][?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?=
=?UTF-8?q?=E7=9A=84=E6=97=B6=E9=97=B4=E7=9A=84=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/order/detail/index.js | 14 +++++++++++++-
pages/order/detail/index.wxml | 20 ++++++++------------
pages/order/detail/index.wxss | 18 +++++++++++++++---
project.config.json | 2 +-
utils/util.js | 22 +++++++++++++++++++++-
5 files changed, 58 insertions(+), 18 deletions(-)
diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js
index 23738c4..16c7576 100644
--- a/pages/order/detail/index.js
+++ b/pages/order/detail/index.js
@@ -59,7 +59,7 @@ Page({
console.log(this.data.flag);
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({
flag: this.data.flag
});
@@ -82,8 +82,20 @@ Page({
that.setData({
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),
+ })
});
},
+
/**
* 生命周期函数--监听页面初次渲染完成
*/
diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml
index b57a2fb..d386672 100644
--- a/pages/order/detail/index.wxml
+++ b/pages/order/detail/index.wxml
@@ -19,19 +19,15 @@
购买数量:1件
-->
- 下单时间:{{data.paymentTime}}
+ 下单时间:{{createDate}}
-
- 有效期:
- 2018-07-10 至 2018-07-10
-
-
+
适用门店
-
+ {{data.merchantName}}
@@ -44,7 +40,7 @@
下单时间
- {{data.paymentTime}}
+ {{createDate}}
订单编号
@@ -52,7 +48,7 @@
订单金额
- ¥{{data.salePrice/100}}
+ ¥{{data.salePrice/100}}
@@ -63,11 +59,11 @@
-
+
-
+
兑换码:{{data.id}}
-
+
\ No newline at end of file
diff --git a/pages/order/detail/index.wxss b/pages/order/detail/index.wxss
index d9bb3de..6208d9a 100644
--- a/pages/order/detail/index.wxss
+++ b/pages/order/detail/index.wxss
@@ -47,6 +47,7 @@
.logo image {
width: 100%;
height: 100%;
+ border-radius:16rpx;
}
.info view:nth-child(1) {
@@ -244,6 +245,7 @@ radio {
-webkit-box-flex: 1;
box-flex: 1;
}
+
.fl {
float: left;
}
@@ -251,7 +253,13 @@ radio {
float: right;
}
-
+.clearfix:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
.panel {
width: 600rpx;
border-radius: 10rpx;
@@ -297,7 +305,7 @@ radio {
}
.qrcode {
- height: 370rpx;
+ height: 340rpx;
display: flex;
flex-direction: column;
justify-content: flex-end;
@@ -306,5 +314,9 @@ radio {
.qrcode > canvas {
width: 350rpx;
- height: 400rpx;
+ height: 350rpx;
+}
+.jine{
+ color: #f96563!important;
+ font-size: 36rpx!important;
}
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
index 8030779..a31ddee 100644
--- a/project.config.json
+++ b/project.config.json
@@ -11,7 +11,7 @@
"newFeature": true
},
"compileType": "miniprogram",
- "libVersion": "2.2.2",
+ "libVersion": "2.2.4",
"appid": "wx8eb8275b78db4ede",
"projectname": "%E5%AF%8C%E8%8C%82%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95",
"isGameTourist": false,
diff --git a/utils/util.js b/utils/util.js
index 37c8e1c..0fe687f 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -76,9 +76,29 @@ function fmtDate(obj) {
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 = {
formatTime: formatTime,
barcode: barc,
qrcode: qrc,
- fmtDate: fmtDate
+ fmtDate: fmtDate,
+ timechuo:timechuo
};