|
|
@@ -4,7 +4,6 @@
|
|
|
<cwg-pc-header @open-right-drawer="openRightDrawer" @open-left-drawer="openLeftDrawer" class="header-box"
|
|
|
:sidebarVisible="sidebarVisible" />
|
|
|
<view class="sidebar-mask mask-visible" v-if="sidebarVisible" @click="openLeftDrawer">
|
|
|
-
|
|
|
</view>
|
|
|
<view class="fixed"></view>
|
|
|
<cwg-header v-if=pageTitle class="custom-header" :title="pageTitle" />
|
|
|
@@ -16,13 +15,12 @@
|
|
|
<view class="page-content" :style="{ backgroundColor: bgColor }">
|
|
|
<cwg-match-media :max-width="991" v-if="!isLoginPage">
|
|
|
<view class="left-sidebar" :class="{ 'sidebar-visible': sidebarVisible }">
|
|
|
- <cwg-sidebar />
|
|
|
+ <cwg-sidebar @handle-click="openLeftDrawer" />
|
|
|
</view>
|
|
|
<view class="sidebar-mask" v-if="sidebarVisible" @click="openLeftDrawer" :style="{
|
|
|
opacity: maskVisible ? 1 : 0,
|
|
|
transition: 'opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1)'
|
|
|
}">
|
|
|
-
|
|
|
</view>
|
|
|
</cwg-match-media>
|
|
|
<view class="content-info">
|
|
|
@@ -34,13 +32,20 @@
|
|
|
<view class="content-wrapper" :class="{ 'content-wrapper-padding': isContentPadding }">
|
|
|
<!-- <cwg-header /> -->
|
|
|
<transition name="fade" mode="out-in">
|
|
|
- <view>
|
|
|
- <slot />
|
|
|
- </view>
|
|
|
+ <view>
|
|
|
+ <slot />
|
|
|
+ </view>
|
|
|
</transition>
|
|
|
<cwg-custom-footer />
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <cwg-match-media :max-width="991">
|
|
|
+ <view class="chat-icon"
|
|
|
+ :class="{ 'chat-icon-expanded': isChatIconExpanded, 'chat-icon-hidden': type == 'chat' }"
|
|
|
+ @click="handleChatIconClick">
|
|
|
+ <cwg-icon name="chat" color="#fff" />
|
|
|
+ </view>
|
|
|
+ </cwg-match-media>
|
|
|
<view :style="{ height: isTabBarPage ? '60px' : '0px' }" />
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -87,12 +92,17 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
default: '',
|
|
|
},
|
|
|
+ type: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
})
|
|
|
const isDark = computed(() => globalStore.theme === 'dark')
|
|
|
const isTabBarPage = ref(false)
|
|
|
const rightDrawerRef = ref<any>(null)
|
|
|
const noticeDrawerRef = ref<any>(null)
|
|
|
const ibRef = ref<any>(null)
|
|
|
+const isChatIconExpanded = ref(false)
|
|
|
|
|
|
// 事件处理函数
|
|
|
const handleOpenIb = () => {
|
|
|
@@ -102,6 +112,18 @@ const handleOpenIb = () => {
|
|
|
const handleOpenNoticeDrawer = () => {
|
|
|
noticeDrawerRef.value?.open()
|
|
|
}
|
|
|
+// 处理聊天图标点击
|
|
|
+const handleChatIconClick = () => {
|
|
|
+ // 如果还没显示 → 先滑出来
|
|
|
+ if (!isChatIconExpanded.value) {
|
|
|
+ isChatIconExpanded.value = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ router.push('/pages/common/chat')
|
|
|
+ setTimeout(() => {
|
|
|
+ isChatIconExpanded.value = false
|
|
|
+ }, 300)
|
|
|
+}
|
|
|
|
|
|
const handleOpenRightDrawer = () => {
|
|
|
openRightDrawer()
|
|
|
@@ -243,6 +265,39 @@ onShow(() => {
|
|
|
min-height: calc(100vh - 56px);
|
|
|
}
|
|
|
|
|
|
+.chat-icon {
|
|
|
+ width: px2rpx(50);
|
|
|
+ height: px2rpx(50);
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #cf1322;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ position: fixed;
|
|
|
+ bottom: px2rpx(25);
|
|
|
+ right: px2rpx(-25);
|
|
|
+ z-index: 999;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
|
+ box-shadow: 0 px2rpx(8) px2rpx(20) rgba(0, 0, 0, 0.15);
|
|
|
+ will-change: transform;
|
|
|
+}
|
|
|
+
|
|
|
+.chat-icon:hover {
|
|
|
+ transform: scale(1.1);
|
|
|
+}
|
|
|
+
|
|
|
+.chat-icon-expanded {
|
|
|
+ bottom: px2rpx(20);
|
|
|
+ right: px2rpx(20);
|
|
|
+ transform: scale(1.1);
|
|
|
+ box-shadow: 0 px2rpx(12) px2rpx(30) rgba(0, 0, 0, 0.2);
|
|
|
+}
|
|
|
+
|
|
|
+.chat-icon-hidden {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+
|
|
|
.fixed {
|
|
|
// position: fixed;
|
|
|
// top: 0;
|