优化首页
This commit is contained in:
@@ -268,7 +268,7 @@
|
||||
<view v-if="common_order_is_booking != 1 && payment_list.length > 0" :class="plugins_coin_is_valid ? 'br-t-f9' : ''">
|
||||
<view v-for="(item, index) in payment_list" :key="index">
|
||||
<view class="item flex-row jc-sb align-c" :data-value="item.id" :data-index="index" @tap="payment_event">
|
||||
<view class="item-content pr flex-1 flex-width">
|
||||
<view class="item-content flex pr flex-1 flex-width">
|
||||
<image v-if="(item.logo || null) != null" class="icon margin-right-sm va-m radius" :src="item.logo" mode="widthFix"></image>
|
||||
<text class="va-m">{{ item.name }}</text>
|
||||
<text v-if="(item.tips || null) !== null" class="pay-tips">{{ item.tips }}</text>
|
||||
@@ -508,7 +508,7 @@
|
||||
is_realstore_model: (params.realstore_id || null) != null,
|
||||
plugins_points_status: app.globalData.get_config('plugins_base.points.data.is_default_use_points', null) == 1,
|
||||
// pay_url: app.globalData.get_request_url('pay', 'order'),
|
||||
pay_url: app.globalData.get_request_url('getpayment', 'xo'),
|
||||
// pay_url: app.globalData.get_request_url('getpayment', 'xo'),
|
||||
qrcode_url: app.globalData.get_request_url('paycheck', 'order'),
|
||||
});
|
||||
|
||||
@@ -625,44 +625,54 @@
|
||||
},
|
||||
// 发起支付请求
|
||||
async onPay(order_id, payment_id = 0, payment_list) {
|
||||
console.log('发起支付请求', `${order_id}+${payment_id}+${JSON.stringify(payment_list)}`);
|
||||
let payment = payment_list.find((item) => item.id == payment_id).payment;
|
||||
if (payment == 'Weixin') {
|
||||
let web_openid = localStorage.getItem('web_openid');
|
||||
this.pay_url = app.globalData.get_request_url('getpayment', 'xo');
|
||||
if (!web_openid) {
|
||||
// 获取code换取web_openid
|
||||
const code = this.getCodeFromUrl();
|
||||
console.log('code===', code);
|
||||
if (!code) {
|
||||
this.handleAuthLogin();
|
||||
return;
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('getwechatuserinfo', 'xo'),
|
||||
method: 'GET',
|
||||
data: {
|
||||
code: code,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
console.log('获取微信web_openid===', res.data);
|
||||
if (res.data.code == 0) {
|
||||
let data = res.data.data;
|
||||
localStorage.setItem('web_openid', data.openid);
|
||||
|
||||
let web_openid = localStorage.getItem('web_openid');
|
||||
console.log('onPay.web_openid===', web_openid);
|
||||
if (!web_openid) {
|
||||
// 获取code换取web_openid
|
||||
const code = this.getCodeFromUrl();
|
||||
console.log('code===', code);
|
||||
if (!code) {
|
||||
this.handleAuthLogin();
|
||||
return;
|
||||
this.$refs.payment.pay_handle(order_id, payment_id, payment_list);
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// 直接走支付流程
|
||||
console.log('直接走支付流程');
|
||||
this.$refs.payment.pay_handle(order_id, payment_id, payment_list);
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('getwechatuserinfo', 'xo'),
|
||||
method: 'GET',
|
||||
data: {
|
||||
code: code,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
console.log('获取微信web_openid===', res.data);
|
||||
if (res.data.code == 0) {
|
||||
let data = res.data.data;
|
||||
localStorage.setItem('web_openid', data.openid);
|
||||
}
|
||||
|
||||
this.$refs.payment.pay_handle(order_id, payment_id, payment_list);
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
if (payment == 'IEPayPoli') {
|
||||
console.log('开始无忧支付===', order_id);
|
||||
|
||||
this.pay_url = app.globalData.get_request_url('wuYouPay', 'xo');
|
||||
this.$nextTick(() => {
|
||||
this.$refs.payment.pay_handle(order_id, payment_id, payment_list);
|
||||
});
|
||||
} else {
|
||||
// 直接走支付流程
|
||||
console.log('直接走支付流程');
|
||||
this.$refs.payment.pay_handle(order_id, payment_id, payment_list);
|
||||
}
|
||||
},
|
||||
// 初始化配置
|
||||
|
||||
Reference in New Issue
Block a user