This commit is contained in:
Sliverber 2024-02-22 18:06:29 +08:00
parent 559ee026fb
commit dac94a6e6b
4 changed files with 49 additions and 39 deletions

View File

@ -59,13 +59,13 @@
intervalId: null, // ID intervalId: null, // ID
// //
payMode: [ payMode: [
// { {
// "name": "", "name": "微信支付",
// "icon": "icon-weixin2", "icon": "icon-weixin2",
// value: 'weixin', value: 'weixin',
// title: '', title: '微信快捷支付',
// payStatus: 1, payStatus: 1,
// }, },
// { // {
// "name": "", // "name": "",
// "icon": "icon-yuezhifu", // "icon": "icon-yuezhifu",
@ -74,15 +74,15 @@
// payStatus: 1, // payStatus: 1,
// number: 0 // number: 0
// }, // },
// #ifndef MP // // #ifndef MP
{ // {
"name": "支付宝支付", // "name": "",
"icon": "icon-zhifubao", // "icon": "icon-zhifubao",
value: 'alipay', // value: 'alipay',
title: '支付宝快捷支付', // title: '',
payStatus: 1, // payStatus: 1,
} // }
// #endif // // #endif
], ],
}; };
}, },
@ -156,7 +156,7 @@
}, },
// //
aliPay(id) { aliPay(id) {
console.log('支付宝小程序支付');
let that = this let that = this
console.log(that.order_id, 'idididiid'); console.log(that.order_id, 'idididiid');
@ -245,13 +245,13 @@
// // #ifndef MP // // #ifndef MP
// payChannel:that.payChannel, // payChannel:that.payChannel,
// // #endif // // #endif
// payType: paytype, payType: paytype,
// scene: that.productType === 'normal' ? 0 : 1177 // // scene: that.productType === 'normal' ? 0 : 1177 //
}).then(res => { }).then(res => {
let jsConfig = res.data.jsConfig; let jsConfig = res.data.jsConfig;
that.order_id = res.data.tradeNo; that.order_id = res.data.tradeNo;
that.checkid = res.data.orderNo that.checkid = res.data.orderNo
console.log(that.checkid,'that.checkidthat.checkid'); // console.log(that.checkid,'that.checkidthat.checkid');
switch (res.data.payType) { switch (res.data.payType) {
case 'weixin': case 'weixin':
that.weixinPay(jsConfig); that.weixinPay(jsConfig);
@ -281,23 +281,29 @@
}); });
break; break;
case 'alipay': case 'alipay':
this.aliPay(that.order_id) //
// uni.hideLoading(); // 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 //#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 //#endif
//#ifdef MP-ALIPAY //#ifdef MP-ALIPAY

View File

@ -1,9 +1,9 @@
//移动端商城API //移动端商城API
// let domain = 'http://117.50.163.143:20410' // let domain = 'http://117.50.163.143:20410'
// let domain = 'http://117.50.215.20: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 = 'http://106.75.49.247:20410'
let domain = 'https://yruibao.com/prod' // let domain = 'https://yruibao.com/prod'
module.exports = { module.exports = {
// 请求域名 格式: https://您的域名 // 请求域名 格式: https://您的域名
// #ifdef MP || APP-PLUS // #ifdef MP || APP-PLUS

View File

@ -54,13 +54,17 @@
}, },
onLoad() { onLoad() {
this.getData()
uni.webView.postMessage({ uni.webView.postMessage({
data: { data: {
action: 'authorize' action: 'authorize'
} }
}) })
//#ifdef MP-ALIPAY
this.getData()
// this.aliPay(that.order_id)
//#endif
// console.log(this.$Cache.get('orderno')) // console.log(this.$Cache.get('orderno'))
// window.my.postMessage({ action: 'authorize' }); // window.my.postMessage({ action: 'authorize' });

View File

@ -28,7 +28,7 @@
<view v-else> <view v-else>
<button v-if="routinePhoneVerification == 1 || routinePhoneVerification.length===3" hover-class="none" <button v-if="routinePhoneVerification == 1 || routinePhoneVerification.length===3" hover-class="none"
@click="onUserPhone" class="btn1 bg-color"><text @click="onUserPhone" class="btn1 bg-color"><text
class='iconfont icon-weixin2'></text>一键绑定手机号</button> class='iconfont icon-weixin2' v-if="false"></text>手机号快捷登录</button>
<button v-if="routinePhoneVerification == 2 || routinePhoneVerification.length===3" hover-class="none" <button v-if="routinePhoneVerification == 2 || routinePhoneVerification.length===3" hover-class="none"
@click="onUserPhone('isPhone')" class="btn2">手动绑定手机号</button> @click="onUserPhone('isPhone')" class="btn2">手动绑定手机号</button>
</view> </view>