|
|
@@ -9,7 +9,11 @@
|
|
|
<div class="container">
|
|
|
<div class="box-top">
|
|
|
<p>{{ status.label }}</p>
|
|
|
- <h3>{{ status.name }}</h3>
|
|
|
+ <h3 v-if="status.orderStatus !== 'CREATED'">{{ status.name }}</h3>
|
|
|
+ <h3 v-if="status.orderStatus == 'CREATED'">
|
|
|
+ 未支付将在,<span v-if="minters < 10">0</span>{{ minters }}分<span v-if="seconds < 10">0</span
|
|
|
+ >{{ seconds }} 后自动取消订单
|
|
|
+ </h3>
|
|
|
</div>
|
|
|
<div class="box-adderss">
|
|
|
<div
|
|
|
@@ -91,7 +95,7 @@
|
|
|
<div class="box-buttom">
|
|
|
<div class="box-buttom-con">
|
|
|
<p>邮费</p>
|
|
|
- <p class="box-buttom-p">¥10</p>
|
|
|
+ <p class="box-buttom-p">¥{{ postage }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="box-buttom">
|
|
|
@@ -119,7 +123,7 @@
|
|
|
</div>
|
|
|
<div class="box-border-but"></div>
|
|
|
<!-- 下单时间 -->
|
|
|
- <div class="box-footer" v-if="status.orderStatus !== 'CANCELED'">
|
|
|
+ <div class="box-footer" v-if="status.orderStatus !== 'CANCELED' && status.orderStatus !== 'CREATED'">
|
|
|
<div class="box-footer-con">
|
|
|
<p>订单编号</p>
|
|
|
<div class="box-footer-cr">
|
|
|
@@ -140,7 +144,7 @@
|
|
|
<p class="box-footer-p">{{ status.paidTime }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="box-footer" v-if="status.orderStatus !== 'CANCELED'">
|
|
|
+ <div class="box-footer" v-if="status.orderStatus !== 'CANCELED' && status.orderStatus !== 'CREATED'">
|
|
|
<div class="box-footer-con">
|
|
|
<p>成交时间</p>
|
|
|
<p class="box-footer-p">{{ status.paidTime }}</p>
|
|
|
@@ -247,13 +251,69 @@ export default {
|
|
|
stepsList: [],
|
|
|
stepsShow: [],
|
|
|
store: {},
|
|
|
- user: {}
|
|
|
+ postage: {},
|
|
|
+ user: {},
|
|
|
+ minters: 0,
|
|
|
+ seconds: 0,
|
|
|
+ allTime: 5 * 60 - 1,
|
|
|
+ closeTime: ''
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
logisticShow() {
|
|
|
this.show = false;
|
|
|
},
|
|
|
+ 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 {
|
|
|
+ // this.getFn();
|
|
|
+ }
|
|
|
+ } 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);
|
|
|
+ }
|
|
|
+ },
|
|
|
getFn() {
|
|
|
this.showLoading();
|
|
|
this.$http
|
|
|
@@ -267,10 +327,11 @@ export default {
|
|
|
this.store = res.store;
|
|
|
this.Boxes = res.cardBoxList;
|
|
|
this.orderInfoId = res.id;
|
|
|
+ this.postage = res.cardCase.postage;
|
|
|
this.cardCaseInfo = res.cardCase.collection;
|
|
|
if (this.status.orderStatus === 'CREATED') {
|
|
|
this.status.label = '买家待支付';
|
|
|
- this.status.name = '未支付将自动取消订单';
|
|
|
+ this.initTime(this.orderInfoId, this.status.createdAt);
|
|
|
}
|
|
|
if (this.status.orderStatus === 'CANCELED') {
|
|
|
this.status.label = '交易关闭';
|