Commit 90fc9fc773a1acd066426a599248576e14684e97

Authored by xp.Huang
2 parents d92728ee dfd91a1b

Merge branch 'fix/scroll-bug' into 'main_dev'

fix: 修复下拉刷新组件的出现问题

See merge request yunteng/thingskit-app!128
@@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
73 data() { 73 data() {
74 return { 74 return {
75 handleText: ['ACTIVE_UNACK', 'CLEARED_UNACK'], 75 handleText: ['ACTIVE_UNACK', 'CLEARED_UNACK'],
76 - clearText: ['ACTIVE_UNACK', 'ACTIVE_ACK'], 76 + clearText: [ 'ACTIVE_ACK'],
77 hasColor: ['告警级别:', '告警状态:'], 77 hasColor: ['告警级别:', '告警状态:'],
78 alarmSeverity, 78 alarmSeverity,
79 alarmStatus, 79 alarmStatus,
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
9 @clickTag="currentIndex => handleClickTag(currentIndex, alarmStatus)"></query-item> 9 @clickTag="currentIndex => handleClickTag(currentIndex, alarmStatus)"></query-item>
10 <query-item :filterList="typeStatus" title="设备类型" 10 <query-item :filterList="typeStatus" title="设备类型"
11 @clickTag="currentIndex => handleClickTag(currentIndex, typeStatus)"></query-item> 11 @clickTag="currentIndex => handleClickTag(currentIndex, typeStatus)"></query-item>
  12 + <query-item :filterList="collectStatus" title="设备是否收藏"
  13 + @clickTag="currentIndex => handleClickTag(currentIndex, collectStatus)"></query-item>
12 <view class="button-group"> 14 <view class="button-group">
13 <view> 15 <view>
14 <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" text="重置" 16 <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" text="重置"
@@ -27,7 +29,8 @@ @@ -27,7 +29,8 @@
27 import { 29 import {
28 deviceStatus, 30 deviceStatus,
29 alarmStatus, 31 alarmStatus,
30 - typeStatus 32 + typeStatus,
  33 + collectStatus
31 } from '../config/data.js' 34 } from '../config/data.js'
32 35
33 export default { 36 export default {
@@ -41,7 +44,8 @@ @@ -41,7 +44,8 @@
41 return { 44 return {
42 deviceStatus, 45 deviceStatus,
43 alarmStatus, 46 alarmStatus,
44 - typeStatus 47 + typeStatus,
  48 + collectStatus
45 } 49 }
46 }, 50 },
47 methods: { 51 methods: {
@@ -61,9 +65,11 @@ @@ -61,9 +65,11 @@
61 const deviceState = this.deviceStatus.find(item => item.checked); 65 const deviceState = this.deviceStatus.find(item => item.checked);
62 const alarmStatus = this.alarmStatus.find(item => item.checked); 66 const alarmStatus = this.alarmStatus.find(item => item.checked);
63 const deviceType = this.typeStatus.find(item => item.checked); 67 const deviceType = this.typeStatus.find(item => item.checked);
  68 + const isCollect = this.collectStatus.find(item => item.checked)
64 this.$emit('queryCondition', { 69 this.$emit('queryCondition', {
65 deviceState: deviceState.type ? deviceState.type : undefined, 70 deviceState: deviceState.type ? deviceState.type : undefined,
66 deviceType: deviceType.type ? deviceType.type : undefined, 71 deviceType: deviceType.type ? deviceType.type : undefined,
  72 + isCollect:isCollect.type?isCollect.type:undefined,
67 alarmStatus: alarmStatus.type === 0 || alarmStatus.type === 1 ? alarmStatus.type : undefined 73 alarmStatus: alarmStatus.type === 0 || alarmStatus.type === 1 ? alarmStatus.type : undefined
68 }) 74 })
69 }, 75 },
@@ -92,4 +98,4 @@ @@ -92,4 +98,4 @@
92 } 98 }
93 } 99 }
94 } 100 }
95 -</style>  
  101 +</style>
@@ -57,9 +57,27 @@ const typeStatus = [{ @@ -57,9 +57,27 @@ const typeStatus = [{
57 type: 'SENSOR' 57 type: 'SENSOR'
58 } 58 }
59 ] 59 ]
  60 +const collectStatus = [
  61 + {
  62 + checked: true,
  63 + name: '全部',
  64 + type: ''
  65 + },
  66 + {
  67 + checked: false,
  68 + name: '是',
  69 + type: '1'
  70 + },
  71 + {
  72 + checked: false,
  73 + name: '否',
  74 + type: '0'
  75 + },
  76 +]
