From 1309102acbdee1db106459a4554ce925f771effd Mon Sep 17 00:00:00 2001 From: gao1021514 <1328969651@qq.com> Date: Sat, 9 Jul 2022 00:07:08 +0800 Subject: [PATCH] =?UTF-8?q?typeid=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=8E=A5=E5=8F=A3=E6=96=B9=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/creator/creatorDetail.vue | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pages/creator/creatorDetail.vue b/pages/creator/creatorDetail.vue index 3201e88..acd4f4a 100644 --- a/pages/creator/creatorDetail.vue +++ b/pages/creator/creatorDetail.vue @@ -60,7 +60,7 @@ return { creatorInfo: {}, current: 0, - typeId: 0, + typeId: 1, typeIdList: [], arrList: [], imgList: [], @@ -87,7 +87,8 @@ this.arrList.push(item.typeName) this.typeIdList.push(item.typeId) }) - this.getTypeImgsPage() + this.typeId = this.typeIdList[0] + this.getTypeImgsPage(this.typeId) } }) }, @@ -96,7 +97,7 @@ console.log(111) if (this.imgList.length > 1) { this.pageNum += 1 - this.getTypeImgsPage() + this.getTypeImgsPage(this.typeId) } }, onShareAppMessage(res) { @@ -112,21 +113,25 @@ icon: 'none' }) }, + watch: { + current(n, o) { + console.log('current', this.current, n, o) + this.typeId = this.typeIdList[n] + this.imgList = [] + this.getTypeImgsPage(this.typeId) + immediate: true + } + }, methods: { // 标签栏点击 onClickItem(e) { this.current = e.currentIndex - this.typeId = this.typeIdList[this.current] - this.imgList = [] - this.getTypeImgsPage() }, // 内容滑动 changeItem(e) { this.pageNum = 1 this.current = e.detail.current - this.typeId = this.typeIdList[this.current] - this.imgList = [] - this.getTypeImgsPage() + // this.getTypeImgsPage(this.typeId) }, // 前往详情页 targetDetail(item) { @@ -145,13 +150,14 @@ }, //获取图片分页 - async getTypeImgsPage() { + async getTypeImgsPage(typeId) { + console.log('typeId', typeId) uni.showLoading({ title: '加载中' }); const params = { scanCode: this.creatorInfo.scanCode, - typeId: this.typeIdList[0], + typeId: typeId, pageNum: this.pageNum, pageSize: this.pageSize, }