You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.2 KiB
Vue

<template>
<view>
支付查询中...
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import {
$image,
$api,
$response
} from '@/api'
import {
onLoad
} from '@dcloudio/uni-app'
let orderid=ref(0);
const CheckPay = async () => {
uni.showLoading()
const response = await $api('CheckPay', {
openid: localStorage.getItem('OPENID'),
order_number: orderid.value,
})
uni.hideLoading()
$response(response, () => {
if(response.status){
uni.showToast({
title: '支付成功'
});
if(response.data.is_yuyue){
uni.reLaunch({
url: '/pages/buy/done/yuyue_done?id='+response.data.id
});
}else{
uni.reLaunch({
url: '/pages/buy/done/done?id='+response.data.id
});
}
}
})
}
onLoad((option) => {
if(!!option.orderid){
let orderid1=option.orderid
const index = orderid1.indexOf('#');
if (index !== -1) {
orderid1= orderid1.substring(0, index); // 包含 # 时,返回 # 前面的部分
}
orderid.value=orderid1
CheckPay()
}else{
uni.showToast({
title: '获取订单号失败',
icon:"none"
});
}
})
</script>
<style>
</style>