60 77
61 export { 78 export {
62 deviceStatus, 79 deviceStatus,
63 alarmStatus, 80 alarmStatus,
64 - typeStatus  
65 -}  
  81 + typeStatus,
  82 + collectStatus
  83 +}
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <!-- 设备头部 --> 3 <!-- 设备头部 -->
4 <header-search @openOrg="openOrg" @openSearchDialog="openSearchDialog" :total="total" :totalText="totalText"> 4 <header-search @openOrg="openOrg" @openSearchDialog="openSearchDialog" :total="total" :totalText="totalText">
5 <!-- 不能写在封装组件里传placeholder,mp-wenxin端编译要报错 --> 5 <!-- 不能写在封装组件里传placeholder,mp-wenxin端编译要报错 -->
6 - <u--input prefixIcon="search" placeholder="请输入设备SN或名称搜索" shape="circle" @change="inputChanged"> 6 + <u--input prefixIcon="search" placeholder="请输入设备名称或别名搜索" shape="circle" @change="inputChanged">
7 </u--input> 7 </u--input>
8 </header-search> 8 </header-search>
9 <!-- 设备分页 --> 9 <!-- 设备分页 -->
@@ -220,4 +220,4 @@ @@ -220,4 +220,4 @@
220 } 220 }
221 } 221 }
222 } 222 }
223 -</style>  
  223 +</style>
@@ -5,11 +5,12 @@ @@ -5,11 +5,12 @@
5 <header-org @openOrg="openOrg" :total="cameraTotal" title="摄像头数:" :imageSrc="imageSrc"></header-org> 5 <header-org @openOrg="openOrg" :total="cameraTotal" title="摄像头数:" :imageSrc="imageSrc"></header-org>
6 <view style="height: 150rpx;"></view> 6 <view style="height: 150rpx;"></view>
7 <!-- 自带分页组件 --> 7 <!-- 自带分页组件 -->
8 - <mescroll-body ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback" 8 + <mescroll-body height="80%" ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback"
9 @up="upCallback"> 9 @up="upCallback">
10 <view class="camera-container"> 10 <view class="camera-container">
11 <view class="container-item"> 11 <view class="container-item">
12 - <view v-for="(item, index) in list" :key="item.id" class="item"> 12 + <!-- #ifdef MP-WEIXIN -->
  13 + <view v-for="(item, index) in list" :key="item.id" class="item" >
13 <video :data-id="item.id" :data-accessMode="item.accessMode" :key="item.id" preload="none" 14 <video :data-id="item.id" :data-accessMode="item.accessMode" :key="item.id" preload="none"
14 :id="'video' + item.id" class="video" :src="item.videoUrl" controls :title="item.name" 15 :id="'video' + item.id" class="video" :src="item.videoUrl" controls :title="item.name"
15 x5-video-player-type="h5" x5-video-orientation="portraint" show-mute-btn 16 x5-video-player-type="h5" x5-video-orientation="portraint" show-mute-btn
@@ -18,9 +19,21 @@ @@ -18,9 +19,21 @@
18 <text class="text">{{ item.name }}</text> 19 <text class="text">{{ item.name }}</text>
19 </view> 20 </view>
20 </view> 21 </view>
  22 + <!-- #endif -->
  23 + <!-- #ifdef APP-PLUS -->
  24 + <cover-view v-for="(item, index) in list" :key="item.id" class="item" style="overflow: hidden;">
  25 + <video :data-id="item.id" :data-accessMode="item.accessMode" :key="item.id" preload="none"
  26 + :id="'video' + item.id" class="video" :src="item.videoUrl" controls :title="item.name"
  27 + x5-video-player-type="h5" x5-video-orientation="portraint" show-mute-btn
  28 + :poster="item.avatar" @play="playVideo"></video>
  29 + <cover-view class="bottom-text text-clip w-300">
  30 + <cover-view class="text">{{ item.name }}</cover-view>
  31 + </cover-view>
  32 + </cover-view>
  33 + <!-- #endif -->
