From 4c1d740f72a9f0344d066f96599860438b21699a Mon Sep 17 00:00:00 2001 From: wangdong <1551135706@qq.com> Date: Sun, 2 Jun 2024 12:52:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=BF=E5=9C=BA=E4=B8=8B=E8=BD=BD=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 25 ++++++++----------------- pages/squareDynamic/index.vue | 8 +++++++- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 8064298..7d71ebd 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -349,7 +349,7 @@ - + @@ -569,8 +569,6 @@ }, list: [{ name: '首页' - }, { - name: '同城送' }], current: 0, tabList: [], @@ -676,13 +674,6 @@ type: 2 }); } - // this.list = data.same_city ? [{ - // name: '首页' - // }, { - // name: '同城送' - // }] : [{ - // name: '首页' - // }] } }, async getWxAppStyle() { @@ -1050,14 +1041,14 @@ }) }, changeHome(val) { - this.current = val; - if (this.current < 2) { - this.getTypeList() - } else { + if (this.list[val].name === '广场') { uni.navigateTo({ url: '/pages/squareDynamic/index' }); + } else { + this.getTypeList() } + this.current = val; }, getCityInfo() { const that = this @@ -1177,11 +1168,11 @@ this.getAuthorize(); }, onShow() { - this.getWxAppStyle(); - this.isLogin = uni.getStorageSync("AccessToken") ? true : false - if (this.current == 2) { + if (this.list[this.current].name === '广场') { this.current = 0; } + this.getWxAppStyle(); + this.isLogin = uni.getStorageSync("AccessToken") ? true : false }, onPageScroll(e) { if (e.scrollTop <= 200) { // 当滚动到顶部且向下滑动时为true diff --git a/pages/squareDynamic/index.vue b/pages/squareDynamic/index.vue index 2540e63..500abd3 100644 --- a/pages/squareDynamic/index.vue +++ b/pages/squareDynamic/index.vue @@ -247,11 +247,17 @@ }, downloadMultipleImages(urls) {   let tasks = [] -   urls.forEach((url) => { +   urls.forEach((url, k) => {     tasks.push(this.downloadSingleImage(url.external_url).then(e => { uni.saveImageToPhotosAlbum({ filePath: e, }); + if (k === urls.length - 1) { + uni.showToast({ + icon: 'success', + title: '下载成功!' + }) + } }));   })   return Promise.all(tasks)