邓洁 : 修改小程序bug

This commit is contained in:
邓洁
2023-05-07 14:31:40 +08:00
parent 4b15b475af
commit 5f3889217b
7 changed files with 48 additions and 61 deletions

View File

@@ -45,6 +45,9 @@
pageSize: 4, // 每页条数
}
},
props: {
reportPageSize: String
},
created() {
// uni.$on("getCurrent", data => {
// if (data == 0) {
@@ -54,18 +57,24 @@
// }
// })
this.imgUrl = uni.getStorageSync('img_url')
if (this.reportPageSize == 6) {
this.pageSize = this.reportPageSize
}
this.getProductsByThumb()
},
methods: {
//获取按点赞量排列的产品列表
getProductsByThumb() {
this.$apiServe.getProducts({
sortType: 2,
this.$apiServe.getProductList({
cateId: 0,
tagIds: 0,
sortType: 1,
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
console.log('产品列表2', res.data);
let tags = res.data.data
console.log('企业需求列表', tags);
for (const item of tags) {
let tag = item.tags
this.tagsArray = tag.split(',')
@@ -76,16 +85,8 @@
this.productList = [...this.productList, ...res.data.data]
//这用于上架时间和点赞量的数据切换
// this.productList = res.data.data
}).finally(_ => {
})
},
//点击图片跳转到详情页
toDetailPage(item) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item.id
})
}
}
}
</script>