|
@@ -75,23 +75,10 @@ function onBridgeReady(obj) {
|
|
|
orderDetal.value.payStatus = 1
|
|
|
// 使用以上方式判断前端返回,微信团队郑重提示:
|
|
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
|
- showConfirm({
|
|
|
- text: '成功了',
|
|
|
- type: 'warn',
|
|
|
- callback: (val) => {
|
|
|
- handlePayresult()
|
|
|
- }
|
|
|
- })
|
|
|
- console.log('成功了', res)
|
|
|
+ handlePayresult()
|
|
|
} else {
|
|
|
orderDetal.value.payStatus = 2
|
|
|
- showConfirm({
|
|
|
- text: '失败了',
|
|
|
- type: 'warn',
|
|
|
- callback: (val) => {
|
|
|
- handlePayresult()
|
|
|
- }
|
|
|
- })
|
|
|
+ handlePayresult()
|
|
|
}
|
|
|
}
|
|
|
)
|
|
@@ -103,13 +90,7 @@ function getDetial() {
|
|
|
getOrderInfo(orderSn.value).then((res) => {
|
|
|
orderDetal.value = res
|
|
|
if(res.payStatus != 0){
|
|
|
- showConfirm({
|
|
|
- text: res.payStatus === 2 ? '支付失败' : '支付成功',
|
|
|
- type: res.payStatus === 2 ? 'err' : 'success',
|
|
|
- callback: () => {
|
|
|
- handlePayresult()
|
|
|
- }
|
|
|
- })
|
|
|
+ handlePayresult()
|
|
|
return
|
|
|
}
|
|
|
if(is_weixn.value){
|
|
@@ -119,11 +100,17 @@ function getDetial() {
|
|
|
}
|
|
|
function handlePayresult(){
|
|
|
let item = orderDetal.value
|
|
|
- if(item.orderType == 'incrementOrder'){
|
|
|
- location.replace(`/mobile.html#/information`)
|
|
|
- }else{
|
|
|
- location.replace(`/mobile.html#/payresult/${item.payStatus == 2?'fail':'success'}`)
|
|
|
- }
|
|
|
+ showConfirm({
|
|
|
+ text: item.payStatus === 2 ? '支付失败' : '支付成功',
|
|
|
+ type: item.payStatus === 2 ? 'err' : 'success',
|
|
|
+ callback: () => {
|
|
|
+ if(item.orderType == 'incrementOrder'){
|
|
|
+ location.replace(`/mobile.html#/information`)
|
|
|
+ }else{
|
|
|
+ location.replace(`/mobile.html#/payresult/${item.payStatus == 2?'fail':'success'}`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
async function handleWxlogin(wxAppId: string) {
|
|
|
// userStore.setUserOpenId('o3S0L1Hyd3O0vYI2Kr1lFDEtEO2k')
|