feat: 新增退款相关功能
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
<text class="orderState orderState2" v-if="orderContet.orderStatus==2">待收到</text>
|
||||
<text class="orderState orderState3" v-if="orderContet.orderStatus==3">已完成</text>
|
||||
<text class="orderState orderState5" v-if="orderContet.orderStatus==5">已超时</text>
|
||||
<text class="orderState orderState6" v-if="orderContet.orderStatus==6">已退款</text>
|
||||
<text class="orderState orderState7" v-if="orderContet.orderStatus==7">退款中</text>
|
||||
</view>
|
||||
<template v-if="orderContet.orderType == 'order' && orderContet.goodsList.length > 0">
|
||||
<view style="position: relative;" class="orderContent" v-for="(item,index) in orderContet.goodsList" :key="index"
|
||||
@@ -140,7 +142,8 @@
|
||||
<view v-if="orderContet.orderStatus==2 && sheetList.length > 0 && orderContet.orderStatus != 5" class="opFix" @click="seeExpressDetail(orderContet)">查看物流</view>
|
||||
<view v-if="orderContet.orderStatus==2" class="opCan" @click="OverOrder" >确认收到</view>
|
||||
|
||||
<view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view>
|
||||
<!-- nuttyreading:注释取消订单入口 -->
|
||||
<!-- <view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view> -->
|
||||
<view v-if="orderContet.orderStatus==0" class="opCan" @click="goPay(orderContet)">去支付</view>
|
||||
|
||||
<view class="opCan" @click="kefu">联系客服</view>
|
||||
@@ -629,6 +632,10 @@
|
||||
this.titleStat = '待收到'
|
||||
} else if (this.orderContet.orderStatus == 3) {
|
||||
this.titleStat = '已完成'
|
||||
} else if (this.orderContet.orderStatus == 6) {
|
||||
this.titleStat = '已退款'
|
||||
} else if (this.orderContet.orderStatus == 7) {
|
||||
this.titleStat = '退款中'
|
||||
}
|
||||
if(this.orderContet.orderStatus >= 2 && this.orderContet.orderType == 'order' && this.orderContet.expressOrders != null){
|
||||
this.sheetList = this.orderContet.expressOrders
|
||||
@@ -665,11 +672,29 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
checkPayTimeout(payItem) {
|
||||
const createTime = payItem && payItem.createTime;
|
||||
if (!createTime) return true;
|
||||
const createdAt = new Date(String(createTime).replace(/-/g, "/")).getTime();
|
||||
if (!createdAt) return true;
|
||||
const expired = Date.now() - createdAt > 10 * 60 * 1000;
|
||||
if (expired) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "订单已超时,不能继续支付,请重新下单",
|
||||
confirmText: "知道了",
|
||||
showCancel: false
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
|
||||
// 支付
|
||||
goPay(payItem) {
|
||||
console.log(payItem,'订单数据')
|
||||
if(!this.checkPayTimeout(payItem)) return
|
||||
if(payItem.paymentMethod == 2){
|
||||
console.log('阿里支付')
|
||||
setPay({
|
||||
@@ -776,6 +801,8 @@
|
||||
.orderState2{background-color: #f56c6c;}
|
||||
.orderState3{background-color: #67c23a;}
|
||||
.orderState5{background-color: #787878;}
|
||||
.orderState6{background-color: #f56c6c;}
|
||||
.orderState7{background-color: #f56c6c;}
|
||||
.guoqi{ font-size: 28rpx; align-items: center; color: red; float: right; line-height: 40rpx;}
|
||||
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
||||
.starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; }
|
||||
|
||||
Reference in New Issue
Block a user