fix(pay): 充值支付逻辑完善
This commit is contained in:
parent
3bb3f240f1
commit
472b36fa0d
|
@ -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
|
||||
|
|
|
@ -812,13 +812,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({
|
||||
|
@ -1032,10 +1037,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) {
|
||||
// 非银行卡
|
||||
|
@ -1340,8 +1353,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() {
|
||||
|
|
Loading…
Reference in New Issue