HHE-5476 1 месяц назад
Родитель
Сommit
8220359f99
4 измененных файлов с 21 добавлено и 6 удалено
  1. 7 0
      api/payment.js
  2. 1 1
      components/payment/WechatPayment.vue
  3. 4 4
      config/app.js
  4. 9 1
      pages/webview/WxPay.vue

+ 7 - 0
api/payment.js

@@ -30,3 +30,10 @@ export function queryPaymentStatus(orderNo) {
 export function goldPrincipalCompleteOrder(params) {
   return request.get("goldprincipal/complete-plate-exchange-order", params);
 }
+/**
+ * SVIP - 根据订单号完成订单
+ * @param {string} orderNo - 订单编号
+ */
+export function svipToggle(params) {
+  return request.get("svip/toggle", params);
+}

+ 1 - 1
components/payment/WechatPayment.vue

@@ -72,7 +72,7 @@ const createUniPay = async (options) => {
       amount: options.amount,
       description: options.description,
       openId: options.openId,
-      orderNo: options.orderNo,
+      orderNo: orderNo.value,
     });
     // return console.log("payRes", payRes);
     // 订单创建成功,触发回调

+ 4 - 4
config/app.js

@@ -1,5 +1,5 @@
-let domain = "https://www.shuibeibyg.com/front-api"; // 正式环境IP
-// let domain = "https://test.shuibeibyg.com/front-api"; // 测试环境IP
+// let domain = "https://www.shuibeibyg.com/front-api"; // 正式环境IP
+let domain = "https://test.shuibeibyg.com/front-api"; // 测试环境IP
 // let domain = 'http://192.168.100.199:8081' // 晋守桦IP
 // let domain = 'http://192.168.100.246:8081' // 韩朝龙IP
 // let domain = "http://192.168.8.29:8081"; // 宏广IP
@@ -7,8 +7,8 @@ let domain = "https://www.shuibeibyg.com/front-api"; // 正式环境IP
 // export const H5_BASE_URL = "http://192.168.8.10:5174"; // 本地测试
 // export const H5_BASE_URL = "http://192.168.8.16:5173"; // 本地测试
 // export const H5_BASE_URL = "http://192.168.100.35:5175"; // 本地测试
-// export const H5_BASE_URL = "https://test.shuibeibyg.com/web-h5/"; // 测试环境H5地址
-export const H5_BASE_URL = "https://www.shuibeibyg.com/web-h5/"; // 正式环境H5地址
+export const H5_BASE_URL = "https://test.shuibeibyg.com/web-h5/"; // 测试环境H5地址
+// export const H5_BASE_URL = "https://www.shuibeibyg.com/web-h5/"; // 正式环境H5地址
 
 let share = "https://www.shuibeibyg.com";
 

+ 9 - 1
pages/webview/WxPay.vue

@@ -55,7 +55,7 @@ import { onLoad } from "@dcloudio/uni-app";
 import { useAppStore } from "@/stores/app";
 import { getUserOpenId } from "@/api/user";
 import { Calc } from "@/utils/util";
-import { goldPrincipalCompleteOrder } from "@/api/payment";
+import { goldPrincipalCompleteOrder, svipToggle } from "@/api/payment";
 import {
   recyclePreOrderSuccessAPI,
   postalDepositCallbackAPI,
@@ -190,6 +190,14 @@ const processOrderBizChange = async (payStatusRes) => {
         });
         break;
       case "svip":
+      case "SVIP":
+        await svipToggle({
+          action: 1,
+          orderNo: payStatusRes.outTradeNo,
+          phone: appStore.$userInfo.phone,
+          price: amount.value,
+          payType: "weixin",
+        });
         break;
     }
   } catch (error) {