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
8551d7d0
Commit
8551d7d0
authored
5 years ago
by
fengzhaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MOD:修改token 下拉刷新
parent
95271782
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
479 additions
and
126 deletions
+479
-126
http.js
API/http.js
+85
-21
login.js
API/login.js
+128
-0
action.js
pages/action/action.js
+6
-9
alipayRecharge.js
pages/alipayRecharge/alipayRecharge.js
+49
-33
allowanceList.js
pages/allowanceList/allowanceList.js
+12
-3
allowanceRecordList.js
pages/allowanceRecordList/allowanceRecordList.js
+20
-4
allowanceRecordList.json
pages/allowanceRecordList/allowanceRecordList.json
+2
-1
billDetails.js
pages/billDetails/billDetails.js
+13
-5
billDetails.json
pages/billDetails/billDetails.json
+2
-4
index.axml
pages/index/index.axml
+1
-1
index.js
pages/index/index.js
+35
-7
noPermission.js
pages/noPermission/noPermission.js
+1
-0
paySuccess.acss
pages/paySuccess/paySuccess.acss
+4
-0
paySuccess.axml
pages/paySuccess/paySuccess.axml
+1
-1
paySuccess.js
pages/paySuccess/paySuccess.js
+13
-5
paySuccess.json
pages/paySuccess/paySuccess.json
+2
-1
payment.js
pages/payment/payment.js
+62
-25
reTry.axml
pages/reTry/reTry.axml
+2
-1
rechargeSuccess.acss
pages/rechargeSuccess/rechargeSuccess.acss
+4
-0
rechargeSuccess.axml
pages/rechargeSuccess/rechargeSuccess.axml
+1
-1
rechargeSuccess.js
pages/rechargeSuccess/rechargeSuccess.js
+8
-1
rechargeSuccess.json
pages/rechargeSuccess/rechargeSuccess.json
+2
-1
recordList.js
pages/recordList/recordList.js
+26
-2
No files found.
API/http.js
View file @
8551d7d0
...
...
@@ -14,8 +14,8 @@ const $http = (url, data, type, loadingType) => {
let
refresh_token
=
hasToken
.
refresh_token
// 刷新token
let
mingUserId
=
dd
.
getStorageSync
({
key
:
'mingUserId'
}).
data
// 时间戳未过期
if
(
!!
hasToken
&&
((
new
Date
()).
getTime
()
-
hasToken
.
loginTime
<
hasToken
.
expires_in
*
1000
)){
// if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime)< 30
* 1000){
//
if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime < hasToken.expires_in * 1000)){
if
(
!!
hasToken
&&
((
new
Date
()).
getTime
()
-
hasToken
.
loginTime
)
<
1
*
1000
){
data
.
orgId
=
dd
.
corpId
;
let
sendData
=
''
;
for
(
let
key
in
data
){
...
...
@@ -35,22 +35,72 @@ const $http = (url, data, type, loadingType) => {
if
(
res
.
data
.
resultCode
===
0
)
{
console
.
log
(
res
.
data
.
data
)
return
resolve
(
res
.
data
.
data
)
}
}
else
{
// 修改系统繁忙时loading隐藏
dd
.
hideLoading
();
dd
.
alert
({
content
:
'
系统异常
'
,
content
:
'
请检查网络并下拉重试
'
,
buttonText
:
'确定'
});
}
},
fail
:
function
(
res
)
{
dd
.
alert
({
content
:
'系统异常'
,
buttonText
:
'确定'
})
dd
.
hideLoading
();
fail
:
function
(
err
)
{
// 服务端没有token
if
(
err
.
status
==
401
)
{
dd
.
httpRequest
({
headers
:
{
'Authorization'
:
'Basic bWluZ3BheS1waG9uZTptaW5ncGF5LXBob25l'
,
'Content-Type'
:
'application/x-www-form-urlencoded'
},
data
:
{
grant_type
:
'refresh_token'
,
refresh_token
:
refresh_token
},
url
:
`
${
app
.
globalData
.
globalUrl
}
/auth/oauth/token`
,
method
:
'POST'
,
dataType
:
'json'
,
success
:
function
(
res
)
{
dd
.
setStorageSync
({
key
:
'token'
,
data
:
{
access_token
:
res
.
data
.
access_token
,
expires_in
:
res
.
data
.
expires_in
,
refresh_token
:
res
.
data
.
refresh_token
,
loginTime
:
(
new
Date
()).
getTime
()
}
})
$http
(
url
,
data
,
type
).
then
(
res
=>
{
return
resolve
(
res
)
})
},
fail
:
function
(
err
)
{
dd
.
hideLoading
()
if
(
err
.
status
==
426
)
{
dd
.
removeStorageSync
({
key
:
'token'
})
dd
.
redirectTo
({
url
:
'/pages/reTry/reTry'
})
}
else
{
dd
.
alert
({
content
:
'请检查网络并下拉重试'
,
buttonText
:
'确定'
})
}
}
})
}
else
{
dd
.
alert
({
content
:
'请检查网络并下拉重试'
,
buttonText
:
'确定'
})
dd
.
hideLoading
();
}
}
})
})
...
...
@@ -59,7 +109,7 @@ const $http = (url, data, type, loadingType) => {
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
dd
.
getNetworkType
({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
// 有网的情况下
if
(
res
.
networkAvailable
)
{
dd
.
httpRequest
({
...
...
@@ -72,9 +122,12 @@ const $http = (url, data, type, loadingType) => {
grant_type
:
'refresh_token'
,
refresh_token
:
refresh_token
},
url
:
`
${
app
.
globalData
.
globalUrl
}
/
mingpay-phone/
auth/oauth/token`
,
url
:
`
${
app
.
globalData
.
globalUrl
}
/auth/oauth/token`
,
method
:
'POST'
,
success
:
function
(
res
)
{
dd
.
removeStorage
({
key
:
'token'
})
dd
.
setStorageSync
({
key
:
'token'
,
data
:
{
...
...
@@ -88,18 +141,29 @@ const $http = (url, data, type, loadingType) => {
return
resolve
(
res
)
})
},
fail
:
function
(
res
)
{
dd
.
alert
({
content
:
'系统异常'
,
buttonText
:
'确定'
})
dd
.
hideLoading
();
}
})
fail
:
function
(
err
)
{
if
(
err
.
status
==
426
)
{
dd
.
hideLoading
()
dd
.
removeStorageSync
({
key
:
'token'
})
dd
.
redirectTo
({
url
:
'/pages/reTry/reTry'
})
}
else
{
dd
.
alert
({
content
:
'请检查网络并下拉重试'
,
buttonText
:
'确定'
})
dd
.
hideLoading
();
}
}
})
}
else
{
dd
.
alert
({
content
:
'
您暂时无网
'
,
content
:
'
请检查网络并下拉重试
'
,
buttonText
:
'确定'
});
dd
.
hideLoading
()
...
...
This diff is collapsed.
Click to expand it.
API/login.js
0 → 100644
View file @
8551d7d0
const
login
=
()
=>
{
const
app
=
getApp
()
let
mingUserId
=
dd
.
getStorageSync
({
key
:
'mingUserId'
}).
data
// 有token
if
((
dd
.
getStorageSync
({
key
:
'token'
}).
data
&&
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
access_token
))
{
let
hasToken
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
;
// token
let
expires_in
=
hasToken
.
expires_in
||
''
;
// 过期时效
let
loginTime
=
hasToken
.
expires_in
||
''
;
// 用户登陆时间
let
token
=
hasToken
.
access_token
||
''
;
let
refresh_token
=
hasToken
.
refresh_token
// 刷新token
// 判断token没有过期
if
(((
new
Date
()).
getTime
()
-
hasToken
.
loginTime
<
hasToken
.
expires_in
*
1000
))
{
// if(((new Date()).getTime() - hasToken.loginTime < 30 * 1000)) {
dd
.
redirectTo
({
url
:
'/pages/index/index'
})
}
// 判断token过期
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// 判断有无网络
dd
.
getNetworkType
({
success
:
(
res
)
=>
{
if
(
res
.
networkAvailable
)
{
dd
.
httpRequest
({
headers
:
{
'Authorization'
:
'Basic bWluZ3BheS1waG9uZTptaW5ncGF5LXBob25l'
,
'Content-Type'
:
'application/x-www-form-urlencoded'
},
dataType
:
'json'
,
data
:
{
grant_type
:
'refresh_token'
,
refresh_token
:
refresh_token
},
url
:
`
${
app
.
globalData
.
globalUrl
}
/auth/oauth/token`
,
method
:
'POST'
,
success
:
function
(
res
)
{
if
(
res
.
status
==
200
)
{
dd
.
setStorageSync
({
key
:
'token'
,
data
:
{
access_token
:
res
.
data
.
access_token
,
expires_in
:
res
.
data
.
expires_in
,
refresh_token
:
res
.
data
.
refresh_token
,
loginTime
:
(
new
Date
()).
getTime
()
}
})
login
()
}
},
fail
:
function
(
err
)
{
if
(
err
.
status
==
426
)
{
dd
.
removeStorageSync
({
key
:
'token'
})
login
()
}
else
{
dd
.
hideLoading
()
dd
.
redirectTo
({
url
:
'/pages/reTry/reTry'
})
}
}
})
}
else
{
dd
.
hideLoading
()
dd
.
redirectTo
({
url
:
'/pages/reTry/reTry'
})
}
}
})
})
}
}
// 无token
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
dd
.
getNetworkType
({
success
:
function
(
res
)
{
if
(
res
.
networkAvailable
)
{
dd
.
httpRequest
({
headers
:
{
'Authorization'
:
'Basic bWluZ3BheS1waG9uZTptaW5ncGF5LXBob25l'
,
'Content-Type'
:
'application/x-www-form-urlencoded'
},
data
:
{
username
:
mingUserId
,
password
:
mingUserId
,
scope
:
'server'
,
grant_type
:
'password'
},
url
:
`
${
app
.
globalData
.
globalUrl
}
/auth/oauth/token`
,
method
:
'POST'
,
dataType
:
'json'
,
success
:
function
(
res
)
{
dd
.
setStorageSync
({
key
:
'token'
,
data
:
{
access_token
:
res
.
data
.
access_token
,
expires_in
:
res
.
data
.
expires_in
,
refresh_token
:
res
.
data
.
refresh_token
,
loginTime
:
(
new
Date
()).
getTime
()
}
})
dd
.
redirectTo
({
url
:
'/pages/index/index'
})
}
})
}
else
{
dd
.
hideLoading
()
dd
.
redirectTo
({
url
:
'/pages/reTry/reTry'
})
}
}
})
})
}
}
export
default
{
login
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/action/action.js
View file @
8551d7d0
const
app
=
getApp
()
import
$login
from
'./../../API/login'
Page
({
onLoad
(
query
)
{
const
_that
=
this
;
...
...
@@ -25,18 +26,14 @@ Page({
}
// 无网络状态
else
{
if
(
dd
.
getStorageSync
({
key
:
'token'
}).
data
)
{
if
(
dd
.
getStorageSync
({
key
:
'token'
}).
data
&&
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
access_token
)
{
dd
.
redirectTo
({
url
:
'/pages/index/index'
})
}
else
{
dd
.
alert
({
content
:
'登录超时,请连接网络重试'
,
buttonText
:
'确定'
});
dd
.
redirectTo
({
url
:
'/pages/reTry/reTry'
url
:
'/pages/reTry/reTry'
})
dd
.
hideLoading
()
}
...
...
@@ -71,16 +68,17 @@ Page({
key
:
'avatar'
,
data
:
data
.
oapiUser
.
avatar
})
_that
.
getUserToken
(
data
.
mingUserId
)
$login
.
login
(
)
}
else
{
dd
.
redirectTo
({
url
:
'pages/reTry/reTry'
url
:
'
/
pages/reTry/reTry'
})
dd
.
hideLoading
()
}
},
fail
:
function
(
res
)
{
dd
.
hideLoading
();
console
.
log
(
'err'
,
res
.
errorMessage
)
if
(
res
.
errorMessage
==
"NETWORK ERROR"
)
{
dd
.
alert
({
...
...
@@ -93,7 +91,6 @@ Page({
url
:
'/pages/reTry/reTry'
})
}
dd
.
hideLoading
();
}
})
...
...
This diff is collapsed.
Click to expand it.
pages/alipayRecharge/alipayRecharge.js
View file @
8551d7d0
...
...
@@ -7,23 +7,34 @@ Page({
messagedetail
:
''
,
type
:
''
},
recharg
(){
dd
.
showLoading
({
content
:
'加载中...'
});
let
data
=
{
ddUserId
:
dd
.
getStorageSync
({
key
:
'userId'
}).
data
,
orderPrice
:
this
.
data
.
inputValue
recharg
()
{
let
regPrice
=
/
(
^
[
1-9
]([
0-9
]
+
)?(\.[
0-9
]{1,2})?
$
)
|
(
^
(
0
){1}
$
)
|
(
^
[
0-9
]\.[
0-9
]([
0-9
])?
$
)
/
;
if
(
!
regPrice
.
test
(
this
.
data
.
inputValue
)
||
this
.
data
.
inputValue
==
''
)
{
dd
.
alert
({
content
:
'请输入正确的金钱格式'
,
buttonText
:
'确定'
})
}
const
_that
=
this
;
$http
.
$http
(
'isv/charge/charge_alipay'
,
data
,
'GET'
).
then
((
res
)
=>
{
_that
.
ddPayFn
(
res
)
}).
catch
((
res
)
=>
{
dd
.
hideLoading
();
console
.
log
(
'rechargError'
)
})
else
{
dd
.
showLoading
({
content
:
'加载中...'
});
let
data
=
{
ddUserId
:
dd
.
getStorageSync
({
key
:
'userId'
}).
data
,
orderPrice
:
this
.
data
.
inputValue
}
const
_that
=
this
;
$http
.
$http
(
'isv/charge/charge_alipay'
,
data
,
'GET'
).
then
((
res
)
=>
{
_that
.
ddPayFn
(
res
)
}).
catch
((
res
)
=>
{
dd
.
hideLoading
();
console
.
log
(
'rechargError'
)
})
}
},
changeRechargeNum
(
event
){
changeRechargeNum
(
event
)
{
const
_that
=
this
;
switch
(
event
.
target
.
dataset
.
num
)
{
case
'20'
:
...
...
@@ -63,7 +74,7 @@ Page({
})
}
},
ddPayFn
(
str
){
ddPayFn
(
str
)
{
const
_that
=
this
;
console
.
log
(
'调用成功'
)
console
.
log
(
str
)
...
...
@@ -73,7 +84,7 @@ Page({
success
:
res
=>
{
console
.
log
(
JSON
.
stringify
(
res
)
+
'ddPayFnSuccess'
)
console
.
log
(
res
)
if
(
res
.
resultStatus
===
"9000"
)
{
if
(
res
.
resultStatus
===
"9000"
)
{
dd
.
redirectTo
({
url
:
`/pages/rechargeSuccess/rechargeSuccess?money=
${
this
.
data
.
inputValue
}
`
})
...
...
@@ -85,23 +96,23 @@ Page({
})
dd
.
hideLoading
();
}
/*{
memo: 'xxxx', // 保留参数,一般无内容
result: 'xxxx', // 本次操作返回的结果数据
resultStatus: '' // 本次操作的状态返回值,标识本次调用的结果
}*/
/*{
memo: 'xxxx', // 保留参数,一般无内容
result: 'xxxx', // 本次操作返回的结果数据
resultStatus: '' // 本次操作的状态返回值,标识本次调用的结果
}*/
},
fail
:
err
=>
{
dd
.
alert
({
content
:
'充值失败'
,
buttonText
:
'确定'
})
fail
:
err
=>
{
dd
.
alert
({
content
:
'充值失败'
,
buttonText
:
'确定'
})
}
})
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
dd
.
alert
({
content
:
err
,
content
:
err
,
buttonText
:
'确定'
});
})
...
...
@@ -115,7 +126,7 @@ Page({
onLoad
(
query
)
{
// 页面加载
console
.
info
(
`Page onLoad with query:
${
JSON
.
stringify
(
query
)}
`
);
dd
.
setNavigationBar
({
title
:
'充值'
});
dd
.
setNavigationBar
({
title
:
'充值'
});
},
onReady
()
{
// 页面加载完成
...
...
@@ -128,16 +139,21 @@ Page({
},
onUnload
()
{
// 页面被关闭
dd
.
stopPullDownRefresh
()
},
onTitleClick
()
{
// 标题被点击
},
onPullDownRefresh
()
{
// 页面被下拉
dd
.
redirectTo
({
url
:
'/pages/alipayRecharge/alipayRecharge'
})
const
_that
=
this
_that
.
setData
({
focus
:
false
,
inputValue
:
''
,
messagedetail
:
''
,
type
:
''
})
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
// 页面被拉到底部
...
...
This diff is collapsed.
Click to expand it.
pages/allowanceList/allowanceList.js
View file @
8551d7d0
...
...
@@ -90,16 +90,25 @@ Page({
},
onUnload
()
{
// 页面被关闭
dd
.
stopPullDownRefresh
()
},
onTitleClick
()
{
// 标题被点击
},
onPullDownRefresh
()
{
// 页面被下拉
dd
.
redirectTo
({
url
:
'/pages/allowanceList/allowanceList'
const
_that
=
this
_that
.
setData
({
type
:
'1'
,
available
:
'YES'
,
dataList
:[],
currentPage
:
1
,
pageNumber
:
10
,
totalCount
:
''
})
this
.
querySubsidyList
()
this
.
resetData
()
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
let
currentNum
=
''
;
...
...
This diff is collapsed.
Click to expand it.
pages/allowanceRecordList/allowanceRecordList.js
View file @
8551d7d0
...
...
@@ -7,14 +7,18 @@ Page({
currentPage
:
1
,
totalCount
:
''
,
pageNumber
:
10
,
subsidyNo
:
''
subsidyNo
:
''
,
query
:
''
},
onLoad
(
query
)
{
this
.
resetData
()
dd
.
setNavigationBar
({
title
:
'账单记录'
});
console
.
log
(
query
,
2222222222
)
this
.
setData
({
query
:
query
,
subsidyNo
:
query
.
subsidyNo
})
console
.
log
(
this
.
data
.
query
,
33333333333333333
)
},
resetData
(){
this
.
setData
({
...
...
@@ -93,9 +97,20 @@ Page({
},
onPullDownRefresh
()
{
// 页面被下拉
// dd.redirectTo({
// url: '/pages/allowanceRecordList/allowanceRecordList'
// })
this
.
setData
({
statusList
:
[
'SUCCESS'
,
'WAITING_PERMIT'
,
'REFUND_SUCCESS'
],
recordAlliwanceListData
:
[],
currentPage
:
1
,
totalCount
:
''
,
pageNumber
:
10
,
subsidyNo
:
''
})
this
.
resetData
()
this
.
setData
({
subsidyNo
:
this
.
data
.
query
.
subsidyNo
})
this
.
queryListPaymentRecord
()
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
let
currentNum
=
''
;
...
...
@@ -105,6 +120,7 @@ Page({
currentPage
:
currentNum
})
this
.
queryListPaymentRecord
(
currentNum
)
}
},
onShareAppMessage
()
{
...
...
This diff is collapsed.
Click to expand it.
pages/allowanceRecordList/allowanceRecordList.json
View file @
8551d7d0
{
"pullRefresh"
:
fals
e
"pullRefresh"
:
tru
e
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/billDetails/billDetails.js
View file @
8551d7d0
...
...
@@ -3,13 +3,15 @@ import $http from './../../API/http'
Page
({
data
:{
trxNo
:
''
,
recordData
:
{}
recordData
:
{},
query
:
''
},
onLoad
(
query
)
{
// 页面加载
console
.
log
(
query
);
this
.
setData
({
trxNo
:
query
.
trxNo
trxNo
:
query
.
trxNo
,
query
:
query
})
dd
.
setNavigationBar
({
title
:
'账单详情'
});
},
...
...
@@ -60,9 +62,15 @@ Page({
},
onPullDownRefresh
()
{
// 页面被下拉
// dd.redirectTo({
// url: '/pages/billDetails/billDetails'
// })
this
.
setData
({
trxNo
:
''
,
recordData
:
{},
})
this
.
setData
({
trxNo
:
this
.
data
.
query
.
trxNo
,
})
this
.
queryListPaymentRecord
()
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
// 页面被拉到底部
...
...
This diff is collapsed.
Click to expand it.
pages/billDetails/billDetails.json
View file @
8551d7d0
{
"pullRefresh"
:
false
}
\ No newline at end of file
{}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/index/index.axml
View file @
8551d7d0
...
...
@@ -11,7 +11,7 @@
</view>
<view class="balanceBox">
<view class="balancetitle">账户余额</view>
<view>¥ <view class="balanceNum">{{
name ?
realityBalance.toFixed(2) : '--'}}</view></view>
<view>¥ <view class="balanceNum">{{
realityBalance ?
realityBalance.toFixed(2) : '--'}}</view></view>
</view>
<view class="indexItemList">
<view touchStart="touchStyle" touchEnd="touchEnd" onTap="toPayment"><image mode="scaleToFill" src="./../../assets/QRcode.png"/>付款</view>
...
...
This diff is collapsed.
Click to expand it.
pages/index/index.js
View file @
8551d7d0
...
...
@@ -84,21 +84,49 @@ Page({
},
onUnload
()
{
// 页面被关闭
dd
.
stopPullDownRefresh
()
},
onTitleClick
()
{
// 标题被点击
},
onPullDownRefresh
()
{
// 页面被下拉
dd
.
redirectTo
({
url
:
'/pages/index/index'
})
const
_that
=
this
;
this
.
setData
({
src
:
'./background.png'
,
name
:
'姓名'
,
avatar
:
''
,
realityBalance
:
''
,
cardNo
:
''
})
this
.
setData
({
avatar
:
dd
.
getStorageSync
({
key
:
'avatar'
}).
data
})
dd
.
getNetworkType
({
success
:
(
res
)
=>
{
if
(
res
.
networkAvailable
)
{
}
else
{
dd
.
showToast
({
type
:
'fail'
,
content
:
'未连网仅支持离线支付'
,
duration
:
3000
,
});
dd
.
hideLoading
()
}
}
});
dd
.
getNetworkType
({
success
:
(
res
)
=>
{
if
(
res
.
networkAvailable
)
{
_that
.
getUserDetails
()
}
else
{
}
}
});
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
},
onShareAppMessage
()
{
// 返回自定义分享信息
...
...
This diff is collapsed.
Click to expand it.
pages/noPermission/noPermission.js
View file @
8551d7d0
...
...
@@ -22,6 +22,7 @@ Page({
},
onPullDownRefresh
()
{
// 页面被下拉
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
},
...
...
This diff is collapsed.
Click to expand it.
pages/paySuccess/paySuccess.acss
View file @
8551d7d0
.paymentSuccess {
width: 100%;
overflow: hidden
}
.paymentDetails{
width: 686rpx;
height: 692rpx;
...
...
This diff is collapsed.
Click to expand it.
pages/paySuccess/paySuccess.axml
View file @
8551d7d0
<view>
<view
class='paymentSuccess'
>
<view class="paymentDetails">
<view><image mode="scaleToFill" src="./../../assets/paySure.png"/></view>
<view><text>支付成功</text></view>
...
...
This diff is collapsed.
Click to expand it.
pages/paySuccess/paySuccess.js
View file @
8551d7d0
const
app
=
getApp
()
Page
({
data
:{
money
:
''
money
:
''
,
query
:
''
},
onLoad
(
query
)
{
// 页面加载
console
.
info
(
`Page onLoad with query:
${
JSON
.
stringify
(
query
)}
`
);
this
.
setData
({
query
:
query
,
money
:
query
.
money
})
dd
.
setNavigationBar
({
title
:
'支付详情'
});
...
...
@@ -31,10 +33,16 @@ Page({
onTitleClick
()
{
// 标题被点击
},
// onPullDownRefresh() {
// // 页面被下拉
// dd.stopPullDownRefresh()
// },
onPullDownRefresh
()
{
// 页面被下拉
this
.
setData
({
money
:
''
})
this
.
setData
({
money
:
this
.
data
.
query
.
money
})
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
// 页面被拉到底部
},
...
...
This diff is collapsed.
Click to expand it.
pages/paySuccess/paySuccess.json
View file @
8551d7d0
{
"pullRefresh"
:
fals
e
"pullRefresh"
:
tru
e
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/payment/payment.js
View file @
8551d7d0
...
...
@@ -38,13 +38,14 @@ Page({
let
token
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
access_token
;
let
expires_in
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
expires_in
;
let
refresh_token
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
refresh_token
;
let
mingUserId
=
dd
.
getStorageSync
({
key
:
'mingUserId'
}).
data
if
(
!!
hasToken
&&
((
new
Date
()).
getTime
()
-
hasToken
.
loginTime
<
(
hasToken
.
expires_in
-
6
0
)
*
1000
))
{
// if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime <
30
* 1000)) {
if
(
!!
hasToken
&&
((
new
Date
()).
getTime
()
-
hasToken
.
loginTime
<
(
hasToken
.
expires_in
-
30
0
)
*
1000
))
{
// if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime <
1
* 1000)) {
let
timestamp
=
(
new
Date
()).
getTime
();
let
url
=
aes
.
getAES
(
JSON
.
stringify
({
"token"
:
token
,
"timestamp"
:
timestamp
,
"timestamp"
:
timestamp
}))
let
size
=
272
let
ecc
=
2
...
...
@@ -57,6 +58,9 @@ Page({
success
:
(
res
=>
{
// 网络可用的情况下 刷新token
if
(
res
.
networkAvailable
)
{
dd
.
showLoading
({
content
:
'加载中...'
});
dd
.
httpRequest
({
headers
:
{
'Authorization'
:
'Basic bWluZ3BheS1waG9uZTptaW5ncGF5LXBob25l'
,
...
...
@@ -70,7 +74,9 @@ Page({
},
method
:
'POST'
,
success
:
function
(
res
)
{
console
.
log
(
res
)
dd
.
removeStorage
({
key
:
'token'
})
dd
.
setStorageSync
({
key
:
'token'
,
data
:
{
...
...
@@ -80,13 +86,14 @@ Page({
loginTime
:
(
new
Date
()).
getTime
()
}
})
_that
.
setData
({
isTimeOut
:
true
})
hasToken
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
;
token
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
access_token
;
expires_in
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
expires_in
;
refresh_token
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
refresh_token
;
dd
.
hideLoading
()
_that
.
setData
({
isTimeOut
:
true
})
// hasToken = dd.getStorageSync({ key: 'token' }).data;
// token = dd.getStorageSync({ key: 'token' }).data.access_token;
// expires_in = dd.getStorageSync({ key: 'token' }).data.expires_in;
// refresh_token = dd.getStorageSync({ key: 'token' }).data.refresh_token;
let
timestamp
=
(
new
Date
()).
getTime
();
let
url
=
aes
.
getAES
(
JSON
.
stringify
({
...
...
@@ -100,18 +107,25 @@ Page({
QR
.
draw
(
url
,
ctx
,
size
,
Number
(
ecc
));
},
fail
:
function
(
res
)
{
dd
.
alert
({
content
:
'系统繁忙'
,
buttonText
:
'确定'
})
dd
.
hideLoading
()
fail
:
function
(
err
)
{
if
(
err
.
status
==
426
)
{
dd
.
redirectTo
({
url
:
'/pages/reTry/reTry'
})
}
else
{
dd
.
alert
({
content
:
'请检查网络并下拉重试'
,
buttonText
:
'确定'
})
dd
.
hideLoading
()
}
}
})
}
else
{
dd
.
alert
({
content
:
'请
连接网络后重新进入
'
,
content
:
'请
检查网络设置并下拉重试
'
,
buttonText
:
'确定'
})
_that
.
setData
({
...
...
@@ -133,11 +147,11 @@ Page({
//刷新二维码
const
_that
=
this
;
setTimeout
(
function
(){
clearInterval
(
timeRefreshQRcode
);
clearInterval
(
timeRefreshQRcode
);
_that
.
refreshQRcode
();
timeRefreshQRcode
=
setInterval
(
function
()
{
_that
.
refreshQRcode
();
},
55000
);
},
55000
);
},
500
)
dd
.
getNetworkType
({
success
:
(
res
)
=>
{
...
...
@@ -196,18 +210,41 @@ Page({
const
_that
=
this
;
clearInterval
(
timeRefreshQRcode
);
webSocket
.
closeSocket
();
// dd.closeSocket();
// dd.offSocketMessage()
},
onTitleClick
()
{
// 标题被点击
},
onPullDownRefresh
()
{
// 页面被下拉
dd
.
redirectTo
({
url
:
'/pages/payment/payment'
this
.
setData
({
src
:
'./background.png'
,
title
:
'123123123123'
,
imgPath
:
''
,
className
:
''
,
size
:
272
,
url
:
''
,
ecc
:
2
,
isTimeOut
:
true
})
const
_that
=
this
;
setTimeout
(
function
(){
clearInterval
(
timeRefreshQRcode
);
_that
.
refreshQRcode
();
timeRefreshQRcode
=
setInterval
(
function
()
{
_that
.
refreshQRcode
();
},
55000
);
},
500
)
dd
.
getNetworkType
({
success
:
(
res
)
=>
{
// 有网络状态
if
(
res
.
networkAvailable
)
{
// 获取免登授权码
webSocket
.
connectSocket
();
webSocket
.
onSocketMessageCallback
=
this
.
onSocketMessageCallback
;
}
}
});
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
// 页面被拉到底部
...
...
This diff is collapsed.
Click to expand it.
pages/reTry/reTry.axml
View file @
8551d7d0
<view>
<view class="noPermissionContent">
<image mode="scaleToFill" src="../../../assets/noPermission.png"/>
<text>
登录失败,请
重试</text>
<text>
请检查网络设置并单击
重试</text>
<button class='reTry' onTap="reTry">重试</button>
</view>
</view>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/rechargeSuccess/rechargeSuccess.acss
View file @
8551d7d0
.rechargeSucess {
width: 100%;
overflow: hidden
}
.paymentDetails{
width: 686rpx;
height: 692rpx;
...
...
This diff is collapsed.
Click to expand it.
pages/rechargeSuccess/rechargeSuccess.axml
View file @
8551d7d0
<view>
<view
class='rechargeSucess'
>
<view class="paymentDetails">
<view><image mode="scaleToFill" src="./../../assets/paySure.png"/></view>
<view><text>支付成功</text></view>
...
...
This diff is collapsed.
Click to expand it.
pages/rechargeSuccess/rechargeSuccess.js
View file @
8551d7d0
const
app
=
getApp
()
Page
({
data
:{
money
:
''
money
:
''
,
query
:
''
},
onLoad
(
query
)
{
// 页面加载
console
.
info
(
`Page onLoad with query:
${
JSON
.
stringify
(
query
)}
`
);
this
.
setData
({
query
:
query
,
money
:
query
.
money
})
dd
.
setNavigationBar
({
title
:
'充值详情'
});
...
...
@@ -33,6 +35,11 @@ Page({
},
onPullDownRefresh
()
{
// 页面被下拉
this
.
setData
({
money
:
''
,
money
:
this
.
data
.
query
.
money
})
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
// 页面被拉到底部
...
...
This diff is collapsed.
Click to expand it.
pages/rechargeSuccess/rechargeSuccess.json
View file @
8551d7d0
{
"pullRefresh"
:
fals
e
"pullRefresh"
:
tru
e
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/recordList/recordList.js
View file @
8551d7d0
...
...
@@ -225,9 +225,33 @@ Page({
},
onPullDownRefresh
()
{
// 页面被下拉
dd
.
redirectTo
({
url
:
'/pages/recordList/recordList'
this
.
setData
({
time
:
''
,
orderStartTime
:
''
,
orderEndTime
:
''
,
orderType
:
''
,
orderStatus
:
''
,
sceneType
:
''
,
statusList
:
[
'SUCCESS'
,
'REFUND_SUCCESS'
],
recordListData
:
[],
currentPage
:
1
,
totalCount
:
''
,
pageNumber
:
20
,
})
this
.
resetData
()
dd
.
setNavigationBar
({
title
:
'账单记录'
});
let
date
=
new
Date
();
let
year
=
date
.
getFullYear
();
let
month
=
date
.
getMonth
()
+
1
;
let
day
=
(
new
Date
(
year
,
month
,
0
).
getDate
().
toString
()).
length
>
1
?
new
Date
(
year
,
month
,
0
).
getDate
()
:
'0'
+
new
Date
(
year
,
month
,
0
).
getDate
()
this
.
setData
({
// 刚进入账单记录页面,时间不够两位补0
time
:
`
${
year
}
-
${
month
.
toString
().
length
>
1
?
month
:
'0'
+
month
}
`
,
orderStartTime
:
`
${
year
}
-
${
month
.
toString
().
length
>
1
?
month
:
'0'
+
month
}
-01`
,
orderEndTime
:
`
${
year
}
-
${
month
.
toString
().
length
>
1
?
month
:
'0'
+
month
}
-
${
day
}
`
})
this
.
queryListPaymentRecord
()
dd
.
stopPullDownRefresh
()
},
onReachBottom
()
{
// dd.alert({
...
...
This diff is collapsed.
Click to expand it.
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