This commit is contained in:
haomingming
2023-04-11 18:41:46 +08:00
parent 3f40c4c237
commit 4f14aad6f3
53 changed files with 657 additions and 205 deletions
+35 -16
View File
@@ -1,3 +1,5 @@
import _console from "../TUIKit/utils/console"
// custom-tab-bar/index.js
const app = getApp()
Component({
@@ -56,9 +58,11 @@ Component({
index_info: "",
wenzhen_info: "",
my_info: "",
next_url: "/Pages/yishi/identity/index"
next_url: "/Pages/yishi/identity/index",
info_inter: 0
},
attached() {
ready() {
console.log("readyreadyreadyreadyreadyready")
const usertype = wx.getStorageSync('usertype')
if (usertype == 2) {
this.setData({
@@ -71,22 +75,37 @@ Component({
items: this.data.listAll.list1
})
}
let _this = this;
let userID = wx.getStorageSync('user_id_'+usertype);
let info_inter = setInterval(() => {
let index_info = wx.getStorageSync(userID+'_index_info');
let wenzhen_info = wx.getStorageSync(userID+'_wenzhen_info');
let my_info = wx.getStorageSync(userID+'_my_info');
_this.setData({
index_info: index_info,
wenzhen_info: wenzhen_info,
my_info: my_info,
})
}, 500);
app.globalData.app_inter.push(info_inter);
},
methods: {
startInterval(){
let _this = this;
const usertype = wx.getStorageSync('usertype')
let userID = wx.getStorageSync('user_id_'+usertype);
let info_inter = setInterval(() => {
if(app.globalData.config.userID == userID){
let index_info = wx.getStorageSync(userID+'_index_info');
let wenzhen_info = wx.getStorageSync(userID+'_wenzhen_info');
let my_info = wx.getStorageSync(userID+'_my_info');
_this.setData({
index_info: this.formatNum(index_info),
wenzhen_info: this.formatNum(wenzhen_info),
my_info: this.formatNum(my_info),
})
}
}, 500);
this.setData({
info_inter: info_inter
})
},
stopInterval(){
clearInterval(this.data.info_inter)
},
formatNum(val){
if(val > 99) val = '+99';
if(val == 0) val = '';
return val;
},
// swichNav: function (e) {
// console.log(123);
// let that = this;