页面切图
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
@trigger="trigger" />
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import YunWei from "./comp/indexYunWei.vue";
|
||||
@@ -60,15 +60,6 @@ export default {
|
||||
text: '子用户',
|
||||
}
|
||||
]
|
||||
// if (arr.indexOf(this.userInfo.role) > -1) {
|
||||
// content.push({
|
||||
// iconPath: '/static/device.png',
|
||||
// text: '添加设备',
|
||||
// }, {
|
||||
// iconPath: '/static/gateway.png',
|
||||
// text: '添加网关',
|
||||
// })
|
||||
// }
|
||||
return content
|
||||
}
|
||||
},
|
||||
@@ -104,18 +95,35 @@ export default {
|
||||
switch (e.index + 1) {
|
||||
case 1:
|
||||
roleName = '运维管理'
|
||||
uni.removeTabBarBadge({
|
||||
index: 1
|
||||
})
|
||||
break
|
||||
case 2:
|
||||
roleName = '专职管理'
|
||||
uni.removeTabBarBadge({
|
||||
index: 1
|
||||
})
|
||||
break
|
||||
case 3:
|
||||
roleName = '工程'
|
||||
uni.removeTabBarBadge({
|
||||
index: 1
|
||||
})
|
||||
break
|
||||
case 4:
|
||||
roleName = '主用户'
|
||||
uni.setTabBarBadge({
|
||||
index: 1,
|
||||
text: '6'
|
||||
})
|
||||
break
|
||||
case 5:
|
||||
roleName = '子用户'
|
||||
uni.setTabBarBadge({
|
||||
index: 1,
|
||||
text: '6'
|
||||
})
|
||||
break
|
||||
}
|
||||
this.$util.toast(roleName + '角色切换成功')
|
||||
@@ -127,7 +135,21 @@ export default {
|
||||
this.loading = false
|
||||
},
|
||||
onShow () {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo) || { role: 4 }
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
if (!this.userInfo) {
|
||||
this.userInfo = {
|
||||
role: 4
|
||||
}
|
||||
uni.setStorageSync('userInfo', {
|
||||
role: 4
|
||||
})
|
||||
}
|
||||
if (this.userInfo.role == 4 || this.userInfo.role == 5) {
|
||||
uni.setTabBarBadge({
|
||||
index: 1,
|
||||
text: '6'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user