diff --git a/components/payments/index.vue b/components/payments/index.vue index 4736166..dcdcba1 100644 --- a/components/payments/index.vue +++ b/components/payments/index.vue @@ -59,13 +59,13 @@ intervalId: null, // 用于存储定时器的ID //支付方式 payMode: [ - // { - // "name": "微信支付", - // "icon": "icon-weixin2", - // value: 'weixin', - // title: '微信快捷支付', - // payStatus: 1, - // }, + { + "name": "微信支付", + "icon": "icon-weixin2", + value: 'weixin', + title: '微信快捷支付', + payStatus: 1, + }, // { // "name": "余额支付", // "icon": "icon-yuezhifu", @@ -74,15 +74,15 @@ // payStatus: 1, // number: 0 // }, - // #ifndef MP - { - "name": "支付宝支付", - "icon": "icon-zhifubao", - value: 'alipay', - title: '支付宝快捷支付', - payStatus: 1, - } - // #endif + // // #ifndef MP + // { + // "name": "支付宝支付", + // "icon": "icon-zhifubao", + // value: 'alipay', + // title: '支付宝快捷支付', + // payStatus: 1, + // } + // // #endif ], }; }, @@ -156,7 +156,7 @@ }, // 调用支付宝支付 aliPay(id) { - + console.log('支付宝小程序支付'); let that = this console.log(that.order_id, 'idididiid'); @@ -245,13 +245,13 @@ // // #ifndef MP // payChannel:that.payChannel, // // #endif - // payType: paytype, + payType: paytype, // scene: that.productType === 'normal' ? 0 : 1177 //下单时小程序的场景值 }).then(res => { let jsConfig = res.data.jsConfig; that.order_id = res.data.tradeNo; that.checkid = res.data.orderNo - console.log(that.checkid,'that.checkidthat.checkid'); + // console.log(that.checkid,'that.checkidthat.checkid'); switch (res.data.payType) { case 'weixin': that.weixinPay(jsConfig); @@ -281,23 +281,29 @@ }); break; case 'alipay': - this.aliPay(that.order_id) + // // uni.hideLoading(); + if(that.openId==''){ + if (this.$wechat.isWeixin()) { + //微信公众号内支付 + } else { + //h5支付 + console.log('进入h5支付宝'); + uni.hideLoading(); + that.formContent = res.data.alipayRequest; + uni.setStorage({ + key: 'orderNo', + data: that.order_id + }); + that.$nextTick(() => { + document.forms['punchout_form'].submit(); + }) + } + }else{ + this.aliPay(that.order_id) + } //#ifdef H5 - // if (this.$wechat.isWeixin()) { - // //微信公众号内支付 - // } else { - // //h5支付 - // uni.hideLoading(); - // that.formContent = res.data.alipayRequest; - // uni.setStorage({ - // key: 'orderNo', - // data: that.order_id - // }); - // that.$nextTick(() => { - // document.forms['punchout_form'].submit(); - // }) - // } + //#endif //#ifdef MP-ALIPAY diff --git a/config/app.js b/config/app.js index f85ef8c..eab6b24 100644 --- a/config/app.js +++ b/config/app.js @@ -1,9 +1,9 @@ //移动端商城API // let domain = 'http://117.50.163.143:20410' // let domain = 'http://117.50.215.20:20410' -// let domain = 'http://192.168.2.26:20411' +let domain = 'http://192.168.2.26:20411' // let domain = 'http://106.75.49.247:20410' -let domain = 'https://yruibao.com/prod' +// let domain = 'https://yruibao.com/prod' module.exports = { // 请求域名 格式: https://您的域名 // #ifdef MP || APP-PLUS diff --git a/pages/users/repayment/index.vue b/pages/users/repayment/index.vue index 29d321f..7dc98d8 100644 --- a/pages/users/repayment/index.vue +++ b/pages/users/repayment/index.vue @@ -54,13 +54,17 @@ }, onLoad() { + this.getData() uni.webView.postMessage({ data: { action: 'authorize' } }) - - this.getData() + //#ifdef MP-ALIPAY + + // this.aliPay(that.order_id) + //#endif + // console.log(this.$Cache.get('orderno')) // window.my.postMessage({ action: 'authorize' }); diff --git a/pages/users/wechat_login/index.vue b/pages/users/wechat_login/index.vue index 4ceaaa4..de3283d 100644 --- a/pages/users/wechat_login/index.vue +++ b/pages/users/wechat_login/index.vue @@ -28,7 +28,7 @@ + class='iconfont icon-weixin2' v-if="false">手机号快捷登录