支付
This commit is contained in:
parent
559ee026fb
commit
dac94a6e6b
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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' });
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user