diff --git a/App.vue b/App.vue index 606d58db..7847c409 100644 --- a/App.vue +++ b/App.vue @@ -2541,25 +2541,29 @@ // 页面导航标题处理 set_pages_navigation_bar_title() { - var arr = [ - 'pages/index/index', - 'pages/goods-category/goods-category', - 'pages/cart/cart', - 'pages/user/user', - 'pages/plugins/realstore/detail/detail' - ]; + // 当前平台 + var client_value = this.application_client_type(); // 当前页面地址 var url = this.current_page(false); - // 不增加标题的页面 - if(arr.indexOf(url) == -1) { - var arr = url.split('/'); - arr = arr.slice(1); - arr = arr.slice(0, -1); - var key = 'pages.'+arr.join('-'); - uni.setNavigationBarTitle({ - title: i18n.t(key), - }); + // 支付宝平台当前tab页面不增加标题 + if(client_value == 'alipay' && this.data.tabbar_pages.indexOf('/'+url) == -1) { + return false; } + // 解析处理key + var arr = url.split('/'); + arr = arr.slice(1); + arr = arr.slice(0, -1); + var key = 'pages.'+arr.join('-'); + // 读取语言 + var value = i18n.t(key); + // 首页则读取当前应用名称 + if(this.data.tabbar_pages[0] == '/'+url) { + value = this.get_application_title(); + } + // 设置标题 + uni.setNavigationBarTitle({ + title: value + }); }, // 页面加载事件处理 diff --git a/components/payment/payment.vue b/components/payment/payment.vue index f1f1fbec..9436ec66 100644 --- a/components/payment/payment.vue +++ b/components/payment/payment.vue @@ -210,7 +210,10 @@ payment_id: Number(this.propPaymentId) === 0 ? this.propDefaultPaymentId : Number(this.propPaymentId), submit_disabled_status: true, order_id: 0, - popup_view_pay_html_is_show: false, + popup_view_pay_html_is_show: false, + // 打开url地址定时任务和状态 + open_pay_url_timer: null, + open_pay_url_status: true, }; }, methods: { @@ -415,17 +418,17 @@ } }, // APP支付 - app_pay_handle(self, data, order_id) { - uni.getProvider({ - service: 'payment', - success: function (res) { - var arr = { - Alipay: 'alipay', - Weixin: 'wxpay', - PayPal: 'paypal' - } - var pay_value = arr[data.payment.payment] || null; - if(pay_value != null) { + app_pay_handle(self, data, order_id) { + var arr = { + Alipay: 'alipay', + Weixin: 'wxpay', + PayPal: 'paypal' + } + var pay_value = arr[data.payment.payment] || null; + if(pay_value != null) { + uni.getProvider({ + service: 'payment', + success: function (res) { if(~res.provider.indexOf(pay_value)) { var pay_data = ((data.data.pay_data || null) == null) ? data.data : data.data.pay_data; uni.requestPayment({ @@ -437,7 +440,7 @@ if(call_back_url != null) { uni.request({url: call_back_url, method: 'GET'}); } - + // 成功处理数据 self.order_item_pay_success_handle(data, order_id); }, @@ -446,13 +449,53 @@ } }); } else { - app.globalData.showToast(data.payment.payment+self.$t('payment.payment.t4d687')); + app.globalData.showToast(data.payment.payment+self.$t('payment.payment.bv637f')); } - } else { - app.globalData.showToast(data.payment.payment+self.$t('payment.payment.bv637f')); - } - } - }); + } + }); + } else { + // 先清除定时任务 + if(self.open_pay_url_timer != null) { + clearTimeout(self.open_pay_url_timer); + } + // 显示加载层 + uni.showLoading({ + title: this.$t('common.loading_in_text'), + mask: true + }); + // 设置打开url状态 + self.setData({ + open_pay_url_status: true + }); + // 打开url + plus.runtime.openURL(data.data, function(error) { + uni.hideLoading(); + // 打开url失败、并进入提示失败环节 + self.setData({ + open_pay_url_status: false + }); + self.order_item_pay_fail_handle(data, order_id, error); + }); + // 定时3秒后提示用户确认支付状态 + self.open_pay_url_timer = setTimeout(function() { + if(self.open_pay_url_status) { + uni.hideLoading(); + uni.showModal({ + content: self.$t('payment.payment.sdfs31'), + showCancel: true, + cancelText: self.$t('common.not_have_name'), + confirmText: self.$t('order.order.s8g966'), + success(res) { + if (res.confirm) { + self.order_item_pay_success_handle(data, order_id); + } else { + self.order_item_pay_fail_handle(data, order_id, self.$t('paytips.paytips.6y488i')); + } + }, + }); + } + }, 3000); + } }, // 快手小程序 kuaishou_pay_handle(self, data, order_id) { @@ -789,4 +832,4 @@ .payment-sub { padding: 86rpx 90rpx 24rpx 90rpx; } - + \ No newline at end of file diff --git a/lang/cht.json b/lang/cht.json index ddb4733c..7124a19b 100644 --- a/lang/cht.json +++ b/lang/cht.json @@ -42,10 +42,10 @@ "internet_error_tips": "網絡開小差了哦~", "sub_error_retry_tips": "提交失敗,請重試!", "not_more_list_data_tips": "無更多清單數據", - "scan_name": "掃一掃" + "scan_name": "掃一掃", + "not_have_name": "沒有" }, "pages": { - "index": "ShopXO", "goods-category": "商品分類", "cart": "購物車", "user": "用戶中心", @@ -1561,7 +1561,8 @@ "bv637f": "支付未定義", "4dszme": "請使用真機操作、或小程式基礎版本太低!", "k2i010": "支付成功後、請不要重複支付、如果訂單狀態未成功請聯系客服處理", - "2rw3qh": "支付方式還未適配" + "2rw3qh": "支付方式還未適配", + "sdfs31": "是否已完成支付?" } }, "realstore-cart": { diff --git a/lang/en.json b/lang/en.json index 5da62ecf..a079e11a 100644 --- a/lang/en.json +++ b/lang/en.json @@ -42,10 +42,10 @@ "login_in_text": "Logging in", "sending_in_text": "Sending", "sending": "Sending", - "scan_name": "Scan it" + "scan_name": "Scan it", + "not_have_name": "not have" }, "pages": { - "index": "ShopXO", "goods-category": "Product classification", "cart": "shopping cart", "user": "User Center", @@ -1574,7 +1574,8 @@ "bv637f": "Payment undefined", "4dszme": "Please use real machine operation, or the basic version of the mini program is too low!", "k2i010": "After successful payment, please do not make duplicate payments. If the order status is not successful, please contact customer service for assistance", - "2rw3qh": "The payment method has not been adapted yet" + "2rw3qh": "The payment method has not been adapted yet", + "sdfs31": "Has the payment been completed?" } }, "realstore-cart": { diff --git a/lang/spa.json b/lang/spa.json index 76e51cc0..05e77e0f 100644 --- a/lang/spa.json +++ b/lang/spa.json @@ -42,10 +42,10 @@ "internet_error_tips": "La red está un poco mal.", "sub_error_retry_tips": "¡La presentación falló, ¡ por favor, vuelva a intentarlo!", "not_more_list_data_tips": "No hay más datos de lista", - "scan_name": "Barrer" + "scan_name": "Barrer", + "not_have_name": "No, No." }, "pages": { - "index": "Shopxo", "goods-category": "Clasificación de mercancías", "cart": "Carrito de compras", "user": "Centro de usuarios", @@ -1561,7 +1561,8 @@ "bv637f": "Pago no definido", "4dszme": "¡¡ por favor, use la máquina real para operar o la versión básica del applet es demasiado baja!", "k2i010": "Después de que el pago sea exitoso, no repita el pago, si el Estado del pedido no es exitoso, Póngase en contacto con el servicio al cliente para procesarlo.", - "2rw3qh": "El método de pago aún no se ha adaptado" + "2rw3qh": "El método de pago aún no se ha adaptado", + "sdfs31": "¿¿ se ha completado el pago?" } }, "realstore-cart": { diff --git a/lang/zh.json b/lang/zh.json index e24821f5..1923141d 100644 --- a/lang/zh.json +++ b/lang/zh.json @@ -42,10 +42,10 @@ "internet_error_tips": "网络开小差了哦~", "sub_error_retry_tips": "提交失败,请重试!", "not_more_list_data_tips": "无更多列表数据", - "scan_name": "扫一扫" + "scan_name": "扫一扫", + "not_have_name": "没有" }, "pages": { - "index": "ShopXO", "goods-category": "商品分类", "cart": "购物车", "user": "用户中心", @@ -1565,7 +1565,8 @@ "bv637f": "支付未定义", "4dszme": "请使用真机操作、或小程序基础版本太低!", "k2i010": "支付成功后、请不要重复支付、如果订单状态未成功请联系客服处理", - "2rw3qh": "支付方式还未适配" + "2rw3qh": "支付方式还未适配", + "sdfs31": "是否已完成支付?" } }, "realstore-cart": {