shish hace 2 días
padre
commit
36d6a79a00
Se han modificado 1 ficheros con 38 adiciones y 62 borrados
  1. 38 62
      hdApp/src/admin/goods/manage.vue

+ 38 - 62
hdApp/src/admin/goods/manage.vue

@@ -45,22 +45,16 @@
       </view>
 
       <view class="content-area">
-        <scroll-view scroll-y class="category-list">
+        <scroll-view scroll-y scroll-with-animation class="tab-view">
           <view
             v-for="(item, index) in tabbar"
             :key="index"
-            class="category-item"
+            class="tab-bar-item"
             :class="{ active: currentTab === index }"
+            :data-current="index"
             @tap.stop="swichTab(index, item)"
           >
-            <!-- 花束分类图标:与 categoryV2 一致取 img,无图时不占位以免侧栏文字错位 -->
-            <image
-              v-if="getCategoryIconSrc(item)"
-              class="category-icon"
-              :src="getCategoryIconSrc(item)"
-              mode="aspectFill"
-            />
-            <text>{{ item.categoryName || '' }}</text>
+            <text class="tab-bar-text">{{ item.categoryName || '' }}</text>
           </view>
         </scroll-view>
 
@@ -149,22 +143,16 @@
       </view>
 
       <view class="content-area scroll-middle_bx">
-        <scroll-view scroll-y scroll-with-animation class="category-list tab-view">
+        <scroll-view scroll-y scroll-with-animation class="tab-view">
           <view
             v-for="(item, index) in globalClassData"
             :key="index"
-            class="category-item tab-bar-item"
+            class="tab-bar-item"
             :class="{ active: globalClassIndex === index }"
+            :data-current="index"
             @tap.stop="globalSwitchClass(index, item)"
           >
-            <!-- 花材分类图标:优先 smallCover,其次 cover,与分类管理页展示字段对齐 -->
-            <image
-              v-if="getCategoryIconSrc(item)"
-              class="category-icon"
-              :src="getCategoryIconSrc(item)"
-              mode="aspectFill"
-            />
-            <text>{{ item.name || '' }}</text>
+            <text class="tab-bar-text">{{ item.name || '' }}</text>
           </view>
         </scroll-view>
 
@@ -543,16 +531,6 @@ export default {
     }
   },
   methods: {
-    /**
-     * 解析侧栏分类图标地址。
-     * 花束分类用 img;花材分类优先 smallCover,其次 cover。
-     * @param {Object} item 分类项
-     * @returns {string} 图标完整地址,无图返回空字符串(模板不渲染 image)
-     */
-    getCategoryIconSrc(item) {
-      if (!item) return ""
-      return item.img || item.smallCover || item.cover || ""
-    },
     /**
      * 切换花束 / 花材面板。
      * 已开通花材批发店(pfShopId>0)时仍进入花材页,但锁定为页内引导(不加载零售花材);
@@ -1538,53 +1516,51 @@ page {
   overflow: hidden;
 }
 
-.category-list {
-  width: 202upx;
-  height: 100%;
-  flex-shrink: 0;
-  background: #fff;
-}
-
+/* 左侧分类栏:对齐 admin/item/list2.vue 的 tab-view */
 .tab-view {
+  width: 170upx;
+  height: 100%;
   flex-shrink: 0;
+  background-color: #f0f2f6;
 }
 
-.category-item {
+.tab-bar-item {
   position: relative;
-  min-height: 92upx;
-  padding: 18upx 10upx 18upx 30upx;
+  width: 170upx;
+  height: 90upx;
   box-sizing: border-box;
   display: flex;
   align-items: center;
-  color: #111;
-  font-size: 24upx;
-  font-weight: 600;
+  justify-content: center;
+  font-size: 26upx;
+  color: #444;
+  font-weight: 400;
+}
+
+.tab-bar-item:last-child {
+  margin-bottom: 110upx;
+}
+
+.tab-bar-text {
+  text-align: center;
+  width: 100%;
+  padding: 0 8upx;
+  box-sizing: border-box;
 }
 
-.category-item.active {
-  color: #189b00;
+.tab-bar-item.active {
+  position: relative;
+  color: $mainColor;
+  font-size: 26upx;
+  background: #fff;
 }
 
-.category-item.active::before {
+.tab-bar-item.active::before {
   content: "";
   position: absolute;
+  border-left: 8upx solid $mainColor;
+  height: 100%;
   left: 0;
-  top: 10upx;
-  bottom: 10upx;
-  width: 6upx;
-  border-radius: 6upx;
-  background: #ff5b22;
-}
-
-.category-icon {
-  width: 42upx;
-  height: 42upx;
-  border-radius: 10upx;
-  flex-shrink: 0;
-  margin-right: 12upx;
-  background: #f5f5f5;
-  display: block;
-  overflow: hidden;
 }
 
 .list-box {