页面接口推介

This commit is contained in:
仲么了
2023-07-31 09:00:30 +08:00
parent 863d30ee61
commit 77b4ff6f88
30 changed files with 928 additions and 652 deletions

View File

@@ -36,20 +36,12 @@
<view class="mine-nav-label">扫一扫</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('engineering')" v-if="userInfo.authorities === 'engineering_user' || userInfo.authorities === 'app_vip_user'">
<view class="mine-nav" @click="jump('engineering')">
<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')"
v-if="
userInfo.authorities === 'app_vip_user' ||
userInfo.authorities === 'engineering_user' ||
userInfo.authorities === 'market_user'
"
>
<view class="mine-nav" @click="jump('project')">
<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>
@@ -57,12 +49,6 @@
<view
class="mine-nav"
@click="jump('gateway')"
v-if="
userInfo.authorities === 'app_vip_user' ||
userInfo.authorities === 'engineering_user' ||
userInfo.authorities == 5 ||
userInfo.authorities === 'market_user'
"
style="border-bottom: none; box-shadow: 0 4rpx 8rpx #e7e7e74c"
>
<image mode="aspectFill" class="mine-nav-icon" src="/static/gateway.png" />
@@ -94,6 +80,7 @@
<script>
import { roleUpdate } from '@/common/api/user'
import { transferDevice } from '@/common/api/device'
export default {
data() {
return {
@@ -114,6 +101,12 @@ export default {
case 'app_vip_user':
roleName = 'VIP用户'
break
case 'market_user':
roleName = '营销用户'
break
case 'operation_manager':
roleName = '运维管理员'
break
}
return roleName
},
@@ -146,9 +139,18 @@ export default {
switch (type) {
case 'scan':
uni.scanCode({
success: function (res) {
success: (res) => {
console.log('条码类型:' + res.scanType)
console.log('条码内容:' + res.result)
let content = JSON.parse(res.result)
switch (content.type) {
case 'transferDevice':
this.transferDevice(content.id)
break
default:
break
}
},
})
break
@@ -187,6 +189,11 @@ export default {
break
}
},
transferDevice(id) {
transferDevice(id).then((res) => {
uni.navigateTo({ url: '/pages/mine/result?type=transferDevice&id=' + id })
})
},
},
onShow() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)