Przeglądaj źródła

Merge branch 'redesign‌-260706' of http://git.huaml.com/zhh/front-end into redesign‌-260706

ouyang 4 dni temu
rodzic
commit
90d5ea46f7

+ 126 - 13
hdApp/src/admin/goods/manage.vue

@@ -43,7 +43,13 @@
             :class="{ active: currentTab === index }"
             @tap.stop="swichTab(index, item)"
           >
-            <view class="category-icon"></view>
+            <!-- 花束分类图标:与 categoryV2 一致取 img,无图时不占位以免侧栏文字错位 -->
+            <image
+              v-if="getCategoryIconSrc(item)"
+              class="category-icon"
+              :src="getCategoryIconSrc(item)"
+              mode="aspectFill"
+            />
             <text>{{ item.categoryName || '' }}</text>
           </view>
         </scroll-view>
@@ -115,8 +121,8 @@
           <view class="filter-tab" :class="{ active: globalLookStock === 2 }" @click="changeHasStock(2)">没库存</view>
         </view>
         <view class="action-btns">
-          <button class="admin-button-com middle blue tool-btn tool-btn--wide" @click="selectFlowerNumFn">筛选</button>
-          <button class="admin-button-com middle blue tool-btn" @click="refreshItem">刷新</button>
+          <button class="admin-button-com middle blue tool-btn tool-btn--wide" @click="selectFlowerNumFn"><zui-svg-icon class="tool-btn-icon" icon="general-filter" :width="14" :height="14" color="#fff" />筛选</button>
+          <button class="admin-button-com middle blue tool-btn" @click="refreshItem"><zui-svg-icon class="tool-btn-icon" icon="general-refresh" :width="14" :height="14" color="#fff" />刷新</button>
         </view>
       </view>
 
@@ -129,7 +135,13 @@
             :class="{ active: globalClassIndex === index }"
             @tap.stop="globalSwitchClass(index, item)"
           >
-            <view class="category-icon"></view>
+            <!-- 花材分类图标:优先 smallCover,其次 cover,与分类管理页展示字段对齐 -->
+            <image
+              v-if="getCategoryIconSrc(item)"
+              class="category-icon"
+              :src="getCategoryIconSrc(item)"
+              mode="aspectFill"
+            />
             <text>{{ item.name || '' }}</text>
           </view>
         </scroll-view>
@@ -280,6 +292,18 @@
       </view>
     </view>
 
+    <!-- 已开通花材批发店时,引导去批发端小程序修改花材,避免在零售端误改 -->
+    <modal-module
+      :show="showPfItemTip"
+      content="请到销花宝批发端修改花材"
+      color="#333"
+      :size="32"
+      padding="30rpx 30rpx"
+      :button="pfItemTipButtons"
+      :maskClosable="true"
+      @click="onPfItemTipClick"
+    />
+
     <modal-module :show="printLabelShow" @click="dialogInputConfirm" :maskClosable="true" title="数量" padding="30rpx 30rpx">
       <template v-slot:content>
         <view class="app-modal-input-wrap">
@@ -464,7 +488,16 @@ export default {
       partFocus: false,
       remarkShow: false,
       remarkText: "",
-      remarkFocus: false
+      remarkFocus: false,
+      // 花材是否已懒加载过,避免重复 initItem 请求
+      itemInited: false,
+      // 已开通批发店时切换花材的引导弹窗
+      showPfItemTip: false,
+      // 引导弹窗按钮:沿用 modal-module 默认描边/实心样式
+      pfItemTipButtons: [
+        { text: "返回花束", plain: true },
+        { text: "去批发端", plain: false }
+      ]
     }
   },
   // 汇总门店、登录人与字典信息;只读取 Vuex,不修改全局状态。
@@ -472,16 +505,16 @@ export default {
     ...mapGetters(["getMyShopInfo", "getLoginInfo"]),
     ...mapGetters({ loginInfo: "getLoginInfo", dictInfo: "getDictionariesInfo" })
   },
