|
@@ -16,6 +16,7 @@ import {
|
|
|
powerCheck,
|
|
|
openSpace,
|
|
|
} from "../../requests/api";
|
|
|
+var refreshTimer=null;
|
|
|
Page({
|
|
|
data: {
|
|
|
surveyShow:false, //是否显示调查问卷
|
|
@@ -232,6 +233,7 @@ Page({
|
|
|
// 第一次进入获取数据
|
|
|
console.log($.storage.get('wxqcode'),"$.storage.get('wxqcode')")
|
|
|
!$.storage.get('wxqcode')&&that.getData();
|
|
|
+ !$.storage.get('wxqcode')&&that.autoRefresh(this.getData);
|
|
|
if($.storage.get('wxqcode')&&$.storage.get('logined')){
|
|
|
this.checkCode($.storage.get('wxqcode'));
|
|
|
}
|
|
@@ -349,6 +351,18 @@ Page({
|
|
|
gotoUser(){
|
|
|
router.push('usercenter')
|
|
|
},
|
|
|
+ // 自动刷新
|
|
|
+ autoRefresh(fn){
|
|
|
+ if(refreshTimer){
|
|
|
+ clearInterval(refreshTimer);
|
|
|
+ refreshTimer = null;
|
|
|
+ }
|
|
|
+ let refreshTime=$.store.get("autoRefreshTime");
|
|
|
+ refreshTimer = setTimeout(()=>{
|
|
|
+ fn();
|
|
|
+ this.autoRefresh(fn);
|
|
|
+ },refreshTime)
|
|
|
+ },
|
|
|
/**
|
|
|
* 获取页面服务端数据
|
|
|
*/
|
|
@@ -358,9 +372,9 @@ Page({
|
|
|
if(!userId){
|
|
|
return;
|
|
|
}
|
|
|
- wx.showLoading({
|
|
|
- title:"加载中"
|
|
|
- })
|
|
|
+ // wx.showLoading({
|
|
|
+ // title:"加载中"
|
|
|
+ // })
|
|
|
const data = {
|
|
|
"criteria": {
|
|
|
"userId": userId,
|
|
@@ -387,7 +401,7 @@ Page({
|
|
|
}else{
|
|
|
this.setData({noDate:true,cardList:[]})
|
|
|
}
|
|
|
- wx.hideLoading()
|
|
|
+ // wx.hideLoading()
|
|
|
// $.hideLoading()
|
|
|
},
|
|
|
checkLevel(value,name){
|
|
@@ -534,6 +548,7 @@ Page({
|
|
|
// await this.inItUserdate();
|
|
|
if($.storage.get("tenantId")&&!$.store.get('changeTenantId')&&!this.data.formList){
|
|
|
this.getData();
|
|
|
+ this.autoRefresh(this.getData);
|
|
|
}
|
|
|
|
|
|
if(this.data.formList){
|
|
@@ -555,6 +570,10 @@ Page({
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ onHide(){
|
|
|
+ clearInterval(refreshTimer);
|
|
|
+ refreshTimer=null;
|
|
|
+ },
|
|
|
/**
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
*/
|