From e05d0d7ce54922110a3a5ce55e568bf3b900f73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= <49033970+XiaoMoDonnie@users.noreply.github.com> Date: Tue, 6 Dec 2022 23:18:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E9=87=8D=E5=86=99?= =?UTF-8?q?=E5=8F=8B=E9=93=BE=E5=88=97=E8=A1=A8=EF=BC=8C=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=EF=BC=9B=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=A7=A3=E5=86=B3=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=BB=9A=E5=8A=A8=E5=9B=9E=E5=BC=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabbar/category/category.vue | 19 ++++++++-- pages/tabbar/links/links.vue | 61 ++++++++++++++++-------------- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/pages/tabbar/category/category.vue b/pages/tabbar/category/category.vue index 4b1c948..08cd0a6 100644 --- a/pages/tabbar/category/category.vue +++ b/pages/tabbar/category/category.vue @@ -23,6 +23,10 @@ @refresherrefresh="fnGetData(true)" @scrolltolower="fnGetData(false)" @scroll="fnOnScroll" + @touchmove.stop + @touchstart="fnOnTouchStart" + @touchend="fnOnTouchEnd" + @touchcancel="fnOnTouchEnd" > @@ -78,6 +82,8 @@ export default { isLoadMore: false, loadMoreText: '', scrollTop: 0, + tempScrollTop: 0, + scrollTimeout: null, triggered: false }; }, @@ -181,9 +187,7 @@ export default { }); }, fnOnScroll(e) { - throttle(() => { - this.scrollTop = e.detail.scrollTop; - }, 1000); + this.tempScrollTop = e.detail.scrollTop; }, fnToTopScroll() { uni.pageScrollTo({ @@ -191,6 +195,15 @@ export default { duration: 500 }); this.scrollTop = 0; + this.tempScrollTop = 0; + }, + fnOnTouchStart() { + clearTimeout(this.scrollTimeout); + }, + fnOnTouchEnd() { + this.scrollTimeout = setTimeout(() => { + this.scrollTop = this.tempScrollTop; + }, 500); } } }; diff --git a/pages/tabbar/links/links.vue b/pages/tabbar/links/links.vue index 7a891a7..18e091f 100644 --- a/pages/tabbar/links/links.vue +++ b/pages/tabbar/links/links.vue @@ -7,7 +7,7 @@ - + @@ -28,44 +28,49 @@ - - - - - - + + + + + @@ -90,7 +95,7 @@ - + @@ -101,7 +106,6 @@ import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vu import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue'; import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue'; import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue'; -import tmQuickIndex from '@/tm-vuetify/components/tm-quickIndex/tm-quickIndex.vue'; import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue'; import { GetRandomNumberByRange } from '@/utils/random.js'; @@ -114,7 +118,6 @@ export default { tmTags, tmEmpty, tmImages, - tmQuickIndex, tmPoup }, data() { @@ -129,7 +132,8 @@ export default { detail: { show: false, data: {} - } + }, + linkTotal: 0 }; }, computed: { @@ -158,6 +162,7 @@ export default { return this.$haloConfig.colors[_r]; }, fnGetData() { + this.linkTotal = 0; this.loading = 'loading'; uni.showLoading({ mask: true, @@ -169,12 +174,12 @@ export default { if (res.status == 200) { console.log('请求结果:'); console.log(res); - let resData = res.data; // 处理数据 - const _result = resData.map(item => { + const _result = res.data.map(item => { const _team = item.team || '未分组'; const _firstChart = _team ? _team.substring(0, 1) : ''; const _links = item.links.map(link => { + this.linkTotal += 1; link.logo = this.$utils.checkAvatarUrl(link.logo); return link; }); @@ -266,7 +271,7 @@ export default { // height: 126rpx; width: 80rpx; height: 80rpx; - border-radius: 50%; + border-radius: 12rpx; border: 6rpx solid #ffffff; box-shadow: none; }