-  // 页面首次进入时按路由参数选择商品类型,并并行初始化分享配置、花束分类与花材数据
+  // 页面首次进入只加载花束与分享配置;花材按需懒加载,路由 type=item 时再进入花材流程
   onLoad(options) {
-    if (options && options.type === "item") {
-      this.activeType = "item"
-    }
     getWeixinId().then(res => {
       this.getAppIdList = res.data
     })
     this.getCategoryData()
-    this.initItem()
+    // 深链直接进花材时走同一套切换逻辑,以便已开通批发店时弹出引导而非误加载花材
+    if (options && options.type === "item") {
+      this.switchType("item")
+    }
   },
   // 页面重新可见时消费花束刷新标记,避免从编辑页返回后展示旧数据。
   onShow() {
@@ -494,9 +527,87 @@ export default {
     }
   },
   methods: {
-    // 切换花束或花材面板;type 仅接受 goods、item,不重新发起已完成的初始化请求。
+    /**
+     * 解析侧栏分类图标地址。
+     * 花束分类用 img;花材分类优先 smallCover,其次 cover。
+     * @param {Object} item 分类项
+     * @returns {string} 图标完整地址,无图返回空字符串(模板不渲染 image)
+     */
+    getCategoryIconSrc(item) {
+      if (!item) return ""
+      return item.img || item.smallCover || item.cover || ""
+    },
+    /**
+     * 切换花束 / 花材面板。
+     * 已开通花材批发店(pfShopId>0)时切到花材只弹引导,不切换面板、不加载花材;
+     * 未开通时才切换并按需懒加载花材数据。
+     * @param {string} type goods | item
+     */
     switchType(type) {
-      this.activeType = type
+      if (type === this.activeType) return
+      if (type === "item") {
+        // 零售店已绑定批发店:花材应在批发端维护,此处拦截并引导跳转销花宝
+        if (Number(this.getMyShopInfo && this.getMyShopInfo.pfShopId) > 0) {
+          this.showPfItemTip = true
+          return
+        }
+        this.activeType = "item"
+        this.ensureItemLoaded()
+        return
+      }
+      this.activeType = "goods"
+    },
+    // 关闭「去批发端」引导弹窗,保持当前仍在花束面板。
+    closePfItemTip() {
+      this.showPfItemTip = false
+    },
+    // 处理引导弹窗按钮:0 返回花束,1 跳转批发端小程序。
+    onPfItemTipClick(val) {
+      if (!val || val.index == 0) {
+        this.closePfItemTip()
+        return
+      }
+      this.goToPfMiniProgram()
+    },
+    /**
+     * 打开批发端小程序(现网「销花宝」,测试环境「花惠宝」)。
+     * appId 取自 getWeixinId 的 ghs.miniAppId;未缓存时再请求一次。
+     */
+    goToPfMiniProgram() {
+      this.closePfItemTip()
+      const openGhs = appIdList => {
+        const appId = appIdList && appIdList.ghs && appIdList.ghs.miniAppId
+        if (!appId) {
+          this.$msg("暂无法打开批发端")
+          return
+        }
+        // #ifdef MP-WEIXIN
+        uni.navigateToMiniProgram({
+          appId: appId,
+          path: "admin/home/workbench",
+          envVersion: process.env.NODE_ENV === "development" ? "develop" : "release",
+          extraData: {},
+          success() {}
+        })
+        // #endif
+        // #ifdef APP-PLUS
+        this.$msg("请用微信打开")
+        // #endif
+      }
+      if (this.getAppIdList && this.getAppIdList.ghs && this.getAppIdList.ghs.miniAppId) {
+        openGhs(this.getAppIdList)
+        return
+      }
+      getWeixinId().then(res => {
+        this.getAppIdList = res.data || {}
+        openGhs(this.getAppIdList)
+      })
+    },
+    // 首次进入花材时初始化分类与列表;已初始化则跳过,避免重复请求。
+    ensureItemLoaded() {
+      if (this.itemInited) return
+      this.itemInited = true
+      this.initItem()
     },
     // 加载花束分类并默认选中首个有效分类;分类为空时保留空态,不请求无效分类。
     getCategoryData() {
@@ -1385,7 +1496,9 @@ page {
   border-radius: 10upx;
   flex-shrink: 0;
   margin-right: 12upx;
-  background: transparent;
+  background: #f5f5f5;
+  display: block;
+  overflow: hidden;
 }
 
 .list-box {

+ 1 - 0
hdApp/src/assets/svg-icons/home/more.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1758013104896" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15229" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M323.8912 131.072a51.2 51.2 0 0 1 71.4752-72.8064l6.5536 6.4512L753.664 478.8224a51.2 51.2 0 0 1 5.12 59.1872l-5.4272 7.5776-351.744 405.0944A51.2 51.2 0 0 1 318.8736 890.88l5.4272-7.4752 322.7648-371.9168L323.8912 131.072z" fill="#000000" fill-opacity=".45" p-id="15230"></path></svg>

+ 5 - 5
hdApp/src/pagesPurchase/pb.vue

@@ -26,12 +26,12 @@
           </view>
           <view class="box_6 flex-row" @click="settleAccounts(ghsInfo)" v-if="Number(ghsInfo.debtAmount)>0">
             <view class="show_clear_area flex-row justify-between">
-              <image class="icon_2" referrerpolicy="no-referrer" src="/static/lanhu_020105gongyingshangliebiao/ps2pvfa1l5i34w5vqj2k7b3kejml3i3nmrba1421bf-caa2-491b-8773-af413df7e96d.png" />
+              <image class="icon_2" referrerpolicy="no-referrer" src="/static/icons/order-filled.svg" />
               <text class="waite_clear_order">待结订单&nbsp;{{ghsInfo.debtNum}}笔&nbsp;¥{{ghsInfo.debtAmount?parseFloat(ghsInfo.debtAmount):0}}</text>
             </view>
             <view class="image-text_9 flex-row justify-between">
               <text class="text-group_4">去结账</text>
-              <image class="icon_3" referrerpolicy="no-referrer" src="/static/lanhu_020105gongyingshangliebiao/ps83ag7scu3a8bfq22ciodg5hiu0x9cesxjbfb4c9ca-ee3f-45ec-a6d7-6f166e13d6e6.png" />
+              <zui-svg-icon icon="home-more" :width="16" :height="16" color="#ff0000" />
             </view>
           </view>
           <view class="button_4 flex-col" @click="recover(ghsInfo)"><text class="text_13">恢复</text></view>
@@ -371,9 +371,9 @@ export default {
           height: 29upx;
           margin: 26upx 0 0 30upx;
           .icon_2 {
-            width: 22upx;
-            height: 26upx;
-            margin-top: 2upx;
+            width: 45upx;
+            height: 45upx;
+            margin-top: -6upx;
           }
           .waite_clear_order {
             width: 214upx;

BIN
hdApp/src/static/lanhu_020105gongyingshangliebiao/ps2pvfa1l5i34w5vqj2k7b3kejml3i3nmrba1421bf-caa2-491b-8773-af413df7e96d.png


BIN
hdApp/src/static/lanhu_020105gongyingshangliebiao/ps83ag7scu3a8bfq22ciodg5hiu0x9cesxjbfb4c9ca-ee3f-45ec-a6d7-6f166e13d6e6.png


Plik diff jest za duży
+ 1 - 1
hdApp/src/static/svg-icons-lib.js


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików