From 4611932ad87e4af0425324cf57f61d9cd10c7ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= Date: Sat, 19 Jul 2025 23:46:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BE=E5=BA=93=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E6=BB=91=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabbar/gallery/gallery.vue | 118 ++++++++++++------ .../tm-flowLayout-custom.vue | 4 - uni_modules/k-touch-listen/changelog.md | 18 +++ .../k-touch-listen/k-touch-listen.vue | 113 +++++++++++++++++ uni_modules/k-touch-listen/package.json | 85 +++++++++++++ 5 files changed, 297 insertions(+), 41 deletions(-) create mode 100644 uni_modules/k-touch-listen/changelog.md create mode 100644 uni_modules/k-touch-listen/components/k-touch-listen/k-touch-listen.vue create mode 100644 uni_modules/k-touch-listen/package.json diff --git a/pages/tabbar/gallery/gallery.vue b/pages/tabbar/gallery/gallery.vue index 02b88a5..e1fa278 100644 --- a/pages/tabbar/gallery/gallery.vue +++ b/pages/tabbar/gallery/gallery.vue @@ -3,44 +3,50 @@ + align="left" @change="fnOnCategoryChange($event, false)"> - + + + + 刷新试试 + + - - - - - - - - - - - - - - - - - - - - - {{ loadMoreText }} - + + + + + + + + + + + + + + + + + + + + + {{ loadMoreText }} + + @@ -55,6 +61,7 @@ import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue'; import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue'; import tmFlowLayoutCustom from '@/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue'; import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue'; +import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue'; export default { options: { @@ -69,7 +76,8 @@ export default { tmIcons, tmImages, tmFlowLayoutCustom, - tmTabs + tmTabs, + tmButton }, data() { return { @@ -88,7 +96,8 @@ export default { isLoadMore: false, loadMoreText: '', hasNext: false, - dataList: [] + dataList: [], + lock:false }; }, computed: { @@ -142,13 +151,23 @@ export default { } }, methods: { + fnGetDataByCategory(index){ + this.fnResetSetAniWaitIndex(); + this.queryParams.group = this.category.list[index].name; + this.queryParams.page = 1; + this.fnToTopPage(); + this.dataList = []; + this.fnGetData(true); + }, fnOnCategoryChange(index) { - this.fnResetSetAniWaitIndex(); - this.queryParams.group = this.category.list[index].name; - this.queryParams.page = 1; - this.fnToTopPage(); - this.dataList = []; - this.fnGetData(true); + if(this.lock) { + // uni.showToast({ + // title: "上一个请求进行中...", + // icon: "none" + // }) + return; + } + this.fnGetDataByCategory(index) }, fnGetCategory() { if (this.calcAuditModeEnabled) { @@ -171,7 +190,12 @@ export default { this.queryParams.group = this.category.list[0].name; this.fnGetData(true); } - }); + }).catch(e=>{ + this.loading = 'error' + this.category.list = [] + this.category.activeIndex = 0 + this.category.activeValue = "" + }); }, fnGetData(isClearWaterfall = false) { if (this.calcAuditModeEnabled) { @@ -201,6 +225,7 @@ export default { this.loadMoreText = '呜呜,没有更多数据啦~'; uni.hideLoading(); uni.stopPullDownRefresh(); + this.lock = false; return; } @@ -244,6 +269,7 @@ export default { setTimeout(() => { uni.hideLoading(); uni.stopPullDownRefresh(); + this.lock = false; }, 500); }); }, @@ -258,7 +284,25 @@ export default { indicator: 'number', loop: true }); - } + }, + touchLeft(){ + if(this.loading != "success") return; + this.category.activeIndex += 1 + if(this.category.activeIndex >= this.category.list.length){ + this.category.activeIndex = 0 + } + this.lock = true + this.fnGetDataByCategory(this.category.activeIndex) + }, + touchRight(){ + if(this.loading != "success") return; + this.category.activeIndex -= 1 + if(this.category.activeIndex < 0){ + this.category.activeIndex = 0 + } + this.lock = true + this.fnGetDataByCategory(this.category.activeIndex) + } } }; diff --git a/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue b/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue index 9973884..1c40aa5 100644 --- a/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue +++ b/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue @@ -100,8 +100,6 @@ export default { }, //向列表添加数据 pushData(list) { - console.log('添加图片数据----------',list) - let prIdx_i = this.list2.length; if (!Array.isArray(list) || typeof list == 'undefined') { return false; @@ -122,8 +120,6 @@ export default { return this.dataList; }, async loadimg(event, isLoad, index) { - console.log('图片加载事件----------',event) - this.isLoading = true; let ps = this.list2[index]; ps.isLoad = true; diff --git a/uni_modules/k-touch-listen/changelog.md b/uni_modules/k-touch-listen/changelog.md new file mode 100644 index 0000000..87e3a86 --- /dev/null +++ b/uni_modules/k-touch-listen/changelog.md @@ -0,0 +1,18 @@ +## 1.0.2(2023-09-14) +更新使用文档: +引入本插件 然后使用,手动滑稽,教程简单吗? + + + //您需要监听的区域的代码 + + +## 1.0.1(2023-09-14) +更新使用文档: +引入本插件 然后使用,手动滑稽,教程简单吗? + + + //您需要监听的区域的代码 + + +## 1.0.0(2023-09-14) +首次提交 diff --git a/uni_modules/k-touch-listen/components/k-touch-listen/k-touch-listen.vue b/uni_modules/k-touch-listen/components/k-touch-listen/k-touch-listen.vue new file mode 100644 index 0000000..a9783be --- /dev/null +++ b/uni_modules/k-touch-listen/components/k-touch-listen/k-touch-listen.vue @@ -0,0 +1,113 @@ + + + + \ No newline at end of file diff --git a/uni_modules/k-touch-listen/package.json b/uni_modules/k-touch-listen/package.json new file mode 100644 index 0000000..586e093 --- /dev/null +++ b/uni_modules/k-touch-listen/package.json @@ -0,0 +1,85 @@ +{ + "id": "k-touch-listen", + "displayName": "k-touch-listen 手势监听 全面兼容小程序、vue2、vue3等多端", + "version": "1.0.2", + "description": "用于监听用户滑动手势,左滑右滑,上滑下滑等一系列手势监听", + "keywords": [ + "touch", + "手势", + "手势监听", + "手势监听", + "vue3" + ], + "repository": "", + "engines": { + "HBuilderX": "^3.7.6" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file