优化楼层装修中商品分类代码可能会出现的bug . 如果更新此版本建议同步更新uni版本更新

master
lemon橪 2021-12-09 18:32:11 +08:00
parent fd1d32d431
commit 3cb0e52ca0
4 changed files with 31 additions and 44 deletions

View File

@ -459,22 +459,32 @@ export const modelData = [
options: { options: {
list: [ list: [
{ {
/**
* 2021/12/9
* 新增索引index判断商品归属分类
* 之前代码没有配置index也不会收到印象
* 新建的楼层将采用索引判断分类
*/
titleWay: [ titleWay: [
{ {
title: "精选", title: "精选",
desc: "电子推荐" desc: "电子推荐",
___index:0,
}, },
{ {
title: "实惠", title: "实惠",
desc: "便宜好货" desc: "便宜好货",
___index:1,
}, },
{ {
title: "进口", title: "进口",
desc: "国际自营" desc: "国际自营",
___index:2,
}, },
{ {
title: "推荐", title: "推荐",
desc: "喂奶推荐" desc: "喂奶推荐",
___index:3,
} }
], ],
listWay: [ listWay: [
@ -483,50 +493,18 @@ export const modelData = [
price: "120", price: "120",
title: title:
" 微软 (Microsoft) Xbox 无线控制器/手柄 湛蓝色 | 3.5mm耳机接口蓝牙连接 Xbox主机电脑平板通用", " 微软 (Microsoft) Xbox 无线控制器/手柄 湛蓝色 | 3.5mm耳机接口蓝牙连接 Xbox主机电脑平板通用",
type: "精选" type: "精选",
___index:0
}, },
{ {
img: "https://i.loli.net/2020/12/05/c9mptI5Pg8qJ6ny.png", img: "https://i.loli.net/2020/12/05/c9mptI5Pg8qJ6ny.png",
title: title:
"宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米", "宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米",
price: "190", price: "190",
type: "精选" type: "精选",
___index:0
}, },
{
img: "https://i.loli.net/2020/12/05/QsSYIPF743Hgf8q.png",
title:
"宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米",
price: "10",
type: "精选"
},
{
img: "https://i.loli.net/2020/12/05/VTwDYcLWnukGxat.png",
title:
"宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米",
price: "190",
type: "精选"
},
{
img: "https://i.loli.net/2020/12/05/SIFwaVpE4YJAuQf.png",
title:
"宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米",
price: "10",
type: "精选"
},
{
img: "https://i.loli.net/2021/05/14/KTLSrOVJmEdX12A.png",
title:
"宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米",
price: "190",
type: "精选"
},
{
img: "https://i.loli.net/2021/05/14/xA5FW2ubiShBdPE.jpg",
title:
"宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米",
price: "10",
type: "精选"
}
] ]
} }
] ]

View File

@ -49,7 +49,7 @@
<div class="decorate-view-link" v-if="res.options.list[0].listWay.length != 0"> <div class="decorate-view-link" v-if="res.options.list[0].listWay.length != 0">
<!-- 绑定商品选择器回调已选择的商品 --> <!-- 绑定商品选择器回调已选择的商品 -->
<div v-if="title_item.title == bindGoods.type" v-for="(bindGoods,bindGoodsIndex) in res.options.list[0].listWay" :key="bindGoodsIndex"> <div v-if="title_item.___index == bindGoods.___index || title_item.title == bindGoods.type" v-for="(bindGoods,bindGoodsIndex) in res.options.list[0].listWay" :key="bindGoodsIndex">
{{bindGoods.title}}, {{bindGoods.title}},
</div> </div>
@ -183,10 +183,13 @@ export default {
if (!val) return false; if (!val) return false;
let data = val.map((item) => { let data = val.map((item) => {
delete item.selected; delete item.selected;
delete item.intro
delete item.mobileIntro
return { return {
img: item.thumbnail, img: item.thumbnail,
title: item.goodsName, title: item.goodsName,
type: this.selectedGoods.title, type: this.selectedGoods.title,
___index:this.selectedGoods.___index,
...item ...item
}; };
}); });

View File

@ -108,6 +108,12 @@ export default {
}, },
methods: { methods: {
enableBindGoodsShow(){
},
// //
init() { init() {
if (!this.$route.query.id) return false; if (!this.$route.query.id) return false;
@ -156,6 +162,7 @@ export default {
}, },
// //
handleDrawer(val) { handleDrawer(val) {
let newIndex = this.selected; let newIndex = this.selected;
this.decorateData = ""; this.decorateData = "";

View File

@ -7,7 +7,7 @@
</div> </div>
</div> </div>
<div class="goods-list"> <div class="goods-list">
<div v-if="selected.val == item.type" class="goods-item" v-for="(item, item_index) in res.list[0].listWay" :key="item_index"> <div v-if="selected.index == item.___index || selected.val == item.type" class="goods-item" v-for="(item, item_index) in res.list[0].listWay" :key="item_index">
<div class="goods-img"> <div class="goods-img">
<Icon size="20" color="#e1251b" @click="closeGoods(item, item_index)" class="goods-icon" type="ios-close-circle" /> <Icon size="20" color="#e1251b" @click="closeGoods(item, item_index)" class="goods-icon" type="ios-close-circle" />
<img :src="item.img" alt /> <img :src="item.img" alt />
@ -31,7 +31,6 @@ export default {
selected: { selected: {
// //
index: 0, index: 0,
val: "",
}, },
}; };
}, },