Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mingPayMobile
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
mingPayMobile
Commits
d4bcc59f
Commit
d4bcc59f
authored
Aug 07, 2019
by
fengzhaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改:猜测连接在onready和onshow中开了两次,导致有异常会弹两次弹窗框,去掉onready中的连接
parent
4a6485ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
44 deletions
+44
-44
payment.js
pages/payment/payment.js
+44
-44
No files found.
pages/payment/payment.js
View file @
d4bcc59f
...
@@ -49,50 +49,50 @@ Page({
...
@@ -49,50 +49,50 @@ Page({
timeRefreshQRcode
=
setInterval
(
function
()
{
timeRefreshQRcode
=
setInterval
(
function
()
{
_that
.
refreshQRcode
();
_that
.
refreshQRcode
();
},
55000
);
},
55000
);
dd
.
connectSocket
({
//
dd.connectSocket({
url
:
`ws://
${
app
.
globalData
.
globalUrl
}
/v1/mingpaywebsocket?param=
${
dd
.
corpId
}
_
${
dd
.
getStorageSync
({
key
:
'userId'
}).
data
}
`
,
//
url: `ws://${app.globalData.globalUrl}/v1/mingpaywebsocket?param=${dd.corpId}_${dd.getStorageSync({ key: 'userId' }).data}`,
data
:
{},
//
data: {},
header
:{
//
header:{
'content-type'
:
'application/json'
,
//
'content-type': 'application/json',
'Authorization'
:
`Bearer
${
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
access_token
}
`
//
'Authorization': `Bearer ${dd.getStorageSync({ key: 'token' }).data.access_token}`
},
//
},
method
:
"GET"
,
//
method:"GET",
});
//
});
dd
.
onSocketOpen
(
function
(
res
)
{
//
dd.onSocketOpen(function(res) {
console
.
log
(
'WebSocket 连接已打开!'
);
//
console.log('WebSocket 连接已打开!');
});
//
});
dd
.
onSocketError
(
function
(
res
){
//
dd.onSocketError(function(res){
console
.
log
(
'WebSocket 连接打开失败,请检查!'
);
//
console.log('WebSocket 连接打开失败,请检查!');
});
//
});
dd
.
onSocketMessage
(
function
(
res
)
{
//
dd.onSocketMessage(function(res) {
console
.
log
(
JSON
.
parse
(
res
.
data
))
//
console.log(JSON.parse(res.data))
let
resData
=
JSON
.
parse
(
res
.
data
)
//
let resData = JSON.parse(res.data)
if
(
resData
.
paymentCode
===
0
){
//
if(resData.paymentCode === 0){
dd
.
redirectTo
({
//
dd.redirectTo({
url
:
`./../paySuccess/paySuccess?money=
${(
JSON
.
parse
(
res
.
data
).
orderAmount
).
toFixed
(
2
)}
`
//
url: `./../paySuccess/paySuccess?money=${(JSON.parse(res.data).orderAmount).toFixed(2)}`
})
//
})
}
else
if
(
resData
.
paymentCode
===
10001
){
//
}else if(resData.paymentCode === 10001){
dd
.
alert
({
//
dd.alert({
content
:
'账户状态异常'
,
//
content: '账户状态异常',
buttonText
:
'确定'
//
buttonText: '确定'
});
//
});
}
else
if
(
resData
.
paymentCode
===
10002
){
//
}else if(resData.paymentCode === 10002){
dd
.
alert
({
//
dd.alert({
content
:
'卡片状态异常'
,
//
content: '卡片状态异常',
buttonText
:
'确定'
//
buttonText: '确定'
});
//
});
}
else
if
(
resData
.
paymentCode
===
10003
){
//
}else if(resData.paymentCode === 10003){
dd
.
alert
({
//
dd.alert({
content
:
'账户余额不足'
,
//
content: '账户余额不足',
buttonText
:
'确定'
//
buttonText: '确定'
});
//
});
}
else
if
(
resData
.
paymentCode
===
10004
){
//
}else if(resData.paymentCode === 10004){
dd
.
alert
({
//
dd.alert({
content
:
'二维码失效'
,
//
content: '二维码失效',
buttonText
:
'确定'
//
buttonText: '确定'
});
//
});
}
//
}
})
//
})
},
},
onShow
()
{
onShow
()
{
//刷新二维码
//刷新二维码
...
...
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