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

This commit is contained in:
woody 2025-07-05 15:45:42 +08:00
parent 3bb3f240f1
commit 472b36fa0d
2 changed files with 22 additions and 6 deletions

View File

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

View File

@ -812,13 +812,18 @@ export default {
return false return false
}, },
}, },
onLoad(options) { async onLoad(options) {
this.paramsPost = JSON.parse(options.paramsPost || '{}') this.paramsPost = JSON.parse(options.paramsPost || '{}')
this.getPayConfig() await this.getPayConfig()
clearInterval(this.clockTime) clearInterval(this.clockTime)
this.pkCountry = uni.getStorageSync('pkCountry') this.pkCountry = uni.getStorageSync('pkCountry')
if (this.paramsPost.isRecharge) { 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.isRecharge = this.paramsPost.isRecharge
this.businessType = 3 this.businessType = 3
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -1032,10 +1037,18 @@ export default {
if (isRecharge) { if (isRecharge) {
if (!this.rechargeAmount || this.rechargeAmount <= 0) { if (!this.rechargeAmount || this.rechargeAmount <= 0) {
uni.showToast({ uni.showToast({
icon: 'none',
title: '请输入正确的充值金额', title: '请输入正确的充值金额',
}) })
return return
} }
if (!this.whatPay) {
uni.showToast({
icon: 'none',
title: '请选择支付方式',
})
return
}
} }
if (this.activeNames == 2) { if (this.activeNames == 2) {
// //
@ -1340,8 +1353,12 @@ export default {
} }
}, },
getPayConfig() { getPayConfig() {
api.payConfig().then(res => { return new Promise((resolve, reject) => {
this.payList = res.data api.payConfig().then(res => {
this.payList = res.data
console.log(this.payList)
resolve(res.data)
})
}) })
}, },
getBankList() { getBankList() {