lxr 2 месяцев назад
Родитель
Сommit
5322a99583

+ 1 - 1
src/layouts/components/Header/components/NotificationBell.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="notification-bell">
-    <el-badge :value="unreadCount > 0 ? unreadCount : undefined" :max="99" class="item">
+    <el-badge :is-dot="unreadCount > 0" class="item">
       <el-icon :size="24" class="toolBar-icon bell-icon" @click="openDialog">
         <Bell />
       </el-icon>

+ 1 - 0
src/layouts/components/Header/components/NotificationDrawerContent.vue

@@ -134,6 +134,7 @@
               v-for="(item, index) in currentMessageList"
               :key="item.id + '_' + index"
               class="message-card message-card-clickable"
+              @click="handleMessageItemClick(item)"
             >
               <div class="message-avatar">
                 <el-avatar :size="40" :src="item.avatar">

+ 12 - 5
src/views/dynamicManagement/userDynamic.vue

@@ -527,7 +527,8 @@
               placeholder="选择优惠券"
               style="flex: 1; min-width: 0"
               clearable
-              @focus="loadGiftCouponList(giftCouponFormData.giftType)"
+              :loading="giftCouponListLoading"
+              @visible-change="(visible: boolean) => visible && loadGiftCouponList(giftCouponFormData.giftType)"
               @change="onGiftRowCouponChange(row)"
             >
               <el-option
@@ -541,7 +542,7 @@
             <div class="quantity-cell">
               <el-input
                 type="number"
-                :model-value="row.quantity"
+                :model-value="row.quantity === 0 ? '' : row.quantity"
                 placeholder="请输入赠券数量"
                 class="quantity-input"
                 :min="1"
@@ -607,7 +608,6 @@ import {
 import { uploadImg } from "@/api/modules/upload";
 import { useUserStore } from "@/stores/modules/user";
 import { localGet } from "@/utils";
-import { s } from "node_modules/vite/dist/node/types.d-aGj9QkWt";
 
 const route = useRoute();
 const router = useRouter();
@@ -1182,6 +1182,7 @@ const giftFriendList = ref<{ id: number | string; name: string; phoneId?: string
 const giftFriendListLoading = ref(false);
 const giftCouponList = ref<{ id: number | string; name: string; singleQty?: number }[]>([]);
 const giftCouponListLoaded = ref(false);
+const giftCouponListLoading = ref(false);
 let giftCouponRowKey = 0;
 const giftCouponFormData = reactive<{
   friendId: string | number;
@@ -1221,6 +1222,7 @@ const loadGiftFriendList = async () => {
 };
 
 const loadGiftCouponList = async (giftType: "coupon" | "voucher" = giftCouponFormData.giftType) => {
+  giftCouponListLoading.value = true;
   try {
     const storeId = localGet("createdId") || userStore.userInfo?.storeId || userStore.userInfo?.createdId;
     let params: any = {};
@@ -1255,6 +1257,7 @@ const loadGiftCouponList = async (giftType: "coupon" | "voucher" = giftCouponFor
   } catch {
     giftCouponList.value = [];
   } finally {
+    giftCouponListLoading.value = false;
   }
 };
 
@@ -1291,10 +1294,14 @@ const onGiftRowCouponChange = (row: { couponId: string | number; quantity: numbe
   if (row.quantity > max) row.quantity = max;
 };
 
-// 输入时即时限制:不允许超出最大数量,输入即截断,输入框从不显示超出的数
+// 输入时即时限制:不允许超出最大数量;允许先清空再输入其他数字(空时暂存为 0,展示为空)
 const setGiftRowQuantity = (row: { couponId: string | number; quantity: number }, val: string | number | undefined) => {
   const max = getGiftRowMaxQuantity(row);
-  const num = val === "" || val == null || Number.isNaN(Number(val)) ? 1 : Number(val);
+  if (val === "" || val == null || Number.isNaN(Number(val))) {
+    row.quantity = 0; // 允许清空,便于用户删除后输入新数量
+    return;
+  }
+  const num = Number(val);
   row.quantity = Math.min(Math.max(1, num), max);
 };
 

+ 29 - 31
src/views/storeDecoration/decorationChat.vue

@@ -24,37 +24,31 @@
               {{ msg.createdTime }}
             </div>
             <div class="msg-bubble">
-              <!-- 文本 -->
-              <div v-if="msg.type === 1 || msg.type === '1'" class="msg-text">
-                {{ msg.content || msg.text }}
-              </div>
-              <!-- 图片 -->
-              <el-image
-                v-else-if="msg.type === 2 || msg.type === '2'"
-                :src="msg.content || msg.text"
-                fit="cover"
-                class="msg-image"
-                :preview-src-list="[msg.content || msg.text]"
-              />
-              <!-- 视频 -->
-              <video
-                v-else-if="msg.type === 8 || msg.type === '8'"
-                :src="msg.content || msg.text"
-                class="msg-video"
-                controls
-                preload="metadata"
-              />
-              <!-- 分享卡片等 -->
-              <div v-else-if="msg.type === 3 || msg.type === '3'" class="msg-share">
-                <span v-if="typeof (msg.content || msg.text) === 'object'">
-                  {{ (msg.content || msg.text)?.title || "分享链接" }}
-                </span>
-                <span v-else>{{ msg.content || msg.text }}</span>
-              </div>
-              <!-- 其他类型 -->
-              <div v-else class="msg-text">
-                {{ msg.content || msg.text || "[消息]" }}
-              </div>
+              <!-- type 1、2、8 正常展示 -->
+              <template v-if="[1, 2, 8].includes(Number(msg.type))">
+                <!-- 文本 type=1 -->
+                <div v-if="msg.type === 1 || msg.type === '1'" class="msg-text">
+                  {{ msg.content || msg.text }}
+                </div>
+                <!-- 图片 type=2 -->
+                <el-image
+                  v-else-if="msg.type === 2 || msg.type === '2'"
+                  :src="msg.content || msg.text"
+                  fit="cover"
+                  class="msg-image"
+                  :preview-src-list="[msg.content || msg.text]"
+                />
+                <!-- 视频 type=8 -->
+                <video
+                  v-else-if="msg.type === 8 || msg.type === '8'"
+                  :src="msg.content || msg.text"
+                  class="msg-video"
+                  controls
+                  preload="metadata"
+                />
+              </template>
+              <!-- 其他 type 显示提示 -->
+              <div v-else class="msg-text msg-tip">此消息请去商家App查看</div>
             </div>
           </div>
         </div>
@@ -555,6 +549,10 @@ onBeforeUnmount(() => {
     .msg-text {
       font-size: 14px;
       line-height: 1.5;
+      &.msg-tip {
+        font-style: italic;
+        color: #ffffff;
+      }
     }
     .msg-image {
       max-width: 200px;