|
@@ -5,7 +5,7 @@
|
|
|
<view class="order-status">
|
|
|
<view class="status-title">{{orderInfo.orderStateDictValue}}</view>
|
|
|
<view v-if="orderInfo.orderState=='WAIT_PAY'" class="status-care">
|
|
|
- 请在 <text>29</text>分钟内付款,过期系统将自动取消订单
|
|
|
+ 请在 <text>{{leftTime}}</text>分钟内付款,过期系统将自动取消订单
|
|
|
</view>
|
|
|
<view v-if="orderInfo.orderState=='CANCEL'" class="status-care">
|
|
|
超时未支付,系统已自动取消订单
|
|
@@ -122,7 +122,8 @@
|
|
|
showSetPswModal: false, // 设置支付密码弹窗
|
|
|
showInputPsw: false, // 打开输入密码弹窗
|
|
|
showLeavePsw: false, // 打开确定放弃弹窗
|
|
|
- orderStatusList: []
|
|
|
+ orderId: '', // 订单id
|
|
|
+ leftTime: null
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
@@ -130,19 +131,38 @@
|
|
|
uni.$once('setPswSuccess', this.setPsw)
|
|
|
if (options.id) {
|
|
|
console.log(options.id)
|
|
|
- this.getOrderDetail(options.id)
|
|
|
- this.orderStatusList = this.$store.state.vuex_payStatus
|
|
|
+ this.orderId = options.id
|
|
|
+ this.getOrderDetail()
|
|
|
}
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 支付剩余时间
|
|
|
+ leftTimeFun() {
|
|
|
+ let nowT = new Date().valueOf() // 现在时间戳
|
|
|
+ let orderT = new Date(this.orderInfo.orderTime).valueOf() // 下单时间戳
|
|
|
+ let tt = (1800 * 1000) - (nowT - orderT) // 距离30分钟支付 相差时间戳
|
|
|
+ console.log(tt,'tttttt')
|
|
|
+ if (tt >0) {
|
|
|
+ this.leftTime = parseInt(tt/(60*1000))
|
|
|
+ } else {
|
|
|
+ // this.getOrderDetail()
|
|
|
+ this.leftTime = '00'
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取订单详情
|
|
|
- getOrderDetail(id) {
|
|
|
- let payTypeList = this.$store.state.vuex_payType
|
|
|
+ getOrderDetail() {
|
|
|
orderDetail({
|
|
|
- id: id
|
|
|
+ id: this.orderId
|
|
|
}).then(res => {
|
|
|
+ console.log(res,'rrrrrrrr')
|
|
|
if (res.status == 200) {
|
|
|
this.orderInfo = res.data
|
|
|
+ if(this.orderInfo.orderState=='WAIT_PAY') {
|
|
|
+ this.leftTimeFun()
|
|
|
+ }
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: res.message,
|
|
@@ -165,6 +185,7 @@
|
|
|
},
|
|
|
//确认放弃
|
|
|
canclePay() {
|
|
|
+ this.password = ''
|
|
|
this.showLeavePsw = false
|
|
|
this.showInputPsw = false
|
|
|
},
|
|
@@ -212,11 +233,13 @@
|
|
|
signPay(params).then(res=>{
|
|
|
this.btnLoading = false
|
|
|
if(res.status == 200) {
|
|
|
+ uni.$emit('refresh')
|
|
|
// 跳转到支付完成界面
|
|
|
uni.navigateTo({
|
|
|
url:"/pages/toOrder/payFinish?id=" + id
|
|
|
})
|
|
|
} else{
|
|
|
+ this.password = ''
|
|
|
uni.showToast({
|
|
|
title: res.message,
|
|
|
icon: 'none'
|