提交app
This commit is contained in:
@@ -16,9 +16,18 @@
|
||||
</template>
|
||||
<template slot="right">
|
||||
<text class="hide-txt mr5" style="font-size: 28rpx"
|
||||
>{{ select.engineeringName || emptyEngineeringName }}
|
||||
>{{
|
||||
userInfo.authorities === 'engineering_user'
|
||||
? '创建工程'
|
||||
: select.engineeringName || emptyEngineeringName
|
||||
}}
|
||||
</text>
|
||||
<uni-icons type="bottom" size="16" color="#111" v-if="select.engineeringName"></uni-icons>
|
||||
<uni-icons
|
||||
type="bottom"
|
||||
size="16"
|
||||
color="#111"
|
||||
v-if="select.engineeringName && userInfo.authorities != 'engineering_user'"
|
||||
></uni-icons>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<view class="index">
|
||||
@@ -32,7 +41,13 @@
|
||||
<ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'" />
|
||||
<!-- 游客 -->
|
||||
<YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"></YouKe>
|
||||
<template v-show="engineeringList.length">
|
||||
<!-- 工程列表 -->
|
||||
<template v-show="engineeringList.length" v-if="userInfo.authorities === 'engineering_user'">
|
||||
<view class="canneng-index-title mt20">工程列表</view>
|
||||
<Engineering ref="engineering" :store="store" @refresh="store.search()"/>
|
||||
</template>
|
||||
<!-- 设备列表 -->
|
||||
<template v-else v-show="engineeringList.length">
|
||||
<view class="canneng-index-title mt20">设备列表</view>
|
||||
<Device ref="device" :store="store" />
|
||||
</template>
|
||||
@@ -47,6 +62,7 @@ import ZhuYongHu from './comp/indexZhuYongHu.vue'
|
||||
import ZhuanZhi from './comp/indexZhuanZhi.vue'
|
||||
import YouKe from './comp/indexYouKe.vue'
|
||||
import Device from './comp/device.vue'
|
||||
import Engineering from './comp/engineering.vue'
|
||||
import list from '../../common/js/list'
|
||||
import { getDevCount } from '../../common/api/device.js'
|
||||
import { queryEngineering } from '@/common/api/engineering.js'
|
||||
@@ -60,6 +76,7 @@ export default {
|
||||
ZhuanZhi,
|
||||
YouKe,
|
||||
Device,
|
||||
Engineering,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -88,7 +105,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
selectEngineering() {
|
||||
if (this.select.engineeringName) {
|
||||
if (this.userInfo.authorities === 'engineering_user') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new',
|
||||
})
|
||||
} else if (this.select.engineeringName) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/selectEngineering',
|
||||
})
|
||||
@@ -140,6 +161,7 @@ export default {
|
||||
console.log(this.$refs.device, 'this.$refs.device')
|
||||
this.$nextTick(() => {
|
||||
this.$refs.device && this.$refs.device.init()
|
||||
this.$refs.engineering && this.$refs.engineering.init()
|
||||
})
|
||||
}
|
||||
this.$refs.gongCheng?.init()
|
||||
@@ -175,7 +197,7 @@ export default {
|
||||
if (messagePage) {
|
||||
uni.setTabBarBadge({
|
||||
index: 1,
|
||||
text:messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '',
|
||||
text: messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '',
|
||||
})
|
||||
} else {
|
||||
uni.removeTabBarBadge({
|
||||
@@ -197,8 +219,10 @@ export default {
|
||||
// #endif
|
||||
})
|
||||
},
|
||||
// 动态配置导航栏按钮
|
||||
},
|
||||
onLoad() {
|
||||
// 页面加载时,动态配置导航栏按钮
|
||||
if (!uni.getStorageSync(this.$cacheKey.access_token)) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/user/login',
|
||||
@@ -216,7 +240,11 @@ export default {
|
||||
}, 1000)
|
||||
}
|
||||
this.timer = setInterval(this.getDevCount, 1000 * 60) // 定时请求
|
||||
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||
|
||||
this.store =
|
||||
uni.getStorageSync(this.$cacheKey.userInfo).authorities === 'engineering_user'
|
||||
? this.DataSource('/cs-harmonic-boot/homePage/getEngineeringHomePage')
|
||||
: this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
|
||||
Reference in New Issue
Block a user