添加游客

This commit is contained in:
仲么了
2023-02-28 16:39:58 +08:00
parent 841cf9ae2d
commit 5feb70a9c5
17 changed files with 388 additions and 43 deletions

View File

@@ -12,6 +12,7 @@
<ZhuYongHu v-if="userInfo.role == 4" />
<!-- 子用户 -->
<ZiYongHu v-if="userInfo.role == 5" />
<YouKe v-if="userInfo.role == 6"> </YouKe>
<uni-fab ref="fab" direction="vertical" horizontal="right" vertical="bottom" :content="content"
@trigger="trigger" />
</view>
@@ -24,13 +25,15 @@ import GongCheng from "./comp/indexGongCheng.vue";
import ZhuYongHu from "./comp/indexZhuYongHu.vue";
import ZiYongHu from "./comp/indexZiYongHu.vue";
import ZhuanZhi from "./comp/indexZhuanZhi.vue";
import YouKe from "./comp/indexYouKe.vue";
export default {
components: {
YunWei,
GongCheng,
ZhuYongHu,
ZiYongHu,
ZhuanZhi
ZhuanZhi,
YouKe
},
data () {
return {
@@ -58,6 +61,9 @@ export default {
}, {
iconPath: '/static/mine3.png',
text: '子用户',
}, {
iconPath: '/static/mine3.png',
text: '游客',
}
]
return content
@@ -78,14 +84,10 @@ export default {
},
trigger (e) {
if (e.index === 5) {
if (e.index === 500) {
uni.navigateTo({
url: '/pages/device/new'
})
} else if (e.index === 6) {
uni.navigateTo({
url: '/pages/gateway/new'
})
} else {
this.userInfo.role = e.index + 1
uni.setStorageSync('userInfo', {
@@ -125,6 +127,13 @@ export default {
text: '6'
})
break
case 6:
roleName = '游客'
uni.setTabBarBadge({
index: 1,
text: '6'
})
break
}
this.$util.toast(roleName + '角色切换成功')
}
@@ -144,7 +153,7 @@ export default {
role: 4
})
}
if (this.userInfo.role == 4 || this.userInfo.role == 5) {
if (this.userInfo.role == 4 || this.userInfo.role == 5 || this.userInfo.role == 6) {
uni.setTabBarBadge({
index: 1,
text: '6'