设备消息
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<view :loading="loading">
|
||||
<view class="mine">
|
||||
<view class="mine-header" @click="jump('basic')">
|
||||
<image mode="aspectFill" class="mine-header-head" :src="userInfo.avatar" v-if="userInfo.avatar"/>
|
||||
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" v-else/>
|
||||
<image mode="aspectFill" class="mine-header-head" :src="userInfo.avatar" v-if="userInfo.avatar" />
|
||||
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" v-else />
|
||||
<view class="mine-header-name hide-txt">
|
||||
<view>{{ userInfo.nickname }}</view>
|
||||
<view></view>
|
||||
@@ -17,7 +17,7 @@
|
||||
<uni-icons type="forward" color="#aaa" size="16"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" v-if="userInfo.authorities === 'tourist'" @click="jump('upgrade')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
|
||||
<view class="mine-nav-label">角色升级</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
@@ -37,24 +37,25 @@
|
||||
@click="jump('scan')"
|
||||
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
|
||||
>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.png" />
|
||||
<view class="mine-nav-label">扫一扫</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('engineering')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<view class="mine-nav-label">工程列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
|
||||
<view class="mine-nav" @click="jump('project')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<view class="mine-nav-label">项目列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('feedback')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/feedback.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/feedback.png" />
|
||||
<view class="mine-nav-label">反馈列表</view>
|
||||
<uni-badge :text="messageCount.feedBackCount"></uni-badge>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<!-- <view
|
||||
@@ -67,7 +68,7 @@
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view> -->
|
||||
<view class="mine-nav" @click="jump('setupMessage')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/message4.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/message4.png" />
|
||||
<view class="mine-nav-label">消息配置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
@@ -76,17 +77,17 @@
|
||||
@click="jump('engineering/setting')"
|
||||
v-if="userInfo.authorities === 'engineering_user'"
|
||||
>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
|
||||
<view class="mine-nav-label">关注工程配置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('setupServer')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server2.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server2.png" />
|
||||
<view class="mine-nav-label">服务内容配置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('setup')" style="border-bottom: none">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png"/>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" />
|
||||
<view class="mine-nav-label">设置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
@@ -104,14 +105,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {roleUpdate, autoLogin} from '@/common/api/user'
|
||||
import {transferDevice, shareDevice} from '@/common/api/device'
|
||||
import { roleUpdate, autoLogin } from '@/common/api/user'
|
||||
import { transferDevice, shareDevice } from '@/common/api/device'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
userInfo: {},
|
||||
messageCount: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -139,10 +141,12 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.init()
|
||||
setInterval(() => {
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
}, 10000) // 定时请求
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
},
|
||||
init() {},
|
||||
upgrade(code) {
|
||||
console.log(code)
|
||||
roleUpdate({
|
||||
@@ -231,18 +235,19 @@ export default {
|
||||
},
|
||||
transferDevice(id) {
|
||||
transferDevice(id).then((res) => {
|
||||
uni.navigateTo({url: '/pages/mine/result?type=transferDevice&id=' + id})
|
||||
uni.navigateTo({ url: '/pages/mine/result?type=transferDevice&id=' + id })
|
||||
})
|
||||
},
|
||||
shareDevice(id) {
|
||||
shareDevice(id).then((res) => {
|
||||
uni.navigateTo({url: '/pages/mine/result?type=shareDevice&id=' + id})
|
||||
uni.navigateTo({ url: '/pages/mine/result?type=shareDevice&id=' + id })
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.loading = false
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user