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
12f5b17b
Commit
12f5b17b
authored
Sep 16, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善退款逻辑;
parent
e48f8025
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
167 additions
and
11 deletions
+167
-11
app.json
app.json
+2
-2
icon_fail.png
images/icon_fail.png
+0
-0
functioncenter.js
pages/functioncenter/functioncenter.js
+10
-1
functioncenter.json
pages/functioncenter/functioncenter.json
+3
-1
functioncenter.wxml
pages/functioncenter/functioncenter.wxml
+38
-1
functioncenter.wxss
pages/functioncenter/functioncenter.wxss
+4
-0
pay_result.js
pages/pay_result/pay_result.js
+24
-2
pay_result.wxml
pages/pay_result/pay_result.wxml
+2
-2
refund.js
pages/refund/refund.js
+84
-2
No files found.
app.json
View file @
12f5b17b
{
{
"pages"
:
[
"pages"
:
[
"pages/
login/login
"
,
"pages/
functioncenter/functioncenter
"
,
"pages/pay_result/pay_result"
,
"pages/pay_result/pay_result"
,
"pages/login/login"
,
"pages/logs/logs"
,
"pages/logs/logs"
,
"pages/functioncenter/functioncenter"
,
"pages/refund/refund"
,
"pages/refund/refund"
,
"pages/balance/balance"
,
"pages/balance/balance"
,
"pages/operation_waiting/operation_waiting"
,
"pages/operation_waiting/operation_waiting"
,
...
...
images/icon_fail.png
0 → 100644
View file @
12f5b17b
7.64 KB
pages/functioncenter/functioncenter.js
View file @
12f5b17b
...
@@ -5,7 +5,8 @@ Page({
...
@@ -5,7 +5,8 @@ Page({
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
aboutSysDialogShow
:
false
,
aboutSysDialogButtons
:[{
text
:
'确定'
}]
},
},
/**
/**
...
@@ -75,7 +76,15 @@ Page({
...
@@ -75,7 +76,15 @@ Page({
},
},
onAboutSysClicked
:
function
(){
onAboutSysClicked
:
function
(){
this
.
setData
({
aboutSysDialogShow
:
true
})
},
onAboutSysDialogClicked
:
function
(
e
){
this
.
setData
({
aboutSysDialogShow
:
false
})
},
},
onCloseClicked
:
function
(){
onCloseClicked
:
function
(){
...
...
pages/functioncenter/functioncenter.json
View file @
12f5b17b
{
{
"usingComponents"
:
{}
"usingComponents"
:
{
"mp-dialog"
:
"/miniprogram_npm/weui-miniprogram/dialog/dialog"
}
}
}
\ No newline at end of file
pages/functioncenter/functioncenter.wxml
View file @
12f5b17b
...
@@ -36,9 +36,46 @@
...
@@ -36,9 +36,46 @@
<!--line-->
<!--line-->
<view class="line"/>
<view class="line"/>
<!--
推
出登录-->
<!--
退
出登录-->
<view class="logout_layout">
<view class="logout_layout">
<text class="btn-submit" bindtap="onLogoutClicked">退出登录</text>
<text class="btn-submit" bindtap="onLogoutClicked">退出登录</text>
</view>
</view>
</view>
</view>
<!--dialog-->
<mp-dialog title="关于系统" show="{{aboutSysDialogShow}}" buttons="{{aboutSysDialogButtons}}" bindbuttontap="onAboutSysDialogClicked">
<view class="about_sys_dialog">
<view style="display:flex;direction:row;width:100%;margin-top:40rpx;">
<text style="color:#788192;">商户</text>
<text style="flex:1;text-align:right;color:black;">--------</text>
</view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">门店</text>
<text style="flex:1;text-align:right;color:black;">--------</text>
</view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">门店号</text>
<text style="flex:1;text-align:right;color:black;">--------</text>
</view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">SN码</text>
<text style="flex:1;text-align:right;color:black;">--------</text>
</view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">小程序</text>
<text style="flex:1;text-align:right;color:black;">--------</text>
</view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">版本号</text>
<text style="flex:1;text-align:right;color:black;">--------</text>
</view>
</view>
</mp-dialog>
</view>
</view>
pages/functioncenter/functioncenter.wxss
View file @
12f5b17b
...
@@ -58,4 +58,8 @@
...
@@ -58,4 +58,8 @@
border-radius: 10rpx;
border-radius: 10rpx;
border-width: 2rpx;
border-width: 2rpx;
border:2rpx solid var(--main-color);
border:2rpx solid var(--main-color);
}
.about_sys_dialog{
}
}
\ No newline at end of file
pages/pay_result/pay_result.js
View file @
12f5b17b
...
@@ -4,10 +4,17 @@ Page({
...
@@ -4,10 +4,17 @@ Page({
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
iconUrl
:
"../../images/icon_success.png"
,
payPriceYuan
:
"0.00"
,
payPriceYuan
:
"0.00"
,
description
:
"支付成功"
,
description
:
"支付成功"
,
goHomeCountDown
:
"3秒后跳转到首页"
,
goHomeCountDown
:
"3秒后跳转到首页"
,
payCountDownTimer
:
null
,
payCountDownTimer
:
null
,
//type==> 0:支付结果 1:退款结果 默认为0
type
:
0
,
//是否退款or支付成功
isSuccess
:
false
,
isShowBackHome
:
false
,
failedReason
:
""
},
},
/**
/**
...
@@ -18,9 +25,24 @@ Page({
...
@@ -18,9 +25,24 @@ Page({
var
description
=
options
.
description
var
description
=
options
.
description
this
.
setData
({
this
.
setData
({
payPriceYuan
:
payPriceYuan
,
payPriceYuan
:
payPriceYuan
,
description
:
description
description
:
description
,
failedReason
:
options
.
failedReason
})
})
if
(
options
.
isSuccess
==
false
){
if
(
options
.
type
==
1
){
//退款结果
this
.
setData
({
isShowBackHome
:
true
,
iconUrl
:
"../../images/icon_fail.png"
})
}
}
else
{
if
(
options
.
type
==
1
){
//退款结果
}
}
},
},
onShow
:
function
(){
onShow
:
function
(){
...
...
pages/pay_result/pay_result.wxml
View file @
12f5b17b
<view class="page">
<view class="page">
<image class="icon-success" src="
../../images/icon_success.png
"/>
<image class="icon-success" src="
{{iconUrl}}
"/>
<view class="description">{{description}}</view>
<view class="description">{{description}}</view>
<view class="price">¥{{payPriceYuan}}</view>
<view class="price">¥{{payPriceYuan}}</view>
<view class="btn-go-home"><button type="default" bindtap="backHome" >回到首页</button>
<view class="btn-go-home"><button type="default" bindtap="backHome"
hidden="{{!isShowBackHome}}"
>回到首页</button>
</view>
</view>
<view class="count-down">{{goHomeCountDown}}</view>
<view class="count-down">{{goHomeCountDown}}</view>
</view>
</view>
\ No newline at end of file
pages/refund/refund.js
View file @
12f5b17b
// pages/refund/refund.js
// pages/refund/refund.js
var
miyapay
=
require
(
"../../utils/miyapay4.js"
);
Page
({
Page
({
/**
/**
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
saasid
:
""
,
marketId
:
""
,
posId
:
""
,
cashierCode
:
""
,
baseUrl
:
null
,
signKey
:
""
,
apiVersion
:
""
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
initData
()
},
},
/**
/**
...
@@ -26,6 +34,80 @@ Page({
...
@@ -26,6 +34,80 @@ Page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
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
)
})
}
})
},
/**
* 初始化数据
*/
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
)
{
this
.
data
.
saasid
=
localAccountInfo
.
data
.
store
.
saasid
;
if
(
localAccountInfo
.
data
.
store
.
marketid
!=
null
)
{
this
.
data
.
marketId
=
localAccountInfo
.
data
.
store
.
marketid
;
}
else
{
this
.
data
.
marketId
=
localAccountInfo
.
data
.
store
.
storeId
;
}
this
.
data
.
posId
=
localAccountInfo
.
data
.
store
.
posId
;
this
.
data
.
cashierCode
=
localAccountInfo
.
data
.
store
.
operatorId
;
this
.
data
.
signKey
=
localAccountInfo
.
data
.
store
.
miyaPayPlatformSignKey
;
this
.
data
.
baseUrl
=
localAccountInfo
.
data
.
store
.
miyaPayPlatformUrl
+
""
;
this
.
data
.
apiVersion
=
localAccountInfo
.
data
.
store
.
miyaPayApiVersion
;
if
(
getApp
().
globalData
.
useTestPayInfo
==
true
)
{
//just for test
this
.
data
.
signKey
=
"nbz9ww27sx4ou6dkr61mf63tth3s6e2d"
;
this
.
data
.
saasid
=
"miya"
;
this
.
data
.
marketId
=
"slzf"
;
this
.
data
.
posId
=
"1"
;
this
.
data
.
cashierCode
=
"1"
;
this
.
data
.
baseUrl
=
"https://paytest.miyapay.com/miya/miyapay_response.action"
;
}
}
},
startRefund
:
function
(
orderNo
){
miyapay
.
refund
({
baseUrl
:
this
.
data
.
baseUrl
,
saasid
:
this
.
data
.
saasid
,
marketId
:
this
.
data
.
marketId
,
posId
:
this
.
data
.
posId
,
cashierCode
:
this
.
data
.
cashierCode
,
version
:
this
.
data
.
apiVersion
,
orderNo
:
this
.
data
.
orderNo
,
refundNo
:
this
.
data
.
refundNo
,
refundPrice
:
this
.
data
.
refundPriceFen
+
""
,
signKey
:
this
.
data
.
signKey
,
callback
:
(
response
)
=>
{
if
(
response
.
code
==
0
)
{
//跳转页面
}
else
{
//提示报错
my
.
showToast
({
type
:
'fail'
,
content
:
response
.
data
,
duration
:
3000
});
}
}
});
},
},
...
...
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