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
502425a6
Commit
502425a6
authored
Sep 17, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善退款逻辑;
parent
12f5b17b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
22 deletions
+85
-22
app.json
app.json
+1
-1
pay_result.js
pages/pay_result/pay_result.js
+41
-6
pay_result.wxml
pages/pay_result/pay_result.wxml
+14
-3
pay_result.wxss
pages/pay_result/pay_result.wxss
+21
-4
refund.js
pages/refund/refund.js
+8
-8
No files found.
app.json
View file @
502425a6
{
"pages"
:
[
"pages/functioncenter/functioncenter"
,
"pages/pay_result/pay_result"
,
"pages/functioncenter/functioncenter"
,
"pages/login/login"
,
"pages/logs/logs"
,
"pages/refund/refund"
,
...
...
pages/pay_result/pay_result.js
View file @
502425a6
...
...
@@ -14,13 +14,23 @@ Page({
//是否退款or支付成功
isSuccess
:
false
,
isShowBackHome
:
false
,
failedReason
:
""
failedReason
:
""
,
//是否需要倒计时
isNeedCountDown
:
false
,
//金额显示
isShowPrice
:
false
,
isShowFailedReason
:
true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
//just for test,delete this code
// options.type = 1
// options.isSuccess = false
var
payPriceYuan
=
options
.
payPriceYuan
var
description
=
options
.
description
this
.
setData
({
...
...
@@ -29,17 +39,40 @@ Page({
failedReason
:
options
.
failedReason
})
if
(
options
.
isSuccess
==
false
){
this
.
setData
({
isNeedCountDown
:
false
})
if
(
options
.
type
==
1
){
//退款
结果
//退款
失败
this
.
setData
({
isSuccess
:
false
,
isShowBackHome
:
true
,
iconUrl
:
"../../images/icon_fail.png"
iconUrl
:
"../../images/icon_fail.png"
,
description
:
"退款失败"
,
failedReason
:
options
.
failedReason
,
isShowFailedReason
:
true
})
}
else
{
//支付结果
}
}
else
{
this
.
setData
({
isNeedCountDown
:
true
})
if
(
options
.
type
==
1
){
//退款结果
//退款成功
this
.
setData
({
isSuccess
:
true
,
isShowBackHome
:
true
,
iconUrl
:
"../../images/icon_success.png"
,
description
:
"退款成功"
,
isShowFailedReason
:
false
,
isShowPrice
:
true
})
}
else
{
//支付结果
}
}
...
...
@@ -47,7 +80,9 @@ Page({
onShow
:
function
(){
//回到首页倒计时
this
.
startPayCountDown
();
if
(
this
.
data
.
isNeedCountDown
==
true
){
this
.
startPayCountDown
()
}
},
/**
...
...
pages/pay_result/pay_result.wxml
View file @
502425a6
<view class="page">
<image class="icon-success" src="{{iconUrl}}"/>
<view class="description">{{description}}</view>
<view class="price">¥{{payPriceYuan}}</view>
<view class="btn-go-home"><button type="default" bindtap="backHome" hidden="{{!isShowBackHome}}">回到首页</button>
<view class="price" hidden="{{!isShowPrice}}">¥{{payPriceYuan}}</view>
<!--失败原因-->
<view style="width:100%;display:flex;align-items:center;margin-top:40rpx;" hidden="{{!isShowFailedReason}}">
<text style="width:100%;padding-left:160rpx;padding-right:160rpx;font-size:32rpx;color:#788192;text-align:center;align-self:center;" hidden="{{!isShowFailedReason}}">失败原因:--------</text>
</view>
<!--重新退款-->
<view style="margin-top:120rpx;" hidden="{{!isShowFailedReason}}">
<text class="btn-re-refund">重新退款</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>
<view class="count-down">{{goHomeCountDown}}</view>
<view class="count-down"
hidden="{{!isNeedCountDown}}"
>{{goHomeCountDown}}</view>
</view>
\ No newline at end of file
pages/pay_result/pay_result.wxss
View file @
502425a6
...
...
@@ -23,13 +23,30 @@
}
.btn-go-home{
width: 70%;
height: 115rpx;
margin-top: 120rpx;
width: 573rpx;
height: 114rpx;
margin-top: 40rpx;
font-size:40rpx;
}
.count-down{
font-size: 32rpx;
color: #788192;
margin-top: 290rpx;
}
\ No newline at end of file
}
.btn-re-refund{
margin-top: 120rpx;
display: flex;
height: 114rpx;
width: 573rpx;
color: var(--main-color);
font-size: 40rpx;
align-items: center;
justify-content: center;
margin: auto;
border-color:var(--main-color);
border-radius: 10rpx;
border-width: 2rpx;
border:2rpx solid var(--main-color);
}
\ No newline at end of file
pages/refund/refund.js
View file @
502425a6
...
...
@@ -11,6 +11,7 @@ Page({
marketId
:
""
,
posId
:
""
,
cashierCode
:
""
,
// 支付平台地址
baseUrl
:
null
,
signKey
:
""
,
apiVersion
:
""
...
...
@@ -54,8 +55,6 @@ Page({
*/
initData
(){
this
.
data
.
baseUrl
=
getApp
().
globalData
.
BASE_URL
;
var
localAccountInfo
=
getApp
().
globalData
.
localAccountInfo
;
console
.
info
(
"localAccountInfo==>"
+
JSON
.
stringify
(
localAccountInfo
));
if
(
localAccountInfo
.
success
==
true
&&
localAccountInfo
.
data
!=
null
)
{
...
...
@@ -97,14 +96,15 @@ Page({
callback
:
(
response
)
=>
{
if
(
response
.
code
==
0
)
{
//跳转页面
var
payPriceYuan
=
miyapay
.
fen2Yuan
(
response
.
data
.
C7
)
wx
.
navigateTo
({
url
:
'pages/pay_result/pay_result?isSuccess=true&payPriceYuan='
+
payPriceYuan
,
})
}
else
{
//提示报错
my
.
showToast
({
type
:
'fail'
,
content
:
response
.
data
,
duration
:
3000
});
wx
.
navigateTo
({
url
:
'pages/pay_result/pay_result?isSuccess=false&failedReason='
+
response
.
data
,
})
}
}
});
...
...
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