Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shop_mobile_uni
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑秀明
shop_mobile_uni
Commits
27c11114
Commit
27c11114
authored
Apr 15, 2020
by
郑秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信支付优化
parent
693adf77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
17 deletions
+45
-17
wxpay.vue
pages/wxpay/wxpay.vue
+45
-17
No files found.
pages/wxpay/wxpay.vue
View file @
27c11114
...
@@ -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
:
1
50rpx
;
margin-top
:
50rpx
;
font-size
:
60rpx
;
font-size
:
60rpx
;
}
}
.submit-btn
{
.submit-btn
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment