diff --git a/pages/creator/creatorDetail.vue b/pages/creator/creatorDetail.vue index 6a0ac0e..9e5645c 100644 --- a/pages/creator/creatorDetail.vue +++ b/pages/creator/creatorDetail.vue @@ -40,11 +40,10 @@ - + - + @@ -62,7 +61,10 @@ return { creatorInfo: {}, current: 0, + typeId: 0, + typeIdList:[], arrList: [], + imgList:[], imgWidth: 0, // 图片宽 imgHeight: 0, // 图片高 pageNum: 1, @@ -84,11 +86,16 @@ console.log('getStorage', this.creatorInfo) this.creatorInfo.typeList.forEach(item => { this.arrList.push(item.typeName) + this.typeIdList.push(item.typeId) }) console.log('arrList', this.arrList) + console.log('this.typeIdList', this.typeIdList) } }) }, + onLoad(){ + this.getTypeImgsPage() + }, onShareAppMessage(res) { if (res.from === 'button') { // 来自页面内分享按钮 console.log(res) @@ -105,26 +112,26 @@ methods: { // 标签栏点击 onClickItem(e) { - console.log('点击', e) this.current = e.currentIndex + this.typeId = this.typeIdList[e.currentIndex] + const params = { scanCode: this.creatorInfo.scanCode, - typeId: this.current, + typeId: this.typeId, pageNum: this.pageNum, pageSize: this.pageSize, } - console.log('params',params) getTypeImgsPage(params).then(response => { if(response.data.code === 200){ - console.log('response',response) - //TODO 待取出圖片列表 + this.imgList = response.data.rows + console.log('this.imgList',this.imgList) } }); }, // 内容滑动 changeItem(e) { - console.log('点击', e.detail) - this.current = e.detail.current + // console.log('点击', e.detail) + // this.current = e.detail.current }, // 前往详情页 targetDetail(item) { @@ -140,7 +147,32 @@ } }) } + }, + + //获取图片分页 + getTypeImgsPage() { + const params = { + scanCode: this.creatorInfo.scanCode, + typeId: this.typeIdList[0], + pageNum: this.pageNum, + pageSize: this.pageSize, + } + console.log('params',params) + getTypeImgsPage(params).then(response =>{ + console.log('response',response) + }); + + // if (res.data.code === 200) { + // this.imgList = response.data.rows + // console.log('this.imgList',this.imgList) + // } else { + // uni.showModal({ + // content: '图片列表加载失败!', + // showCancel: false + // }); + // } } + } }