|
@@ -1,7 +1,10 @@
|
|
|
<script setup>
|
|
|
+import { computed } from 'vue'
|
|
|
import AnimatedOverlay from '../../components/dialog/AnimatedOverlay.vue'
|
|
|
import PopupLayout from './components/PopupLayout.vue'
|
|
|
-import ContentCard from './content-card.vue'
|
|
|
+import CenterLayout from './components/CenterLayout.vue'
|
|
|
+import MobileContentCard from './components/content-card.vue'
|
|
|
+import MobileCenterCard from './components/center-card.vue'
|
|
|
import { usePreLeaveInfo } from '@/utils/hooks'
|
|
|
|
|
|
const props = defineProps({
|
|
@@ -18,6 +21,26 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
default: '联系专属客服,申请免费体验'
|
|
|
},
|
|
|
+ // 是否静态客服信息(非线索客服信息)
|
|
|
+ staticInfo: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ useCustomer3: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ platform: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
+})
|
|
|
+
|
|
|
+const center = computed(() => {
|
|
|
+ return props.staticInfo
|
|
|
+})
|
|
|
+const contentTransitionName = computed(() => {
|
|
|
+ return center.value ? 'fade' : 'slide-up'
|
|
|
})
|
|
|
|
|
|
const {
|
|
@@ -25,7 +48,9 @@ const {
|
|
|
close,
|
|
|
visible,
|
|
|
configInfo,
|
|
|
-} = usePreLeaveInfo({ props })
|
|
|
+} = usePreLeaveInfo({
|
|
|
+ props
|
|
|
+})
|
|
|
|
|
|
console.log(configInfo)
|
|
|
|
|
@@ -44,17 +69,37 @@ export default {
|
|
|
<AnimatedOverlay
|
|
|
class="mobile-leave-dialog"
|
|
|
:visible="visible"
|
|
|
- content-transition-name="slide-up"
|
|
|
+ :content-transition-name="contentTransitionName"
|
|
|
@update:visible="updateVisible"
|
|
|
@close="close"
|
|
|
>
|
|
|
- <PopupLayout :title="popupTitle">
|
|
|
- <ContentCard />
|
|
|
- </PopupLayout>
|
|
|
+ <div class="mobile-leave-dialog-content" :class="{ 'c-m-center': center, 'c-m-bottom': !center }">
|
|
|
+ <CenterLayout v-if="center" @closeIconClick="close">
|
|
|
+ <MobileCenterCard
|
|
|
+ :qr="configInfo.wxer"
|
|
|
+ :phone="configInfo.phone"
|
|
|
+ :platform="platform"
|
|
|
+ />
|
|
|
+ </CenterLayout>
|
|
|
+ <PopupLayout v-else :title="popupTitle" @closeIconClick="close">
|
|
|
+ <MobileContentCard
|
|
|
+ :qr="configInfo.wxer"
|
|
|
+ :phone="configInfo.phone"
|
|
|
+ :platform="platform"
|
|
|
+ :use-customer3="useCustomer3"
|
|
|
+ />
|
|
|
+ </PopupLayout>
|
|
|
+ </div>
|
|
|
</AnimatedOverlay>
|
|
|
</template>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+::v-deep {
|
|
|
+ ::-webkit-scrollbar {
|
|
|
+ /*滚动条整体样式*/
|
|
|
+ width: 2px;
|
|
|
+ }
|
|
|
+}
|
|
|
.mobile-leave-dialog {
|
|
|
display: flex;
|
|
|
align-items: flex-end; /* 内容置底 */
|
|
@@ -62,11 +107,29 @@ export default {
|
|
|
::v-deep {
|
|
|
.overlay-content {
|
|
|
width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.mobile-leave-dialog-content {
|
|
|
+ box-sizing: border-box;
|
|
|
+ &.c-m-bottom {
|
|
|
+ width: 100%;
|
|
|
max-height: 70vh;
|
|
|
- background: #fff;
|
|
|
- border-radius: 16px 16px 0 0;
|
|
|
+ border-radius: 12px 12px 0 0;
|
|
|
+ background-color: #fff;
|
|
|
overflow-y: auto;
|
|
|
- box-sizing: border-box;
|
|
|
+ }
|
|
|
+ &.c-m-center {
|
|
|
+ position: absolute;
|
|
|
+ top: 45%;
|
|
|
+ left: 50%;
|
|
|
+ width: 86%;
|
|
|
+ min-height: 200px;
|
|
|
+ transform: translate3d(-50%,-50%,0);
|
|
|
+ border-radius: 8px;
|
|
|
+ z-index: 2;
|
|
|
+ background-color: #fff;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
}
|
|
|
</style>
|