This commit is contained in:
3321822538@qq.com 2024-06-11 18:02:33 +08:00
parent 1b228b632e
commit 86bb6d7a96

View File

@ -38,7 +38,6 @@
<view class="space-y-13"> <view class="space-y-13">
<view class="list-item" @scrolltolower="onReachBottom" v-for="(item, index) in listData" :key="index"> <view class="list-item" @scrolltolower="onReachBottom" v-for="(item, index) in listData" :key="index">
<view class="group_7 bianhao-top-yi"> <view class="group_7 bianhao-top-yi">
<view class="bianhao-zuo"> <view class="bianhao-zuo">
<text class="font_2" @click="detilsq(item)">{{item.name}}</text> <text class="font_2" @click="detilsq(item)">{{item.name}}</text>
@ -241,6 +240,9 @@
</view> </view>
</view> </view>
<view class="mask" v-if="masks" style="position: fixed;top: 0;left: 0;width: 100%;height: 100vh;background-color: #333;opacity: .5;z-index: 99;">
</view>
<!-- 加载状态 --> <!-- 加载状态 -->
@ -292,7 +294,8 @@
disabledflag: false, disabledflag: false,
tokenflag: false, tokenflag: false,
total:0, total:0,
showflag:false showflag:false,
masks:false
}; };
}, },
onShow() { onShow() {
@ -757,9 +760,9 @@
}, },
// //
async pageData(page, apiary_id, qrcode) { async pageData(page, apiary_id, qrcode) {
uni.showLoading({ // uni.showLoading({
title: '加载中...', // title: '...',
}) // })
await request.get('/api/beehive/index?page=' + this.page, { await request.get('/api/beehive/index?page=' + this.page, {
params: { params: {
page, page,
@ -767,9 +770,9 @@
qrcode qrcode
} }
}).then(res => { }).then(res => {
this.masks = false
uni.hideLoading() uni.hideLoading()
wx.setStorageSync('user_id', res.data.data[0].user_id); wx.setStorageSync('user_id', res.data.data[0].user_id);
// this.listData = JSON.parse(JSON.stringify(res.data.data))
this.total = res.data.total this.total = res.data.total
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
// //
@ -777,10 +780,6 @@
this.page++ this.page++
// uni.hideLoading() // uni.hideLoading()
} }
// wx.pageScrollTo({
// scrollTop: 0,
// duration: 300
// });
// //
wx.stopPullDownRefresh(); wx.stopPullDownRefresh();
// this.$forceUpdate() // this.$forceUpdate()
@ -827,25 +826,26 @@
}) })
}, },
clicktabs(event) { clicktabs(event) {
// this.currentindex= uni.showLoading({
console.log('调用了', event); title: '加载中',
console.log('调用了', this.tabitems); mask: true
})
this.page = 1 this.page = 1
this.listData = [] this.listData = []
this.masks = true
if (event.index = 0) { if (event.index = 0) {
this.checkid = '' this.checkid = ''
this.currentindex = 0 this.currentindex = 0
} else { } else {
this.checkid = event.id this.checkid = event.id
const index = this.tabitems.findIndex(item => item.id === this.checkid); const index = this.tabitems.findIndex(item => item.id === this.checkid);
this.currentindex = index
// this.currentindex
this.currentindex = index;
console.log(this.currentindex, 'this.currentindex this.currentindex ');
// this.currentindex=0
} }
setTimeout(()=>{
this.refresh() this.refresh()
// this.pageData('', event.id) },1000)
}, },
}, },
}; };