|
@@ -262,22 +262,49 @@
|
|
|
onShow() {
|
|
|
uni.showTabBar()
|
|
|
this.loadData()
|
|
|
- this.userInfo = uni.getStorageSync("userInfo")
|
|
|
- if(!this.userInfo.avatarUrl){
|
|
|
- this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
|
- }else{
|
|
|
- this.headUrl = this.userInfo.avatarUrl
|
|
|
- }
|
|
|
- console.log("this.userInfo",this.userInfo)
|
|
|
- if(this.userInfo.userName){
|
|
|
+ console.log("hasLogin",this.hasLogin )
|
|
|
+ if(this.userInfo){
|
|
|
+ if(!this.userInfo.avatarUrl){
|
|
|
+ this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
|
+ }else{
|
|
|
+ this.headUrl = this.userInfo.avatarUrl
|
|
|
+ }
|
|
|
this.username = this.userInfo.userName
|
|
|
- }
|
|
|
- else{
|
|
|
- this.username = "请更改昵称"
|
|
|
- }
|
|
|
- if(this.userInfo.phone){
|
|
|
this.userphone = this.userInfo.phone
|
|
|
+ var that = this
|
|
|
+ this.$api.doRequest('get', '/salePlanInfo/getTips', {phone:this.userInfo.phone}).then(res => {
|
|
|
+ if (res.data.data) {
|
|
|
+ let name = 'myTip';
|
|
|
+ let value = res.data.data.myTip;
|
|
|
+ that.$store.commit('$uStore', {
|
|
|
+ name,
|
|
|
+ value
|
|
|
+ });
|
|
|
+ if(value != 0){
|
|
|
+ uni.setTabBarBadge({
|
|
|
+ index:3,
|
|
|
+ text:value+""
|
|
|
+ })
|
|
|
+ }
|
|
|
+ name = 'taskTip';
|
|
|
+ value = res.data.data.taskTip;
|
|
|
+ that.$store.commit('$uStore', {
|
|
|
+ name,
|
|
|
+ value
|
|
|
+ });
|
|
|
+ name = 'contractTip';
|
|
|
+ value = res.data.data.contractTip;
|
|
|
+ that.$store.commit('$uStore', {
|
|
|
+ name,
|
|
|
+ value
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
|
+ this.username = "立即登录"
|
|
|
}
|
|
|
+ console.log("this.userInfo",this.userInfo)
|
|
|
},
|
|
|
methods: {
|
|
|
fankui(){
|
|
@@ -397,11 +424,17 @@
|
|
|
}
|
|
|
},
|
|
|
toLogin() {
|
|
|
- if (!this.hasLogin) {
|
|
|
+ console.log("userInfo",this.userInfo)
|
|
|
+ if (!this.hasLogin || !this.userInfo || this.username == "立即登录") {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/public/login_account_number'
|
|
|
})
|
|
|
}
|
|
|
+ else{
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/user/setUp'
|
|
|
+ })
|
|
|
+ }
|
|
|
// else if(!this.userInfo.nickname){
|
|
|
// this.inputShow = true
|
|
|
// this.inputStatus = 'inline'
|