|
@@ -18,7 +18,10 @@
|
|
|
alt=""
|
|
alt=""
|
|
|
/>
|
|
/>
|
|
|
<div class="text1">待支付</div>
|
|
<div class="text1">待支付</div>
|
|
|
- <div class="text2">请尽快支付,04分56秒 后未支付将自动取消订单</div>
|
|
|
|
|
|
|
+ <div class="text2">
|
|
|
|
|
+ 请尽快支付,<span v-if="minters < 10">0</span>{{ minters }}分<span v-if="seconds < 10">0</span
|
|
|
|
|
+ >{{ seconds }} 后未支付将自动取消订单
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</van-sticky>
|
|
</van-sticky>
|
|
|
<div class="conBox">
|
|
<div class="conBox">
|
|
@@ -44,14 +47,15 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="order">
|
|
<div class="order">
|
|
|
<div class="text1">打包费</div>
|
|
<div class="text1">打包费</div>
|
|
|
- <div class="text1">¥{{ list.packPrice }}</div>
|
|
|
|
|
|
|
+ <div class="text2">¥{{ list.packPrice }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="order order2">
|
|
<div class="order order2">
|
|
|
<div class="text1">配送费</div>
|
|
<div class="text1">配送费</div>
|
|
|
- <div class="text1">¥{{ list.distributionPrice }}</div>
|
|
|
|
|
|
|
+ <div class="text2">¥{{ list.distributionPrice }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="add">
|
|
|
|
|
- <div class="text">合计:¥{{ list.total }}</div>
|
|
|
|
|
|
|
+ <div class="text">
|
|
|
|
|
+ <div class="text1">合计:</div>
|
|
|
|
|
+ <div class="text2">¥{{ list.total }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="border2"></div>
|
|
<div class="border2"></div>
|
|
|
<div class="address">
|
|
<div class="address">
|
|
@@ -112,10 +116,14 @@ export default {
|
|
|
components: { NavHeader },
|
|
components: { NavHeader },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ minters: 0,
|
|
|
|
|
+ seconds: 0,
|
|
|
|
|
+ allTime: 5 * 60 - 1,
|
|
|
|
|
+ closeTime: '',
|
|
|
takeout: [],
|
|
takeout: [],
|
|
|
list: {
|
|
list: {
|
|
|
transactionId: '2019052035464',
|
|
transactionId: '2019052035464',
|
|
|
- createdAt: '2021-05-20 07:52:36',
|
|
|
|
|
|
|
+ createdAt: '2021-09-03 14:18:26',
|
|
|
remark: '加急',
|
|
remark: '加急',
|
|
|
packPrice: '2',
|
|
packPrice: '2',
|
|
|
distributionPrice: '2',
|
|
distributionPrice: '2',
|
|
@@ -123,27 +131,79 @@ export default {
|
|
|
lists: [
|
|
lists: [
|
|
|
{
|
|
{
|
|
|
price: '11',
|
|
price: '11',
|
|
|
- name: '南瓜粥',
|
|
|
|
|
|
|
+ name: '寿司',
|
|
|
|
|
+ id: 2,
|
|
|
num: '1',
|
|
num: '1',
|
|
|
image:
|
|
image:
|
|
|
- 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-10-17-31-24egsujwUw.jpg'
|
|
|
|
|
|
|
+ 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-13-15-54-36URxMKUXs.jpg'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
price: '22',
|
|
price: '22',
|
|
|
- name: '南瓜粥,八宝粥',
|
|
|
|
|
|
|
+ name: '寿司,八宝粥',
|
|
|
|
|
+ id: 5,
|
|
|
num: '2',
|
|
num: '2',
|
|
|
image:
|
|
image:
|
|
|
- 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-10-17-31-24egsujwUw.jpg'
|
|
|
|
|
|
|
+ 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-13-15-54-36URxMKUXs.jpg'
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ initTime(dingdanId, initTime) {
|
|
|
|
|
+ let oldTime = new Date(initTime).valueOf();
|
|
|
|
|
+ let newTime = new Date().valueOf();
|
|
|
|
|
+ let matchedTime = undefined;
|
|
|
|
|
+ let matchedTime1 = undefined;
|
|
|
|
|
+ if (oldTime) {
|
|
|
|
|
+ matchedTime = newTime - oldTime;
|
|
|
|
|
+ matchedTime1 = this.allTime - parseInt(matchedTime / 1000);
|
|
|
|
|
+ if (matchedTime1 > 0) {
|
|
|
|
|
+ this.timeout(matchedTime1);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log(22);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (dingdanId) {
|
|
|
|
|
+ this.timeout(this.allTime);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ timeout(time) {
|
|
|
|
|
+ let _this = this;
|
|
|
|
|
+ _this.minters = parseInt(time / 60) > 0 ? parseInt(time / 60) : 0;
|
|
|
|
|
+ _this.seconds = parseInt(time - _this.minters * 60);
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (_this.minters > 0) {
|
|
|
|
|
+ _this.closeTime = setInterval(() => {
|
|
|
|
|
+ _this.seconds--;
|
|
|
|
|
+ if (_this.seconds <= 0) {
|
|
|
|
|
+ _this.minters--;
|
|
|
|
|
+ if (_this.minters == -1) {
|
|
|
|
|
+ _this.minters = 0;
|
|
|
|
|
+ _this.seconds = 0;
|
|
|
|
|
+ clearInterval(_this.closeTime);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ _this.seconds = 60;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ _this.closeTime = setInterval(() => {
|
|
|
|
|
+ _this.seconds--;
|
|
|
|
|
+ if (_this.seconds <= 0) {
|
|
|
|
|
+ _this.seconds = 0;
|
|
|
|
|
+ clearInterval(_this.closeTime);
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.log(err);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
order() {
|
|
order() {
|
|
|
this.navigateTo('/pages/apply');
|
|
this.navigateTo('/pages/apply');
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
orderCopy() {
|
|
orderCopy() {
|
|
|
wx.setClipboardData({
|
|
wx.setClipboardData({
|
|
|
data: this.list.transactionId + '',
|
|
data: this.list.transactionId + '',
|
|
@@ -151,7 +211,7 @@ export default {
|
|
|
wx.getClipboardData({
|
|
wx.getClipboardData({
|
|
|
success(res) {
|
|
success(res) {
|
|
|
wx.showToast({
|
|
wx.showToast({
|
|
|
- title: '订单单号复制成功'
|
|
|
|
|
|
|
+ title: '复制成功'
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -161,6 +221,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
this.takeout = this.list.lists;
|
|
this.takeout = this.list.lists;
|
|
|
|
|
+ this.initTime(this.takeout[0].id, this.list.createdAt);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -272,19 +333,30 @@ export default {
|
|
|
color: #939599;
|
|
color: #939599;
|
|
|
line-height: 24px;
|
|
line-height: 24px;
|
|
|
}
|
|
}
|
|
|
|
|
+ .text2 {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: 400;
|
|
|
|
|
+ color: #1c1c1c;
|
|
|
|
|
+ line-height: 24px;
|
|
|
|
|
+ }
|
|
|
&.order2 {
|
|
&.order2 {
|
|
|
margin-bottom: 14px;
|
|
margin-bottom: 14px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .add {
|
|
|
|
|
- text-align: right;
|
|
|
|
|
- padding: 0 16px;
|
|
|
|
|
- .text {
|
|
|
|
|
|
|
+ .text {
|
|
|
|
|
+ .flex();
|
|
|
|
|
+ padding-left: 288px;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ .text1 {
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
- font-weight: bold;
|
|
|
|
|
- color: #939599;
|
|
|
|
|
|
|
+ color: #c8c9cc;
|
|
|
line-height: 24px;
|
|
line-height: 24px;
|
|
|
}
|
|
}
|
|
|
|
|
+ .text2 {
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ color: #ff7f1f;
|
|
|
|
|
+ line-height: 26px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.border2 {
|
|
.border2 {
|
|
|
height: 5px;
|
|
height: 5px;
|
|
@@ -303,6 +375,7 @@ export default {
|
|
|
line-height: 20px;
|
|
line-height: 20px;
|
|
|
}
|
|
}
|
|
|
.text1 {
|
|
.text1 {
|
|
|
|
|
+ text-align: right;
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
|
color: #000000;
|
|
color: #000000;
|