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 39d42643892eaa6c83d4b453ec126fa6660af619 Mon Sep 17 00:00:00 2001
From: jinhhanhan <1683105490@qq.com>
Date: Tue, 14 Jul 2026 09:59:44 +0800
Subject: [PATCH 2/6] =?UTF-8?q?chore=EF=BC=9A=E5=A2=9E=E5=8A=A0=E6=96=B0?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=AA=E5=9C=A8template=20=3D=3D=2099?=
=?UTF-8?q?=E9=87=8C=E7=94=9F=E6=95=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-category-item.vue | 134 ++++++++++++++++++++++++++-
components-diy/diy-category.vue | 14 ++-
2 files changed, 138 insertions(+), 10 deletions(-)
diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue
index f7a5d29..7754063 100644
--- a/components-diy/diy-category-item.vue
+++ b/components-diy/diy-category-item.vue
@@ -2,10 +2,50 @@
-
-
+
+
-
+
+
+
+ {{ 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') }}
+
+
+
+
{{ category.category_name }}
0) {
+ 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(targetCategory.category_id);
+ }
},
mounted() {
setTimeout(() => {
@@ -332,6 +390,18 @@ export default {
if (data) this.contentWrapHeight = data.height;
}).exec();
}, 1000);
+ if (this.value.template == 99 && parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) {
+ 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(targetCategory.category_id);
+ }
},
watch: {
oneCategorySelect: function () {
@@ -360,6 +430,18 @@ export default {
} else if (this.loadType == 'part') {
this.scrollTop = -1;
}
+ if (this.value.template == 99 && parseInt(this.value.level) == 2 && this.category.child_list && this.category.child_list.length > 0) {
+ 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(targetCategory.category_id);
+ }
},
'globalStoreInfo.store_id': {
handler(nval, oval) {
@@ -739,6 +821,48 @@ 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);
+ this.$emit('saveSecondCategory', category.category_name);
+ }
+ },
+ 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 = 'sales';
+ sort = 'desc';
+ } else if (this.value.sortWay == 'price') {
+ order = 'min_price';
+ sort = this.value.sortType == 'desc' ? 'desc' : 'asc';
+ }
+ }
+ this.$api.goods.getGoodsList({
+ category_id: categoryId,
+ page: this.pageIndex,
+ page_size: this.pageSize,
+ order: order,
+ sort: sort
+ }).then(res => {
+ this.loading = false;
+ if (res.data.data.list) {
+ this.secondCategoryGoodsList = res.data.data.list;
+ }
+ }).catch(err => {
+ this.loading = false;
+ });
+ },
//加载商品在购物车的总数量
loadGoodsCartNum(isRefresh = false) {
this.goodsList.forEach((item) => {
diff --git a/components-diy/diy-category.vue b/components-diy/diy-category.vue
index e6e01ce..bc17e54 100644
--- a/components-diy/diy-category.vue
+++ b/components-diy/diy-category.vue
@@ -92,17 +92,18 @@
-
+ :id="'category-' + index" :style="{ display: value.template == 99 && select != index ? 'none' : 'block' }">
+ @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;
},
From 7f2e5d3934e25e578b7c41ea807f8e5f50f5e4f4 Mon Sep 17 00:00:00 2001
From: jinhhanhan <1683105490@qq.com>
Date: Wed, 15 Jul 2026 16:50:26 +0800
Subject: [PATCH 3/6] =?UTF-8?q?chore=EF=BC=9A=20template=2099=E6=AD=A3?=
=?UTF-8?q?=E5=B8=B8=E8=BF=90=E8=A1=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-category-item.vue | 175 ++++++++++++++++++++++++---
components-diy/diy-category.vue | 95 +++++++++++++++
pages.json | 24 +++-
3 files changed, 274 insertions(+), 20 deletions(-)
diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue
index 7754063..c0734c1 100644
--- a/components-diy/diy-category-item.vue
+++ b/components-diy/diy-category-item.vue
@@ -45,7 +45,7 @@
-
+
{{ category.category_name }}
-
+
{{ one.category_name }}
@@ -848,19 +848,23 @@ export default {
sort = this.value.sortType == 'desc' ? 'desc' : 'asc';
}
}
- this.$api.goods.getGoodsList({
- category_id: categoryId,
- page: this.pageIndex,
- page_size: this.pageSize,
- order: order,
- sort: sort
- }).then(res => {
- this.loading = false;
- if (res.data.data.list) {
- this.secondCategoryGoodsList = res.data.data.list;
+ this.$api.sendRequest({
+ url: '/api/goodssku/pageByCategory',
+ data: {
+ category_id: categoryId,
+ page: 1,
+ page_size: this.pageSize,
+ order: order,
+ sort: sort
+ },
+ success: res => {
+ this.loading = false;
+ if (res.code == 0 && res.data && res.data.list) {
+ this.secondCategoryGoodsList = res.data.list;
+ } else {
+ this.secondCategoryGoodsList = [];
+ }
}
- }).catch(err => {
- this.loading = false;
});
},
//加载商品在购物车的总数量
@@ -1589,4 +1593,147 @@ export default {
.price-font {
font-weight: var(--diy-category-item-price-font-weight, 500) !important;
}
+
+// ===================== 模板99 商品分类样式 =====================
+.second-category-btns {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 20rpx 20rpx 10rpx;
+ background: #fff;
+ border-bottom: 1rpx solid #f0f0f0;
+
+ .second-category-btn {
+ padding: 14rpx 32rpx;
+ background: #f5f5f5;
+ color: #666;
+ border-radius: 40rpx;
+ font-size: 26rpx;
+ margin: 0 16rpx 16rpx 0;
+ max-width: 100%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ &.selected {
+ background: #FF6B35;
+ color: #fff;
+ }
+ }
+}
+
+.category-goods-list {
+ padding: 20rpx;
+ background: #f5f5f5;
+ width: 100%;
+ box-sizing: border-box;
+
+ .goods-list {
+ margin: 0;
+ padding-top: 0;
+ display: flex;
+
+ .goods-item {
+ width: calc(50% - 10rpx);
+ background: #fff;
+ border-radius: 12rpx;
+ overflow: hidden;
+ margin-bottom: 20rpx;
+ display: flex;
+ flex-direction: column;
+ box-sizing: border-box;
+
+ .goods-img {
+ width: 100%;
+ height: 0;
+ padding-top: 100%;
+ position: relative;
+ overflow: hidden;
+ background: #fff;
+ border-top-left-radius: 12rpx;
+ border-top-right-radius: 12rpx;
+
+ image {
+ width: 100%;
+ height: 100%;
+ position: absolute !important;
+ top: 0;
+ left: 0;
+ transform: none;
+ }
+
+ .goods-tag {
+ position: absolute;
+ top: 10rpx;
+ left: 10rpx;
+ padding: 4rpx 12rpx;
+ color: #fff;
+ font-size: 22rpx;
+ border-radius: 6rpx;
+ background: #FF6B35;
+ z-index: 2;
+ }
+ }
+
+ .info-wrap {
+ flex: 1;
+ padding: 16rpx;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .name-wrap {
+ .goods-name {
+ font-size: 26rpx;
+ color: #333;
+ -webkit-line-clamp: 2;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ line-height: 1.4;
+ margin-top: 0;
+ white-space: normal;
+ text-overflow: clip;
+ }
+ }
+
+ .price-wrap {
+ margin-top: 10rpx;
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+
+ .discount-price {
+ color: #FF6B35;
+ font-size: 30rpx;
+ font-weight: bold;
+
+ .unit {
+ font-size: 22rpx;
+ }
+ }
+ }
+ }
+ }
+}
+
+.category-goods-empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 80rpx 0;
+ background: #f5f5f5;
+ width: 100%;
+
+ image {
+ width: 280rpx;
+ height: 252rpx;
+ }
+
+ .tips {
+ font-size: 26rpx;
+ color: #999;
+ margin-top: 20rpx;
+ }
+}
\ No newline at end of file
diff --git a/components-diy/diy-category.vue b/components-diy/diy-category.vue
index bc17e54..cb4727d 100644
--- a/components-diy/diy-category.vue
+++ b/components-diy/diy-category.vue
@@ -1054,4 +1054,99 @@ export default {
border-bottom-right-radius: 8rpx;
}
}
+
+// ===================== 模板99 商品分类样式 =====================
+.category-template-99 {
+ .search-box {
+ padding: 20rpx 24rpx;
+ background: #fff;
+ border-bottom: 1rpx solid #f0f0f0;
+
+ .search-content {
+ height: 64rpx;
+ background-color: #f5f5f5;
+ border-radius: 40rpx;
+
+ input {
+ height: 64rpx;
+ line-height: 64rpx;
+ padding: 0 80rpx 0 30rpx;
+ background: #f5f5f5;
+ border-radius: 40rpx;
+ font-size: 26rpx;
+ color: #333;
+ }
+
+ .iconfont {
+ font-size: 32rpx;
+ color: #89899a;
+ width: 70rpx;
+ text-align: center;
+ }
+ }
+
+ > .iconfont {
+ font-size: 40rpx;
+ color: #666;
+ margin-left: 20rpx;
+ }
+ }
+
+ .content-box {
+ .tree-wrap {
+ width: 200rpx;
+ background-color: #f5f5f5;
+ }
+
+ .right-flex-wrap {
+ flex: 1;
+ width: 0;
+ background: #f5f5f5;
+ }
+ }
+
+ .tree-wrap .category-item {
+ padding: 30rpx 16rpx;
+ background-color: #f5f5f5;
+
+ view {
+ color: #333;
+ font-size: 26rpx;
+ line-height: 1.3;
+ }
+
+ &.select {
+ background: #fff;
+
+ view {
+ color: #FF6B35;
+ font-weight: bold;
+ font-size: 28rpx;
+ }
+
+ &::before {
+ content: ' ';
+ width: 6rpx;
+ height: 36rpx;
+ background: #FF6B35;
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 50%;
+ transform: translateY(-50%);
+ border-radius: 0 6rpx 6rpx 0;
+ }
+ }
+ }
+
+ .content-wrap {
+ background: #f5f5f5;
+ padding: 0;
+ }
+
+ .child-category {
+ width: 100%;
+ box-sizing: border-box;
+ }
+}
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 1a6d0a3..6276820 100644
--- a/pages.json
+++ b/pages.json
@@ -145,13 +145,25 @@
"diy-store-label": "view",
"diy-tab": "view",
"diy-text": "view",
- "diy-video": "view",
- "diy-video-list": "view"
- }
+ "diy-video": "view",
+ "diy-video-list": "view"
}
- },
- {
- "path": "cart",
+ }
+ },
+ {
+ // 分类模板99测试页面
+ "path": "category-test99",
+ "style": {
+ "disableScroll": true,
+ "navigationBarTitleText": "分类模板99",
+ "componentPlaceholder": {
+ "diy-category": "view",
+ "diy-category-item": "view"
+ }
+ }
+ },
+ {
+ "path": "cart",
"style": {
// #ifdef APP-PLUS
"navigationStyle": "custom",
From 7a6495fa33a968df32bb6e2ba981a6fb106686c5 Mon Sep 17 00:00:00 2001
From: jinhhanhan <1683105490@qq.com>
Date: Thu, 16 Jul 2026 14:31:14 +0800
Subject: [PATCH 4/6] =?UTF-8?q?chore:=E6=8C=89=E9=92=AE=20=3D=20=E5=85=A8?=
=?UTF-8?q?=E5=B1=80=E6=89=80=E6=9C=89=E6=9C=89=E5=95=86=E5=93=81=E7=9A=84?=
=?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=88=86=E7=B1=BB=EF=BC=88=E5=8E=BB=E9=87=8D?=
=?UTF-8?q?=EF=BC=8C=E4=B8=80=E7=9B=B4=E6=98=BE=E7=A4=BA=EF=BC=89=EF=BC=8C?=
=?UTF-8?q?=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81=E5=9C=A8=E5=88=87=E6=8D=A2?=
=?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E6=97=B6=E4=BF=9D=E6=8C=81?=
=?UTF-8?q?=20=E5=95=86=E5=93=81=20=3D=20=E5=88=87=E6=8D=A2=E4=B8=80?=
=?UTF-8?q?=E7=BA=A7=E5=88=86=E7=B1=BB=E6=97=B6=EF=BC=8C=E7=94=A8=E9=80=89?=
=?UTF-8?q?=E4=B8=AD=E6=8C=89=E9=92=AE=E7=9A=84=E5=90=8D=E7=A7=B0=E5=9C=A8?=
=?UTF-8?q?=E5=BD=93=E5=89=8D=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E4=B8=8B?=
=?UTF-8?q?=E6=89=BE=E5=90=8C=E5=90=8D=20category=EF=BC=8C=E9=87=8D?=
=?UTF-8?q?=E6=96=B0=E5=8A=A0=E8=BD=BD=E8=AF=A5=20category=20=E7=9A=84?=
=?UTF-8?q?=E5=95=86=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-category-item.vue | 50 ++++++++++++++++-
components-diy/diy-category.vue | 84 +++++++++++++++++++++++++++-
2 files changed, 129 insertions(+), 5 deletions(-)
diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue
index c0734c1..bf600cc 100644
--- a/components-diy/diy-category-item.vue
+++ b/components-diy/diy-category-item.vue
@@ -340,6 +340,10 @@ export default {
lastSecondCategoryName: {
type: String,
default: ''
+ },
+ currentOneCategory: {
+ type: Object,
+ default: null
}
},
mixins: [DiyMinx],
@@ -379,7 +383,8 @@ export default {
}
this.selectedSecondCategory = targetCategory.category_id;
this.secondCategoryGoodsList = [];
- this.getSecondCategoryGoods(targetCategory.category_id);
+ // 用当前一级分类下同名二级分类的 id 查商品(而非全局按钮的 id)
+ this.refreshGoodsByCurrentCategory();
}
},
mounted() {
@@ -440,9 +445,18 @@ export default {
}
this.selectedSecondCategory = targetCategory.category_id;
this.secondCategoryGoodsList = [];
- this.getSecondCategoryGoods(targetCategory.category_id);
+ this.refreshGoodsByCurrentCategory();
}
},
+ // 切换一级分类时, 根据当前一级分类下同名二级分类重新加载商品
+ currentOneCategory: {
+ handler() {
+ if (this.value.template == 99 && parseInt(this.value.level) == 2) {
+ this.refreshGoodsByCurrentCategory();
+ }
+ },
+ deep: true
+ },
'globalStoreInfo.store_id': {
handler(nval, oval) {
if (nval != oval) {
@@ -821,6 +835,35 @@ export default {
if (!link) return;
this.$util.diyRedirectTo(JSON.parse(link));
},
+ /**
+ * 根据当前一级分类(currentOneCategory)下与选中按钮同名的二级分类, 加载对应商品
+ * 按钮是全局去重的(选中状态用全局 category_id), 但商品只显示当前一级分类下的
+ * 当前一级分类下若没有同名二级分类, 则商品清空(按钮保持选中)
+ */
+ refreshGoodsByCurrentCategory() {
+ if (this.selectedSecondCategory == null) {
+ this.secondCategoryGoodsList = [];
+ return;
+ }
+ // 取当前选中按钮的名称
+ const cur = (this.category.child_list || []).find(c => c.category_id === this.selectedSecondCategory);
+ if (!cur) {
+ this.secondCategoryGoodsList = [];
+ return;
+ }
+ const one = this.currentOneCategory;
+ if (!one || !one.child_list || one.child_list.length === 0) {
+ this.secondCategoryGoodsList = [];
+ return;
+ }
+ const match = one.child_list.find(c => c.category_name === cur.category_name);
+ if (match) {
+ this.getSecondCategoryGoods(match.category_id);
+ } else {
+ // 当前一级分类下没有该二级分类, 商品清空(按钮仍保持选中)
+ this.secondCategoryGoodsList = [];
+ }
+ },
selectSecondCategory(category) {
if (this.selectedSecondCategory === category.category_id) {
this.selectedSecondCategory = null;
@@ -828,8 +871,9 @@ export default {
} else {
this.selectedSecondCategory = category.category_id;
this.secondCategoryGoodsList = [];
- this.getSecondCategoryGoods(category.category_id);
this.$emit('saveSecondCategory', category.category_name);
+ // 用当前一级分类下同名 category_id 查商品
+ this.refreshGoodsByCurrentCategory();
}
},
getSecondCategoryGoods(categoryId) {
diff --git a/components-diy/diy-category.vue b/components-diy/diy-category.vue
index cb4727d..e85b231 100644
--- a/components-diy/diy-category.vue
+++ b/components-diy/diy-category.vue
@@ -92,7 +92,19 @@
-
+
+
+
+
+ {
+ if (one.child_list && one.child_list.length) {
+ one.child_list.forEach(two => {
+ allSecond.push(Object.assign({ _origIndex: allSecond.length }, two));
+ });
+ }
+ });
+ if (!allSecond.length) {
+ this.template99Category = { category_name: '', child_list: [] };
+ return;
+ }
+ let pending = allSecond.length;
+ const results = [];
+ const finishOne = () => {
+ pending--;
+ if (pending <= 0) {
+ results.sort((a, b) => a._origIndex - b._origIndex);
+ // 按名称去重, 同名只保留第一个有商品的(只要任一同名有商品就显示)
+ const deduped = [];
+ const seenNames = {};
+ results.forEach(item => {
+ if (!seenNames[item.category_name]) {
+ seenNames[item.category_name] = true;
+ deduped.push(item);
+ }
+ });
+ this.template99Category = {
+ category_name: '',
+ child_list: deduped
+ };
+ }
+ };
+ allSecond.forEach(two => {
+ this.$api.sendRequest({
+ url: '/api/goodssku/pageByCategory',
+ data: {
+ category_id: two.category_id,
+ page: 1,
+ page_size: 1
+ },
+ success: res => {
+ if (res && res.code == 0 && res.data && res.data.list && res.data.list.length > 0) {
+ results.push(two);
+ }
+ },
+ complete: () => {
+ finishOne();
+ }
+ });
+ });
+ },
/**
* 切换一级分类
* @param {Object} index
From d78a23602e2b291b558b2da08019dc14b94e8366 Mon Sep 17 00:00:00 2001
From: jinhhanhan <1683105490@qq.com>
Date: Thu, 16 Jul 2026 15:31:07 +0800
Subject: [PATCH 5/6] =?UTF-8?q?chore=EF=BC=9A=E5=88=A0=E9=99=A4=E4=B8=B4?=
=?UTF-8?q?=E6=97=B6=E6=B5=8B=E8=AF=95=E7=BD=91=E5=9D=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.local.config.js | 10 +++++++++-
components-diy/diy-category.vue | 12 ++++++------
pages.json | 12 ------------
3 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/.local.config.js b/.local.config.js
index 5590cd8..54f0be4 100644
--- a/.local.config.js
+++ b/.local.config.js
@@ -123,10 +123,18 @@ const localDevConfig = ({
uniacid: 2821,
domain: 'https://xcx.aigc-quickapp.com/',
},
+ '18': { // 测试平台
+ uniacid: 18,
+ domain: 'https://test.aigc-quickapp.com',
+ },
+ '2': { // 测试平台
+ uniacid: 2,
+ domain: 'https://test.aigc-quickapp.com',
+ },
// })['5g-237']; // 商品分类,没有立即咨询文字
// })['5g-97']; // 大宗商品贸易,支持自定义字体大小、颜色
// })['5g-50']; // 燃气安全产品机器人,购物车无反应
-})['2821']; // 离型纸硅油纸
+})['2']; // 离型纸硅油纸
// })['2485']; // 验证电子表单前后端数据一致性
// })['5g-11']; // 数码
// })['5g-213']; // 选择要使用的环境配置
diff --git a/components-diy/diy-category.vue b/components-diy/diy-category.vue
index e85b231..cbffec6 100644
--- a/components-diy/diy-category.vue
+++ b/components-diy/diy-category.vue
@@ -346,7 +346,7 @@ export default {
})
.exec();
this.heightArea = heightArea;
- if (index != -1 && index < this.categoryTree.length - 1) this.$refs.categoryItem[index + 1].getGoodsList();
+ if (index != -1 && index < this.categoryTree.length - 1 && Array.isArray(this.$refs.categoryItem) && this.$refs.categoryItem[index + 1]) this.$refs.categoryItem[index + 1].getGoodsList();
},
/**
* 获取全部分类
@@ -477,10 +477,10 @@ export default {
break;
}
}
- if (this.value.template != 1 && this.value.loadType == 'all' && this.heightArea[this.select][1] -
- scrollTop - contentWrapHeight < 300) {
- this.$refs.categoryItem[this.select].getGoodsList();
- }
+ if (this.value.template != 1 && this.value.loadType == 'all' && this.heightArea[this.select][1] -
+ scrollTop - contentWrapHeight < 300) {
+ if (Array.isArray(this.$refs.categoryItem) && this.$refs.categoryItem[this.select]) this.$refs.categoryItem[this.select].getGoodsList();
+ }
}
},
onRefresh() {
@@ -633,7 +633,7 @@ export default {
},
// 操作多规格商品弹框后,刷新商品数据
refreshData() {
- this.$refs.categoryItem[this.select].loadGoodsCartNum(true);
+ if (Array.isArray(this.$refs.categoryItem) && this.$refs.categoryItem[this.select]) this.$refs.categoryItem[this.select].loadGoodsCartNum(true);
},
changeListStyle() {
this.isList = !this.isList;
diff --git a/pages.json b/pages.json
index 6276820..90ea173 100644
--- a/pages.json
+++ b/pages.json
@@ -150,18 +150,6 @@
}
}
},
- {
- // 分类模板99测试页面
- "path": "category-test99",
- "style": {
- "disableScroll": true,
- "navigationBarTitleText": "分类模板99",
- "componentPlaceholder": {
- "diy-category": "view",
- "diy-category-item": "view"
- }
- }
- },
{
"path": "cart",
"style": {
From 660ab27377fef7dd4294c53dfdc0e2599f34dbc4 Mon Sep 17 00:00:00 2001
From: jinhhanhan <1683105490@qq.com>
Date: Thu, 16 Jul 2026 16:11:01 +0800
Subject: [PATCH 6/6] =?UTF-8?q?chore=20:=E6=8C=89=E9=92=AE=20=3D=20?=
=?UTF-8?q?=E5=85=A8=E5=B1=80=E6=89=80=E6=9C=89=E6=9C=89=E5=95=86=E5=93=81?=
=?UTF-8?q?=E7=9A=84=E4=BA=8C=E7=BA=A7=E5=88=86=E7=B1=BB=EF=BC=88=E5=8E=BB?=
=?UTF-8?q?=E9=87=8D=EF=BC=8C=E4=B8=80=E7=9B=B4=E6=98=BE=E7=A4=BA=EF=BC=89?=
=?UTF-8?q?=EF=BC=8C=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81=E5=88=87=E6=8D=A2?=
=?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E6=97=B6=E4=BF=9D=E6=8C=81?=
=?UTF-8?q?=20=E5=95=86=E5=93=81=20=3D=20=E5=88=87=E6=8D=A2=E4=B8=80?=
=?UTF-8?q?=E7=BA=A7=E5=88=86=E7=B1=BB=E6=97=B6=EF=BC=8C=E7=94=A8=E9=80=89?=
=?UTF-8?q?=E4=B8=AD=E6=8C=89=E9=92=AE=E7=9A=84=E5=90=8D=E7=A7=B0=E5=9C=A8?=
=?UTF-8?q?=E5=BD=93=E5=89=8D=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E4=B8=8B?=
=?UTF-8?q?=E6=89=BE=E5=90=8C=E5=90=8D=20category=EF=BC=8C=E9=87=8D?=
=?UTF-8?q?=E6=96=B0=E5=8A=A0=E8=BD=BD=E5=95=86=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.local.config.js | 6 +++++-
components-diy/diy-category-item.vue | 10 +++++-----
components-diy/diy-category.vue | 4 ++--
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/.local.config.js b/.local.config.js
index 54f0be4..b24c4a0 100644
--- a/.local.config.js
+++ b/.local.config.js
@@ -131,10 +131,14 @@ const localDevConfig = ({
uniacid: 2,
domain: 'https://test.aigc-quickapp.com',
},
+ '48': { // 测试平台
+ uniacid: 48,
+ domain: 'https://test.aigc-quickapp.com',
+ },
// })['5g-237']; // 商品分类,没有立即咨询文字
// })['5g-97']; // 大宗商品贸易,支持自定义字体大小、颜色
// })['5g-50']; // 燃气安全产品机器人,购物车无反应
-})['2']; // 离型纸硅油纸
+})['48']; // 离型纸硅油纸
// })['2485']; // 验证电子表单前后端数据一致性
// })['5g-11']; // 数码
// })['5g-213']; // 选择要使用的环境配置
diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue
index bf600cc..9c6e419 100644
--- a/components-diy/diy-category-item.vue
+++ b/components-diy/diy-category-item.vue
@@ -5,7 +5,7 @@
-
+
0) {
+ if (this.value.template == 99 && this.index == this.select && this.category.child_list && this.category.child_list.length > 0) {
let targetCategory = null;
if (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;
}).exec();
}, 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;
if (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') {
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;
if (this.lastSecondCategoryName) {
targetCategory = this.category.child_list.find(item => item.category_name === this.lastSecondCategoryName);
@@ -451,7 +451,7 @@ export default {
// 切换一级分类时, 根据当前一级分类下同名二级分类重新加载商品
currentOneCategory: {
handler() {
- if (this.value.template == 99 && parseInt(this.value.level) == 2) {
+ if (this.value.template == 99) {
this.refreshGoodsByCurrentCategory();
}
},
diff --git a/components-diy/diy-category.vue b/components-diy/diy-category.vue
index cbffec6..a7186e6 100644
--- a/components-diy/diy-category.vue
+++ b/components-diy/diy-category.vue
@@ -93,7 +93,7 @@
-