|
|
@ -2,7 +2,7 @@
|
|
|
|
* @Author: ch
|
|
|
|
* @Author: ch
|
|
|
|
* @Date: 2022-05-08 00:39:50
|
|
|
|
* @Date: 2022-05-08 00:39:50
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditTime: 2022-05-12 11:44:04
|
|
|
|
* @LastEditTime: 2022-06-10 18:12:14
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
-->
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -11,7 +11,7 @@
|
|
|
|
<div class="pay">
|
|
|
|
<div class="pay">
|
|
|
|
<span class="pay--timer">{{timerTxt}}</span>
|
|
|
|
<span class="pay--timer">{{timerTxt}}</span>
|
|
|
|
<UiMoney class="money" sufSize="14px" preSize="14px" size="20px"
|
|
|
|
<UiMoney class="money" sufSize="14px" preSize="14px" size="20px"
|
|
|
|
float suffix prefix :money="orderInfo.payAmount"/>
|
|
|
|
float suffix prefix :money="orderDetail.payAmount"/>
|
|
|
|
<div class="pay--code">
|
|
|
|
<div class="pay--code">
|
|
|
|
<img :src="imgUrl" v-if="imgUrl"/>
|
|
|
|
<img :src="imgUrl" v-if="imgUrl"/>
|
|
|
|
<!-- <p v-if="!timer">已超时,请重新下单</p> -->
|
|
|
|
<!-- <p v-if="!timer">已超时,请重新下单</p> -->
|
|
|
@ -34,11 +34,15 @@ export default {
|
|
|
|
orderId : {
|
|
|
|
orderId : {
|
|
|
|
type : Number | String,
|
|
|
|
type : Number | String,
|
|
|
|
default : ''
|
|
|
|
default : ''
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
orderInfo:{
|
|
|
|
|
|
|
|
type : Object,
|
|
|
|
|
|
|
|
default : () => ({})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data(){
|
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
orderInfo: {},
|
|
|
|
orderDetail: {},
|
|
|
|
imgUrl : '',
|
|
|
|
imgUrl : '',
|
|
|
|
timerTxt : '',
|
|
|
|
timerTxt : '',
|
|
|
|
startSecondNum : 0,
|
|
|
|
startSecondNum : 0,
|
|
|
@ -57,20 +61,24 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods : {
|
|
|
|
methods : {
|
|
|
|
open(){
|
|
|
|
open(){
|
|
|
|
this.getOrderInfo();
|
|
|
|
this.getOrderDetail();
|
|
|
|
this.getCodeImg();
|
|
|
|
this.getCodeImg();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取订单最新信息
|
|
|
|
* 获取订单最新信息
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async getOrderInfo(){
|
|
|
|
async getOrderDetail(){
|
|
|
|
|
|
|
|
if(this.orderInfo.orderId){
|
|
|
|
|
|
|
|
this.orderDetail = this.orderInfo;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
const {error, result} = await ApiGetOrderDetail(this.orderId);
|
|
|
|
const {error, result} = await ApiGetOrderDetail(this.orderId);
|
|
|
|
if(error){
|
|
|
|
if(error){
|
|
|
|
this.$message.warning(error.message);
|
|
|
|
this.$message.warning(error.message);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.orderInfo = result;
|
|
|
|
this.orderDetail = result;
|
|
|
|
if(this.orderInfo.orderStatus === 1){
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.orderDetail.orderStatus === 1 || !this.orderDetail.orderStatus){
|
|
|
|
// 待支付 开始倒计时
|
|
|
|
// 待支付 开始倒计时
|
|
|
|
if(this.timerStop){
|
|
|
|
if(this.timerStop){
|
|
|
|
clearInterval(this.timerStop);
|
|
|
|
clearInterval(this.timerStop);
|
|
|
@ -81,7 +89,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getCodeImg(){
|
|
|
|
async getCodeImg(){
|
|
|
|
const {error, result} = await ApiPostPayCdoeImg({orderId : this.orderId});
|
|
|
|
const {error, result} = await ApiPostPayCdoeImg({orderId : this.orderId || this.orderInfo.orderId});
|
|
|
|
if(error){
|
|
|
|
if(error){
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -92,8 +100,8 @@ export default {
|
|
|
|
* 计算倒计时开始秒数
|
|
|
|
* 计算倒计时开始秒数
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
calcTimerStartSecondNum(){
|
|
|
|
calcTimerStartSecondNum(){
|
|
|
|
let expireTime = (new Date(this.orderInfo.expireTime.replace(/-/g,'/'))).getTime(),
|
|
|
|
let expireTime = (new Date(this.orderDetail.expireTime.replace(/-/g,'/'))).getTime(),
|
|
|
|
curTime = (new Date(this.orderInfo.serverTime.replace(/-/g,'/'))).getTime(),
|
|
|
|
curTime = (new Date(this.orderDetail.serverTime.replace(/-/g,'/'))).getTime(),
|
|
|
|
second = Math.floor((expireTime - curTime) / 1000);
|
|
|
|
second = Math.floor((expireTime - curTime) / 1000);
|
|
|
|
this.startSecondNum = second > 0 ? second : 0;
|
|
|
|
this.startSecondNum = second > 0 ? second : 0;
|
|
|
|
this.timerStop = setInterval(()=> {
|
|
|
|
this.timerStop = setInterval(()=> {
|
|
|
|