提交app
This commit is contained in:
@@ -107,9 +107,7 @@ export default {
|
||||
array: ['发生时间', '暂降深度', '持续时间'],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
},
|
||||
mounted() {},
|
||||
|
||||
methods: {
|
||||
setHeight() {
|
||||
@@ -118,10 +116,10 @@ export default {
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 100 || 0
|
||||
this.height = rect?.height + 170 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 90 || 0
|
||||
this.height = rect?.height + 100 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
@@ -129,7 +127,9 @@ export default {
|
||||
async select(val) {
|
||||
this.selectValue = val
|
||||
await this.init()
|
||||
this.setHeight()
|
||||
setTimeout(() => {
|
||||
this.setHeight()
|
||||
}, 200)
|
||||
},
|
||||
init() {
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
|
||||
@@ -35,13 +35,12 @@
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
<!-- <view style="padding: 20rpx 20rpx 0">
|
||||
<Cn-grid title="">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||
<Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item>
|
||||
</Cn-grid>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage('0')">
|
||||
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
|
||||
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
|
||||
<view class="header-item-label">暂态事件数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage('1')">
|
||||
<view class="header-item-value">{{ devCount.harmonicCount || 0 }}</view>
|
||||
<view class="header-item-value">{{ devCount.currentHarmonicCount || 0 }}</view>
|
||||
<view class="header-item-label">稳态事件数</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view class="dateReport">
|
||||
<!-- {{ height }} -->
|
||||
<!-- <view class="pd20">
|
||||
<uni-segmented-control
|
||||
:current="curSub"
|
||||
@@ -97,7 +98,7 @@ export default {
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
// this.setHeight()
|
||||
},
|
||||
methods: {
|
||||
setHeight() {
|
||||
@@ -106,7 +107,7 @@ export default {
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 20 || 0
|
||||
this.height = rect?.height + 80 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 30 || 0
|
||||
@@ -136,10 +137,11 @@ export default {
|
||||
|
||||
select(value) {
|
||||
this.selectValue = value
|
||||
this.init()
|
||||
setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
this.setHeight()
|
||||
}, 100)
|
||||
}, 200)
|
||||
this.init()
|
||||
|
||||
},
|
||||
// 下载
|
||||
download(item) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<!-- 申请报告 -->
|
||||
<view v-show="curSub == 0">
|
||||
<!-- apply -->
|
||||
<Apply :navHeight="navHeight" />
|
||||
<Apply ref="applyRef" :navHeight="navHeight" />
|
||||
</view>
|
||||
|
||||
<!-- 申请记录 -->
|
||||
@@ -158,10 +158,10 @@ export default {
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 115 || 0
|
||||
this.height = rect?.height + 180 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 10 || 0
|
||||
this.height = rect?.height + 110 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
@@ -174,9 +174,11 @@ export default {
|
||||
this.store.reload()
|
||||
},
|
||||
async select(val) {
|
||||
setTimeout(() => {
|
||||
this.setHeight()
|
||||
}, 200)
|
||||
this.selectValue = val
|
||||
await this.init()
|
||||
this.setHeight()
|
||||
},
|
||||
|
||||
sectionChange(index) {
|
||||
@@ -270,6 +272,19 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
// 刷新
|
||||
reload() {
|
||||
console.log(123, this.curSub)
|
||||
|
||||
switch (this.curSub) {
|
||||
case 0:
|
||||
this.$refs.applyRef.store.reload()
|
||||
break
|
||||
case 1:
|
||||
this.store && this.store.reload()
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
}
|
||||
@@ -340,4 +355,9 @@ export default {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.segmented-control {
|
||||
flex: 1;
|
||||
margin-right: 24rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,64 +1,64 @@
|
||||
<template>
|
||||
<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 />
|
||||
<view class="mine-header-name hide-txt">
|
||||
<view>{{ userInfo.nickname }}</view>
|
||||
<view></view>
|
||||
<view class="tag">{{ roleName }}</view>
|
||||
</view>
|
||||
<image
|
||||
src="/static/erweima.png"
|
||||
style="height: 50rpx; width: 50rpx; border-radius: 12rpx"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<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" />
|
||||
<view class="mine-nav-label">角色升级</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<!-- <view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||
<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 />
|
||||
<view class="mine-header-name hide-txt">
|
||||
<view>{{ userInfo.nickname }}</view>
|
||||
<view></view>
|
||||
<view class="tag">{{ roleName }}</view>
|
||||
</view>
|
||||
<image
|
||||
src="/static/erweima.png"
|
||||
style="height: 50rpx; width: 50rpx; border-radius: 12rpx"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<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" />
|
||||
<view class="mine-nav-label">角色升级</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<!-- <view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||
<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> -->
|
||||
|
||||
<!-- <view class="mine-nav" @click="jump('user')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||
<!-- <view class="mine-nav" @click="jump('user')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/subordinate.png" />
|
||||
<view class="mine-nav-label">分享用户列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view> -->
|
||||
<view
|
||||
class="mine-nav"
|
||||
@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" />
|
||||
<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/gongcheng.png" />
|
||||
<view class="mine-nav-label">工程管理</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view
|
||||
class="mine-nav"
|
||||
@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" />
|
||||
<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 !== 'tourist'">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/gongcheng.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" />
|
||||
<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" />
|
||||
<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
|
||||
<view class="mine-nav" @click="jump('project')" v-if="userInfo.authorities !== 'tourist'">
|
||||
<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')" v-if="userInfo.authorities !== 'tourist'">
|
||||
<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
|
||||
class="mine-nav"
|
||||
@click="jump('gateway')"
|
||||
style="border-bottom: none; box-shadow: 0 4rpx 8rpx #e7e7e74c"
|
||||
@@ -67,317 +67,315 @@
|
||||
<view class="mine-nav-label">网关列表</view>
|
||||
<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" />
|
||||
<view class="mine-nav-label">推送通知设置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view
|
||||
class="mine-nav"
|
||||
@click="jump('engineering/setting')"
|
||||
v-if="userInfo.authorities === 'engineering_user'"
|
||||
>
|
||||
<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('transientSetting')" >
|
||||
<!-- 调试内容配置 serverSetting-->
|
||||
<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" />
|
||||
<view class="mine-nav-label">设置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
ref="inputClose"
|
||||
mode="input"
|
||||
title="角色升级"
|
||||
placeholder="请输入六位邀请码"
|
||||
@confirm="upgrade"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="alertDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
style="width: 90%; margin: 5%"
|
||||
type="info"
|
||||
cancelText="禁止"
|
||||
confirmText="允许"
|
||||
title="权限说明"
|
||||
content='是否允许"灿能物联"使用相机?'
|
||||
@confirm="handleScon('camera')"
|
||||
@close="dialogClose"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<uni-popup ref="message" type="message">
|
||||
<uni-popup-message type="info" :duration="0" style="width: 90%; margin: 5%">
|
||||
<view style="color: #909399; font-style: 16px">相机权限使用说明:</view>
|
||||
<view style="color: #6c6c6c; margin-top: 3rpx; "> 用于相机扫描二维码!</view>
|
||||
</uni-popup-message>
|
||||
</uni-popup>
|
||||
<yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" permissionID="CAMERA"></yk-authpup>
|
||||
<view class="mine-nav" @click="jump('setupMessage')" v-if="userInfo.authorities !== 'tourist'">
|
||||
<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>
|
||||
<view
|
||||
class="mine-nav"
|
||||
@click="jump('engineering/setting')"
|
||||
v-if="userInfo.authorities === 'engineering_user' || userInfo.authorities !== 'tourist'"
|
||||
>
|
||||
<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('transientSetting')" v-if="userInfo.authorities !== 'tourist'">
|
||||
<!-- 调试内容配置 serverSetting-->
|
||||
<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" />
|
||||
<view class="mine-nav-label">设置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
ref="inputClose"
|
||||
mode="input"
|
||||
title="角色升级"
|
||||
placeholder="请输入六位邀请码"
|
||||
@confirm="upgrade"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<uni-popup ref="alertDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
style="width: 90%; margin: 5%"
|
||||
type="info"
|
||||
cancelText="禁止"
|
||||
confirmText="允许"
|
||||
title="权限说明"
|
||||
content='是否允许"灿能物联"使用相机?'
|
||||
@confirm="handleScon('camera')"
|
||||
@close="dialogClose"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<uni-popup ref="message" type="message">
|
||||
<uni-popup-message type="info" :duration="0" style="width: 90%; margin: 5%">
|
||||
<view style="color: #909399; font-style: 16px">相机权限使用说明:</view>
|
||||
<view style="color: #6c6c6c; margin-top: 3rpx"> 用于相机扫描二维码!</view>
|
||||
</uni-popup-message>
|
||||
</uni-popup>
|
||||
<yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" permissionID="CAMERA"></yk-authpup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { roleUpdate, autoLogin } from '@/common/api/user'
|
||||
import { transferDevice, shareDevice } from '@/common/api/device'
|
||||
import ykAuthpup from "@/components/yk-authpup/yk-authpup";
|
||||
import ykAuthpup from '@/components/yk-authpup/yk-authpup'
|
||||
export default {
|
||||
components: {
|
||||
ykAuthpup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
userInfo: {},
|
||||
messageCount: {},
|
||||
timer: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
roleName() {
|
||||
let roleName = ''
|
||||
switch (this.userInfo.authorities) {
|
||||
case 'tourist':
|
||||
roleName = '游客'
|
||||
break
|
||||
case 'engineering_user':
|
||||
roleName = '工程用户'
|
||||
break
|
||||
case 'app_vip_user':
|
||||
roleName = '正式用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
break
|
||||
case 'operation_manager':
|
||||
roleName = '运维管理员'
|
||||
break
|
||||
}
|
||||
return roleName
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {},
|
||||
upgrade(code) {
|
||||
console.log(code)
|
||||
roleUpdate({
|
||||
referralCode: code,
|
||||
userId: this.userInfo.userIndex,
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '升级成功',
|
||||
icon: 'none',
|
||||
})
|
||||
uni.removeStorageSync('access_token')
|
||||
// 直接登录
|
||||
autoLogin(this.userInfo.user_name).then((res) => {
|
||||
this.$util.loginSuccess(res.data).then((userInfo) => {
|
||||
this.userInfo = userInfo
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
changeAuth(){
|
||||
//这里是权限通过后执行自己的代码逻辑
|
||||
console.log('权限已授权,可执行自己的代码逻辑了');
|
||||
// this.handleScon()
|
||||
this.handleScon()
|
||||
},
|
||||
jump(type) {
|
||||
switch (type) {
|
||||
case 'scan':
|
||||
if (
|
||||
plus.os.name == 'Android'
|
||||
// && plus.navigator.checkPermission('android.permission.CAMERA') === 'undetermined'
|
||||
) {
|
||||
//未授权
|
||||
// this.$refs.alertDialog.open('bottom')
|
||||
this.$refs['authpup'].open()
|
||||
// this.$refs.message.open()
|
||||
|
||||
} else {
|
||||
console.log(2)
|
||||
this.handleScon()
|
||||
}
|
||||
components: {
|
||||
ykAuthpup,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
userInfo: {},
|
||||
messageCount: {},
|
||||
timer: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
roleName() {
|
||||
let roleName = ''
|
||||
switch (this.userInfo.authorities) {
|
||||
case 'tourist':
|
||||
roleName = '游客'
|
||||
break
|
||||
case 'engineering_user':
|
||||
roleName = '工程用户'
|
||||
break
|
||||
case 'app_vip_user':
|
||||
roleName = '正式用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
break
|
||||
case 'operation_manager':
|
||||
roleName = '运维管理员'
|
||||
break
|
||||
}
|
||||
return roleName
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {},
|
||||
upgrade(code) {
|
||||
console.log(code)
|
||||
roleUpdate({
|
||||
referralCode: code,
|
||||
userId: this.userInfo.userIndex,
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '升级成功',
|
||||
icon: 'none',
|
||||
})
|
||||
uni.removeStorageSync('access_token')
|
||||
// 直接登录
|
||||
autoLogin(this.userInfo.user_name).then((res) => {
|
||||
this.$util.loginSuccess(res.data).then((userInfo) => {
|
||||
this.userInfo = userInfo
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
changeAuth() {
|
||||
//这里是权限通过后执行自己的代码逻辑
|
||||
console.log('权限已授权,可执行自己的代码逻辑了')
|
||||
// this.handleScon()
|
||||
this.handleScon()
|
||||
},
|
||||
jump(type) {
|
||||
switch (type) {
|
||||
case 'scan':
|
||||
if (
|
||||
plus.os.name == 'Android'
|
||||
// && plus.navigator.checkPermission('android.permission.CAMERA') === 'undetermined'
|
||||
) {
|
||||
//未授权
|
||||
// this.$refs.alertDialog.open('bottom')
|
||||
this.$refs['authpup'].open()
|
||||
// this.$refs.message.open()
|
||||
} else {
|
||||
console.log(2)
|
||||
this.handleScon()
|
||||
}
|
||||
|
||||
|
||||
break
|
||||
case 'login':
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/login`,
|
||||
})
|
||||
break
|
||||
case 'gateway':
|
||||
uni.navigateTo({
|
||||
url: `/pages/gateway/list`,
|
||||
})
|
||||
break
|
||||
case 'upgrade':
|
||||
this.$refs.inputDialog.open()
|
||||
break
|
||||
case 'basic':
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/basic`,
|
||||
})
|
||||
break
|
||||
case 'project':
|
||||
uni.navigateTo({
|
||||
url: `/pages/project/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering/setting':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/setting`,
|
||||
})
|
||||
break
|
||||
case 'feedback':
|
||||
uni.navigateTo({
|
||||
url: `/pages/message/feedback`,
|
||||
})
|
||||
break
|
||||
default:
|
||||
uni.navigateTo({
|
||||
url: `/pages/mine/${type}`,
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
handleScon(){
|
||||
this.$refs.message.close()
|
||||
uni.scanCode({
|
||||
onlyFromCamera:true,
|
||||
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.split(','))
|
||||
break
|
||||
case 'shareDevice':
|
||||
this.shareDevice(content.id.split(','))
|
||||
break
|
||||
default:
|
||||
this.$util.toast('无效二维码')
|
||||
break
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
dialogClose(){this.$refs.message.close()},
|
||||
transferDevice(id) {
|
||||
transferDevice(id).then((res) => {
|
||||
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 })
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.loading = false
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
this.timer = setInterval(() => {
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
}, 1000) // 定时请求
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
break
|
||||
case 'login':
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/login`,
|
||||
})
|
||||
break
|
||||
case 'gateway':
|
||||
uni.navigateTo({
|
||||
url: `/pages/gateway/list`,
|
||||
})
|
||||
break
|
||||
case 'upgrade':
|
||||
this.$refs.inputDialog.open()
|
||||
break
|
||||
case 'basic':
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/basic`,
|
||||
})
|
||||
break
|
||||
case 'project':
|
||||
uni.navigateTo({
|
||||
url: `/pages/project/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering/setting':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/setting`,
|
||||
})
|
||||
break
|
||||
case 'feedback':
|
||||
uni.navigateTo({
|
||||
url: `/pages/message/feedback`,
|
||||
})
|
||||
break
|
||||
default:
|
||||
uni.navigateTo({
|
||||
url: `/pages/mine/${type}`,
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
handleScon() {
|
||||
this.$refs.message.close()
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
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.split(','))
|
||||
break
|
||||
case 'shareDevice':
|
||||
this.shareDevice(content.id.split(','))
|
||||
break
|
||||
default:
|
||||
this.$util.toast('无效二维码')
|
||||
break
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
dialogClose() {
|
||||
this.$refs.message.close()
|
||||
},
|
||||
transferDevice(id) {
|
||||
transferDevice(id).then((res) => {
|
||||
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 })
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.loading = false
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
this.timer = setInterval(() => {
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
}, 1000) // 定时请求
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mine {
|
||||
.mine-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 8rpx #e7e7e74c;
|
||||
.mine-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 8rpx #e7e7e74c;
|
||||
|
||||
.mine-header-head {
|
||||
margin-right: 30rpx;
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
.mine-header-head {
|
||||
margin-right: 30rpx;
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mine-header-name {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
.mine-header-name {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
|
||||
.engineering-button {
|
||||
margin-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 12rpx;
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
border-radius: 16rpx;
|
||||
background: $uni-theme-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.engineering-button {
|
||||
margin-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 12rpx;
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
border-radius: 16rpx;
|
||||
background: $uni-theme-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mine-nav {
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
border-bottom: 1rpx solid #e8e8e8;
|
||||
.mine-nav {
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
border-bottom: 1rpx solid #e8e8e8;
|
||||
|
||||
&-icon {
|
||||
margin-right: 30rpx;
|
||||
height: 44rpx;
|
||||
width: 44rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
&-icon {
|
||||
margin-right: 30rpx;
|
||||
height: 44rpx;
|
||||
width: 44rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-label {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #111;
|
||||
}
|
||||
}
|
||||
&-label {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #111;
|
||||
}
|
||||
}
|
||||
}
|
||||
/deep/ .uni-popup-message__box {
|
||||
border-radius: 10rpx !important;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx !important;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view :loading="loading" class="report" style="padding-top: 10px">
|
||||
|
||||
<view class="navReport">
|
||||
<view class="tabsBox">
|
||||
<uni-segmented-control
|
||||
@@ -14,6 +15,7 @@
|
||||
<!-- 稳态报表 -->
|
||||
<SteadyState
|
||||
v-if="curTabs == 0"
|
||||
ref="SteadyStateRef"
|
||||
:indexList="indexList"
|
||||
:total="total"
|
||||
:status="status"
|
||||
@@ -23,6 +25,7 @@
|
||||
<!-- 暂态报表 -->
|
||||
<Transient
|
||||
v-if="curTabs == 1"
|
||||
ref="TransientRef"
|
||||
:indexList="indexList"
|
||||
:total="total"
|
||||
:status="status"
|
||||
@@ -51,58 +54,25 @@ export default {
|
||||
|
||||
navHeight: 0,
|
||||
|
||||
indexList: [
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '2',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '0',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '0',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '0',
|
||||
},
|
||||
],
|
||||
indexList: [],
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
onPullDownRefresh() {
|
||||
this.refresh()
|
||||
},
|
||||
mounted() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.navReport')
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.navHeight = rect.height + 65
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.navHeight = rect.height + 25
|
||||
// #endif
|
||||
this.navHeight = rect.height
|
||||
// // #ifdef H5
|
||||
|
||||
// // #endif
|
||||
// // #ifdef APP-PLUS
|
||||
// this.navHeight = rect.height
|
||||
// // #endif
|
||||
})
|
||||
.exec()
|
||||
},
|
||||
@@ -127,6 +97,16 @@ export default {
|
||||
this.status = 'more'
|
||||
}, 1000)
|
||||
},
|
||||
refresh() {
|
||||
switch (this.curTabs) {
|
||||
case 0:
|
||||
this.$refs.SteadyStateRef.store.reload()
|
||||
break
|
||||
case 1:
|
||||
this.$refs.TransientRef.reload()
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
|
||||
Reference in New Issue
Block a user