列表优化

This commit is contained in:
仲么了
2023-11-06 11:01:29 +08:00
parent bb95331392
commit 7e90d2b6e1
12 changed files with 296 additions and 123 deletions

View File

@@ -1,9 +1,6 @@
export default { export default {
onPullDownRefresh() { onPullDownRefresh() {
this.store && this.store.reload() this.store && this.store.reload()
this.store.loadedCallback = () => {
uni.stopPullDownRefresh()
}
}, },
onReachBottom() { onReachBottom() {
if (this.store.status != 'noMore') { if (this.store.status != 'noMore') {
@@ -20,7 +17,7 @@ export default {
var me = this var me = this
return { return {
data: [], data: [],
status: 'more', status: 'noMore',
empty: false, empty: false,
total: 0, total: 0,
header: { header: {
@@ -35,9 +32,8 @@ export default {
firstCallBack: null, firstCallBack: null,
loadedCallback: null, loadedCallback: null,
reload() { reload() {
if(this.status == 'loading') return if (this.status == 'loading') return
this.data = [] this.data = []
this.status = 'loading'
this.empty = false this.empty = false
this.params.pageNum = 1 this.params.pageNum = 1
this.next() this.next()
@@ -50,6 +46,7 @@ export default {
}, 300) }, 300)
}, },
next() { next() {
this.status = 'loading'
me.$request({ me.$request({
url: url, url: url,
data: this.params, data: this.params,
@@ -68,14 +65,17 @@ export default {
this.status = 'noMore' this.status = 'noMore'
} else if (res.total == resultData.length) { } else if (res.total == resultData.length) {
this.status = 'noMore' this.status = 'noMore'
} else {
this.status = 'more'
} }
} else { } else {
this.data.push(...resultData) this.data.push(...resultData)
if (resultData.length < this.params.pageSize) { if (resultData.length < this.params.pageSize) {
this.status = 'noMore' this.status = 'noMore'
} else {
this.status = 'more'
} }
} }
if (this.params.pageNum == 1) { if (this.params.pageNum == 1) {
this.firstCallBack && this.firstCallBack() this.firstCallBack && this.firstCallBack()
} }
@@ -83,6 +83,7 @@ export default {
this.params.pageNum++ this.params.pageNum++
this.total = res.total this.total = res.total
this.loading = false this.loading = false
uni.stopPullDownRefresh()
}) })
}, },
} }

View File

@@ -2,8 +2,8 @@
"name" : "灿能物联", "name" : "灿能物联",
"appid" : "__UNI__88BC25B", "appid" : "__UNI__88BC25B",
"description" : "", "description" : "",
"versionName" : "1.4.2", "versionName" : "1.4.4",
"versionCode" : 142, "versionCode" : 144,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@@ -7,7 +7,8 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"pullToRefresh": { "pullToRefresh": {
"support":true, "support":true,
"style": "circle" "style": "circle",
"color":"#007aff"
} }
} }
}, },
@@ -194,6 +195,11 @@
{ {
"path": "pages/message/message", "path": "pages/message/message",
"style": { "style": {
"pullToRefresh": {
"support":true,
"style": "circle",
"color":"#007aff"
},
"app-plus": { "app-plus": {
"bounce": "none", "bounce": "none",
//关闭窗口回弹效果 //关闭窗口回弹效果

View File

@@ -1,21 +1,50 @@
<template> <template>
<Cn-page :loading="loading"> <Cn-page :loading="loading">
<view class="content" slot="body"> <view class="content" slot="body">
<uni-list :border="false"> <view class="content-item" v-for="(item, index) in store.data" :key="index" @click="jump(item)">
<uni-list-item <view class="content-item-header">
isDot <uni-badge
show-badge class="uni-badge-left-margin"
badgeType="error" :is-dot="true"
:badge-text="item.status == 1 ? '' : '未读'" :text="item.status == '1' ? 0 : 1"
:title="'告警代码:'+item.code" absolute="rightTop"
:note="item.startTime" size="small"
>
<view class="content-item-header-icon">
<image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image>
</view>
</uni-badge>
<view class="content-item-header-right">
<view class="content-item-header-right-title">{{ item.equipmentName }}</view>
<!-- <view class="content-item-header-right-des">{{ item.engineeringName }} {{ item.projectName }}</view> -->
<view class="content-item-header-right-des">工程名称{{ item.engineeringName }}</view>
<view class="content-item-header-right-des">项目名称{{ item.projectName }}</view>
<!-- <view class="content-item-header-right-des">{{ item.subTitle }}</view> -->
</view>
<view class="ml10" v-if="type === '0' || item.status != '1'">🔍</view>
</view>
<view class="content-item-footer">{{ item.subTitle }}</view>
</view>
<!-- <uni-card
:title="item.equipmentName"
:extra="item.status == '1' ? '' : '未读'"
:sub-title="item.subTitle"
thumbnail="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"
@click="jump(item)" @click="jump(item)"
clickable
v-for="(item, index) in store.data" v-for="(item, index) in store.data"
/> :key="index"
</uni-list> >
<view class="term-list-bottom">
<view class="term-list-bottom-item" v-for="(item2, textIndex) in item.dataSet" :key="textIndex">
{{ item2.showName + ':' + (item2.value == 3.1415926 ? '-' : item2.value) + (item2.unit || '') }}
</view>
</view>
</uni-card> -->
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty> <Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more> <uni-load-more
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"
></uni-load-more>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
@@ -29,13 +58,31 @@ export default {
data() { data() {
return { return {
loading: true, loading: true,
deviceId:'' type: '',
staticIcon: '',
} }
}, },
onLoad(options) { onLoad(o) {
this.deviceId = options.id this.type = '3'
}, this.devId = o.id
onShow() { switch (this.type) {
case '0':
uni.setNavigationBarTitle({ title: '暂态事件' })
this.staticIcon = '/static/zantai2.png'
break
case '1':
uni.setNavigationBarTitle({ title: '稳态事件' })
this.staticIcon = '/static/steady2.png'
break
case '2':
uni.setNavigationBarTitle({ title: '运行事件' })
this.staticIcon = '/static/run2.png'
break
case '3':
uni.setNavigationBarTitle({ title: '设备告警' })
this.staticIcon = '/static/device_bad2.png'
break
}
this.init() this.init()
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@@ -45,9 +92,10 @@ export default {
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
updateStatus({ updateStatus({
type: 3, type: this.type,
eventIds:[] eventIds: [],
}).then(() => { }).then(() => {
this.loading = true
this.store.reload() this.store.reload()
}) })
} }
@@ -57,21 +105,48 @@ export default {
methods: { methods: {
async init() { async init() {
let dictData = await this.$util.getDictData('app_event') let dictData = await this.$util.getDictData('app_event')
console.log(dictData)
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage') this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
this.store.params.type = 3 this.store.params.type = this.type
this.store.params.deviceId = this.deviceId this.store.params.deviceId = this.deviceId
this.store.firstCallBack = (res) => { this.store.loadedCallback = () => {
// this.store.data.forEach((item) => { this.store.data.forEach((item) => {
// item.title = dictData.find((item2) => item2.code === item.tag)?.name if (this.type === '3') {
// }) item.showName = '告警,告警码:' + item.code
// console.log(this.store.data) }
if (this.type !== '0') {
item.subTitle = `${item.startTime}发生${item.showName}`
} else {
item.subTitle =
`${item.startTime}发生${item.showName}` +
item.dataSet
.map((item2) => {
return (
item2.showName +
'' +
(item2.value == 3.1415926 ? '-' : item2.value) +
(item2.unit || '')
)
})
.join('')
}
})
this.loading = false this.loading = false
} }
this.store.reload() this.store.reload()
}, },
jump(item) { jump(item) {
if (this.type === '0') {
let str = JSON.stringify(item).replace(/%/g, '百分比') let str = JSON.stringify(item).replace(/%/g, '百分比')
uni.navigateTo({ url: '/pages/message/reportDetail?detail=' + encodeURIComponent(str) }) uni.navigateTo({ url: '/pages/message/messageDetail?detail=' + encodeURIComponent(str) })
} else {
if (item.status != '1') {
item.status = '1'
updateStatus({
eventIds: [item.id],
})
}
}
}, },
}, },
} }
@@ -79,6 +154,50 @@ export default {
<style lang="scss"> <style lang="scss">
.content { .content {
.content-item {
margin: 20rpx;
padding: 20rpx 20rpx;
box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 6rpx 2rpx;
border-radius: 8rpx;
border: 1px solid #ebeef5;
background: #fff;
.content-item-header {
display: flex;
padding: 20rpx 0;
border-bottom: 1px solid #ebeef5;
.content-item-header-icon {
display: flex;
align-items: center;
justify-content: center;
width: 100rpx;
height: 100rpx;
border-radius: 8rpx;
background: $uni-theme-color;
}
.content-item-header-right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100rpx;
margin-left: 20rpx;
.content-item-header-right-title {
font-size: 28rpx;
font-weight: bold;
color: #111;
}
.content-item-header-right-des {
font-size: 24rpx;
color: #999;
}
}
}
.content-item-footer {
margin-top: 20rpx;
font-size: 24rpx;
color: #999;
}
}
// padding-top: 20rpx; // padding-top: 20rpx;
} }

View File

@@ -3,7 +3,9 @@
<template slot="body"> <template slot="body">
<view class="device"> <view class="device">
<view class="nav" :style="{ top: navTabHeight + 'px' }"> <view class="nav" :style="{ top: navTabHeight + 'px' }">
<view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" <view
class="nav-menu"
:class="{ 'nav-menu-active': select.engineeringName }"
@click="selectEngineering" @click="selectEngineering"
>{{ select.engineeringName || '全部工程' }} >{{ select.engineeringName || '全部工程' }}
<uni-icons <uni-icons
@@ -20,8 +22,11 @@
range-key="text" range-key="text"
v-if="select.engineeringId" v-if="select.engineeringId"
> >
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }" <view
@click="select.selectProject = true"> class="nav-menu"
:class="{ 'nav-menu-active': select.projectName }"
@click="select.selectProject = true"
>
{{ {{
select.projectName select.projectName
? select.projectName.length > 6 ? select.projectName.length > 6
@@ -50,8 +55,11 @@
:range="projectType" :range="projectType"
range-key="text" range-key="text"
> >
<view class="nav-menu" :class="{ 'nav-menu-active': select.runStatusName }" <view
@click="select.runStatusSelect = true"> class="nav-menu"
:class="{ 'nav-menu-active': select.runStatusName }"
@click="select.runStatusSelect = true"
>
{{ {{
select.runStatusName select.runStatusName
? select.runStatusName.length > 4 ? select.runStatusName.length > 4
@@ -81,24 +89,21 @@
</picker> --> </picker> -->
</view> </view>
<view class="content device" :style="{ minHeight: minHeight }"> <view class="content device" :style="{ minHeight: minHeight }">
<Cn-device-card v-for="(item, index) in store.data" :device="item" :key="index"> <Cn-device-card v-for="(item, index) in store.data" :device="item" :key="index"> </Cn-device-card>
</Cn-device-card>
<uni-load-more <uni-load-more
v-if="store.status == 'loading' || store.data.length > 0" v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status" :status="store.status"
></uni-load-more> ></uni-load-more>
<Cn-empty v-else></Cn-empty> <Cn-empty v-else></Cn-empty>
</view> </view>
</view> </view>
</template> </template>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import {getProjectList} from '@/common/api/project' import { getProjectList } from '@/common/api/project'
import {queryDictData} from '@/common/api/dictionary' import { queryDictData } from '@/common/api/dictionary'
import list from "@/common/js/list"; import list from '@/common/js/list'
export default { export default {
mixins: [list], mixins: [list],
@@ -122,24 +127,29 @@ export default {
navTabHeight: 0, navTabHeight: 0,
engineeringList: [], engineeringList: [],
projectList: [], projectList: [],
projectType: [{ projectType: [
{
text: '全部', text: '全部',
value: '', value: '',
}, { },
{
text: '离线', text: '离线',
value: 1 value: 1,
}, { },
{
text: '在线', text: '在线',
value: 2 value: 2,
}], },
pageOptions: {} ],
pageOptions: {},
} }
}, },
watch: { watch: {
select: { select: {
handler(val, oldVal) { handler(val, oldVal) {
if (this.loading) return if (this.loading) return
this.store.params.projectId = val.projectNameIndex === 0 ? '' : this.filterProjectList[val.projectNameIndex].value this.store.params.projectId =
val.projectNameIndex === 0 ? '' : this.filterProjectList[val.projectNameIndex].value
this.store.params.runStatus = val.runStatusIndex === 0 ? '' : this.projectType[val.runStatusIndex].value this.store.params.runStatus = val.runStatusIndex === 0 ? '' : this.projectType[val.runStatusIndex].value
this.store.params.engineerId = val.engineeringId || '' this.store.params.engineerId = val.engineeringId || ''
this.store.reload() this.store.reload()
@@ -149,8 +159,10 @@ export default {
}, },
computed: { computed: {
filterProjectList() { filterProjectList() {
return this.projectList.filter(item => item.engineeringId === this.select.engineeringId || item.value === '-1') return this.projectList.filter(
} (item) => item.engineeringId === this.select.engineeringId || item.value === '-1',
)
},
}, },
onLoad(options) { onLoad(options) {
let engineering = uni.getStorageSync('engineering') let engineering = uni.getStorageSync('engineering')
@@ -240,9 +252,9 @@ export default {
return return
} }
if (this.transfer) { if (this.transfer) {
uni.navigateTo({url: '/pages/device/transfer?id=' + this.checkList.join(',')}) uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
} else if (this.share) { } else if (this.share) {
uni.navigateTo({url: '/pages/device/share?id=' + this.checkList.join(',')}) uni.navigateTo({ url: '/pages/device/share?id=' + this.checkList.join(',') })
} }
this.cancel() this.cancel()
}, },
@@ -255,7 +267,8 @@ export default {
getDeviceList() { getDeviceList() {
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject') this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
this.store.params.engineerId = this.select.engineeringId this.store.params.engineerId = this.select.engineeringId
this.store.params.runStatus = this.select.runStatusIndex === 0 ? '' : this.projectType[this.select.runStatusIndex].value this.store.params.runStatus =
this.select.runStatusIndex === 0 ? '' : this.projectType[this.select.runStatusIndex].value
this.store.params.pageSize = 50 this.store.params.pageSize = 50
this.store.firstCallBack = (res) => { this.store.firstCallBack = (res) => {
this.loading = false this.loading = false
@@ -305,7 +318,7 @@ export default {
}) })
}, },
submitFeedBack() { submitFeedBack() {
uni.navigateTo({url: '/pages/home/feedback'}) uni.navigateTo({ url: '/pages/home/feedback' })
}, },
runStatusChange(e) { runStatusChange(e) {
this.select.runStatusSelect = false this.select.runStatusSelect = false
@@ -333,7 +346,7 @@ export default {
confirmText: '直连设备', confirmText: '直连设备',
cancelText: '网关接入', cancelText: '网关接入',
cancelColor: '#007aff', cancelColor: '#007aff',
success: ({confirm, cancel}) => { success: ({ confirm, cancel }) => {
if (confirm) { if (confirm) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/device/new', url: '/pages/device/new',
@@ -362,6 +375,4 @@ export default {
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss"></style>
</style>

View File

@@ -34,17 +34,17 @@
<view class="term-list-bottom"> <view class="term-list-bottom">
<view class="term-list-bottom-item"> <view class="term-list-bottom-item">
<view>设备个数</view> <view>设备个数</view>
<view>{{item.devNum}}</view> <view>{{ item.devNum }}</view>
</view> </view>
<view class="term-list-bottom-item"> <view class="term-list-bottom-item">
<view>创建时间</view> <view>创建时间</view>
<view>{{item.createTime}}</view> <view>{{ item.createTime }}</view>
</view> </view>
</view> </view>
</uni-card> </uni-card>
<Cn-empty v-if="store.empty"></Cn-empty> <Cn-empty v-if="store.empty"></Cn-empty>
<uni-load-more <uni-load-more
v-if="store.data && store.data.length > 0" v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status" :status="store.status"
></uni-load-more> ></uni-load-more>
</view> </view>

View File

@@ -17,15 +17,20 @@
@clickLeft="back" @clickLeft="back"
@clickRight="add" @clickRight="add"
/> />
<uni-search-bar v-model="store.params.name" clearButton="none" bgColor="#fff" placeholder="请输入关键词" <uni-search-bar
@input="store.search()"></uni-search-bar> v-model="store.params.name"
clearButton="none"
bgColor="#fff"
placeholder="请输入关键词"
@input="store.search()"
></uni-search-bar>
<view class="message"> <view class="message">
<uni-card <uni-card
:title="item.name" :title="item.name"
extra="🔍" extra="🔍"
@click="jump(item)" @click="jump(item)"
v-for="(item, index) in store.data" v-for="(item, index) in store.data"
:style="{marginTop:index===0?'0':''}" :style="{ marginTop: index === 0 ? '0' : '' }"
:key="index" :key="index"
> >
<view class="term-list-bottom"> <view class="term-list-bottom">
@@ -40,7 +45,10 @@
</view> </view>
</uni-card> </uni-card>
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty> <Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more> <uni-load-more
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"
></uni-load-more>
</view> </view>
</view> </view>
</template> </template>
@@ -52,7 +60,7 @@ export default {
mixins: [list], mixins: [list],
data() { data() {
return { return {
loading: false, loading: true,
userInfo: {}, userInfo: {},
} }
}, },

View File

@@ -3,36 +3,45 @@
<view class="message-list-item" v-for="(item, index) in store.data" :key="index" @click="jump(item)"> <view class="message-list-item" v-for="(item, index) in store.data" :key="index" @click="jump(item)">
<view class="hide-txt message-list-item-title">{{ item.title }}</view> <view class="hide-txt message-list-item-title">{{ item.title }}</view>
<view class="message-list-item-footer"> <view class="message-list-item-footer">
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-over" <view
v-if="item.status === '0'"> class="mr20 message-list-item-footer-status message-list-item-footer-status-over"
v-if="item.status === '0'"
>
已解决 已解决
</view> </view>
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-processing" <view
v-else-if="item.status === '1'"> class="mr20 message-list-item-footer-status message-list-item-footer-status-processing"
v-else-if="item.status === '1'"
>
待处理 待处理
</view> </view>
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-handler" <view
v-else-if="item.status === '2'"> class="mr20 message-list-item-footer-status message-list-item-footer-status-handler"
v-else-if="item.status === '2'"
>
处理中 处理中
</view> </view>
<view class="message-list-item-footer-time"> {{ item.createTime }}</view> <view class="message-list-item-footer-time"> {{ item.createTime }}</view>
<uni-badge class="uni-badge-left-margin" :text="item.chatCount"/> <uni-badge class="uni-badge-left-margin" :text="item.chatCount" />
</view> </view>
</view> </view>
<Cn-empty v-if="store.empty"></Cn-empty> <Cn-empty v-if="store.empty"></Cn-empty>
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more> <uni-load-more
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"
></uni-load-more>
</view> </view>
</template> </template>
<script> <script>
import {queryFeedBackPage} from '../../common/api/feedback' import { queryFeedBackPage } from '../../common/api/feedback'
import list from '../../common/js/list' import list from '../../common/js/list'
export default { export default {
mixins: [list], mixins: [list],
data() { data() {
return { return {
title: '灿能' title: '灿能',
} }
}, },
onShow() { onShow() {
@@ -44,9 +53,9 @@ export default {
this.store.reload() this.store.reload()
}, },
jump(item) { jump(item) {
uni.navigateTo({url: '/pages/message/feedbackDetail?id=' + item.id + '&chatCount=' + item.chatCount}) uni.navigateTo({ url: '/pages/message/feedbackDetail?id=' + item.id + '&chatCount=' + item.chatCount })
},
}, },
}
} }
</script> </script>
@@ -109,7 +118,6 @@ export default {
} }
} }
/deep/ .uni-list-item { /deep/ .uni-list-item {
background-color: $uni-theme-white !important; background-color: $uni-theme-white !important;
} }

View File

@@ -41,7 +41,10 @@
</view> </view>
</uni-card> --> </uni-card> -->
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty> <Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more> <uni-load-more
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"
></uni-load-more>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
@@ -79,11 +82,9 @@ export default {
this.staticIcon = '/static/device_bad2.png' this.staticIcon = '/static/device_bad2.png'
break break
} }
},
onShow() {
this.loading = true
this.init() this.init()
}, },
onShow() {},
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@@ -109,6 +110,9 @@ export default {
this.store.params.type = this.type this.store.params.type = this.type
this.store.loadedCallback = () => { this.store.loadedCallback = () => {
this.store.data.forEach((item) => { this.store.data.forEach((item) => {
if (this.type === '3') {
item.showName = '告警,告警码:' + item.code
}
if (this.type !== '0') { if (this.type !== '0') {
item.subTitle = `${item.startTime}发生${item.showName}` item.subTitle = `${item.startTime}发生${item.showName}`
} else { } else {
@@ -126,6 +130,7 @@ export default {
.join('') .join('')
} }
}) })
console.log(this.store.data)
this.loading = false this.loading = false
} }
this.store.reload() this.store.reload()

View File

@@ -1,26 +1,25 @@
<template> <template>
<Cn-page :loading='loading'> <Cn-page :loading="loading">
<view slot='body'> <view slot="body">
<view class='about'> <view class="about">
<image src="/static/logo.png" class="logo"></image> <image src="/static/logo.png" class="logo"></image>
<view class="name">灿能物联</view> <view class="name">灿能物联</view>
<view class="version">Version 1.0.1</view> <view class="version">Version 1.0.2</view>
</view> </view>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
loading: false loading: false,
} }
}, },
methods: { methods: {},
}
} }
</script> </script>
<style lang='scss'> <style lang="scss">
.about { .about {
box-sizing: border-box; box-sizing: border-box;
padding: 34rpx; padding: 34rpx;

View File

@@ -36,7 +36,7 @@
</Cn-device-card> </Cn-device-card>
<Cn-empty v-if="store.empty"></Cn-empty> <Cn-empty v-if="store.empty"></Cn-empty>
<uni-load-more <uni-load-more
v-if="store.data && store.data.length > 0" v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status" :status="store.status"
></uni-load-more> ></uni-load-more>
</view> </view>

View File

@@ -6,20 +6,33 @@
:fixed="true" :fixed="true"
status-bar status-bar
left-icon="left" left-icon="left"
:rightIcon="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user' ? 'plusempty' : ''" :rightIcon="
userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'
? 'plusempty'
: ''
"
background-color="#fff" background-color="#fff"
color="#111" color="#111"
title="项目管理" title="项目管理"
@clickLeft="back" @clickLeft="back"
@clickRight="add" @clickRight="add"
/> />
<uni-search-bar v-model="store.params.searchValue" clearButton="none" bgColor="#fff" placeholder="请输入关键词" <uni-search-bar
@input="store.search()"></uni-search-bar> v-model="store.params.searchValue"
clearButton="none"
bgColor="#fff"
placeholder="请输入关键词"
@input="store.search()"
></uni-search-bar>
<view class="message"> <view class="message">
<uni-card :title="item.name" @click="jump(item)" <uni-card
:title="item.name"
@click="jump(item)"
extra="🔍" extra="🔍"
v-for="(item, index) in store.data" :key="index" v-for="(item, index) in store.data"
:style="{marginTop:index===0?'0':''}"> :key="index"
:style="{ marginTop: index === 0 ? '0' : '' }"
>
<view class="term-list-bottom"> <view class="term-list-bottom">
<view class="term-list-bottom-item"> <view class="term-list-bottom-item">
<view>设备个数</view> <view>设备个数</view>
@@ -32,7 +45,10 @@
</view> </view>
</uni-card> </uni-card>
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty> <Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more> <uni-load-more
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"
></uni-load-more>
</view> </view>
</view> </view>
</template> </template>
@@ -80,13 +96,13 @@ export default {
}) })
}, },
jump(project) { jump(project) {
console.log(project); console.log(project)
uni.navigateTo({ uni.navigateTo({
url: `/pages/project/detail?project=${encodeURIComponent(JSON.stringify(project))}`, url: `/pages/project/detail?project=${encodeURIComponent(JSON.stringify(project))}`,
}) })
}, },
}, },
onLoad({engineeringId}) { onLoad({ engineeringId }) {
this.init(engineeringId) this.init(engineeringId)
}, },
} }