Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MiyaFrogFastCashApp
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
MiyaFrogFastCashApp
Commits
4ac6e92e
Commit
4ac6e92e
authored
Sep 18, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加防抖逻辑;完善支付结果页;
parent
54209913
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
40 deletions
+76
-40
pay_result.js
pages/pay_result/pay_result.js
+49
-20
pay_result.wxml
pages/pay_result/pay_result.wxml
+3
-3
refund.js
pages/refund/refund.js
+23
-16
refund.wxml
pages/refund/refund.wxml
+1
-1
No files found.
pages/pay_result/pay_result.js
View file @
4ac6e92e
...
...
@@ -21,16 +21,17 @@ Page({
isNeedCountDown
:
false
,
//金额显示
isShowPrice
:
false
,
isShowFailedReason
:
true
isShowFailedReason
:
true
,
reOpText
:
"重新支付"
,
countDownConfig
:
5
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
//just for test,delete this code
options
.
type
=
1
options
.
isSuccess
=
false
options
.
type
=
parseInt
(
options
.
type
)
options
.
isSuccess
=
'true'
===
options
.
isSuccess
var
payPriceYuan
=
options
.
payPriceYuan
var
description
=
options
.
description
...
...
@@ -51,11 +52,25 @@ Page({
iconUrl
:
"../../images/icon_fail.png"
,
description
:
"退款失败"
,
failedReason
:
options
.
failedReason
,
isShowFailedReason
:
true
isShowFailedReason
:
true
,
reOpText
:
"重新退款"
,
type
:
1
})
}
else
{
//支付结果
//支付失败
this
.
setData
({
isSuccess
:
false
,
isShowBackHome
:
true
,
iconUrl
:
"../../images/icon_fail.png"
,
description
:
"支付失败"
,
failedReason
:
options
.
failedReason
,
isShowFailedReason
:
true
,
reOpText
:
"重新支付"
,
type
:
0
,
isShowBackHome
:
false
,
countDownConfig
:
30
,
isNeedCountDown
:
true
})
}
}
else
{
this
.
setData
({
...
...
@@ -69,10 +84,20 @@ Page({
iconUrl
:
"../../images/icon_success.png"
,
description
:
"退款成功"
,
isShowFailedReason
:
false
,
isShowPrice
:
true
isShowPrice
:
true
,
type
:
1
})
}
else
{
//支付结果
this
.
setData
({
isSuccess
:
true
,
isShowBackHome
:
true
,
iconUrl
:
"../../images/icon_success.png"
,
description
:
"支付成功"
,
isShowFailedReason
:
false
,
isShowPrice
:
true
,
type
:
0
})
}
}
...
...
@@ -81,21 +106,21 @@ Page({
onShow
:
function
(){
//回到首页倒计时
if
(
this
.
data
.
isNeedCountDown
==
true
){
this
.
startPayCountDown
()
this
.
startPayCountDown
(
this
.
data
.
countDownConfig
)
}
},
/**
* 3秒倒计时结束 弹出选择支付方式
*/
startPayCountDown
:
function
(){
startPayCountDown
:
function
(
countDownConfig
){
this
.
setData
({
goHomeCountDown
:
"3秒
后跳转到首页"
})
this
.
setData
({
goHomeCountDown
:
countDownConfig
+
"s
后跳转到首页"
})
if
(
this
.
data
.
payCountDownTimer
!=
null
)
{
clearInterval
(
this
.
data
.
payCountDownTimer
)
}
var
countDown
=
3
;
var
countDown
=
countDownConfig
;
var
that
=
this
;
var
payCountDownTimer
=
setInterval
(()
=>
{
if
(
countDown
<=
0
){
...
...
@@ -103,25 +128,29 @@ Page({
clearInterval
(
payCountDownTimer
)
}
else
{
--
countDown
that
.
setData
({
goHomeCountDown
:
countDown
+
"s
秒
后跳转到首页"
})
that
.
setData
({
goHomeCountDown
:
countDown
+
"s后跳转到首页"
})
}
},
1000
);
},
onReRefundClicked
:
throttle
(
1000
,
function
(){
wx
.
navigateTo
({
url
:
'/pages/refund/refund'
,
})
onReOpClicked
:
throttle
(
1000
,
function
(){
if
(
this
.
data
.
type
==
0
){
//重新支付
}
else
{
wx
.
navigateTo
({
url
:
'/pages/refund/refund'
,
})
}
}),
/**
* 回到首页
*/
backHome
(){
backHome
:
throttle
(
1000
,
function
(){
wx
.
redirectTo
({
url
:
'/pages/home/home'
,
})
}
}
)
})
\ No newline at end of file
pages/pay_result/pay_result.wxml
View file @
4ac6e92e
...
...
@@ -9,9 +9,9 @@
</view>
<!--重新退款-->
<view style="margin-top:120rpx;" hidden="{{!isShowFailedReason}}" bindtap="onRe
Refund
Clicked">
<text class="btn-re-refund">
重新退款
</text>
<!--重新退款
or重新支付
-->
<view style="margin-top:120rpx;" hidden="{{!isShowFailedReason}}" bindtap="onRe
Op
Clicked">
<text class="btn-re-refund">
{{reOpText}}
</text>
</view>
<view class="btn-go-home"><button style="width:572rpx;height:114rpx;display:flex; justify-content:center; align-items:center;font-size:40rpx;" type="default" bindtap="backHome" hidden="{{!isShowBackHome}}">回到首页</button>
</view>
...
...
pages/refund/refund.js
View file @
4ac6e92e
...
...
@@ -37,17 +37,24 @@ Page({
*/
onShow
:
function
()
{
//声明监听扫码器
wxfaceapp
.
listenCodePayment
({
success
(
res
){
//被扫码回调事件
wxfaceapp
.
onCodePayEvent
(
function
(
res
)
{
console
.
log
(
"onCodePayEvent retCode = "
+
res
.
replyCode
)
//被扫码到的具体的码
console
.
log
(
"onCodePayEvent code scanned = "
+
res
.
code
)
//去退款
startRefund
(
res
.
code
)
})
}
// wxfaceapp.listenCodePayment({
// success(res){
// //被扫码回调事件
// wxfaceapp.onCodePayEvent(function (res) {
// console.log("onCodePayEvent retCode = " + res.replyCode)
// //被扫码到的具体的码
// console.log("onCodePayEvent code scanned = " + res.code)
// //去退款
// startRefund(res.code)
// })
// }
// })
},
onImageClicked
:
function
(){
wx
.
redirectTo
({
url
:
'/pages/pay_result/pay_result?isSuccess=false&type=1'
,
})
},
...
...
@@ -58,7 +65,7 @@ Page({
var
localAccountInfo
=
getApp
().
globalData
.
localAccountInfo
;
console
.
info
(
"localAccountInfo==>"
+
JSON
.
stringify
(
localAccountInfo
));
if
(
localAccountInfo
.
success
==
true
&&
localAccountInfo
.
data
!=
null
)
{
if
(
localAccountInfo
!=
null
&&
localAccountInfo
.
success
==
true
&&
localAccountInfo
.
data
!=
null
)
{
this
.
data
.
saasid
=
localAccountInfo
.
data
.
store
.
saasid
;
if
(
localAccountInfo
.
data
.
store
.
marketid
!=
null
)
{
this
.
data
.
marketId
=
localAccountInfo
.
data
.
store
.
marketid
;
...
...
@@ -98,13 +105,13 @@ Page({
if
(
response
.
code
==
0
)
{
//跳转页面
var
payPriceYuan
=
miyapay
.
fen2Yuan
(
response
.
data
.
C7
)
wx
.
navigate
To
({
url
:
'pages/pay_result/pay_result?isSuccess=true&payPriceYuan='
+
payPriceYuan
,
wx
.
redirect
To
({
url
:
'
/
pages/pay_result/pay_result?isSuccess=true&payPriceYuan='
+
payPriceYuan
,
})
}
else
{
//提示报错
wx
.
navigate
To
({
url
:
'pages/pay_result/pay_result?isSuccess=false&failedReason='
+
response
.
data
,
wx
.
redirect
To
({
url
:
'
/
pages/pay_result/pay_result?isSuccess=false&failedReason='
+
response
.
data
,
})
}
}
...
...
pages/refund/refund.wxml
View file @
4ac6e92e
...
...
@@ -7,7 +7,7 @@
<!--提示文字-->
<text style="color:black;font-weight:bold;font-size:40rpx;margin-left:auto;margin-right:auto;margin-top:112rpx;">请扫描订单条码退款</text>
<image src="" style="width:567rpx;height:567rpx;background-color:black;margin-left:auto;margin-right:auto;margin-top:224rpx;"></image>
<image src="" style="width:567rpx;height:567rpx;background-color:black;margin-left:auto;margin-right:auto;margin-top:224rpx;"
bindtap="onImageClicked"
></image>
...
...
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