APPbug反馈修改
This commit is contained in:
@@ -16,10 +16,30 @@
|
||||
<uni-icons type="bottom" size="14" color="#666"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
<view style="flex: 1"></view>
|
||||
<template v-if="deviceListFilter.length">
|
||||
<template v-if="transfer || share">
|
||||
<view class="nav-menu nav-menu-btn" @click="submit">完成 </view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view
|
||||
class="nav-menu nav-menu-btn"
|
||||
@click="transfer = true"
|
||||
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
|
||||
>移交
|
||||
</view>
|
||||
<view
|
||||
class="nav-menu nav-menu-btn"
|
||||
@click="share = true"
|
||||
v-if="userInfo.authorities === 'app_vip_user'"
|
||||
>分享
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }"
|
||||
>{{ select.projectType || '类型' }}
|
||||
</view>
|
||||
</view>
|
||||
</picker> -->
|
||||
</view>
|
||||
<view class="content device" :style="{ minHeight: minHeight }">
|
||||
@@ -31,15 +51,25 @@
|
||||
v-for="(item, index) in deviceListFilter"
|
||||
:key="index"
|
||||
@click="jump(item)"
|
||||
thumbnail="/static/device.png"
|
||||
:thumbnail="deviceIcon(item.runStatus)"
|
||||
>
|
||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
||||
<template v-slot:title v-if="transfer || share">
|
||||
<view class="switch-title">
|
||||
<view class="switch-title-left">{{ item.equipmentName }}</view>
|
||||
<switch
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8)"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
</uni-card>
|
||||
<Cn-empty v-if="store.empty || deviceListFilter.length == 0"></Cn-empty>
|
||||
<uni-load-more
|
||||
v-if="deviceListFilter && deviceListFilter.length > 0"
|
||||
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else></Cn-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -56,6 +86,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
transfer: false,
|
||||
share: false,
|
||||
checkList: [],
|
||||
select: {
|
||||
projectName: '',
|
||||
projectNameIndex: 0,
|
||||
@@ -67,6 +100,7 @@ export default {
|
||||
projectList: [],
|
||||
projectType: [],
|
||||
navHeight: 0,
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -84,39 +118,66 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.uni-navbar')
|
||||
.boundingClientRect((rect1) => {
|
||||
this.navHeight = rect1.height
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect2) => {
|
||||
// #ifdef H5
|
||||
this.minHeight =
|
||||
'calc(100vh - env(safe-area-inset-bottom) - ' +
|
||||
(50 + (rect2.height + rect1.height)) +
|
||||
'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + (rect2.height + rect1.height) + 'px)'
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
.exec()
|
||||
}, 1000)
|
||||
created() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
},
|
||||
methods: {
|
||||
deviceIcon(e) {
|
||||
let str = ''
|
||||
switch (e) {
|
||||
case 1:
|
||||
str = '/static/device_bad.png'
|
||||
break
|
||||
case 2:
|
||||
str = '/static/device.png'
|
||||
break
|
||||
default:
|
||||
str = '/static/device.png'
|
||||
break
|
||||
}
|
||||
return str
|
||||
},
|
||||
switchChange(e) {
|
||||
console.log(e)
|
||||
let index = this.checkList.indexOf(e.equipmentId)
|
||||
if (index > -1) {
|
||||
this.checkList.splice(index, 1)
|
||||
} else {
|
||||
this.checkList.push(e.equipmentId)
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
console.log(this.checkList)
|
||||
if (this.transfer) {
|
||||
this.transfer = false
|
||||
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
|
||||
} else if (this.share) {
|
||||
this.share = false
|
||||
this.$emit('share', this.shareList)
|
||||
}
|
||||
this.checkList = []
|
||||
},
|
||||
async init() {
|
||||
this.getProjectList()
|
||||
this.getDeviceList()
|
||||
},
|
||||
getDeviceList() {
|
||||
this.store.params.pageSize = 999
|
||||
this.store.firstCallBack = () => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect2) => {
|
||||
if (!rect2) return
|
||||
// #ifdef H5
|
||||
this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + rect2.height) + 'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + rect2.height + 'px)'
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
}
|
||||
this.store.reload()
|
||||
},
|
||||
getProjectList() {
|
||||
@@ -214,4 +275,14 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
<style lang="scss">
|
||||
/deep/ .switch-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
&-left {
|
||||
flex: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user