|
|
|
@ -2,31 +2,70 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-07-08 15:30:29
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-07-08 17:00:04
|
|
|
|
|
* @LastEditTime: 2022-07-09 15:39:22
|
|
|
|
|
* @Description: file content
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<view>
|
|
|
|
|
<template v-if="status === 'await'">
|
|
|
|
|
<view class="icon icon__await"></view>
|
|
|
|
|
<view class="title">支付成功</view>
|
|
|
|
|
<view class="title">支付结果查询中</view>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="status === 'fail'">
|
|
|
|
|
<view class="icon icon__fail"></view>
|
|
|
|
|
<view class="title">支付成功</view>
|
|
|
|
|
<view class="title">{{errorMsg}}</view>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<view class="icon icon__success"></view>
|
|
|
|
|
<view class="title">支付成功</view>
|
|
|
|
|
</template>
|
|
|
|
|
<view class="btn">返回商家</view>
|
|
|
|
|
<view class="btn" @click="back">返回商家</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
const ENV = process.env;
|
|
|
|
|
export default {
|
|
|
|
|
data(){
|
|
|
|
|
return {
|
|
|
|
|
status : 'success'
|
|
|
|
|
status : 'await',
|
|
|
|
|
payOrderNo : this.$route.query.payOrderNo,
|
|
|
|
|
payStatus : {
|
|
|
|
|
await : [0,1],
|
|
|
|
|
success : [3],
|
|
|
|
|
fail : [2,4,5,6]
|
|
|
|
|
},
|
|
|
|
|
errorMsg : ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
|
this.getOrderInfo();
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
|
getOrderInfo(){
|
|
|
|
|
uni.request({
|
|
|
|
|
url : `${ENV.VUE_APP_BASE_URL}/payCenter/payCenter/payResult/${this.payOrderNo}`,
|
|
|
|
|
method : 'GET',
|
|
|
|
|
success : (res) =>{
|
|
|
|
|
let data = res.data.data;
|
|
|
|
|
if(res.data.code === 'SUCCESS'){
|
|
|
|
|
if(this.payStatus.success.includes(data.payStatus)){
|
|
|
|
|
this.status = 'success';
|
|
|
|
|
}else if(this.payStatus.await.includes(data.payStatus)){
|
|
|
|
|
this.status = 'await';
|
|
|
|
|
setTimeout(this.getOrderInfo,3000);
|
|
|
|
|
}else{
|
|
|
|
|
this.status = 'fail';
|
|
|
|
|
this.errorMsg = data.payStatusText
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.status = 'fail';
|
|
|
|
|
this.errorMsg = '支付结果出错,请联系商家';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
back(){
|
|
|
|
|
uni.navigateBack();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|