zhb il y a 3 semaines
Parent
commit
2fd0d09358

+ 46 - 30
components/cwg-notice.vue

@@ -1,30 +1,36 @@
 <template>
     <view class="notice-container">
         <cwg-dropdown ref="dropdownRef" :menu-list="[]">
-            <view class="pc-header-btn" :class="{ 'has-dot': isRed }">
-                <cwg-icon name="xxtz" color="#97A1C0" :size="20" @click="openNotice" />
+            <view class="pc-header-btn" :class="{ '!has-dot': isRed }">
+                <text v-if="isRed"
+                    class="position-absolute top-0 end-0 p-1 mt-1 me-1 bg-danger border border-3 border-light rounded-circle" />
+                <cwg-icon name="cwg-bell" color="#97A1C0" :size="20" @click="openNotice" />
             </view>
             <template #btn>
-                <view class="right-drawer">
-                    <view class="notification-list" v-if="list.length">
-                        <view v-for="item in list" :key="item.id" class="notification-item" @click="goPages(item)">
-                            <view class="item-content">
-                                <view class="item-title">{{ item.subject }}</view>
-                                <view class="item-time">{{ item.addTime }}</view>
-                            </view>
-                            <view class="item-badge" v-if="item.read == 0">
-                                <view class="dot"></view>
+                <view class="dropdown-menu dropdown-menu-lg-end p-0 w-300px mt-2 show">
+                    <view class="px-3 py-3 border-bottom d-flex justify-content-between align-items-center">
+                        <h6 class="mb-0" v-t="'News.Notice'"></h6>
+                    </view>
+                    <view class="p-2" v-if="list.length > 0">
+                        <view class="list-group list-group-hover list-group-smooth list-group-unlined">
+                            <view
+                                class="list-group-item d-flex justify-content-between align-items-center cursor-pointer"
+                                v-for="item in list" :key="item.id" @click="goPages(item)">
+                                <view class="ms-2 me-auto">
+                                    <h6 class="mb-2 position-relative">{{ item.subject
+                                        }} <view class="item-badge" v-if="item.read == 0">
+                                            <view class="dot" />
+                                        </view>
+                                    </h6>
+                                    <small class="text-body d-block">{{ item.addTime }}</small>
+                                </view>
                             </view>
                         </view>
                     </view>
-                    <view class="notification-list" v-if="list.length == 0">
-                        <cwg-empty-state />
-                    </view>
 
-                    <view class="logout-wrap">
-                        <view class="logout-btn btn btn-primary" @click="goMore">
-                            <cwg-icon name="crm-mb" :size="16" color="#fff" />
-                            <text v-t="'News.More'" />
+                    <cwg-empty-state v-else />
+                    <view class="p-2">
+                        <view @click="goMore" class="btn w-100 btn-danger waves-effect waves-light " v-t="'News.More'">
                         </view>
                     </view>
                 </view>
