|
@@ -2,12 +2,11 @@
|
|
<view class="order-detail">
|
|
<view class="order-detail">
|
|
<view class="status-box">
|
|
<view class="status-box">
|
|
<view class="text-box">
|
|
<view class="text-box">
|
|
- <!-- {{ info.orderType }} -->
|
|
|
|
- <!-- <view class="status" v-if="info.orderType == 'WAIT_PAYMENT' && !isNotTime">
|
|
|
|
- 等待支付,剩余<u-count-down :time="closeTime" format="HH:mm:ss" @finish="finish"></u-count-down>
|
|
|
|
- </view> -->
|
|
|
|
|
|
+ <view class="status" v-if="info.orderType == 'WAIT_PAYMENT' && !isNotTime">
|
|
|
|
+ 等待支付,剩余<u-count-down :time="closeTime" format="mm:ss" @finish="finish"></u-count-down>
|
|
|
|
+ </view>
|
|
<view class="status">
|
|
<view class="status">
|
|
- {{ filterType(info.orderType) }}
|
|
|
|
|
|
+ {{ filterType(info.orderType) || "订单错误" }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -30,7 +29,8 @@
|
|
{{ info.goodsList[0].goodsInfo.activityName }}
|
|
{{ info.goodsList[0].goodsInfo.activityName }}
|
|
</view>
|
|
</view>
|
|
<view class="goods-desc">
|
|
<view class="goods-desc">
|
|
- 活动时间: {{ info.goodsList[0].goodsInfo.activityStartTime }} 至 {{ info.goodsList[0].goodsInfo.activityEndTime }}
|
|
|
|
|
|
+ 活动时间: {{ info.goodsList[0].goodsInfo.activityStartTime }} 至 {{ info.goodsList[0].goodsInfo.activityEndTime
|
|
|
|
+ }}
|
|
</view>
|
|
</view>
|
|
<view class="price-box">
|
|
<view class="price-box">
|
|
<view class="goods-desc">
|
|
<view class="goods-desc">
|
|
@@ -93,8 +93,8 @@
|
|
{{ o }}
|
|
{{ o }}
|
|
</view>
|
|
</view>
|
|
<view class="value" v-else>
|
|
<view class="value" v-else>
|
|
- <image v-for="(img, index) in obj.value" :key="index" @click="clickImg(obj.value, index)" :src="img" mode="widthFix"
|
|
|
|
- style="width: 150rpx; height: 150rpx;"></image>
|
|
|
|
|
|
+ <image v-for="(img, index) in obj.value" :key="index" @click="clickImg(obj.value, index)" :src="img"
|
|
|
|
+ mode="widthFix" style="width: 150rpx; height: 150rpx;"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- uniapp 下划线 -->
|
|
<!-- uniapp 下划线 -->
|
|
@@ -259,6 +259,14 @@ export default {
|
|
|
|
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ closeTime() {
|
|
|
|
+ // if((this.info.createTime + 1000*60*15) - new Date().getTime()){
|
|
|
|
+ // this.isNotTime = false
|
|
|
|
+ // }else{
|
|
|
|
+ // this.isNotTime = true
|
|
|
|
+ // }
|
|
|
|
+ return (this.info.createTime + 1000 * 60 * 30) - new Date().getTime()
|
|
|
|
+ },
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
clickImg(list, index) {
|
|
clickImg(list, index) {
|
|
@@ -281,8 +289,8 @@ export default {
|
|
return "订单已完成";
|
|
return "订单已完成";
|
|
} else if (val == "WAIT_PAYMENT") {
|
|
} else if (val == "WAIT_PAYMENT") {
|
|
return "待付款";
|
|
return "待付款";
|
|
- }else if (val == "HAVE_PAID") {
|
|
|
|
- return "已付款";
|
|
|
|
|
|
+ } else if (val == "HAVE_PAID") {
|
|
|
|
+ return "待使用";
|
|
} else if (val == "WAIT_USE") {
|
|
} else if (val == "WAIT_USE") {
|
|
return "待使用";
|
|
return "待使用";
|
|
}
|
|
}
|
|
@@ -370,8 +378,13 @@ export default {
|
|
payDetails(orderNo) {
|
|
payDetails(orderNo) {
|
|
payDetails(orderNo).then((res) => {
|
|
payDetails(orderNo).then((res) => {
|
|
this.info = res.content;
|
|
this.info = res.content;
|
|
- this.$forceUpdate()
|
|
|
|
- if(this.info.payAmount > 0){
|
|
|
|
|
|
+ if (!this.info.payment) {
|
|
|
|
+ this.info.payment = {
|
|
|
|
+ paymentWay: "",
|
|
|
|
+ pay: false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (this.info.payAmount > 0) {
|
|
queryPayOrder(this.info.orderNo)
|
|
queryPayOrder(this.info.orderNo)
|
|
}
|
|
}
|
|
this.info.extend = JSON.parse(this.info.goodsList[0].extend);
|
|
this.info.extend = JSON.parse(this.info.goodsList[0].extend);
|
|
@@ -421,41 +434,41 @@ export default {
|
|
});
|
|
});
|
|
let checkOrder = setInterval(() => {
|
|
let checkOrder = setInterval(() => {
|
|
queryPayOrder(that.info.orderNo)
|
|
queryPayOrder(that.info.orderNo)
|
|
- .then((res1) => {
|
|
|
|
- // 支付成功
|
|
|
|
- if (res1.content.status == "TRADE_SUCCESS") {
|
|
|
|
- that.payDetails(that.info.orderNo);
|
|
|
|
- uni.showToast({
|
|
|
|
- title: "支付成功!",
|
|
|
|
- icon: "none",
|
|
|
|
- });
|
|
|
|
- clearInterval(checkOrder)
|
|
|
|
- uni.hideLoading();
|
|
|
|
- that.btnLoading = false;
|
|
|
|
- } else {
|
|
|
|
- checkTime++;
|
|
|
|
- }
|
|
|
|
- if (checkTime > 5) {
|
|
|
|
- clearInterval(checkOrder)
|
|
|
|
|
|
+ .then((res1) => {
|
|
|
|
+ // 支付成功
|
|
|
|
+ if (res1.content.status == "TRADE_SUCCESS") {
|
|
|
|
+ that.payDetails(that.info.orderNo);
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "支付成功!",
|
|
|
|
+ icon: "none",
|
|
|
|
+ });
|
|
|
|
+ clearInterval(checkOrder)
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ that.btnLoading = false;
|
|
|
|
+ } else {
|
|
|
|
+ checkTime++;
|
|
|
|
+ }
|
|
|
|
+ if (checkTime > 5) {
|
|
|
|
+ clearInterval(checkOrder)
|
|
|
|
+ that.btnLoading = false;
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "订单查询失败",
|
|
|
|
+ icon: "none",
|
|
|
|
+ });
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ if (checkOrder) {
|
|
|
|
+ clearInterval(checkOrder)
|
|
|
|
+ checkOrder = null
|
|
|
|
+ }
|
|
that.btnLoading = false;
|
|
that.btnLoading = false;
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: "订单查询失败",
|
|
title: "订单查询失败",
|
|
icon: "none",
|
|
icon: "none",
|
|
});
|
|
});
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
- }
|
|
|
|
- }).catch(() => {
|
|
|
|
- if(checkOrder){
|
|
|
|
- clearInterval(checkOrder)
|
|
|
|
- checkOrder = null
|
|
|
|
- }
|
|
|
|
- that.btnLoading = false;
|
|
|
|
- uni.showToast({
|
|
|
|
- title: "订单查询失败",
|
|
|
|
- icon: "none",
|
|
|
|
});
|
|
});
|
|
- uni.hideLoading();
|
|
|
|
- });
|
|
|
|
}, 1000);
|
|
}, 1000);
|
|
}
|
|
}
|
|
});
|
|
});
|