Quellcode durchsuchen

feat(ui): 优化搜索与红包提醒交互

- 合并商品名称与编号搜索切换,并将搜索入口内嵌到输入框\n- 调整红包提醒弹窗响应式宽度,改用本地可着色 SVG 图标\n- 清理会员搜索与红包提醒中的冗余展示代码
shizhongqi vor 3 Tagen
Ursprung
Commit
b6b6506531

+ 47 - 22
hdApp/src/admin/goods/manage.vue

@@ -7,15 +7,15 @@
 
     <view v-if="activeType === 'goods'" class="panel">
       <view class="search-row">
-        <view class="search-type-wrap">
-          <button class="admin-button-com middle small-btn" :class="[searchType === 0 ? 'blue' : 'default']" @click="changeSearchType(0)">名称</button>
-          <button class="admin-button-com middle small-btn" :class="[searchType === 1 ? 'blue' : 'default']" @click="changeSearchType(1)">编号</button>
-        </view>
-        <view class="search-box">
+        <button class="admin-button-com middle small-btn blue" @click="changeSearchType">
+          <text>{{ searchTypeLabel }}</text>
+          <zui-svg-icon class="search-type-icon" icon="general-switch" :width="14" :height="14" color="#fff" />
+        </button>
+        <view class="search-box has-search-btn">
           <text class="search-icon">⌕</text>
           <input v-model="searchText" class="search-input" placeholder="请输入" confirm-type="search" @confirm="searchGoods" />
+          <button class="admin-button-com middle blue search-btn" @click="searchGoods">搜索</button>
         </view>
-        <button class="admin-button-com middle blue search-btn" @click="searchGoods">搜索</button>
       </view>
 
       <view class="filter-row">