@@ -49,7 +55,7 @@ const router = useRouter();
 const list = ref([])
 const getList = async () => {
     const res = await newsApi.newsNoticeList({
-        page: { current: 1, row: 6 },
+        page: { current: 1, row: 4 },
         lang: locale.value,
         read: 0
     })
@@ -115,17 +121,36 @@ onUnmounted(() => {
 
 .notice-container {
     :deep(.cwg-dropdown-menu-container) {
-        left: px2rpx(-280) !important;
+        left: px2rpx(-260) !important;
         right: px2rpx(0) !important;
+
+        .menu {
+            border: 0;
+            overflow: visible;
+        }
     }
 
     @media screen and (max-width: 991px) {
         :deep(.cwg-dropdown-menu-container) {
-            left: px2rpx(-270) !important;
+            left: px2rpx(-230) !important;
             max-width: px2rpx(400);
         }
     }
 
+    .item-badge {
+        position: absolute;
+        top: px2rpx(1);
+        right: px2rpx(-14);
+        margin-left: px2rpx(12);
+
+        .dot {
+            width: px2rpx(6);
+            height: px2rpx(6);
+            background-color: #f56c6c;
+            border-radius: 50%;
+        }
+    }
+
     .pc-header-btn {
         position: relative;
 
@@ -184,16 +209,7 @@ onUnmounted(() => {
             }
         }
 
-        .item-badge {
-            margin-left: px2rpx(12);
 
-            .dot {
-                width: px2rpx(8);
-                height: px2rpx(8);
-                background-color: #f56c6c;
-                border-radius: 50%;
-            }
-        }
     }
 
     .logout-wrap {

+ 53 - 36
components/cwg-right-drawer.vue

@@ -5,25 +5,35 @@
                 <cwg-icon name="icon_my" color="#97A1C0" @click="openNotice" />
             </view>
             <template #btn>
-                <view class="right-drawer">
-                    <view class="drawer-header">
-                        <image class="avatar" src="/static/images/avatars.png" mode="aspectFill" />
-                        <view class="user-info">
-                            <text class="name">{{ _displayName }}</text>
+                <view class="dropdown-menu dropdown-menu-end w-225px mt-1 show">
+                    <view class="d-flex align-items-center p-2">
+                        <view class="avatar avatar-sm rounded-circle">
+                            <image class="avatar1" src="/static/images/vu/logo.png" mode="aspectFill" />
+                        </view>
+                        <view class="ms-2">
+                            <view class="fw-bold text-dark text-ellipsis mb-2">{{ _displayName }}</view>
+                            <view class="text-body d-block lh-sm text-ellipsis mb-2">{{ _email }}</view>
                             <text class="cid">CID: <text class="cwg-cursor" @click="copy(_displayCid)">{{ _displayCid
-                                    }}</text></text>
+                            }}</text></text>
                         </view>
                     </view>
-                    <view class="menu-list">
-                        <view v-for="item in menuList" :key="item.id" class="menu-item"
-                            :class="{ active: _activePath === item.path }" @click="handleNavigate(item.path)">
-                            <cwg-icon :name="item.icon" :size="16" :color="isDark ? '#fff' : '#000'" />
+                    <view>
+                        <view class="dropdown-divider my-1"></view>
+                    </view>
+                    <view v-for="item in menuList" :key="item.id">
+                        <view class="dropdown-item d-flex align-items-center gap-2 cursor-pointer"
+                            @click="handleNavigate(item.path)">
+                            <cwg-icon :name="item.icon" :size="16" color="#97A1C0" />
                             <text v-t="item.name"></text>
                         </view>
                     </view>
-                    <view class="logout-wrap">
-                        <view class="logout-btn btn btn-danger" @click="handleLogout">
-                            <cwg-icon name="logout" :size="16" color="#fff" />
+                    <view>
+                        <view class="dropdown-divider my-1"></view>
+                    </view>
+                    <view>
+                        <view class="dropdown-item d-flex align-items-center gap-2 text-danger cursor-pointer"
+                            @click="handleLogout">
+                            <cwg-icon name="logout" :size="16" color="#FF401C" />
                             <text v-t="'language.i6'"></text>
                         </view>
                     </view>
@@ -56,6 +66,7 @@ const menuList = ref([])
 const _displayName = ref('--')
 const _displayCid = ref('--')
 const _activePath = ref('')
+const _email = ref('--')
 // 复制文本
 const copy = (text: string) => {
     uni.setClipboardData({
@@ -86,6 +97,7 @@ function syncUserInfo() {
     const lastName = info.lastName || ''
     _displayName.value = (firstName + ' ' + lastName).trim() || info.name || info.email || '--'
     _displayCid.value = info.cId || info.id || '--'
+    _email.value = info.email || '--'
 }
 
 // 强制同步路径
@@ -136,7 +148,7 @@ async function handleLogout() {
         await userApi.logout()
     } catch (e) { }
     userStore.clearUserInfo()
-  uni.setStorageSync('logoutToSystem',1)
+    uni.setStorageSync('logoutToSystem', 1)
     // uni.$emit('updateSystemList')
     router.push('/pages/login/index')
     close()
@@ -150,13 +162,18 @@ defineExpose({ openNotice, close })
 
 .notice-container {
     :deep(.cwg-dropdown-menu-container) {
-        left: px2rpx(-280) !important;
+        left: px2rpx(-190) !important;
         right: px2rpx(0) !important;
+
+        .menu {
+            border: 0;
+            overflow: visible;
+        }
     }
 
     @media screen and (max-width: 991px) {
         :deep(.cwg-dropdown-menu-container) {
-            left: px2rpx(-270) !important;
+            left: px2rpx(-190) !important;
             max-width: px2rpx(400);
         }
     }
@@ -170,54 +187,54 @@ defineExpose({ openNotice, close })
         background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
         display: flex;
         flex-direction: column;
-        padding: 20px 16px;
+        padding: px2rpx(20) px2rpx(16);
         box-sizing: border-box;
     }
 
     .drawer-header {
         display: flex;
         align-items: center;
-        gap: 12px;
-        padding: 20px 16px;
+        gap: px2rpx(12);
+        padding: px2rpx(20);
         border-bottom: 1px solid #d9dde5;
     }
 
-    .avatar {
-        width: 76px;
-        height: 76px;
+    .avatar1 {
+        width: px2rpx(40);
+        height: px2rpx(40);
         border-radius: 50%;
-        background: #fff;
+        // background: #fff;
     }
 
     .user-info {
         display: flex;
         flex-direction: column;
-        gap: 6px;
+        gap: px2rpx(6);
     }
 
     .name {
-        font-size: 20px;
+        font-size: px2rpx(22);
         font-weight: 600;
         color: var(--bs-heading-color);
     }
 
     .cid {
-        font-size: 14px;
+        font-size: px2rpx(14);
         color: #ef4444;
     }
 
     .menu-list {
-        padding: 12px 0;
+        padding: px2rpx(12) 0;
     }
 
     .menu-item {
-        height: 48px;
+        height: px2rpx(48);
         display: flex;
         align-items: center;
-        gap: 10px;
-        padding: 0 16px;
+        gap: px2rpx(10);
+        padding: 0 px2rpx(16);
         color: var(--bs-heading-color);
-        font-size: 16px;
+        font-size: px2rpx(16);
         font-weight: 600;
 
         &:hover {
@@ -232,20 +249,20 @@ defineExpose({ openNotice, close })
 
     .logout-wrap {
         margin-top: auto;
-        padding: 20px 16px;
-        margin-bottom: 20px;
+        padding: px2rpx(20);
+        margin-bottom: px2rpx(20);
     }
 
     .logout-btn {
-        height: 44px;
+        height: px2rpx(44);
         background-color: var(--bs-btn-bg);
         display: flex;
         align-items: center;
         justify-content: center;
-        gap: 8px;
+        gap: px2rpx(8);
         color: #fff;
         font-weight: 600;
-        font-size: 16px;
+        font-size: px2rpx(16);
         cursor: pointer;
     }
 }

+ 1 - 1
pages/customer/components/PaymentMethodsList.vue

@@ -6,7 +6,7 @@
           <h4 class="card-title mb-0">{{ item.name }}</h4>
         </view>
         <view class="card-body">
-          <image v-if="item.icon" class="img-fluid mb-3 square-box" :src="imgUrl + item.icon" mode="widthFix" />
+          <image v-if="item.icon" class="img-fluid mb-3 square-box" :src="imgUrl + item.icon" mode="aspectFit" />
           <!-- <image src="/static/images/vu/pay-3.jpg" class="img-fluid mb-3" mode="widthFix" /> -->
           <view v-if="item.payTypeTags && item.payTypeTags.length > 0" class="pay-box">
             <view class="carousel-box">

+ 1 - 0
static/icons/cwg-bell.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M320 64C306.7 64 296 74.7 296 88L296 97.7C214.6 109.3 152 179.4 152 264L152 278.5C152 316.2 142 353.2 123 385.8L101.1 423.2C97.8 429 96 435.5 96 442.2C96 463.1 112.9 480 133.8 480L506.2 480C527.1 480 544 463.1 544 442.2C544 435.5 542.2 428.9 538.9 423.2L517 385.7C498 353.1 488 316.1 488 278.4L488 263.9C488 179.3 425.4 109.2 344 97.6L344 87.9C344 74.6 333.3 63.9 320 63.9zM488.4 432L151.5 432L164.4 409.9C187.7 370 200 324.6 200 278.5L200 264C200 197.7 253.7 144 320 144C386.3 144 440 197.7 440 264L440 278.5C440 324.7 452.3 370 475.5 409.9L488.4 432zM252.1 528C262 556 288.7 576 320 576C351.3 576 378 556 387.9 528L252.1 528z"/></svg>

+ 4 - 0
static/svg-icons-lib.js

@@ -288,6 +288,10 @@ const collections = {
         "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill=\"#22ac38\" d=\"M566.6 342.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L466.7 288H96c-17.7 0-32 14.3-32 32s14.3 32 32 32h370.7L361.3 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z\"/></svg>",
         2
       ],
+      "cwg-bell": [
+        "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill=\"#22ac38\" d=\"M320 64c-13.3 0-24 10.7-24 24v9.7c-81.4 11.6-144 81.7-144 166.3v14.5c0 37.7-10 74.7-29 107.3l-21.9 37.4c-3.3 5.8-5.1 12.3-5.1 19 0 20.9 16.9 37.8 37.8 37.8h372.4c20.9 0 37.8-16.9 37.8-37.8 0-6.7-1.8-13.3-5.1-19L517 385.7c-19-32.6-29-69.6-29-107.3v-14.5c0-84.6-62.6-154.7-144-166.3v-9.7c0-13.3-10.7-24-24-24zm168.4 368H151.5l12.9-22.1C187.7 370 200 324.6 200 278.5V264c0-66.3 53.7-120 120-120s120 53.7 120 120v14.5c0 46.2 12.3 91.5 35.5 131.4zm-236.3 96c9.9 28 36.6 48 67.9 48s58-20 67.9-48z\"/></svg>",
+        2
+      ],
       "cwg-calendar": [
         "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#22ac38\" d=\"M5 22q-.824 0-1.412-.587A1.93 1.93 0 0 1 3 20V6q0-.824.587-1.412A1.93 1.93 0 0 1 5 4h1V3q0-.424.287-.712A.97.97 0 0 1 7 2q.424 0 .713.288Q8 2.575 8 3v1h8V3q0-.424.288-.712A.97.97 0 0 1 17 2q.424 0 .712.288Q18 2.575 18 3v1h1q.824 0 1.413.588Q21 5.175 21 6v14q0 .824-.587 1.413A1.93 1.93 0 0 1 19 22zm0-2h14V10H5zM5 8h14V6H5zm7 6a.97.97 0 0 1-.713-.287A.97.97 0 0 1 11 13q0-.424.287-.713A.97.97 0 0 1 12 12q.424 0 .713.287.287.288.287.713 0 .424-.287.713A.97.97 0 0 1 12 14m-4 0a.97.97 0 0 1-.713-.287A.97.97 0 0 1 7 13q0-.424.287-.713A.97.97 0 0 1 8 12q.424 0 .713.287Q9 12.576 9 13t-.287.713A.97.97 0 0 1 8 14m8 0a.97.97 0 0 1-.713-.287A.97.97 0 0 1 15 13q0-.424.287-.713A.97.97 0 0 1 16 12q.424 0 .712.287.288.288.288.713 0 .424-.288.713A.97.97 0 0 1 16 14m-4 4a.97.97 0 0 1-.713-.288A.97.97 0 0 1 11 17q0-.424.287-.712A.97.97 0 0 1 12 16q.424 0 .713.288.287.287.287.712 0 .424-.287.712A.97.97 0 0 1 12 18m-4 0a.97.97 0 0 1-.713-.288A.97.97 0 0 1 7 17q0-.424.287-.712A.97.97 0 0 1 8 16q.424 0 .713.288Q9 16.575 9 17q0 .424-.287.712A.97.97 0 0 1 8 18m8 0a.97.97 0 0 1-.713-.288A.97.97 0 0 1 15 17q0-.424.287-.712A.97.97 0 0 1 16 16q.424 0 .712.288.288.287.288.712 0 .424-.288.712A.97.97 0 0 1 16 18\"/></svg>",
         2