// pages/mine/mine.js const app = getApp(); const utils = require("../../utils/http"); Page({ data: { unreadNum: 0, personobj: {}, mineObj: {}, imgUrl: app.globalData.imgUrl, unfutureflag: false, paper: 0 }, onLoad: function () { var that = this; wx.showLoading({ title: '加载中...', }) this.setData({ unreadNum: app.globalData.unreadNum }) setTimeout(function () { wx.hideLoading() }, 1000) }, closetap: function () { this.setData({ unfutureflag: false }) }, unreadMsg: function () { var that = this; app.globalData.tokenflag = true; utils.$post({ url: app.globalData.webUrl + 'api/user_msg/unreadCount', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: {}, success: function (res) { if (res.data.code == '0') { that.setData({ unreadNum: res.data.data > 99 ? '99+' : res.data.data, paper: res.data.paper }) app.globalData.unreadNum = res.data.data > 99 ? '99+' : res.data.data; } } }) }, designerap() { wx.navigateTo({ url: '/mycustomer/pages/setdesigner/setdesigner' }) }, onReady: function () { }, onShow: function () { var that = this; that.setData({ personobj: app.globalData.personMsg, }) app.globalData.tabflag = true; // that.getTabBar().setData({ // tabflag: true // }) // if (typeof this.getTabBar === 'function' && this.getTabBar()) { // this.getTabBar().setData({ // selected: 3 // }) // } that.unreadMsg(); }, guestap: function (e) { var that = this; wx.navigateTo({ url: '/mycustomer/pages/guestlook/guestlook', }) }, changeTap: function () { wx.navigateTo({ url: '/pages/change/change' }) }, talktap: function () { // wx.navigateTo({ // url: '/mycustomer/pages/mytalkskill/mytalkskill' // }) wx.navigateTo({ url: '/mycustomer/pages/mycreation/mycreation' }) }, sreenumtap() { wx.navigateTo({ url: '/mycustomer/pages/screenset/screenset' }) }, mysharetap: function (e) { var that = this; wx.navigateTo({ url: '/mycustomer/pages/myshare/myshare' }) }, mycollectap: function (e) { var that = this; wx.navigateTo({ url: '/mycustomer/pages/mycollect/mycollect' }) }, mycompanytap: function () { wx.navigateTo({ url: '/mycustomer/pages/mycompany/mycompany' }) }, teammanagertap: function () { wx.navigateTo({ url: '/mycustomer/pages/managerdata/managerdata' }) }, setap: function () { wx.navigateTo({ url: '/mycustomer/pages/set/set' }) }, persontap: function () { wx.navigateTo({ url: '/mycustomer/pages/scoremsg/scoremsg' }) }, informTap: function (e) { var that = this; wx.navigateTo({ url: '/mycustomer/pages/information/information', }) }, setTap: function () { var that = this; this.setData({ unfutureflag: true }) }, servicetap: function (e) { wx.navigateTo({ url: '/mycustomer/pages/scoremsg/scoremsg', }) }, testap: function (e) { wx.navigateTo({ url: '/index/pages/testapprove/testapprove' }) }, aboutap: function (e) { wx.navigateTo({ url: '/mycustomer/pages/about/about' }) }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { this.unreadMsg(); wx.stopPullDownRefresh(); }, dothis: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { } })