Browse Source

修改支付

lex 1 year ago
parent
commit
5151ec8797
1 changed files with 16 additions and 15 deletions
  1. 16 15
      src/views/adapay/payment/index.tsx

+ 16 - 15
src/views/adapay/payment/index.tsx

@@ -140,31 +140,32 @@ export default defineComponent({
     const submitNativePay = async () => {
       // 支付...
       try {
+        const payChannel = state.payType === 'zfb' ? 'ali_app' : 'wx_app'
         console.log(props.paymentConfig, 'paymentConfig')
+        let paymentType = props.paymentVendor
+        props.paymentChannels.forEach((item: any) => {
+          if (state.payType === 'zfb' && item.indexOf('alipay') !== -1) {
+            paymentType = item
+          }
+          if (state.payType === 'wx' && item.indexOf('wxpay') !== -1) {
+            paymentType = item
+          }
+        })
         const params = {
-          orderNo: props.paymentConfig.orderNo,
-          payChannel: state.payType,
-          paymentClient: null as any
+          // orderNo: props.paymentConfig.orderNo,
+          merOrderNo: props.paymentConfig.orderNo,
+          payChannel,
+          paymentType
         }
-        // if (this.paymentType === 'goodsPay') {
-        //   params.paymentClient = state.platformType
-        // }
-        // const payMap: any = {
-        //   merOrderNo: state.orderNo,
-        //   paymentChannel: state.pay_channel, // 支付渠道
-        //   userId: state.userId,
-        //   code: state.code
-        // }
         const res = await request.post(
-          urlFix + '/open/userOrder/executePayment/v2',
+          urlFix + '/userOrder/executePayment/v2',
           {
             data: {
               ...params
             }
           }
         )
-        console.log(res, 'response')
-        const payChannel = state.payType === 'zfb' ? 'ali_app' : 'wx_app'
+
         postMessage({
           api: 'paymentOrder',
           content: {