You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.8 KiB
76 lines
1.8 KiB
2 years ago
|
// components/me/me.js
|
||
|
const axios = require('../../api/index')
|
||
|
|
||
|
Component({
|
||
|
/**
|
||
|
* 组件的属性列表
|
||
|
*/
|
||
|
properties: {
|
||
|
},
|
||
|
pageLifetimes: {
|
||
|
show() {
|
||
|
// console.log(1)
|
||
|
this.getUnreadMessageList()
|
||
|
var userinfo = wx.getStorageSync('userInfo')
|
||
|
setTimeout(()=>{
|
||
|
this.setData({
|
||
|
userinfo
|
||
|
})
|
||
|
console.log(this.data.userinfo)
|
||
|
console.log(this.data.userinfo.userName)
|
||
|
},0)
|
||
|
}
|
||
|
},
|
||
|
lifetimes: {
|
||
|
created() {
|
||
|
this.getUnreadMessageList()
|
||
|
var userinfo = wx.getStorageSync('userInfo')
|
||
|
setTimeout(()=>{
|
||
|
this.setData({
|
||
|
userinfo
|
||
|
})
|
||
|
// console.log(this.data.userinfo)
|
||
|
// console.log(this.data.userinfo.userName)
|
||
|
},0)
|
||
|
},
|
||
|
attached: function () {
|
||
|
// this.getSysdata()
|
||
|
},
|
||
|
detached: function () {
|
||
|
// 在组件实例被从页面节点树移除时执行
|
||
|
},
|
||
|
},
|
||
|
/**
|
||
|
* 组件的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
userinfo:{},
|
||
|
messageCount:''
|
||
|
},
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 组件的方法列表
|
||
|
*/
|
||
|
methods: {
|
||
|
// 消息通知
|
||
|
getUnreadMessageList(){
|
||
|
axios.getUnreadMessageList().then(res => {
|
||
|
// auditFailCount: "0"审核失败
|
||
|
// messageCount: "0"消息提醒
|
||
|
let messageCount = res.data.messageCount
|
||
|
this.setData({
|
||
|
messageCount
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
// 路由跳转
|
||
|
to_path(e) {
|
||
|
// console.log(e.currentTarget.dataset.path)
|
||
|
wx.navigateTo({
|
||
|
url: e.currentTarget.dataset.path,
|
||
|
})
|
||
|
},
|
||
|
}
|
||
|
})
|