tangning 2 lat temu
rodzic
commit
9db6c85c5d
1 zmienionych plików z 14 dodań i 27 usunięć
  1. 14 27
      src/views/mobile/index.vue

+ 14 - 27
src/views/mobile/index.vue

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