21 </view> 34 </view>
22 </view> 35 </view>
23 - <mescroll-empty v-if="!list.length" /> 36 + <!-- <mescroll-empty v-if="!list.length" /> -->
24 </mescroll-body> 37 </mescroll-body>
25 <!-- 自带分页组件 --> 38 <!-- 自带分页组件 -->
26 <view style="height: 60rpx;"></view> 39 <view style="height: 60rpx;"></view>
@@ -98,8 +111,14 @@ @@ -98,8 +111,14 @@
98 }) 111 })
99 if (res) { 112 if (res) {
100 uni.stopPullDownRefresh(); 113 uni.stopPullDownRefresh();
101 - this.mescroll.endByPage(res.items.length, res.total); 114 + this.mescroll.endBySize(res.items.length, res.total);
102 this.cameraTotal = res.total; 115 this.cameraTotal = res.total;
  116 + if(!res.items.length && res.total==0){
  117 + this.mescroll.showEmpty()
  118 + }else{
  119 + this.mescroll.removeEmpty()
  120 + }
  121 +
103 if (pageNo == 1) { 122 if (pageNo == 1) {
104 this.list = res.items; 123 this.list = res.items;
105 } else { 124 } else {
@@ -14,9 +14,9 @@ @@ -14,9 +14,9 @@
14 <!-- 公共组件-每个页面必须引入 --> 14 <!-- 公共组件-每个页面必须引入 -->
15 <public-module></public-module> 15 <public-module></public-module>
16 <!-- 自带分页组件 --> 16 <!-- 自带分页组件 -->
17 - <mescroll-body ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback" 17 + <mescroll-body height="80%" :page="page" ref="mescrollRef" :empty="{use:false}" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback"
18 @up="upCallback"> 18 @up="upCallback">
19 - <view class="configuation-container" v-if="list.length"> 19 + <view class="configuation-container" >
20 <view class="configuation-item"> 20 <view class="configuation-item">
21 <view @click="openConfigDetail(item)" v-for="(item, index) in list" :key="index" class="item"> 21 <view @click="openConfigDetail(item)" v-for="(item, index) in list" :key="index" class="item">
22 <image class="image" :src="item.icon || defaultConfigImage"></image> 22 <image class="image" :src="item.icon || defaultConfigImage"></image>
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 auto: true //是否在初始化后,自动执行downCallback; 默认true 59 auto: true //是否在初始化后,自动执行downCallback; 默认true
60 }, 60 },
61 upOption: { 61 upOption: {
62 - auto: false // 不自动加载 62 + auto: false, // 不自动加载
63 }, 63 },
64 list: [], 64 list: [],
65 total:0, 65 total:0,
@@ -75,6 +75,7 @@ @@ -75,6 +75,7 @@
75 }, 75 },
76 onShow() { 76 onShow() {
77 if (this.ordId) { 77 if (this.ordId) {
  78 + this.page.num = 1
78 this.loadData(1,null, this.ordId); 79 this.loadData(1,null, this.ordId);
79 } 80 }
80 }, 81 },
@@ -127,8 +128,13 @@ @@ -127,8 +128,13 @@
127 }) 128 })
128 if (res) { 129 if (res) {
129 uni.stopPullDownRefresh(); 130 uni.stopPullDownRefresh();
130 - this.mescroll.endByPage(res.items.length, res.total); 131 + this.mescroll.endBySize(res.items.length, res.total);
131 this.total = res.total; 132 this.total = res.total;
  133 + if(!res.items.length && res.total==0){
  134 + this.mescroll.showEmpty()
  135 + }else{
  136 + this.mescroll.removeEmpty()
  137 + }
132 if (pageNo == 1) { 138 if (pageNo == 1) {
133 this.list = res.items; 139 this.list = res.items;
134 } else { 140 } else {
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <!-- 公共组件-每个页面必须引入 --> 14 <!-- 公共组件-每个页面必须引入 -->
15 <public-module></public-module> 15 <public-module></public-module>
16 <!-- 自带分页组件 --> 16 <!-- 自带分页组件 -->
17 - <mescroll-body ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback" 17 + <mescroll-body height="80%" ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback"
18 @up="upCallback"> 18 @up="upCallback">
19 <view class="configuation-container"> 19 <view class="configuation-container">
20 <view class="configuation-item"> 20 <view class="configuation-item">
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 </view> 24 </view>
25 </view> 25 </view>
26 </view> 26 </view>
27 - <mescroll-empty v-if="!list.length" /> 27 + <!-- <mescroll-empty v-if="!list.length" /> -->
28 </mescroll-body> 28 </mescroll-body>
29 <!-- 自带分页组件 --> 29 <!-- 自带分页组件 -->
30 <view style="height: 60rpx;"></view> 30 <view style="height: 60rpx;"></view>
@@ -122,8 +122,13 @@ @@ -122,8 +122,13 @@
122 }) 122 })
123 if (res) { 123 if (res) {
124 uni.stopPullDownRefresh(); 124 uni.stopPullDownRefresh();
125 - this.mescroll.endByPage(res.items.length, res.total); 125 + this.mescroll.endBySize(res.items.length, res.total);
126 this.total = res.total; 126 this.total = res.total;
  127 + if(!res.items.length && res.total==0){
  128 + this.mescroll.showEmpty()
  129 + }else{
  130 + this.mescroll.removeEmpty()
  131 + }
127 if (pageNo == 1) { 132 if (pageNo == 1) {
128 this.list = res.items; 133 this.list = res.items;
129 } else { 134 } else {
@@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
17 .item { 17 .item {
18 margin-top: 80rpx; 18 margin-top: 80rpx;
19 width: 330rpx; 19 width: 330rpx;
20 - height: 200rpx;  
21 - background-color: #fff; 20 + height: 206rpx;
  21 + // background-color: #fff;
22 border-radius: 10px; 22 border-radius: 10px;
23 margin-left: 25rpx; 23 margin-left: 25rpx;
24 margin-right: 21rpx; 24 margin-right: 21rpx;
@@ -28,9 +28,8 @@ @@ -28,9 +28,8 @@
28 height: 200rpx; 28 height: 200rpx;
29 } 29 }
30 .bottom-text { 30 .bottom-text {
31 - position: relative;  
32 - top: 8rpx;  
33 text-align: center; 31 text-align: center;
  32 + height:50rpx;
34 .text { 33 .text {
35 color: #333333; 34 color: #333333;
36 font-size: 13px; 35 font-size: 13px;