fix(pay): 充值支付逻辑完善

This commit is contained in:
woody 2025-07-05 15:45:42 +08:00
parent 196a4c0909
commit d7a22a9bb3
2 changed files with 22 additions and 6 deletions

View File

@ -15,12 +15,11 @@ module.exports = vm => {
// 初始化请求配置
uni.$u.http.setConfig(config => {
// config.baseURL = 'https://p1.hzs413.com/inter-api';
// 192.168.0.100:8080
//#ifdef DEV_SERVER
console.log('DEV_SERVER')
config.baseURL = 'http://192.168.0.101:8080'
config.baseURL = 'https://t-app.beida666.com/prod-api'
//#endif
//#ifdef QA_SERVER

View File

@ -842,13 +842,18 @@ export default {
return false
},
},
onLoad(options) {
async onLoad(options) {
this.paramsPost = JSON.parse(options.paramsPost || '{}')
this.getPayConfig()
await this.getPayConfig()
clearInterval(this.clockTime)
this.pkCountry = uni.getStorageSync('pkCountry')
if (this.paramsPost.isRecharge) {
this.activeNames = '2'
const auth = Object.keys(this.payList).find(key => this.payList[key])
this.whatPay = Object.keys(this.PAY_AUTH).find(
key => this.PAY_AUTH[key] === auth
)
this.isRecharge = this.paramsPost.isRecharge
this.businessType = 3
uni.setNavigationBarTitle({
@ -1062,10 +1067,18 @@ export default {
if (isRecharge) {
if (!this.rechargeAmount || this.rechargeAmount <= 0) {
uni.showToast({
icon: 'none',
title: '请输入正确的充值金额',
})
return
}
if (!this.whatPay) {
uni.showToast({
icon: 'none',
title: '请选择支付方式',
})
return
}
}
if (this.activeNames == 2) {
//
@ -1345,8 +1358,12 @@ export default {
}
},
getPayConfig() {
api.payConfig().then(res => {
this.payList = res.data
return new Promise((resolve, reject) => {
api.payConfig().then(res => {
this.payList = res.data
console.log(this.payList)
resolve(res.data)
})
})
},
getBankList() {