dengjie commit : 代码完善

This commit is contained in:
clay
2023-01-09 18:03:51 +08:00
parent 9c0477da5c
commit c906a7d33a
16 changed files with 198 additions and 173 deletions

View File

@@ -64,7 +64,7 @@
</view>
<scroll-view scroll-y class="goods-list" @scrolltolower="reachGoodsBottom">
<block v-for="(item1,index1) in goodsList" :key="index1">
<view class="goods-item">
<view class="goods-item" @click="toDetailPage(item1)">
<view class="left">
<view class="image">
<image :src="item1.imageF" mode="scaleToFill"
@@ -225,6 +225,12 @@
})
},
methods: {
//点击goodsItem跳转到详情页
toDetailPage(item1) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item1.id
})
},
goSearch(param) {
this.queryParam = param
const index = this.recentRecordList.findIndex(item => {
@@ -308,10 +314,11 @@
this.$apiServe.getCategories().then(res => {
this.categoryList = res.data.data.map((item, index) => {
item.icon = this.imgUrl + item.icon
if(selectedCategoryId && selectedCategoryId === item.id) {
if (selectedCategoryId && selectedCategoryId === item.id) {
item.active = true
this.selectedCategory = index
} else if (selectedCategoryId === null && this.selectedCategory && this.selectedCategory === index) {
} else if (selectedCategoryId === null && this.selectedCategory && this
.selectedCategory === index) {
item.active = true
active = true
} else if (selectedCategoryId === null && !this.selectedCategory && !index) {