Просмотр исходного кода

feat(hd): 优化拼团与秒杀商品编辑体验

- 区分新增与编辑入口的导航栏标题,提升页面状态辨识度
- 统一商品操作按钮样式,并简化多规格商品展示名称
shizhongqi 1 день назад
Родитель
Сommit
463323f929

+ 14 - 7
hdApp/src/admin/homePageConfig/groupBuy.vue

@@ -113,8 +113,8 @@
           </view>
         </view>
         <view class="goods-actions">
-          <text class="action-edit" @click="goGoodsEdit(index)">编辑</text>
-          <text class="action-delete" @click="removeGoods(index)">删除</text>
+          <view class="action-edit" @click="goGoodsEdit(index)">编辑</view>
+          <view class="action-delete" @click="removeGoods(index)">删除</view>
         </view>
       </view>
     </view>
@@ -625,17 +625,24 @@ export default {
   margin-left: 12upx;
 }
 
-.action-edit {
+.action-edit,
+.action-delete {
   font-size: 26upx;
+  line-height: 1.2;
+  padding: 8upx 20upx;
+  border-radius: 8upx;
+  text-align: center;
+}
+
+.action-edit {
   color: #09C567;
-  padding: 8upx 0;
+  border: 2upx solid #09C567;
 }
 
 .action-delete {
-  font-size: 26upx;
   color: #f04545;
-  padding: 8upx 0;
-  margin-top: 8upx;
+  border: 2upx solid #f04545;
+  margin-top: 32upx;
 }
 
 .bottom-space {

+ 6 - 2
hdApp/src/admin/homePageConfig/groupBuyGoodsEdit.vue

@@ -190,12 +190,17 @@ export default {
     /**
      * 解析路由 index,从 groupBuyDraft 加载待编辑商品
      * 编辑态按单条展示(列表中每规格已是独立一条)
+     * index>=0 为编辑,-1 为新增,据此切换导航栏标题
      */
     init() {
       this.goodsIndex = parseInt(this.option && this.option.index, 10)
       if (isNaN(this.goodsIndex)) {
         this.goodsIndex = -1
       }
+      // 新增/编辑共用本页,标题按入口区分,避免一直显示 pages.json 里的「新增」
+      uni.setNavigationBarTitle({
+        title: this.goodsIndex >= 0 ? '编辑' : '新增'
+      })
       const draft = uni.getStorageSync(DRAFT_KEY) || {}
       if (this.goodsIndex >= 0 && draft.goods && draft.goods[this.goodsIndex]) {
         const item = draft.goods[this.goodsIndex]
@@ -389,8 +394,7 @@ export default {
           return
         }
         // 列表展示名带规格后缀,便于区分同商品多规格
-        const displayName = form.specName
-          ? `${this.goodsBase.name}(${form.specName})` : this.goodsBase.name
+        const displayName = this.goodsBase.name
         items.push({
           id: parseInt(form.id, 10) || 0,
           goodsId,

+ 14 - 7
hdApp/src/admin/homePageConfig/seckill.vue

@@ -110,8 +110,8 @@
           </view>
         </view>
         <view class="goods-actions">
-          <text class="action-edit" @click="goGoodsEdit(index)">编辑</text>
-          <text class="action-delete" @click="removeGoods(index)">删除</text>
+          <view class="action-edit" @click="goGoodsEdit(index)">编辑</view>
+          <view class="action-delete" @click="removeGoods(index)">删除</view>
         </view>
       </view>
     </view>
@@ -605,17 +605,24 @@ export default {
   margin-left: 12upx;
 }
 
-.action-edit {
+.action-edit,
+.action-delete {
   font-size: 26upx;
+  line-height: 1.2;
+  padding: 8upx 20upx;
+  border-radius: 8upx;
+  text-align: center;
+}
+
+.action-edit {
   color: #09C567;
-  padding: 8upx 0;
+  border: 2upx solid #09C567;
 }
 
 .action-delete {
-  font-size: 26upx;
   color: #f04545;
-  padding: 8upx 0;
-  margin-top: 8upx;
+  border: 2upx solid #f04545;
+  margin-top: 32upx;
 }
 
 .bottom-space {

+ 6 - 3
hdApp/src/admin/homePageConfig/seckillGoodsEdit.vue

@@ -138,12 +138,17 @@ export default {
     /**
      * 解析路由 index,从 seckillDraft 加载待编辑商品
      * 编辑态按单条展示(列表中每规格已是独立一条)
+     * index>=0 为编辑,-1 为新增,据此切换导航栏标题
      */
     init() {
       this.goodsIndex = parseInt(this.option && this.option.index, 10)
       if (isNaN(this.goodsIndex)) {
         this.goodsIndex = -1
       }
+      // 新增/编辑共用本页,标题按入口区分,避免一直显示 pages.json 里的「新增」
+      uni.setNavigationBarTitle({
+        title: this.goodsIndex >= 0 ? '编辑' : '新增'
+      })
       const draft = uni.getStorageSync(DRAFT_KEY) || {}
       if (this.goodsIndex >= 0 && draft.goods && draft.goods[this.goodsIndex]) {
         const item = draft.goods[this.goodsIndex]
@@ -310,9 +315,7 @@ export default {
           return
         }
         // 列表展示名带规格后缀,便于区分同商品多规格
-        const displayName = form.specName
-          ? `${this.goodsBase.name}(${form.specName})`
-          : this.goodsBase.name
+        const displayName = this.goodsBase.name
         items.push({
           goodsId,
           price,