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 {
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,
}

Loading…
Cancel
Save