Commit 95271782 by fengzhaoyu

MOD:action进不去,跳转重新登录页面,加下拉刷新

parent e4f256da
......@@ -40,14 +40,14 @@ const $http = (url, data, type, loadingType) => {
// 修改系统繁忙时loading隐藏
dd.hideLoading();
dd.alert({
content: '系统繁忙',
content: '系统异常',
buttonText: '确定'
});
}
},
fail: function(res) {
dd.alert({
content:'系统繁忙',
content:'系统异常',
buttonText:'确定'
})
dd.hideLoading();
......@@ -90,7 +90,7 @@ const $http = (url, data, type, loadingType) => {
},
fail: function(res) {
dd.alert({
content:'系统繁忙',
content:'系统异常',
buttonText:'确定'
})
dd.hideLoading();
......@@ -99,7 +99,7 @@ const $http = (url, data, type, loadingType) => {
}
else {
dd.alert({
content: '登录超时,请连接网络重新登录',
content: '您暂时无网',
buttonText: '确定'
});
dd.hideLoading()
......
......@@ -10,13 +10,14 @@
"pages/rechargeSuccess/rechargeSuccess",
"pages/billDetails/billDetails",
"pages/noPermission/noPermission",
"pages/allowanceRecordList/allowanceRecordList"
"pages/allowanceRecordList/allowanceRecordList",
"pages/reTry/reTry"
],
"window": {
"enableWK": "YES",
"enableDSL": true,
"defaultTitle": "小程序",
"pullRefresh": false,
"pullRefresh": true,
"allowsBounceVertical": true
},
"debug": true
......
......@@ -25,16 +25,19 @@ Page({
}
// 无网络状态
else {
if (dd.getStorageSync({ key: 'token' }).data.access_token) {
if (dd.getStorageSync({ key: 'token' }).data) {
dd.redirectTo({
url: '/pages/index/index'
})
}
else {
dd.alert({
content: '登录超时,请连接网络重新登录',
content: '登录超时,请连接网络重',
buttonText: '确定'
});
dd.redirectTo({
url:'/pages/reTry/reTry'
})
dd.hideLoading()
}
}
......@@ -71,9 +74,8 @@ Page({
_that.getUserToken(data.mingUserId)
}
else {
dd.alert({
content: '系统繁忙',
buttonText: '确定'
dd.redirectTo({
url:'pages/reTry/reTry'
})
dd.hideLoading()
}
......@@ -87,9 +89,8 @@ Page({
})
}
else {
dd.alert({
content:'系统繁忙',
buttonText:'确定'
dd.redirectTo({
url:'/pages/reTry/reTry'
})
}
dd.hideLoading();
......@@ -111,6 +112,7 @@ Page({
grant_type: 'password'
},
url:`${app.globalData.globalUrl}/auth/oauth/token`,
// url:`${app.globalData.globalUrl}/auth/oauth/`,
method: 'POST',
dataType: 'json',
success: function(res) {
......@@ -130,74 +132,14 @@ Page({
},
fail: function(res) {
console.log('err',res)
dd.alert({
content: '系统繁忙',
buttonText: '确定'
dd.redirectTo({
url:'/pages/reTry/reTry'
})
dd.hideLoading()
}
})
},
// 有网络的状态更新用户userId和token
// getUserMsg(code) {
// const _that = this;
// let token = dd.getStorageSync({ key: 'token' }).data ? dd.getStorageSync({ key: 'token' }).data.access_token : '';
// let orgId = dd.corpId;
// dd.httpRequest({
// headers: {
// "Content-Type": "application/json",
// "Authorization": `Bearer ${token}`
// },
// url: `https://${app.globalData.globalUrl}/v1/auth/userToken?version=v1&code=${code}&token=${token}&orgId=${orgId}`,
// method: 'POST',
// dataType: 'json',
// success: function(res) {
// console.log(res)
// // 全局存储用户信息token和用户信息
// if(res.data.resultCode === '0'){
// const data = res.data.data;
// // 更新用户内部信息
// dd.setStorageSync({
// key: 'token',
// data: {
// access_token: data.accessToken.access_token,
// token_type: data.accessToken.token_type,
// expires_in: data.accessToken.expires_in,
// loginTime: (new Date()).getTime()
// }
// });
// dd.setStorageSync({
// key: 'userId',
// data: data.oapiUser.userid
// });
// dd.setStorageSync({
// key: 'avatar',
// data: data.oapiUser.avatar
// });
// dd.hideLoading();
// dd.redirectTo({
// url: '/pages/index/index'
// })
// }else{
// dd.hideLoading();
// dd.redirectTo({
// url: '/pages/noPermission/noPermission'
// })
// }
// },
// fail: function(res) {
// console.log('err',res)
// dd.alert({
// content: '系统繁忙',
// buttonText: '确定'
// });
// dd.hideLoading();
// }
// });
// },
onReady() {
// 页面加载完成
},
......@@ -213,9 +155,6 @@ Page({
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
......
......@@ -128,12 +128,16 @@ Page({
},
onUnload() {
// 页面被关闭
dd.stopPullDownRefresh()
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
dd.redirectTo({
url:'/pages/alipayRecharge/alipayRecharge'
})
},
onReachBottom() {
// 页面被拉到底部
......
......@@ -22,6 +22,7 @@
font-size: 30rpx;
flex: 1;
display: flex;
line-height: 20px
}
.availableItemFullMoney,.availableItemBalance{
padding-left: 60rpx;
......@@ -33,6 +34,7 @@
.availableItemTime{
color: #636363;
font-size: 24rpx;
line-height: 20px;
}
.availableItemDetails{
font-size: 24rpx;
......
......@@ -90,12 +90,16 @@ Page({
},
onUnload() {
// 页面被关闭
dd.stopPullDownRefresh()
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
dd.redirectTo({
url: '/pages/allowanceList/allowanceList'
})
},
onReachBottom() {
let currentNum = '';
......
......@@ -86,12 +86,16 @@ Page({
},
onUnload() {
// 页面被关闭
// dd.stopPullDownRefresh
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
// dd.redirectTo({
// url: '/pages/allowanceRecordList/allowanceRecordList'
// })
},
onReachBottom() {
let currentNum = '';
......
{}
\ No newline at end of file
{
"pullRefresh": false
}
\ No newline at end of file
......@@ -53,12 +53,16 @@ Page({
},
onUnload() {
// 页面被关闭
// dd.stopPullDownRefresh()
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
// dd.redirectTo({
// url: '/pages/billDetails/billDetails'
// })
},
onReachBottom() {
// 页面被拉到底部
......
{}
\ No newline at end of file
{
"pullRefresh": false
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ Page({
// },
onLoad(query) {
const _that = this;
dd.setNavigationBar({
title: '一卡通',
......@@ -83,12 +84,18 @@ Page({
},
onUnload() {
// 页面被关闭
dd.stopPullDownRefresh()
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
dd.redirectTo({
url: '/pages/index/index'
})
},
onReachBottom() {
......
......@@ -31,9 +31,10 @@ Page({
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
// onPullDownRefresh() {
// // 页面被下拉
// dd.stopPullDownRefresh()
// },
onReachBottom() {
// 页面被拉到底部
},
......
{}
\ No newline at end of file
{
"pullRefresh": false
}
\ No newline at end of file
......@@ -191,6 +191,7 @@ Page({
},
onUnload() {
// 页面被关闭
dd.stopPullDownRefresh()
console.log('onUnload')
const _that = this;
clearInterval(timeRefreshQRcode);
......@@ -204,6 +205,9 @@ Page({
},
onPullDownRefresh() {
// 页面被下拉
dd.redirectTo({
url: '/pages/payment/payment'
})
},
onReachBottom() {
// 页面被拉到底部
......
.noPermissionContent{
width: 7.5rem;
text-align: center;
padding-top: 380rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.noPermissionContent image{
width: 280rpx;
height: 220rpx;
display: block;
/* margin-bottom: 20rpx; */
}
.noPermissionContent text{
display: block;
font-size: 28rpx;
color: rgba(25, 31, 37, 0.48);
margin-bottom: 20rpx;
}
.reTry {
width: 132rpx;
height: 60rpx;
margin-top: 0 auto;
border-radius: 8rpx;
line-height: 60rpx;
text-align: center;
background: #2474FF;
color: white;
font-size: 32rpx;
}
\ No newline at end of file
<view>
<view class="noPermissionContent">
<image mode="scaleToFill" src="../../../assets/noPermission.png"/>
<text>登录失败,请重试</text>
<button class='reTry' onTap="reTry">重试</button>
</view>
</view>
\ No newline at end of file
const app = getApp()
import $http from './../../API/http'
Page({
data:{
},
onLoad(query) {
dd.setNavigationBar({
title: '一卡通',
backgroundColor: '#2474FF'
});
},
reTry() {
dd.redirectTo({
url: '/pages/action/action'
})
},
onReady() {
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onReachBottom() {
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
{
"pullRefresh": false
}
\ No newline at end of file
{}
\ No newline at end of file
{
"pullRefresh": false
}
\ No newline at end of file
......@@ -218,13 +218,17 @@ Page({
},
onUnload() {
// 页面被关闭
dd.stopPullDownRefresh()
},
onTitleClick() {
// 标题被点击
},
// onPullDownRefresh() {
// // 页面被下拉
// },
onPullDownRefresh() {
// 页面被下拉
dd.redirectTo({
url:'/pages/recordList/recordList'
})
},
onReachBottom() {
// dd.alert({
// content: '111111',
......
......@@ -27,10 +27,10 @@ var webSocket = {
* complete Function 否 接口调用结束的回调函数(调用成功、失败都会执行)
*/
connectSocket: function(options) {
dd.showLoading({
title: '',
mask: true,
})
// dd.showLoading({
// title: '',
// mask: true,
// })
socketOpen = false
socketClose = false
socketMsgQueue = []
......@@ -183,7 +183,6 @@ var webSocket = {
// 监听WebSocket连接打开事件。callback 回调函数
dd.onSocketOpen(function(res) {
console.log('WebSocket连接已打开!')
dd.hideLoading();
// 如果已经调用过关闭function
if (socketClose) {
webSocket.closeSocket();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment