123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- // 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 () {
- }
- })
|