Browse Source

feature-tiktok-1.0:暂时修改艺术家详情

feature-1.0
penny 4 years ago
parent
commit
746aecf8a4
  1. 54
      pages/creator/creatorDetail.vue

54
pages/creator/creatorDetail.vue

@ -40,11 +40,10 @@
</view>
<swiper class="swiper" :circular="false" :current="current" :indicator-dots="false" :autoplay="false"
@change="changeItem" :duration="500">
<swiper-item v-for="(item,index) in creatorInfo.typeList" :key="item.typeId"
:current-item-id="item.typeId" >
<swiper-item v-for="(item,index) in imgList" :key="item"
:current-item-id="item">
<view class="swiper-item bottom">
<image :src="val.imgUrl" mode="" v-for="(val,i) in item.imgList" :key="i"
:style="'width:'+imgWidth+';height:'+imgHeight" @click="targetDetail(val)"></image>
<image :src="item.imgUrl" mode="":style="'width:'+imgWidth+';height:'+imgHeight" @click="targetDetail(item)"></image>
</view>
</swiper-item>
</swiper>
@ -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
// });
// }
}
}
}
</script>

Loading…
Cancel
Save