Commit 27c11114 authored by 郑秀明's avatar 郑秀明

微信支付优化

parent 693adf77
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<uni-icons color="#212121" class="search-icon-arrowleft" size="24" type="arrowleft" @click="goBack" /> <uni-icons color="#212121" class="search-icon-arrowleft" size="24" type="arrowleft" @click="goBack" />
<view class="title">微信支付</view> <view class="title">微信支付</view>
</view> </view>
<view class="sub-title">
谛宝多多分期定金订单-{{order_id}}
</view>
<view class="price"> <view class="price">
{{amount}} {{amount}}
</view> </view>
...@@ -21,13 +24,15 @@ ...@@ -21,13 +24,15 @@
data(){ data(){
return { return {
loading: false, loading: false,
amount: '' amount: '',
order_id: ''
} }
}, },
onLoad(){ onLoad(){
const { href } = location; const { href } = location;
const { amount, order_id, code } = parse(href.split('?')[1]); const { amount, order_id, code } = parse(href.split('?')[1]);
this.amount = amount; this.amount = amount;
this.order_id = order_id;
}, },
methods: { methods: {
handleSumit(){ handleSumit(){
...@@ -68,7 +73,9 @@ ...@@ -68,7 +73,9 @@
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}); });
// this.closeWindow(); setTimeout(() => {
history.back();
},2000);
return; return;
} }
WeixinJSBridge.invoke( WeixinJSBridge.invoke(
...@@ -88,24 +95,39 @@ ...@@ -88,24 +95,39 @@
url: '/pages/payresult/payresult' url: '/pages/payresult/payresult'
}) })
} else if (res.err_msg === "get_brand_wcpay_request:cancel") { } else if (res.err_msg === "get_brand_wcpay_request:cancel") {
Toast.info("支付取消", 2); uni.showToast({
// 重新跳转支付页面,刷新当前code 值 title: '已取消支付,请重新支付',
this.$jump(`${url}?app=member`); duration: 2000,
icon: 'none'
});
setTimeout(() => {
history.back();
},2000);
} else if (res.err_msg === "get_brand_wcpay_request:fail") { } else if (res.err_msg === "get_brand_wcpay_request:fail") {
// Toast.fail('支付失败', 3); // Toast.fail('支付失败', 3);
uni.showToast({
title: '支付失败,请重新支付',
duration: 2000,
icon: 'none'
});
// 回退上一页重新支付
setTimeout(() => {
history.back();
},2000);
// 提示支付失败,关闭当前页面 // 提示支付失败,关闭当前页面
setTimeout(function() { // setTimeout(function() {
//这个可以关闭安卓系统的手机 //这个可以关闭安卓系统的手机
document.addEventListener( // document.addEventListener(
"WeixinJSBridgeReady", // "WeixinJSBridgeReady",
function() { // function() {
WeixinJSBridge.call("closeWindow"); // WeixinJSBridge.call("closeWindow");
}, // },
false // false
); // );
//这个可以关闭ios系统的手机 // //这个可以关闭ios系统的手机
WeixinJSBridge.call("closeWindow"); // WeixinJSBridge.call("closeWindow");
}, 300); // this.$jump(`${url}?app=member`);
// }, 300);
} else { } else {
uni.showToast({ uni.showToast({
title: '未知错误,刷新重试', title: '未知错误,刷新重试',
...@@ -142,9 +164,15 @@ ...@@ -142,9 +164,15 @@
font-size: 30rpx; font-size: 30rpx;
} }
} }
.sub-title{
font-size:30rpx;
text-align: center;
color: #5d5d5d;
margin-top: 120rpx;
}
.price{ .price{
text-align: center; text-align: center;
margin-top: 150rpx; margin-top: 50rpx;
font-size: 60rpx; font-size: 60rpx;
} }
.submit-btn{ .submit-btn{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment