From 0ca64b7dcf9f2098d4502d00dc426b79238d4b15 Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Mon, 13 Jul 2026 13:52:30 +0800 Subject: [PATCH 1/6] =?UTF-8?q?chore=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.local.config.js b/.local.config.js index 45a4eb2..5590cd8 100644 --- a/.local.config.js +++ b/.local.config.js @@ -119,10 +119,14 @@ const localDevConfig = ({ uniacid: 2485, domain: 'https://xcx6.aigc-quickapp.com/', }, + '2821': { // 离型纸硅油纸 + uniacid: 2821, + domain: 'https://xcx.aigc-quickapp.com/', + }, // })['5g-237']; // 商品分类,没有立即咨询文字 // })['5g-97']; // 大宗商品贸易,支持自定义字体大小、颜色 // })['5g-50']; // 燃气安全产品机器人,购物车无反应 -})['2482']; // 低空经济 +})['2821']; // 离型纸硅油纸 // })['2485']; // 验证电子表单前后端数据一致性 // })['5g-11']; // 数码 // })['5g-213']; // 选择要使用的环境配置 From 2e4f11d1089b412881b6d6dc967e99db69220d2f Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Mon, 13 Jul 2026 17:14:15 +0800 Subject: [PATCH 2/6] =?UTF-8?q?chore=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E6=8C=89=E9=92=AE=EF=BC=8C=E6=8A=8A=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E5=95=86=E5=93=81=E6=94=BE=E5=9C=A8?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8B=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components-diy/diy-category-item.vue | 154 +++++++++++++++++++++++++-- 1 file changed, 145 insertions(+), 9 deletions(-) diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue index f7a5d29..dd8deea 100644 --- a/components-diy/diy-category-item.vue +++ b/components-diy/diy-category-item.vue @@ -5,17 +5,45 @@ - + {{ category.category_name }} - - - - - - {{ one.category_name }} + + + {{ one.category_name }} + + + + + + {{ item.label_name }} + + + + {{ isEnEnv ? item.en_goods_name : item.goods_name }} + + + + + {{ $lang('common.currencySymbol') }} + {{ parseFloat(showPrice(item)).toFixed(2).split('.')[0] }} + .{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }} + + + + + + + + + + {{ $lang('components-diy.diy-category.noCategory') }} + @@ -316,13 +344,17 @@ export default { scrollTop: 0, loadType: '', timeout: {}, - cartEditRepeat: false + cartEditRepeat: false, + selectedSecondCategory: null, + secondCategoryGoodsList: [] }; }, created() { this.type = this.value.template == 1 ? 'category' : 'goods'; if (this.index == this.select && this.pageIndex == 0) this.getGoodsList(); this.loadType = this.value.goodsLevel == 1 && this.value.loadType == 'all' ? 'all' : 'part'; + console.log('diy-category-item type:', this.type, 'value.level:', this.value.level, 'typeof value.level:', typeof this.value.level); + console.log('diy-category-item category.child_list:', this.category.child_list, 'length:', this.category.child_list ? this.category.child_list.length : 'undefined'); }, mounted() { setTimeout(() => { @@ -739,6 +771,58 @@ export default { if (!link) return; this.$util.diyRedirectTo(JSON.parse(link)); }, + selectSecondCategory(category) { + if (this.selectedSecondCategory === category.category_id) { + this.selectedSecondCategory = null; + this.secondCategoryGoodsList = []; + } else { + this.selectedSecondCategory = category.category_id; + this.secondCategoryGoodsList = []; + this.getSecondCategoryGoods(category.category_id); + } + }, + getSecondCategoryGoods(categoryId) { + this.loading = true; + let order = ''; + let sort = ''; + if (this.value.sortWay) { + if (this.value.sortWay == 'default') { + order = ''; + sort = ''; + } else if (this.value.sortWay == 'sales') { + order = 'sale_num'; + sort = 'desc'; + } else if (this.value.sortWay == 'price') { + order = 'discount_price'; + sort = 'desc'; + } else if (this.value.sortWay == 'news') { + order = 'create_time'; + sort = 'desc'; + } + } + this.$api.sendRequest({ + url: '/api/goodssku/pageByCategory', + data: { + page: 1, + page_size: this.pageSize, + category_id: categoryId, + order: order, + sort: sort + }, + success: res => { + if (res.code == 0 && res.data) { + this.secondCategoryGoodsList = res.data.list || []; + this.secondCategoryGoodsList.forEach((item) => { + item.num = this.cartList['goods_' + item.goods_id] ? this.cartList['goods_' + item.goods_id].num : 0; + }); + } + this.loading = false; + }, + fail: () => { + this.loading = false; + } + }); + }, //加载商品在购物车的总数量 loadGoodsCartNum(isRefresh = false) { this.goodsList.forEach((item) => { @@ -803,6 +887,58 @@ export default { } } +.second-category-btns { + display: flex; + flex-wrap: wrap; + background: #fff; + margin: 0 20rpx; + border-radius: 10rpx; + padding: 20rpx; + gap: 16rpx; + margin-bottom: 20rpx; + + .second-category-btn { + padding: 16rpx 32rpx; + background: #f5f5f5; + border-radius: 20rpx; + font-size: 26rpx; + color: #333; + cursor: pointer; + user-select: none; + z-index: 100; + position: relative; + + &.selected { + background: var(--color-base-bg, #ff5000); + color: #fff; + } + } +} + +.category-goods-list { + padding: 0 20rpx; + margin-bottom: 20rpx; +} + +.category-goods-empty { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 60rpx 0; + + image { + width: 200rpx; + height: 200rpx; + margin-bottom: 20rpx; + } + + .tips { + font-size: 26rpx; + color: #999; + } +} + .category-list { display: flex; flex-wrap: wrap; From 45e997adae881405183bc17b6f1dcdd4a721ba08 Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Mon, 13 Jul 2026 17:21:14 +0800 Subject: [PATCH 3/6] =?UTF-8?q?chore=EF=BC=9A=E5=AE=9E=E7=8E=B0=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=93=AA=E4=B8=AA=E8=A1=8C=E4=B8=9A=EF=BC=8C=E5=8F=B3=E9=9D=A2?= =?UTF-8?q?=E5=B0=B1=E5=8F=AA=E6=98=BE=E7=A4=BA=E8=BF=99=E4=B8=AA=E8=A1=8C?= =?UTF-8?q?=E4=B8=9A=EF=BC=8C=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E7=9A=84=E8=A1=8C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components-diy/diy-category.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components-diy/diy-category.vue b/components-diy/diy-category.vue index e6e01ce..5ff3844 100644 --- a/components-diy/diy-category.vue +++ b/components-diy/diy-category.vue @@ -98,7 +98,7 @@ refresher-default-style="none" :refresher-triggered="triggered" @refresherrefresh="onRefresh" @refresherrestore="onRestore"> + :id="'category-' + index" v-if="select == index"> Date: Mon, 13 Jul 2026 17:26:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?chore=EF=BC=9A=E5=88=A0=E9=99=A4=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=B8=8A=E6=96=B9=E7=9A=84=E2=80=9C=E4=BB=80=E4=B9=88?= =?UTF-8?q?=E8=A1=8C=E4=B8=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components-diy/diy-category-item.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue index dd8deea..a3820e3 100644 --- a/components-diy/diy-category-item.vue +++ b/components-diy/diy-category-item.vue @@ -6,7 +6,6 @@ - {{ category.category_name }} Date: Mon, 13 Jul 2026 18:00:48 +0800 Subject: [PATCH 5/6] =?UTF-8?q?chore:=E5=88=87=E6=8D=A2=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E6=97=B6=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components-diy/diy-category-item.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue index a3820e3..52a23a0 100644 --- a/components-diy/diy-category-item.vue +++ b/components-diy/diy-category-item.vue @@ -352,8 +352,11 @@ export default { this.type = this.value.template == 1 ? 'category' : 'goods'; if (this.index == this.select && this.pageIndex == 0) this.getGoodsList(); this.loadType = this.value.goodsLevel == 1 && this.value.loadType == 'all' ? 'all' : 'part'; - console.log('diy-category-item type:', this.type, 'value.level:', this.value.level, 'typeof value.level:', typeof this.value.level); - console.log('diy-category-item category.child_list:', this.category.child_list, 'length:', this.category.child_list ? this.category.child_list.length : 'undefined'); + if (this.index == this.select && parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) { + this.selectedSecondCategory = this.category.child_list[0].category_id; + this.secondCategoryGoodsList = []; + this.getSecondCategoryGoods(this.category.child_list[0].category_id); + } }, mounted() { setTimeout(() => { @@ -363,6 +366,11 @@ export default { if (data) this.contentWrapHeight = data.height; }).exec(); }, 1000); + if (parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) { + this.selectedSecondCategory = this.category.child_list[0].category_id; + this.secondCategoryGoodsList = []; + this.getSecondCategoryGoods(this.category.child_list[0].category_id); + } }, watch: { oneCategorySelect: function () { @@ -391,6 +399,11 @@ export default { } else if (this.loadType == 'part') { this.scrollTop = -1; } + if (parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) { + this.selectedSecondCategory = this.category.child_list[0].category_id; + this.secondCategoryGoodsList = []; + this.getSecondCategoryGoods(this.category.child_list[0].category_id); + } }, 'globalStoreInfo.store_id': { handler(nval, oval) { From f18577a46c6a8bc09c8148ab3a76bca58b610c9f Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Mon, 13 Jul 2026 18:05:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?chore:=E5=88=87=E6=8D=A2=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E6=97=B6=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E4=BC=9A=E8=87=AA=E5=8A=A8=E9=80=89=E4=B8=AD=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E4=BA=8C=E7=BA=A7=E5=88=86=E7=B1=BB=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=88=E5=A6=82"=E7=A6=BB=E5=9E=8B=E7=BA=B8"?= =?UTF-8?q?=EF=BC=89=20=E5=A6=82=E6=9E=9C=E7=94=A8=E6=88=B7=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E7=82=B9=E5=87=BB=E8=BF=87=E6=9F=90=E4=B8=AA=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E5=88=86=E7=B1=BB=EF=BC=88=E5=A6=82"=E7=A6=BB?= =?UTF-8?q?=E5=9E=8B=E8=86=9C"=EF=BC=89=EF=BC=8C=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E5=90=8E=E4=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=80=89=E4=B8=AD=E5=90=8C=E5=90=8D=E7=9A=84=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components-diy/diy-category-item.vue | 38 +++++++++++++++++++++++----- components-diy/diy-category.vue | 10 +++++--- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue index 52a23a0..b91076d 100644 --- a/components-diy/diy-category-item.vue +++ b/components-diy/diy-category-item.vue @@ -323,6 +323,10 @@ export default { isList: { type: Boolean, default: false + }, + lastSecondCategoryName: { + type: String, + default: '' } }, mixins: [DiyMinx], @@ -353,9 +357,16 @@ export default { if (this.index == this.select && this.pageIndex == 0) this.getGoodsList(); this.loadType = this.value.goodsLevel == 1 && this.value.loadType == 'all' ? 'all' : 'part'; if (this.index == this.select && parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) { - this.selectedSecondCategory = this.category.child_list[0].category_id; + let targetCategory = null; + if (this.lastSecondCategoryName) { + targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName); + } + if (!targetCategory) { + targetCategory = this.category.child_list[0]; + } + this.selectedSecondCategory = targetCategory.category_id; this.secondCategoryGoodsList = []; - this.getSecondCategoryGoods(this.category.child_list[0].category_id); + this.getSecondCategoryGoods(targetCategory.category_id); } }, mounted() { @@ -367,9 +378,16 @@ export default { }).exec(); }, 1000); if (parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) { - this.selectedSecondCategory = this.category.child_list[0].category_id; + let targetCategory = null; + if (this.lastSecondCategoryName) { + targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName); + } + if (!targetCategory) { + targetCategory = this.category.child_list[0]; + } + this.selectedSecondCategory = targetCategory.category_id; this.secondCategoryGoodsList = []; - this.getSecondCategoryGoods(this.category.child_list[0].category_id); + this.getSecondCategoryGoods(targetCategory.category_id); } }, watch: { @@ -400,9 +418,16 @@ export default { this.scrollTop = -1; } if (parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) { - this.selectedSecondCategory = this.category.child_list[0].category_id; + let targetCategory = null; + if (this.lastSecondCategoryName) { + targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName); + } + if (!targetCategory) { + targetCategory = this.category.child_list[0]; + } + this.selectedSecondCategory = targetCategory.category_id; this.secondCategoryGoodsList = []; - this.getSecondCategoryGoods(this.category.child_list[0].category_id); + this.getSecondCategoryGoods(targetCategory.category_id); } }, 'globalStoreInfo.store_id': { @@ -791,6 +816,7 @@ export default { this.selectedSecondCategory = category.category_id; this.secondCategoryGoodsList = []; this.getSecondCategoryGoods(category.category_id); + this.$emit('saveSecondCategory', category.category_name); } }, getSecondCategoryGoods(categoryId) { diff --git a/components-diy/diy-category.vue b/components-diy/diy-category.vue index 5ff3844..330fd40 100644 --- a/components-diy/diy-category.vue +++ b/components-diy/diy-category.vue @@ -101,8 +101,9 @@ :id="'category-' + index" v-if="select == index"> + @loadfinish="getHeightArea" @saveSecondCategory="saveSecondCategoryName"> {{ $lang('components-diy.diy-category.reachedBottom') }} @@ -194,7 +195,8 @@ export default { loadType: '', templateFourData: [], isList: false, - lang: uni.getStorageSync("lang")//en-us 英文 + lang: uni.getStorageSync("lang"), + lastSecondCategoryName: '' }; }, created() { @@ -373,9 +375,11 @@ export default { if (index >= this.categoryTree.length) return; this.select = index; this.categoryId = 'category-' + index; - // 阻止切换分类之后滚动事件也立即执行 this.scrollLock = true; }, + saveSecondCategoryName(name) { + this.lastSecondCategoryName = name; + }, touchStart() { this.scrollLock = false; },