Browse Source

typeid修改,请求接口方式优化

feature-1.0
gao1021514 4 years ago
parent
commit
1309102acb
  1. 28
      pages/creator/creatorDetail.vue

28
pages/creator/creatorDetail.vue

@ -60,7 +60,7 @@
return { return {
creatorInfo: {}, creatorInfo: {},
current: 0, current: 0,
typeId: 0, typeId: 1,
typeIdList: [], typeIdList: [],
arrList: [], arrList: [],
imgList: [], imgList: [],
@ -87,7 +87,8 @@
this.arrList.push(item.typeName) this.arrList.push(item.typeName)
this.typeIdList.push(item.typeId) this.typeIdList.push(item.typeId)
}) })
this.getTypeImgsPage() this.typeId = this.typeIdList[0]
this.getTypeImgsPage(this.typeId)
} }
}) })
}, },
@ -96,7 +97,7 @@
console.log(111) console.log(111)
if (this.imgList.length > 1) { if (this.imgList.length > 1) {
this.pageNum += 1 this.pageNum += 1
this.getTypeImgsPage() this.getTypeImgsPage(this.typeId)
} }
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
@ -112,21 +113,25 @@
icon: 'none' 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: { methods: {
// //
onClickItem(e) { onClickItem(e) {
this.current = e.currentIndex this.current = e.currentIndex
this.typeId = this.typeIdList[this.current]
this.imgList = []
this.getTypeImgsPage()
}, },
// //
changeItem(e) { changeItem(e) {
this.pageNum = 1 this.pageNum = 1
this.current = e.detail.current this.current = e.detail.current
this.typeId = this.typeIdList[this.current] // this.getTypeImgsPage(this.typeId)
this.imgList = []
this.getTypeImgsPage()
}, },
// //
targetDetail(item) { targetDetail(item) {
@ -145,13 +150,14 @@
}, },
// //
async getTypeImgsPage() { async getTypeImgsPage(typeId) {
console.log('typeId', typeId)
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}); });
const params = { const params = {
scanCode: this.creatorInfo.scanCode, scanCode: this.creatorInfo.scanCode,
typeId: this.typeIdList[0], typeId: typeId,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize, pageSize: this.pageSize,
} }

Loading…
Cancel
Save