diff --git a/config/request.js b/config/request.js index 3a287d4..f800f96 100644 --- a/config/request.js +++ b/config/request.js @@ -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 diff --git a/pages/pay/index.vue b/pages/pay/index.vue index 7bcbfc6..62c6398 100644 --- a/pages/pay/index.vue +++ b/pages/pay/index.vue @@ -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() {