Commit dfd91a1b7f63abae1e6ef098511f53b39d616825
Committed by
xp.Huang
1 parent
d92728ee
fix: 修复下拉刷新组件的出现问题
Showing
8 changed files
with
76 additions
and
23 deletions
... | ... | @@ -9,6 +9,8 @@ |
9 | 9 | @clickTag="currentIndex => handleClickTag(currentIndex, alarmStatus)"></query-item> |
10 | 10 | <query-item :filterList="typeStatus" title="设备类型" |
11 | 11 | @clickTag="currentIndex => handleClickTag(currentIndex, typeStatus)"></query-item> |
12 | + <query-item :filterList="collectStatus" title="设备是否收藏" | |
13 | + @clickTag="currentIndex => handleClickTag(currentIndex, collectStatus)"></query-item> | |
12 | 14 | <view class="button-group"> |
13 | 15 | <view> |
14 | 16 | <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" text="重置" |
... | ... | @@ -27,7 +29,8 @@ |
27 | 29 | import { |
28 | 30 | deviceStatus, |
29 | 31 | alarmStatus, |
30 | - typeStatus | |
32 | + typeStatus, | |
33 | + collectStatus | |
31 | 34 | } from '../config/data.js' |
32 | 35 | |
33 | 36 | export default { |
... | ... | @@ -41,7 +44,8 @@ |
41 | 44 | return { |
42 | 45 | deviceStatus, |
43 | 46 | alarmStatus, |
44 | - typeStatus | |
47 | + typeStatus, | |
48 | + collectStatus | |
45 | 49 | } |
46 | 50 | }, |
47 | 51 | methods: { |
... | ... | @@ -61,9 +65,11 @@ |
61 | 65 | const deviceState = this.deviceStatus.find(item => item.checked); |
62 | 66 | const alarmStatus = this.alarmStatus.find(item => item.checked); |
63 | 67 | const deviceType = this.typeStatus.find(item => item.checked); |
68 | + const isCollect = this.collectStatus.find(item => item.checked) | |
64 | 69 | this.$emit('queryCondition', { |
65 | 70 | deviceState: deviceState.type ? deviceState.type : undefined, |
66 | 71 | deviceType: deviceType.type ? deviceType.type : undefined, |
72 | + isCollect:isCollect.type?isCollect.type:undefined, | |
67 | 73 | alarmStatus: alarmStatus.type === 0 || alarmStatus.type === 1 ? alarmStatus.type : undefined |
68 | 74 | }) |
69 | 75 | }, |
... | ... | @@ -92,4 +98,4 @@ |
92 | 98 | } |
93 | 99 | } |
94 | 100 | } |
95 | -</style> | |
\ No newline at end of file | ||
101 | +</style> | ... | ... |
... | ... | @@ -57,9 +57,27 @@ const typeStatus = [{ |
57 | 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 | 78 | export { |
62 | 79 | deviceStatus, |
63 | 80 | alarmStatus, |
64 | - typeStatus | |
65 | -} | |
\ No newline at end of file | ||
81 | + typeStatus, | |
82 | + collectStatus | |
83 | +} | ... | ... |
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <!-- 设备头部 --> |
4 | 4 | <header-search @openOrg="openOrg" @openSearchDialog="openSearchDialog" :total="total" :totalText="totalText"> |
5 | 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 | 7 | </u--input> |
8 | 8 | </header-search> |
9 | 9 | <!-- 设备分页 --> |
... | ... | @@ -220,4 +220,4 @@ |
220 | 220 | } |
221 | 221 | } |
222 | 222 | } |
223 | -</style> | |
\ No newline at end of file | ||
223 | +</style> | ... | ... |
... | ... | @@ -5,11 +5,12 @@ |
5 | 5 | <header-org @openOrg="openOrg" :total="cameraTotal" title="摄像头数:" :imageSrc="imageSrc"></header-org> |
6 | 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 | 9 | @up="upCallback"> |
10 | 10 | <view class="camera-container"> |
11 | 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 | 14 | <video :data-id="item.id" :data-accessMode="item.accessMode" :key="item.id" preload="none" |
14 | 15 | :id="'video' + item.id" class="video" :src="item.videoUrl" controls :title="item.name" |
15 | 16 | x5-video-player-type="h5" x5-video-orientation="portraint" show-mute-btn |
... | ... | @@ -18,9 +19,21 @@ |
18 | 19 | <text class="text">{{ item.name }}</text> |
19 | 20 | </view> |
20 | 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 | 34 | </view> |
22 | 35 | </view> |
23 | - <mescroll-empty v-if="!list.length" /> | |
36 | + <!-- <mescroll-empty v-if="!list.length" /> --> | |
24 | 37 | </mescroll-body> |
25 | 38 | <!-- 自带分页组件 --> |
26 | 39 | <view style="height: 60rpx;"></view> |
... | ... | @@ -98,8 +111,14 @@ |
98 | 111 | }) |
99 | 112 | if (res) { |
100 | 113 | uni.stopPullDownRefresh(); |
101 | - this.mescroll.endByPage(res.items.length, res.total); | |
114 | + this.mescroll.endBySize(res.items.length, res.total); | |
102 | 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 | 122 | if (pageNo == 1) { |
104 | 123 | this.list = res.items; |
105 | 124 | } else { | ... | ... |
... | ... | @@ -14,9 +14,9 @@ |
14 | 14 | <!-- 公共组件-每个页面必须引入 --> |
15 | 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 | 18 | @up="upCallback"> |
19 | - <view class="configuation-container" v-if="list.length"> | |
19 | + <view class="configuation-container" > | |
20 | 20 | <view class="configuation-item"> |
21 | 21 | <view @click="openConfigDetail(item)" v-for="(item, index) in list" :key="index" class="item"> |
22 | 22 | <image class="image" :src="item.icon || defaultConfigImage"></image> |
... | ... | @@ -59,7 +59,7 @@ |
59 | 59 | auto: true //是否在初始化后,自动执行downCallback; 默认true |
60 | 60 | }, |
61 | 61 | upOption: { |
62 | - auto: false // 不自动加载 | |
62 | + auto: false, // 不自动加载 | |
63 | 63 | }, |
64 | 64 | list: [], |
65 | 65 | total:0, |
... | ... | @@ -75,6 +75,7 @@ |
75 | 75 | }, |
76 | 76 | onShow() { |
77 | 77 | if (this.ordId) { |
78 | + this.page.num = 1 | |
78 | 79 | this.loadData(1,null, this.ordId); |
79 | 80 | } |
80 | 81 | }, |
... | ... | @@ -127,8 +128,13 @@ |
127 | 128 | }) |
128 | 129 | if (res) { |
129 | 130 | uni.stopPullDownRefresh(); |
130 | - this.mescroll.endByPage(res.items.length, res.total); | |
131 | + this.mescroll.endBySize(res.items.length, res.total); | |
131 | 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 | 138 | if (pageNo == 1) { |
133 | 139 | this.list = res.items; |
134 | 140 | } else { | ... | ... |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | <!-- 公共组件-每个页面必须引入 --> |
15 | 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 | 18 | @up="upCallback"> |
19 | 19 | <view class="configuation-container"> |
20 | 20 | <view class="configuation-item"> |
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | </view> |
25 | 25 | </view> |
26 | 26 | </view> |
27 | - <mescroll-empty v-if="!list.length" /> | |
27 | + <!-- <mescroll-empty v-if="!list.length" /> --> | |
28 | 28 | </mescroll-body> |
29 | 29 | <!-- 自带分页组件 --> |
30 | 30 | <view style="height: 60rpx;"></view> |
... | ... | @@ -122,8 +122,13 @@ |
122 | 122 | }) |
123 | 123 | if (res) { |
124 | 124 | uni.stopPullDownRefresh(); |
125 | - this.mescroll.endByPage(res.items.length, res.total); | |
125 | + this.mescroll.endBySize(res.items.length, res.total); | |
126 | 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 | 132 | if (pageNo == 1) { |
128 | 133 | this.list = res.items; |
129 | 134 | } else { | ... | ... |
... | ... | @@ -17,8 +17,8 @@ |
17 | 17 | .item { |
18 | 18 | margin-top: 80rpx; |
19 | 19 | width: 330rpx; |
20 | - height: 200rpx; | |
21 | - background-color: #fff; | |
20 | + height: 206rpx; | |
21 | + // background-color: #fff; | |
22 | 22 | border-radius: 10px; |
23 | 23 | margin-left: 25rpx; |
24 | 24 | margin-right: 21rpx; |
... | ... | @@ -28,9 +28,8 @@ |
28 | 28 | height: 200rpx; |
29 | 29 | } |
30 | 30 | .bottom-text { |
31 | - position: relative; | |
32 | - top: 8rpx; | |
33 | 31 | text-align: center; |
32 | + height:50rpx; | |
34 | 33 | .text { |
35 | 34 | color: #333333; |
36 | 35 | font-size: 13px; | ... | ... |