修改易购页面选择规格按钮的逻辑错误

This commit is contained in:
赵毅 2025-09-06 10:09:44 +08:00
parent 2a69930eaa
commit b70b3a40df

View File

@ -135,14 +135,14 @@
</view> </view>
</view> </view>
<view class="gg" @click="chooseGG(items)" v-if=" <view class="gg" @click="chooseGG(item,items)" v-if="
items.commodity_goods_info_list.length > 1 && !items.isShow items.commodity_goods_info_list.length > 1 && !items.isShow
"> ">
选择规格 选择规格
<u-icon name="arrow-down" size="26rpx" color="#FF370B"></u-icon> <u-icon name="arrow-down" size="26rpx" color="#FF370B"></u-icon>
</view> </view>
<view class="gg" @click="chooseGG(items)" v-if=" <view class="gg" @click="chooseGG(item,items)" v-if="
items.commodity_goods_info_list.length > 1 && items.isShow items.commodity_goods_info_list.length > 1 && items.isShow
"> ">
收起 收起
@ -338,11 +338,14 @@ export default {
this.topShow = !this.topShow; this.topShow = !this.topShow;
}, },
// //
chooseGG(targetItems) { chooseGG(item,targetItems) {
// tagList""1 // id
if (item && targetItems && item.id) {
for (let i = 1; i < this.tagList.length; i++) { for (let i = 1; i < this.tagList.length; i++) {
const tagItem = this.tagList[i]; const tagItem = this.tagList[i];
const infoIndex = tagItem.commodity_info_list.findIndex(item => item.id === targetItems.id); // item.idtagItem
if (tagItem.id === item.id) {
const infoIndex = tagItem.commodity_info_list.findIndex(infoItem => infoItem.id === targetItems.id);
if (infoIndex > -1) { if (infoIndex > -1) {
// //
const currentItem = tagItem.commodity_info_list[infoIndex]; const currentItem = tagItem.commodity_info_list[infoIndex];
@ -351,6 +354,8 @@ export default {
break; break;
} }
} }
}
}
}, },
// //
searchPage() { searchPage() {