优化易购页面的页面布局

This commit is contained in:
赵毅 2025-10-17 11:19:32 +08:00
parent 295872ccf1
commit 31dc706eed
2 changed files with 30 additions and 13 deletions

View File

@ -315,11 +315,11 @@ page {
}
.CateList_Box {
width: 71.5%;
width: 95%;
display: flex;
overflow: hidden;
/* position: relative; */
position: fixed;
position: relative;
/* position: fixed; */
z-index: 15;
padding: 20rpx 10rpx;
background-color: #ffffff;
@ -368,7 +368,7 @@ page {
}
.CateIte {
margin-top: 80rpx;
/* margin-top: 80rpx; */
}
.CateInfo {

View File

@ -63,7 +63,8 @@
{{ item.category_name }}
</view>
</view>
<view class="Con_right" v-if="tagList1.length > 0">
<view class="Con_right" v-if="tagList1.length > 0" ref="conRightRef"
:style="{ overflow: cateListShow ? 'hidden' : 'auto' }">
<view class="CateList_Box" :class="cateListShow ? 'bgf' : ''">
<view class="CateList" ref="cateListRef">
<view class="CateList_Item" v-for="(item, index) in tagList" :key="item.id"
@ -135,14 +136,14 @@
</view>
</view>
<view class="gg" @click="chooseGG(item,items)" v-if="
<view class="gg" @click="chooseGG(item, items)" v-if="
items.commodity_goods_info_list.length > 1 && !items.isShow
">
选择规格
<u-icon name="arrow-down" size="26rpx" color="#FF370B"></u-icon>
</view>
<view class="gg" @click="chooseGG(item,items)" v-if="
<view class="gg" @click="chooseGG(item, items)" v-if="
items.commodity_goods_info_list.length > 1 && items.isShow
">
收起
@ -152,7 +153,8 @@
</view>
<view class="GGList" v-if="items.isShow">
<view class="GGItem" v-for="ite in items.commodity_goods_info_list" :key="ite.id" @click="goods(ite,items)">
<view class="GGItem" v-for="ite in items.commodity_goods_info_list" :key="ite.id"
@click="goods(ite, items)">
<view class="GGItem_Image">
<view class="tag tag-img" v-if="ite.is_same_day">当日达</view>
<image :src="picUrl + ite.commodity_pic" mode="aspectFill"></image>
@ -227,6 +229,7 @@ export default {
search: "",
value: "1",
cateListShow: false,
scrollTop: 0,
conRightElement: null,
iconList: [
{
@ -325,6 +328,20 @@ export default {
//
changeCateListShow() {
this.cateListShow = !this.cateListShow;
// cateListShowCon_right
if (this.conRightRef) {
if (this.cateListShow) {
//
this.scrollTop = this.conRightRef.scrollTop;
} else {
//
setTimeout(() => {
if (this.conRightRef) {
this.conRightRef.scrollTop = this.scrollTop || 0;
}
}, 0);
}
}
},
//
checkItem(index) {
@ -338,7 +355,7 @@ export default {
this.topShow = !this.topShow;
},
//
chooseGG(item,targetItems) {
chooseGG(item, targetItems) {
// id
if (item && targetItems && item.id) {
for (let i = 1; i < this.tagList.length; i++) {
@ -362,7 +379,7 @@ export default {
NavgateTo("../search/index");
},
//
goods(ite,items) {
goods(ite, items) {
NavgateTo(`../goods/index?item=${JSON.stringify(ite)}`);
},
@ -447,7 +464,7 @@ export default {
let currentQuantity = 0;
let stockQuantity = 0;
let goodsToUpdate = null;
// items.commodity_goods_info_list[0].quantity
if (
item.commodity_goods_info_list &&
@ -465,7 +482,7 @@ export default {
stockQuantity = item.stock_quantity || 0;
goodsToUpdate = item;
}
//
if (quantity > currentQuantity && currentQuantity >= stockQuantity) {
uni.showToast({
@ -474,7 +491,7 @@ export default {
});
return;
}
// 使$set
this.$set(goodsToUpdate, 'quantity', quantity);