优化楼层装修中商品分类判断

master
lemon橪 2021-12-13 17:16:12 +08:00
parent 1416762afe
commit 108b7f5b0b
1 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="layout"> <div class="layout">
<u-sticky > <u-sticky>
<div class="goods-cell-title"> <div class="goods-cell-title">
<div class="goods-item-title" :class="{ 'selected-title': selected.index == index }" <div class="goods-item-title" :class="{ 'selected-title': selected.index == index }"
@click="handleClickTitle(title, index)" v-for="(title, index) in res.list[0].titleWay" :key="index"> @click="handleClickTitle(title, index)" v-for="(title, index) in res.list[0].titleWay" :key="index">
@ -11,8 +11,9 @@
</div> </div>
</u-sticky> </u-sticky>
<div class="goods-list"> <div class="goods-list">
<div v-if="selected.index == item.___index || selected.val == item.type" @click="handleClick(item)" class="goods-item" <div v-if="item.___index != undefined ? (selected.index == item.___index) : ( selected.val == item.type)"
v-for="(item, item_index) in res.list[0].listWay" :key="item_index"> @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in res.list[0].listWay"
:key="item_index">
<div class="goods-img"> <div class="goods-img">
<u-image :src="item.img" height="350rpx" mode="aspectFit" width="100%"> <u-image :src="item.img" height="350rpx" mode="aspectFit" width="100%">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
@ -20,7 +21,7 @@
</div> </div>
<div class="goods-desc"> <div class="goods-desc">
<div class="goods-title"> <div class="goods-title">
{{ item.title }} {{ item.title }} {{item.___index}}
</div> </div>
<div class="goods-bottom"> <div class="goods-bottom">
<div class="goods-price">{{ item.price | unitPrice }}</div> <div class="goods-price">{{ item.price | unitPrice }}</div>
@ -53,11 +54,7 @@ export default {
immediate: true, immediate: true,
}, },
}, },
mounted () { mounted() {},
this.$u.getRect('.goods-cell-title').then(res=>{
console.log(res)
})
},
methods: { methods: {
handleClick(item) { handleClick(item) {
uni.navigateTo({ uni.navigateTo({