diff --git a/App.vue b/App.vue
index 77bd482a..dfb03325 100644
--- a/App.vue
+++ b/App.vue
@@ -1777,7 +1777,7 @@
url = this.page_url_protocol(url);
// #endif
// #ifdef H5
- var url = window.location.href;
+ url = window.location.href;
// #endif
if (is_whole == false) {
var temp = url.split('?');
@@ -1813,7 +1813,7 @@
},
// 用户微信webopenid是否存在
- is_user_weixin_web_openid(order_ids, payment_id = 0) {
+ is_user_weixin_web_openid(order_ids, payment_id = 0, page = null) {
// 微信环境判断是否已有web_openid、不存在则跳转到插件进行授权
if (this.is_weixin_env()) {
var web_openid = this.get_user_cache_info('weixin_web_openid') || null;
@@ -1848,7 +1848,7 @@
order_ids: typeof order_ids == 'array' ? order_ids.join(',') : order_ids,
payment_id: payment_id,
});
- var page_url = this.get_page_url();
+ var page_url = (page || null) == null ? this.get_page_url() : this.page_url_protocol(page);
page_url += page_url.indexOf('?') == -1 ? '?' : '&';
page_url += 'is_weixin_auth_web_openid=1';
var request_url = encodeURIComponent(base64.encode(page_url));
diff --git a/components/payment/payment.vue b/components/payment/payment.vue
index 12aa63fe..fd9d94bc 100644
--- a/components/payment/payment.vue
+++ b/components/payment/payment.vue
@@ -64,27 +64,27 @@
import base64 from '@/common/js/lib/base64.js';
import componentPopup from '@/components/popup/popup';
export default {
- name: 'pay',
- data() {
- return {
- theme_view: app.globalData.get_theme_value_view(),
- // 支付方式列表
- payment_list: [],
- // 弹窗开关
- is_show_payment_popup: false,
- popup_view_pay_qrcode_is_show: false,
- // 定时器
- popup_view_pay_timer: null,
- popup_view_pay_data: null,
- // 支付id
- payment_id: 0,
- submit_disabled_status: true,
- order_id: 0,
- popup_view_pay_html_is_show: false,
- // 打开url地址定时任务和状态
- open_pay_url_timer: null,
- open_pay_url_status: true,
- };
+ name: 'pay',
+ data() {
+ return {
+ theme_view: app.globalData.get_theme_value_view(),
+ // 支付方式列表
+ payment_list: [],
+ // 弹窗开关
+ is_show_payment_popup: false,
+ popup_view_pay_qrcode_is_show: false,
+ // 定时器
+ popup_view_pay_timer: null,
+ popup_view_pay_data: null,
+ // 支付id
+ payment_id: 0,
+ submit_disabled_status: true,
+ order_id: 0,
+ popup_view_pay_html_is_show: false,
+ // 打开url地址定时任务和状态
+ open_pay_url_timer: null,
+ open_pay_url_status: true,
+ };
},
props: {
propCurrencySymbol: {
@@ -175,12 +175,12 @@
components: {
componentPopup,
},
- watch: {
- // 支付方式是否改变
- propPaymentList(value, old_value) {
- this.setData({
- payment_list: value,
- });
+ watch: {
+ // 支付方式是否改变
+ propPaymentList(value, old_value) {
+ this.setData({
+ payment_list: value,
+ });
},
// 是否显示支付方式
propIsShowPayment(new_val, old_val) {
@@ -202,7 +202,7 @@
this.setData({
payment_id: Number(this.propPaymentId) == 0 ? this.propDefaultPaymentId : Number(this.propPaymentId),
});
- }
+ }
this.setData({
is_show_payment_popup: new_val,
@@ -214,7 +214,7 @@
// 页面被展示
created: function () {
this.setData({
- payment_list: this.propPaymentList,
+ payment_list: this.propPaymentList,
payment_id: Number(this.propPaymentId) == 0 ? this.propDefaultPaymentId : Number(this.propPaymentId),
});
},
@@ -261,11 +261,11 @@
this.setData({
payment_list: payment_list
});
- }
- // 没有支付方式
- if((payment_id || 0) == 0) {
- this.pay_handle_event(order_id, payment_id);
- } else {
+ }
+ // 没有支付方式
+ if((payment_id || 0) == 0) {
+ this.pay_handle_event(order_id, payment_id);
+ } else {
// 循环匹配支付方式
this.payment_list.forEach((item) => {
if (item.id == payment_id) {
@@ -288,18 +288,18 @@
this.pay_handle_event(order_id, payment_id);
}
}
- });
+ });
}
},
// 支付处理
- pay_handle_event(order_id, payment_id = 0) {
- // 没有指定支付方式则不匹配支付标识
- var payment = null;
+ pay_handle_event(order_id, payment_id = 0) {
+ // 没有指定支付方式则不匹配支付标识
+ var payment = null;
if((payment_id || 0) != 0) {
// #ifdef H5
// 微信环境判断是否已有web_openid、不存在则不继续执行跳转到插件进行授权
- if (!app.globalData.is_user_weixin_web_openid(order_id, payment_id || this.payment_id)) {
+ if (!app.globalData.is_user_weixin_web_openid(order_id, payment_id || this.payment_id, this.propToAppointPage)) {
return false;
}
// #endif
@@ -312,8 +312,8 @@
if (payment == null) {
app.globalData.showToast(this.$t('payment.payment.7ihx9u'));
return false;
- }
- }
+ }
+ }
// 请求数据
var post_data = {
@@ -324,13 +324,13 @@
// #ifdef H5
var redirect_url = app.globalData.page_url_protocol(this.propToAppointPage || app.globalData.get_page_url(false));
post_data['redirect_url'] = encodeURIComponent(base64.encode(redirect_url));
- // 存在支付标识、指定支付方式使用respond_url返回地址、移除重定向地址
+ // 存在支付标识、指定支付方式使用respond_url返回地址、移除重定向地址
if(payment != null) {
var respond_arr = ['PayPal', 'UniPayment'];
if (respond_arr.indexOf(payment.payment) != -1) {
post_data['respond_url'] = post_data['redirect_url'];
delete post_data['redirect_url'];
- }
+ }
}
// #endif
// 请求支付接口
@@ -729,9 +729,11 @@
let back_data = {
data: data,
order_id: order_id,
+ temp_pay_index: this.propTempPayIndex,
+ payment_id: this.payment_id,
is_to_page: is_to_page,
};
- this.$emit('pay-success', back_data, this.propTempPayIndex, Number(this.propPaymentId) == 0 ? this.propDefaultPaymentId : Number(this.propPaymentId));
+ this.$emit('pay-success', back_data);
if (is_to_page) {
this.to_success_page_event();
}
diff --git a/pages/buy/buy.vue b/pages/buy/buy.vue
index 16ed8b26..113c90ee 100644
--- a/pages/buy/buy.vue
+++ b/pages/buy/buy.vue
@@ -889,10 +889,6 @@
},
});
} else {
- // 调用支付
- this.setData({
- to_appoint_page: this.to_appoint_page + '?order_ids=' + res.data.order_ids.join(','),
- });
this.$refs.payment.pay_handle(res.data.order_ids.join(','), res.data.payment_id, this.payment_list);
}
},
diff --git a/pages/plugins/membershiplevelvip/order/order.vue b/pages/plugins/membershiplevelvip/order/order.vue
index bafa1fed..d51f5ca9 100644
--- a/pages/plugins/membershiplevelvip/order/order.vue
+++ b/pages/plugins/membershiplevelvip/order/order.vue
@@ -39,6 +39,7 @@
1 && this.data_page > this.data_page_total,
});
+
+ // 下订单支付处理
+ var key = app.globalData.data.cache_page_pay_key;
+ var pay_data = uni.getStorageSync(key) || null;
+ if (pay_data != null && (pay_data.order_ids || null) != null && (pay_data.payment_id || null) != null) {
+ uni.removeStorageSync(key);
+ this.setData({
+ temp_pay_value: pay_data.order_ids,
+ payment_id: pay_data.payment_id,
+ });
+ if ((this.$refs.payment || null) != null) {
+ this.$refs.payment.pay_handle(pay_data.order_ids, pay_data.payment_id, this.payment_list);
+ }
+ }
} else {
this.setData({
data_list_loding_status: 0,
@@ -310,12 +325,16 @@
},
// 支付成功数据设置
- order_item_pay_success_handle(data, index) {
- // 数据设置
+ order_item_pay_success_handle(data) {
+ var order_ids_arr = data.order_id.toString().split(',');
var temp_data_list = this.data_list;
- temp_data_list[index]['pay_price'] = temp_data_list[index]['price'];
- temp_data_list[index]['status'] = 1;
- temp_data_list[index]['status_name'] = this.$t('order.order.s8g966');
+ for (var i in temp_data_list) {
+ if (order_ids_arr.indexOf(temp_data_list[i]['id'].toString()) != -1) {
+ temp_data_list[i]['pay_price'] = temp_data_list[i]['price'];
+ temp_data_list[i]['status'] = 1;
+ temp_data_list[i]['status_name'] = this.$t('order.order.s8g966');
+ }
+ }
this.setData({
data_list: temp_data_list,
});
diff --git a/pages/plugins/realstore/orderallot-list/orderallot-list.vue b/pages/plugins/realstore/orderallot-list/orderallot-list.vue
index 38cd1301..09a1ed79 100644
--- a/pages/plugins/realstore/orderallot-list/orderallot-list.vue
+++ b/pages/plugins/realstore/orderallot-list/orderallot-list.vue
@@ -70,6 +70,7 @@
1 && this.data_page > this.data_page_total,
});
- // 判断url是否含有从其他页面携带过来的参数
- if ((this.params.order_ids || null) !== null) {
- var order_ids_arr = this.params.order_ids.split(',');
- var temp_data_list = this.data_list;
- for (var i in temp_data_list) {
- if (order_ids_arr.indexOf(temp_data_list[i]['order_id']) != -1) {
- temp_data_list[i]['is_under_line'] = 1;
- }
- }
+ // 下订单支付处理
+ var key = app.globalData.data.cache_page_pay_key;
+ var pay_data = uni.getStorageSync(key) || null;
+ if (pay_data != null && (pay_data.order_ids || null) != null && (pay_data.payment_id || null) != null) {
+ uni.removeStorageSync(key);
this.setData({
- data_list: temp_data_list,
+ temp_pay_value: pay_data.order_ids,
+ payment_id: pay_data.payment_id,
});
+ if ((this.$refs.payment || null) != null) {
+ this.$refs.payment.pay_handle(pay_data.order_ids, pay_data.payment_id, this.original_payment_list);
+ }
}
} else {
this.setData({
@@ -372,11 +373,11 @@ export default {
// 支付成功数据设置
// 订单完成回调
- order_item_pay_success_handle(data, index, order_ids) {
- var order_ids_arr = data.order_id.split(',');
+ order_item_pay_success_handle(data) {
+ var order_ids_arr = data.order_id.toString().split(',');
var temp_data_list = this.data_list;
for (var i in temp_data_list) {
- if (order_ids_arr.indexOf(temp_data_list[i]['order_id']) != -1) {
+ if (order_ids_arr.indexOf(temp_data_list[i]['order_id'].toString()) != -1) {
temp_data_list[i]['operate_data']['is_pay'] = 0;
temp_data_list[i]['operate_data']['is_cancel'] = 0;
temp_data_list[i]['status'] = 2;
diff --git a/pages/plugins/scanpay/index/index.vue b/pages/plugins/scanpay/index/index.vue
index 41a0a5aa..9a13c46b 100644
--- a/pages/plugins/scanpay/index/index.vue
+++ b/pages/plugins/scanpay/index/index.vue
@@ -270,8 +270,8 @@
form: new_data,
});
},
- // 更多
+ // 更多
more_event() {
this.setData({
is_more: !this.is_more,
diff --git a/pages/plugins/wallet/components/user-recharge/user-recharge.vue b/pages/plugins/wallet/components/user-recharge/user-recharge.vue
index d47b57ff..a2ff95c9 100644
--- a/pages/plugins/wallet/components/user-recharge/user-recharge.vue
+++ b/pages/plugins/wallet/components/user-recharge/user-recharge.vue
@@ -39,6 +39,7 @@
1 && this.data_page > this.data_page_total,
});
+
+ // 下订单支付处理
+ var key = app.globalData.data.cache_page_pay_key;
+ var pay_data = uni.getStorageSync(key) || null;
+ if (pay_data != null && (pay_data.order_ids || null) != null && (pay_data.payment_id || null) != null) {
+ uni.removeStorageSync(key);
+ this.setData({
+ temp_pay_value: pay_data.order_ids,
+ payment_id: pay_data.payment_id,
+ });
+ if ((this.$refs.payment || null) != null) {
+ this.$refs.payment.pay_handle(pay_data.order_ids, pay_data.payment_id, this.payment_list);
+ }
+ }
} else {
this.setData({
data_list_loding_status: 0,
@@ -292,15 +307,21 @@
});
},
// 支付成功数据设置
- order_item_pay_success_handle(data, index) {
- // 数据设置
+ order_item_pay_success_handle(data) {
+ var order_ids_arr = data.order_id.toString().split(',');
var temp_data_list = this.data_list;
- temp_data_list[index]['pay_money'] = temp_data_list[index]['money'];
- temp_data_list[index]['status'] = 1;
- temp_data_list[index]['status_name'] = this.$t('order.order.s8g966');
+ for (var i in temp_data_list) {
+ if (order_ids_arr.indexOf(temp_data_list[i]['id'].toString()) != -1) {
+ temp_data_list[i]['pay_money'] = temp_data_list[i]['money'];
+ temp_data_list[i]['status'] = 1;
+ temp_data_list[i]['status_name'] = this.$t('order.order.s8g966');
+ }
+ }
this.setData({
data_list: temp_data_list,
});
+
+ // 成功回调事件
this.$emit('pay-success');
},
diff --git a/pages/user-order/user-order.vue b/pages/user-order/user-order.vue
index f3b64b29..4d57e45c 100644
--- a/pages/user-order/user-order.vue
+++ b/pages/user-order/user-order.vue
@@ -102,6 +102,7 @@
1 && this.data_page > this.data_page_total,
});
- // 判断url是否含有从其他页面携带过来的参数
- if ((this.params.order_ids || null) !== null) {
- var order_ids_arr = this.params.order_ids.split(',');
- var temp_data_list = this.data_list;
- for (var i in temp_data_list) {
- if (order_ids_arr.indexOf(temp_data_list[i]['id']) != -1) {
- temp_data_list[i]['is_under_line'] = 1;
- }
+ // 下订单支付处理
+ var key = app.globalData.data.cache_page_pay_key;
+ var pay_data = uni.getStorageSync(key) || null;
+ if (pay_data != null && (pay_data.order_ids || null) != null && (pay_data.payment_id || null) != null) {
+ uni.removeStorageSync(key);
+ if ((this.$refs.payment || null) != null) {
+ this.$refs.payment.pay_handle(pay_data.order_ids, pay_data.payment_id, this.original_payment_list);
}
- this.setData({
- data_list: temp_data_list,
- });
}
} else {
this.setData({
@@ -426,13 +423,12 @@
// 支付成功数据设置
// 订单完成回调
- order_item_pay_success_handle(data, index, order_ids) {
- var order_ids_arr = data.order_id.split(',');
+ order_item_pay_success_handle(data) {
+ var order_ids_arr = data.order_id.toString().split(',');
var temp_data_list = this.data_list;
-
- // 数据设置
+ console.log(order_ids_arr)
for (var i in temp_data_list) {
- if (order_ids_arr.indexOf(temp_data_list[i]['id']) != -1) {
+ if (order_ids_arr.indexOf(temp_data_list[i]['id'].toString()) != -1) {
temp_data_list[i]['operate_data']['is_pay'] = 0;
temp_data_list[i]['operate_data']['is_cancel'] = 0;
switch (parseInt(temp_data_list[i]['order_model'])) {