chore :按钮 = 全局所有有商品的二级分类(去重,一直显示),选中状态切换一级分类时保持
商品 = 切换一级分类时,用选中按钮的名称在当前一级分类下找同名 category,重新加载商品
This commit is contained in:
@@ -131,10 +131,14 @@ const localDevConfig = ({
|
|||||||
uniacid: 2,
|
uniacid: 2,
|
||||||
domain: 'https://test.aigc-quickapp.com',
|
domain: 'https://test.aigc-quickapp.com',
|
||||||
},
|
},
|
||||||
|
'48': { // 测试平台
|
||||||
|
uniacid: 48,
|
||||||
|
domain: 'https://test.aigc-quickapp.com',
|
||||||
|
},
|
||||||
// })['5g-237']; // 商品分类,没有立即咨询文字
|
// })['5g-237']; // 商品分类,没有立即咨询文字
|
||||||
// })['5g-97']; // 大宗商品贸易,支持自定义字体大小、颜色
|
// })['5g-97']; // 大宗商品贸易,支持自定义字体大小、颜色
|
||||||
// })['5g-50']; // 燃气安全产品机器人,购物车无反应
|
// })['5g-50']; // 燃气安全产品机器人,购物车无反应
|
||||||
})['2']; // 离型纸硅油纸
|
})['48']; // 离型纸硅油纸
|
||||||
// })['2485']; // 验证电子表单前后端数据一致性
|
// })['2485']; // 验证电子表单前后端数据一致性
|
||||||
// })['5g-11']; // 数码
|
// })['5g-11']; // 数码
|
||||||
// })['5g-213']; // 选择要使用的环境配置
|
// })['5g-213']; // 选择要使用的环境配置
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<image :src="$util.img(category.image_adv)" mode="widthFix" show-menu-by-longpress />
|
<image :src="$util.img(category.image_adv)" mode="widthFix" show-menu-by-longpress />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<block v-if="value.template == 99 && parseInt(value.level) == 2">
|
<block v-if="value.template == 99">
|
||||||
<view class="second-category-btns">
|
<view class="second-category-btns">
|
||||||
<view class="second-category-btn"
|
<view class="second-category-btn"
|
||||||
v-for="(one, oneIndex) in category.child_list"
|
v-for="(one, oneIndex) in category.child_list"
|
||||||
@@ -373,7 +373,7 @@ export default {
|
|||||||
this.type = this.value.template == 1 || this.value.template == 99 ? 'category' : 'goods';
|
this.type = this.value.template == 1 || this.value.template == 99 ? 'category' : 'goods';
|
||||||
if (this.index == this.select && this.pageIndex == 0) this.getGoodsList();
|
if (this.index == this.select && this.pageIndex == 0) this.getGoodsList();
|
||||||
this.loadType = this.value.goodsLevel == 1 && this.value.loadType == 'all' ? 'all' : 'part';
|
this.loadType = this.value.goodsLevel == 1 && this.value.loadType == 'all' ? 'all' : 'part';
|
||||||
if (this.value.template == 99 && this.index == this.select && parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) {
|
if (this.value.template == 99 && this.index == this.select && this.category.child_list && this.category.child_list.length > 0) {
|
||||||
let targetCategory = null;
|
let targetCategory = null;
|
||||||
if (this.lastSecondCategoryName) {
|
if (this.lastSecondCategoryName) {
|
||||||
targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName);
|
targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName);
|
||||||
@@ -395,7 +395,7 @@ export default {
|
|||||||
if (data) this.contentWrapHeight = data.height;
|
if (data) this.contentWrapHeight = data.height;
|
||||||
}).exec();
|
}).exec();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
if (this.value.template == 99 && parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) {
|
if (this.value.template == 99 && this.category.child_list && this.category.child_list.length > 0) {
|
||||||
let targetCategory = null;
|
let targetCategory = null;
|
||||||
if (this.lastSecondCategoryName) {
|
if (this.lastSecondCategoryName) {
|
||||||
targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName);
|
targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName);
|
||||||
@@ -435,7 +435,7 @@ export default {
|
|||||||
} else if (this.loadType == 'part') {
|
} else if (this.loadType == 'part') {
|
||||||
this.scrollTop = -1;
|
this.scrollTop = -1;
|
||||||
}
|
}
|
||||||
if (this.value.template == 99 && parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) {
|
if (this.value.template == 99 && this.category.child_list && this.category.child_list.length > 0) {
|
||||||
let targetCategory = null;
|
let targetCategory = null;
|
||||||
if (this.lastSecondCategoryName) {
|
if (this.lastSecondCategoryName) {
|
||||||
targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName);
|
targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName);
|
||||||
@@ -451,7 +451,7 @@ export default {
|
|||||||
// 切换一级分类时, 根据当前一级分类下同名二级分类重新加载商品
|
// 切换一级分类时, 根据当前一级分类下同名二级分类重新加载商品
|
||||||
currentOneCategory: {
|
currentOneCategory: {
|
||||||
handler() {
|
handler() {
|
||||||
if (this.value.template == 99 && parseInt(this.value.level) == 2) {
|
if (this.value.template == 99) {
|
||||||
this.refreshGoodsByCurrentCategory();
|
this.refreshGoodsByCurrentCategory();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
<view class="right-flex-wrap">
|
<view class="right-flex-wrap">
|
||||||
<!-- 模板99 + 二级分类: 全局二级分类按钮(去重, 一直显示) + 商品列表 -->
|
<!-- 模板99 + 二级分类: 全局二级分类按钮(去重, 一直显示) + 商品列表 -->
|
||||||
<scroll-view scroll-y="true" class="content-wrap" v-if="value.template == 99 && parseInt(value.level) == 2 && template99Category"
|
<scroll-view scroll-y="true" class="content-wrap" v-if="value.template == 99 && template99Category"
|
||||||
:refresher-enabled="true" refresher-default-style="none"
|
:refresher-enabled="true" refresher-default-style="none"
|
||||||
:refresher-triggered="triggered" @refresherrefresh="onRefresh" @refresherrestore="onRestore">
|
:refresher-triggered="triggered" @refresherrefresh="onRefresh" @refresherrestore="onRestore">
|
||||||
<diy-category-item :category="template99Category" :value="value" ref="categoryItem" :index="0" :select="0"
|
<diy-category-item :category="template99Category" :value="value" ref="categoryItem" :index="0" :select="0"
|
||||||
@@ -377,7 +377,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 模板99 + 二级分类: 全局查询所有有商品的二级分类(去重), 按钮一直显示
|
// 模板99 + 二级分类: 全局查询所有有商品的二级分类(去重), 按钮一直显示
|
||||||
if (this.value.template == 99 && parseInt(this.value.level) == 2) {
|
if (this.value.template == 99) {
|
||||||
this.loadGlobalSecondCategoryBtns();
|
this.loadGlobalSecondCategoryBtns();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user