|
|
@@ -94,14 +94,16 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-show="activeTab === 'viewImage'">
|
|
|
- <photoImage
|
|
|
- :images="imageList"
|
|
|
- :pestList="pestList"
|
|
|
- :disableShow="disableShow"
|
|
|
- @changeTab="changeTab"
|
|
|
- :currentYear="currentYear"
|
|
|
- :deviceInfo="deviceInfo"
|
|
|
- />
|
|
|
+ <scroll-view class="scroll-view" scroll-y style="height: 60vh;" @scrolltolower="handleReachBottom">
|
|
|
+ <photoImage
|
|
|
+ :images="imageList"
|
|
|
+ :pestList="pestList"
|
|
|
+ :disableShow="disableShow"
|
|
|
+ @changeTab="changeTab"
|
|
|
+ :currentYear="currentYear"
|
|
|
+ :deviceInfo="deviceInfo"
|
|
|
+ />
|
|
|
+ </scroll-view>
|
|
|
</view>
|
|
|
<view v-show="activeTab === 'deviceData'">
|
|
|
<DeviceData
|
|
|
@@ -171,6 +173,7 @@ export default {
|
|
|
deviceType: '',
|
|
|
location: '',
|
|
|
total: 0,
|
|
|
+ imgTotal: 0,
|
|
|
day: [],
|
|
|
pest: [],
|
|
|
page:1,
|
|
|
@@ -214,6 +217,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleReachBottom(){
|
|
|
+ if (this.activeTab === 'viewImage') {
|
|
|
+ if(this.imageList.length >= this.imgTotal){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.initImageList(true);
|
|
|
+ }
|
|
|
+ },
|
|
|
handleSimClick(){
|
|
|
// this.showSim = true;
|
|
|
//`/pages/deviceDetails/weatherStation/${type}?deviceInfo=${encodeURIComponent(JSON.stringify(this.deviceInfo))}`
|
|
|
@@ -377,7 +388,13 @@ export default {
|
|
|
});
|
|
|
this.deviceStatic = res;
|
|
|
},
|
|
|
- async initImageList(){
|
|
|
+ async initImageList(isLoadMore){
|
|
|
+ if(isLoadMore){
|
|
|
+ this.page++;
|
|
|
+ }
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ })
|
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=forecast.new_cbd.photo_list',
|
|
|
method: 'POST',
|
|
|
@@ -393,7 +410,13 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
const data = res?.data || [];
|
|
|
- this.imageList = data
|
|
|
+ uni.hideLoading();
|
|
|
+ this.imgTotal = res?.num || 0;
|
|
|
+ if (isLoadMore) {
|
|
|
+ this.imageList = [...this.imageList, ...data];
|
|
|
+ } else {
|
|
|
+ this.imageList = data;
|
|
|
+ }
|
|
|
},
|
|
|
async initPest(){
|
|
|
const res = await this.$myRequest({
|