| | |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { Toast as NutToast } from '@nutui/nutui-taro'; |
| | | import { onMounted, reactive, ref, computed } from 'vue'; |
| | | import Taro from '@tarojs/taro'; |
| | | |
| | | defineOptions({ |
| | | name: 'SelectPayTypeView', |
| | |
| | | attach: Date.now().toString(), |
| | | }; |
| | | let res = await blLifeRecharge.services.getPayOrderForJsAPI(params); |
| | | |
| | | if (res) { |
| | | //@ts-ignore |
| | | if (res && WeixinJSBridge) { |
| | | if (WeixinJSBridge) { |
| | | //@ts-ignore |
| | | WeixinJSBridge.invoke( |
| | | 'getBrandWCPayRequest', |
| | |
| | | } |
| | | } |
| | | ); |
| | | } else if (Taro.getEnv() === Taro.ENV_TYPE.WEAPP) { |
| | | Taro.requestPayment({ |
| | | timeStamp: res.timestamp, |
| | | nonceStr: res.nonceStr, |
| | | package: res.package, |
| | | signType: res.signType as any, |
| | | paySign: res.paySign, |
| | | success: function (res) { |
| | | console.log('res: ', res); |
| | | // if(res.errMsg) |
| | | }, |
| | | fail: function (res) {}, |
| | | }); |
| | | } |
| | | } |
| | | } catch (error) {} |
| | | } |