分类接口对接
This commit is contained in:
@@ -355,13 +355,15 @@
|
||||
menuItemHeight: 0, // 左边菜单item的高度
|
||||
tabCurrent: 0, //分类详情 上架时间, // 左边菜单item的高度
|
||||
tagCurrent: 0, //分类详情 上架时间
|
||||
imgUrl: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
console.log(menuButtonInfo)
|
||||
this.searchBarTop = menuButtonInfo.top;
|
||||
this.searchBarHeight = menuButtonInfo.height;
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getCategoryList()
|
||||
},
|
||||
onReady() {
|
||||
let that = this;
|
||||
@@ -448,9 +450,22 @@
|
||||
},
|
||||
navigateToSearch() {
|
||||
uni.navigateTo({
|
||||
url: '../../search/search'
|
||||
url: '../search/search'
|
||||
})
|
||||
},
|
||||
getCategoryList() {
|
||||
this.$apiServe.getCategories().then(res => {
|
||||
this.categoryList = res.data.data.map((item, index) => {
|
||||
item.icon = this.imgUrl + item.icon
|
||||
item.active = false
|
||||
if(!index) {
|
||||
item.active = true
|
||||
}
|
||||
return item
|
||||
})
|
||||
console.log(this.categoryList)
|
||||
}).finally(_ => {})
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user