@@ -503,7 +503,11 @@ export default {
   // 汇总门店、登录人与字典信息;只读取 Vuex,不修改全局状态。
   computed: {
     ...mapGetters(["getMyShopInfo", "getLoginInfo"]),
-    ...mapGetters({ loginInfo: "getLoginInfo", dictInfo: "getDictionariesInfo" })
+    ...mapGetters({ loginInfo: "getLoginInfo", dictInfo: "getDictionariesInfo" }),
+    // 合并后的搜索类型按钮文案:0 按名称,1 按编号,避免模板里写三元判断。
+    searchTypeLabel() {
+      return this.searchType === 0 ? "名称" : "编号"
+    }
   },
   // 页面首次进入只加载花束与分享配置;花材按需懒加载,路由 type=item 时再进入花材流程。
   onLoad(options) {
@@ -656,9 +660,9 @@ export default {
       this.lastSearchText = ""
       this.refreshGoods()
     },
-    // 切换按名称或编号搜索并立即刷新;i 为后端约定的搜索类型值
-    changeSearchType(i) {
-      this.searchType = i
+    // 在名称/编号之间切换搜索类型并立即刷新;合并为一个按钮后点击即取反
+    changeSearchType() {
+      this.searchType = this.searchType === 0 ? 1 : 0
       this.searchGoods()
     },
     // 提交花束关键词搜索;有关键词时跨分类查询,清空后恢复首个分类。
@@ -1298,16 +1302,6 @@ page {
   margin-left: 10upx;
 }
 
-.search-type-wrap {
-  display: flex;
-  align-items: center;
-}
-
-/* 名称/编号切换按钮间距,避免小程序原生 button 相邻选择器不生效 */
-.search-type-wrap .small-btn:not(:last-child) {
-  margin-right: 12upx;
-}
-
 .small-btn,
 .image-class-btn,
 .search-btn,
@@ -1316,8 +1310,20 @@ page {
   white-space: nowrap;
 }
 
-.small-btn {
-  width: 92upx;
+/* 名称/编号合并按钮:文字+切换图标同一行,宽度随内容伸缩 */
+.admin-button-com.middle.small-btn {
+  width: auto;
+  min-width: 120upx;
+  height: 68upx;
+  padding: 0 16upx;
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.search-type-icon {
+  flex-shrink: 0;
+  margin-left: 6upx;
 }
 
 .image-class-btn {
@@ -1335,6 +1341,12 @@ page {
   padding: 0 24upx;
   box-sizing: border-box;
   min-width: 0;
+  margin-left: 8upx;
+}
+
+/* 内嵌搜索按钮时收紧右侧内边距,让按钮贴在圆角框内 */
+.search-box.has-search-btn {
+  padding-right: 6upx;
 }
 
 .search-icon {
@@ -1354,6 +1366,19 @@ page {
   width: 108upx;
 }
 
+/* 花束搜索框内的搜索按钮:压低高度以免撑破圆角输入框 */
+.search-box .search-btn {
+  height: 54upx;
+  padding-top: 0;
+  padding-bottom: 0;
+  flex-shrink: 0;
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 24upx;
+  border-radius: 26upx;
+}
+
 .filter-row {
   display: flex;
   align-items: center;

+ 0 - 1
hdApp/src/admin/home/member.vue

@@ -14,7 +14,6 @@
         <view class="search-style-btn" @click="changeSearchStyle">
           <image class="toolbar-icon" :src="iconSrc('order-switch')" mode="aspectFit" />
           <text>{{ searchStyle == 0 ? '尾号' : '名称' }}</text>
-          <!-- <text class="down-icon">⌄</text> -->
         </view>
         <view class="search-box">
           <AppSearchModule

+ 1 - 0
hdApp/src/assets/svg-icons/general/switch.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="1779349510191" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6553" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M233.92 230.250667l61.76 61.76A255.872 255.872 0 0 0 170.666667 512c0 139.2 111.125333 252.458667 249.493333 255.914667L426.666667 768h96.469333l-65.536-65.536 60.330667-60.330667 25.365333 25.365334-0.064 0.085333 166.741333 166.72c-31.893333 11.157333-65.92 17.706667-101.333333 18.837333l-0.192 0.170667-0.170667-0.149333-5.461333 0.128L597.333333 853.333333h-170.666666c-188.522667 0-341.333333-152.810667-341.333334-341.333333 0-116.992 58.88-220.245333 148.586667-281.749333zM597.333333 170.666667c188.522667 0 341.333333 152.810667 341.333334 341.333333 0 116.992-58.88 220.245333-148.586667 281.749333l-61.76-61.76A255.872 255.872 0 0 0 853.333333 512c0-141.376-114.624-256-256-256h-96.469333l65.514667 65.514667-60.330667 60.330666-118.016-118.037333 0.064-0.042667-74.069333-74.069333a340.288 340.288 0 0 1 101.333333-18.837333L415.509333 170.666667l0.213334 0.170666 5.44-0.128L426.666667 170.666667h170.666666z" fill="#09C567" p-id="6554"></path></svg>

+ 5 - 1
hdApp/src/static/svg-icons-lib.js

@@ -6,7 +6,7 @@
  *
  * !!! DO NOT MODIFY MANUALLY !!!
  *
- * @datetime 8/6/2026 2:50:34 PM
+ * @datetime 2026/8/14 10:07:06
  *
  */
 
@@ -102,6 +102,10 @@ const collections = {
         "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\" class=\"icon\" viewBox=\"0 0 1024 1024\"><path fill=\"#09c567\" d=\"M240.135 420.615c8.544 8.55 22.405 8.55 30.95 0q.002.001.005-.004l.002.004L512.107 179.46l240.209 240.207h.003c8.544 8.55 22.401 8.55 30.949 0 8.55-8.549 8.55-22.404 0-30.95l.002-.005-255.69-255.688a21.82 21.82 0 0 0-15.475-6.41 21.82 21.82 0 0 0-15.48 6.412l-.002.002-256.493 256.64c-8.545 8.545-8.543 22.401.005 30.946m543.134 185.76c-8.549-8.548-22.406-8.548-30.95 0h-.002l-240.21 240.21L271.092 605.43l-.002.005c-.002 0-.002-.005-.005-.005-8.546-8.549-22.406-8.549-30.95 0-8.548 8.547-8.55 22.401-.005 30.945l256.493 256.64.002.004a21.83 21.83 0 0 0 15.48 6.413c5.6 0 11.199-2.139 15.474-6.413L783.27 637.33h-.001c8.55-8.55 8.55-22.405 0-30.955\"/></svg>",
         3
       ],
+      "general-switch": [
+        "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\" class=\"icon\" viewBox=\"0 0 1024 1024\"><path fill=\"#09c567\" d=\"m233.92 230.25 61.76 61.76A255.87 255.87 0 0 0 170.667 512c0 139.2 111.125 252.459 249.493 255.915l6.507.085h96.469L457.6 702.464l60.33-60.33 25.366 25.365-.064.085 166.741 166.72c-31.893 11.157-65.92 17.707-101.333 18.837l-.192.171-.17-.15-5.462.129-5.483.042H426.667c-188.523 0-341.334-152.81-341.334-341.333 0-116.992 58.88-220.245 148.587-281.75m363.413-59.583c188.523 0 341.334 152.81 341.334 341.333 0 116.992-58.88 220.245-148.587 281.75l-61.76-61.76A255.87 255.87 0 0 0 853.333 512c0-141.376-114.624-256-256-256h-96.469l65.515 65.515-60.331 60.33-118.016-118.037.064-.043-74.07-74.069a340.3 340.3 0 0 1 101.334-18.837l.15-.192.213.17 5.44-.128 5.504-.042z\"/></svg>",
+        3
+      ],
       "general-text": [
         "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\" class=\"icon\" viewBox=\"0 0 1024 1024\"><path fill=\"#22ac38\" d=\"m368.52 753.578-219.58 53.904 61.831-217.995 428.855-441.538 156.956 164.09zm458.185-475.625-157.749-164.09 79.271-81.649c26.159-26.952 68.173-26.952 94.332 0l63.417 65.795c26.159 26.952 26.159 71.344 0 98.296zM18.143 893.887V1012h987.713V893.887z\"/></svg>",
         0

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
mallApp/src/assets/svg-icons/general/red-packet.svg


+ 3 - 12
mallApp/src/components/module/app-hb-arrival.vue

@@ -7,18 +7,15 @@
 		:show="show"
 		:custom="true"
 		:mask-closable="false"
-		width="620upx"
+		width="75%"
 		padding="0"
 		radius="28upx"
 		bgcolor="#ffffff"
 	>
 		<view class="hb-arrival">
+			<!-- 圆形底上放红包 SVG,尺寸对齐原 112upx 图,避免 16px 在 150upx 容器里过小 -->
 			<view class="hb-arrival-icon">
-				<image
-					class="hb-arrival-image"
-					:src="`${constant.imgUrl}/retail/coupon/new-coupon-bg.png`"
-					mode="aspectFit"
-				/>
+				<zui-svg-icon icon="general-red-packet" :width="56" :height="56" color="#FF2842" />
 			</view>
 			<text class="hb-arrival-title">新红包到账</text>
 			<text class="hb-arrival-subtitle">您有一个新红包,请及时查看</text>
@@ -61,7 +58,6 @@ export default {
 	},
 	data() {
 		return {
-			constant: this.$constant,
 			submitting: false
 		}
 	},
@@ -140,11 +136,6 @@ export default {
 	overflow: hidden;
 }
 
-.hb-arrival-image {
-	width: 112upx;
-	height: 112upx;
-}
-
 .hb-arrival-title {
 	font-size: 40upx;
 	font-weight: bold;

+ 7 - 2
mallApp/src/static/svg-icons-lib.js

@@ -6,7 +6,7 @@
  *
  * !!! DO NOT MODIFY MANUALLY !!!
  *
- * @datetime 2026/8/3 18:35:31
+ * @datetime 2026/8/14 10:48:17
  *
  */
 
@@ -42,6 +42,10 @@ const collections = {
         "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\" class=\"icon\" viewBox=\"0 0 1024 1024\"><path fill=\"#22ac38\" d=\"M399.36 335.872s-3.072 58.368-84.992 102.4c0 0 111.616 219.136 310.272 301.056 0 0 78.848-88.064 102.4-81.92l234.496 102.4s17.408 97.28-149.504 161.792-332.8-63.488-507.904-265.216-205.824-396.288-158.72-498.688S296.96 90.112 296.96 90.112z\"/></svg>",
         1
       ],
+      "general-red-packet": [
+        "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" class=\"icon\" viewBox=\"0 0 1024 1024\"><path fill=\"#09c567\" d=\"M819.004 1023.653H204.988c-75.353 0-136.44-61.091-136.44-136.449V205.001l409.34 136.448h68.216L955.45 205v682.204c0 75.357-61.093 136.45-136.446 136.45M547.77 680.401l99.019-.238c24.799.238 33.634-12.62 34.09-28.12.383-13.447-12.32-38.784-34.69-39.39h-98.985v-23.877s75.133-76.736 94.632-94.418c19.436-17.764 24.349-31.674 12.334-46.041-12.177-14.662-33.646-13.755-49.365-.744-15.952 13.222-92.682 84.505-92.682 84.505s-65.87-68.023-80.128-81.708c-12.805-12.327-39.986-24.272-54.613-7.714-15.262 17.307-3.397 38.926 6.16 48.382 9.53 9.366 91.959 96.518 91.959 96.518l-.15 26.224H372.06c-15.268 0-28.757 27.165-28.272 41.6.49 14.362 12.055 25.625 28.238 25.625 16.175 0 102.983-.6 102.983-.6l-.225 73.14H367.797c-15.268 0-28.08 15.376-28.696 29.811-.6 14.443 11.413 34.009 28.696 34.009H474.55s-.184 25.023.458 35.446c1.44 23.277 16.708 32.802 37.113 33.183 20.413.389 34.897-16.693 34.848-31.967-.07-12.623-.369-36.662-.369-36.662s88.847-.158 105.63 0c16.783.142 29.33-16.844 28.647-34.009-.6-17.232-11.032-30.411-36.505-30.411h-97.17zm-1.665-407.18h-68.217L68.55 136.787C68.55 61.424 129.636.347 204.99.347h614.016c75.352 0 136.447 61.077 136.447 136.44z\"/></svg>",
+        5
+      ],
       "general-search": [
         "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\" class=\"icon\" viewBox=\"0 0 1024 1024\"><path fill=\"#000\" d=\"M482.133 724.846a252.952 252.952 0 1 1 252.953-252.953 253.32 253.32 0 0 1-252.953 252.953m0-457.143a204.19 204.19 0 1 0 204.19 204.19 204.31 204.31 0 0 0-204.19-203.703z\"/><path fill=\"#000\" d=\"m615.948 660.724 34.487-34.487L787.749 763.55l-34.475 34.487z\"/></svg>",
         3
@@ -53,7 +57,8 @@ const collections = {
       "#22ac38",
       "#515151",
       "#000",
-      "#ff4d7d"
+      "#ff4d7d",
+      "#09c567"
     ]
   },
 }

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.