feat(pay): merge pay

This commit is contained in:
woody 2025-07-08 09:32:48 +08:00
parent ee01aba367
commit d2db18d57e
1 changed files with 59 additions and 54 deletions

View File

@ -30,10 +30,10 @@
<u-collapse-item <u-collapse-item
name="1" name="1"
v-if=" v-if="
!isRecharge && !isShare & (userInfo.memberCode != 'CN68880628') !isRecharge && !isShare & (userInfo.memberCode != 'BD68880628')
" "
> >
<view slot="title" BD68880628 class="pf"> <view slot="title" class="pf">
<img src="@/static/images/yhkzf.jpg" alt="" /> <img src="@/static/images/yhkzf.jpg" alt="" />
<view>{{ '钱包支付' }}</view> <view>{{ '钱包支付' }}</view>
</view> </view>
@ -169,7 +169,7 @@
</view> </view>
</u-collapse-item> </u-collapse-item>
<!-- 暂时隐藏在线支付 --> <!-- 暂时隐藏在线支付 -->
<u-collapse-item name="2" v-if="onlinePay && false"> <u-collapse-item name="2" v-if="onlinePay">
<view slot="title" class="pf"> <view slot="title" class="pf">
<img src="@/static/images/under_pay.png" alt="" /> <img src="@/static/images/under_pay.png" alt="" />
<view>{{ '在线支付' }}</view> <view>{{ '在线支付' }}</view>
@ -183,7 +183,12 @@
<view>{{ '宝付微信支付' }}</view> <view>{{ '宝付微信支付' }}</view>
</view> </view>
<u-radio-group v-model="whatPay"> <u-radio-group v-model="whatPay">
<u-radio activeColor="red" size="14" label="" :name="11"> <u-radio
activeColor="red"
size="14"
label=""
:name="PAY_TYPE.BAO_FU_WECHAT"
>
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
@ -196,7 +201,12 @@
<view>{{ '宝付微信扫码' }}</view> <view>{{ '宝付微信扫码' }}</view>
</view> </view>
<u-radio-group v-model="whatPay"> <u-radio-group v-model="whatPay">
<u-radio activeColor="red" size="14" label="" :name="12"> <u-radio
activeColor="red"
size="14"
label=""
:name="PAY_TYPE.BAO_FU_WECHAT_SCAN"
>
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
@ -209,7 +219,12 @@
<view>{{ '汇付微信支付' }}</view> <view>{{ '汇付微信支付' }}</view>
</view> </view>
<u-radio-group v-model="whatPay"> <u-radio-group v-model="whatPay">
<u-radio activeColor="red" size="14" label="" :name="13"> <u-radio
activeColor="red"
size="14"
label=""
:name="PAY_TYPE.HUI_FU_WECHAT"
>
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
@ -223,7 +238,12 @@
<view>{{ '微信支付' }}</view> <view>{{ '微信支付' }}</view>
</view> </view>
<u-radio-group v-model="whatPay"> <u-radio-group v-model="whatPay">
<u-radio activeColor="red" size="14" label="" :name="73"> <u-radio
activeColor="red"
size="14"
label=""
:name="PAY_TYPE.WECHAT_PAY"
>
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
@ -234,7 +254,12 @@
<view>{{ '支付宝支付' }}</view> <view>{{ '支付宝支付' }}</view>
</view> </view>
<u-radio-group v-model="whatPay"> <u-radio-group v-model="whatPay">
<u-radio activeColor="red" size="14" label="" :name="74"> <u-radio
activeColor="red"
size="14"
label=""
:name="PAY_TYPE.ALI_PAY"
>
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
@ -263,7 +288,7 @@
activeColor="red" activeColor="red"
size="14" size="14"
label="" label=""
:name="'hf' + index" :name="PAY_TYPE.HUI_FU_BANK_CARD + index"
> >
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
@ -283,7 +308,12 @@
<view>通联微信支付</view> <view>通联微信支付</view>
</view> </view>
<u-radio-group v-model="whatPay"> <u-radio-group v-model="whatPay">
<u-radio activeColor="red" size="14" label="" :name="32"> <u-radio
activeColor="red"
size="14"
label=""
:name="PAY_TYPE.TONG_LIAN_WECHAT"
>
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
@ -310,7 +340,7 @@
activeColor="red" activeColor="red"
size="14" size="14"
label="" label=""
:name="'jd' + index" :name="PAY_TYPE.JING_DONG_BANK_CARD + index"
> >
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
@ -362,7 +392,7 @@
activeColor="red" activeColor="red"
size="14" size="14"
label="" label=""
:name="'tl' + index" :name="PAY_TYPE.TONG_LIAN_BANK_CARD + index"
> >
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
@ -1136,30 +1166,11 @@ export default {
}) })
} }
} else { } else {
if (cz) { api.generate().then(res => {
// uni.setStorageSync('mToken', res.msg)
api })
.preCharge({ this.isBank = ''
rechargeAmount: this.czJe, this.isPw = true
})
.then(res => {
this.paramsPost = res.data
this.orderCode = res.orderCode
if (this.whatPay == 12) {
this.scanPayBfWx(5)
} else if (this.whatPay == 13) {
this.scanPayBfWx(6)
}
})
this.isBank = ''
this.isPw = true
} else {
api.generate().then(res => {
uni.setStorageSync('mToken', res.msg)
})
this.isBank = ''
this.isPw = true
}
} }
}, },
scanPayBfWx(val) { scanPayBfWx(val) {
@ -1221,25 +1232,19 @@ export default {
businessCode: this.orderCode, businessCode: this.orderCode,
extParam: extParamBase64, extParam: extParamBase64,
} }
} else { api.unifiedorder(params).then(res => {
params = { if (res.code === 200) {
businessType: this.businessType, // resolve(res.data)
businessCode: this.orderCode, this.checkPayStatus(params)
payChannel: val, } else {
payType: 2, uni.showToast({
appletFlag: 0, title: res.msg,
} icon: 'none',
} })
api.unifiedorder(params).then(res => { reject(res.msg)
let url = }
'https://clooud1-5g23d3je04dda65b-1326540601.tcloudbaseapp.com/jump_mp.html?sign=20f03b022bc39e837056bdbe475632c8&t=1715569339&state=' + })
res.data +
'&payment=0'
// https://clooud1-5g23d3je04dda65b-1326540601.tcloudbaseapp.com/jump_mp.html?sign=812bf9ab54292b1fb7161a3a6f7fa0f6&t=1715570889&state=' +
// res.data + '&payment=0'
window.open(url)
}) })
this.checkPayStatus(params)
}, },
drawQrcode(text) { drawQrcode(text) {
let that = this let that = this