Commit 3e88e253 by liimin

fix(MessageBox): 为popupW添加默认值并修复样式计算

refactor(ReceptionCenter): 重构保存记录页面的布局和导航逻辑

style(HomeFrame): 优化主页和详情页的样式及动画性能
1 parent d02c6104
<template>
<MessageBox ref="bizTypeBox" position="bottom" :isFooter="false" title="请选择接待类型" :maxHeight="900">
<MessageBox ref="bizTypeBox" position="bottom" :isFooter="false" title="请选择接待类型" :maxHeight="900" :popupW="750" :maskBackgroundColor="'rgba(0,0,0,0.4)'">
<view class="selector-container">
<view class="options-grid">
<template v-for="(i, index) in businessTypeList">
......
<template>
<view class="data-container">
<view class="nav-bar">
<view class="back-btn" @click="backClick">
<view class="title-bar">
<view class="back-btn" @click="$emit('cancel')">
<uni-icons type="left" :size="20" color="#1a1a1a"></uni-icons>
</view>
<view class="title">接待记录</view>
</view>
<view class="content-scroll">
<view class="container">
<view class="error-banner" v-if="errorTip">
<uni-icons type="info-filled" :size="16" color="#f45c3d"></uni-icons>
<text>请完善必填信息</text>
......@@ -197,10 +197,6 @@ export default {
radioChange (e) {
this.customerInfo.customerType = e.detail.value
},
backClick() {
console.log('backClick')
this.$emit('cancel')
}
}
}
</script>
......@@ -209,55 +205,35 @@ export default {
.data-container {
background: #ffffff;
border-radius: toRpx(24);
margin: toRpx(48) auto;
margin: toRpx(108) toRpx(0) toRpx(60);
width: calc(100% - #{toRpx(64)});
height: calc(100% - #{toRpx(96)});
height: calc(100% - #{toRpx(196)});
box-shadow: 0 toRpx(8) toRpx(24) rgba(0, 0, 0, 0.05);
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
// 硬件加速
transform: translateZ(0);
will-change: transform;
}
.nav-bar {
height: toRpx(100);
display: flex;
align-items: center;
justify-content: center;
position: absolute; // 改为 absolute
top: 0;
left: 0;
.title-bar {
height: toRpx(120);
width: 100%;
border-bottom: 1px solid #f5f5f5;
background-color: #fff;
z-index: 999; // 提高层级
text-align: center;
line-height: toRpx(120);
position: relative;
.back-btn {
position: absolute;
left: 0; // 扩大点击区域
left: 0;
top: 0;
height: 100%;
width: toRpx(100); // 增加宽度
display: flex;
align-items: center;
justify-content: center;
z-index: 11; // 确保在最上层
cursor: pointer;
display:none;
&:active {
opacity: 0.7;
}
// 让图标不拦截点击事件
/deep/ .uni-icons {
pointer-events: none;
}
}
.title {
font-size: toRpx(34);
font-weight: 600;
......@@ -265,11 +241,10 @@ export default {
}
}
.content-scroll {
.container {
flex: 1;
overflow-y: auto;
margin-top: toRpx(100); // 留出nav-bar的高度
padding: toRpx(32) toRpx(40);
padding: toRpx(62) toRpx(40);
-webkit-overflow-scrolling: touch;
}
......
<template>
<view class="container" @click="handleTouchStart">
<view :class="['home', { show: !activeDetailId && showHome }]">
<view :class="['home', { show: !id && showHome }]">
<left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" ref="leftBox" @changeTab="changeTab" @stopAudio="stopAudio" @showReadCountTips="showReadCountTips" @closeTips="closeTips" />
<view class="tips-box" :style="tipsObject.style" @click.stop="closeTips">{{ tipsObject.text }}</view>
<view class="right-side">
......@@ -11,10 +11,10 @@
</view>
<store-address v-if="footerBox" />
</view>
<view :class="['detail', { show: activeDetailId }]">
<view :class="['detail', { show: id }]">
<slot name="detail" />
</view>
<view class="point-page" v-if="!showHome && !activeDetailId">
<view class="point-page" v-if="!showHome && !id">
<component :is="pointComponentName" :transfer="transfer" @close="showHome = true" />
</view>
<!-- 未点击开始接待,弹窗 -->
......@@ -40,19 +40,18 @@ import recorder from '@/mixin/record/recorder'
import uploader from '@/mixin/record/uploader.js'
import versionCheck from '@/mixin/versionCheck.js'
import LeftSide from './components/LeftSide.vue'
import Material from '@/components/MaterialIndex.vue'
import HomeSlot from './components/HomeSlot.vue'
import Order from './components/Order/index.vue'
const TAB_COMPONENTS = {
1: 'ReceptionCenter',
2: 'Order'
}
export default {
mixins: [recorder, uploader, timeout, versionCheck],
components: { LeftSide, ReceptionCenter, FinishReceptionDialog, StoreAddress, HomeSlot, Order },
components: { LeftSide, Material, ReceptionCenter, FinishReceptionDialog, StoreAddress, HomeSlot, Order },
props: {
activeDetailId: [String, Number],
id: [String, Number],
finishDoneText: String,
finishContene: {
type: String,
......@@ -105,7 +104,7 @@ export default {
return this.$refs.finish
},
componentName() {
return TAB_COMPONENTS[this.tabIndex] || ''
return TAB_COMPONENTS[this.tabIndex] || ''
}
},
methods: {
......@@ -181,10 +180,9 @@ export default {
background-image: url('@/assets/images/common/home-bg-1.webp');
background-size: 100% 100%;
z-index: 1;
pointer-events: none; // 避免背景图阻挡交互
}
.home {
.home {
position: fixed;
width: 100%;
height: 100%;
......@@ -215,6 +213,7 @@ export default {
z-index: 2;
visibility: visible;
transform: translateX(0);
will-change: transform;
}
}
......@@ -281,7 +280,6 @@ export default {
z-index: 2;
visibility: visible;
animation: show-content-left 0.15s forwards;
will-change: transform;
}
}
......@@ -296,29 +294,27 @@ export default {
}
.right-side {
flex: 1;
flex: 1;
position: relative;
width: calc(100vw - #{toRpx(240)});
.right-content {
height: 100vh;
box-sizing: border-box;
position: relative;
width: calc(100vw - #{toRpx(240)});
contain: layout style; // 限制样式和布局计算范围
animation: show-box 0.15s forwards;
overflow: hidden;
}
.right-content {
height: 100vh;
box-sizing: border-box;
position: relative;
animation: show-box 0.15s forwards;
overflow: hidden;
will-change: transform; // 优化动画
@keyframes show-box {
0% {
left: 100%;
}
@keyframes show-box {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(0);
}
100% {
left: 0;
}
}
.start {
height: toRpx(232);
......
......@@ -8,7 +8,7 @@
>
<view
class="tips-wrapper"
:style="{ width: popupW + 'rpx', minHeight: popupH + 'rpx',maxHeight: maxHeight + 'rpx' }"
:style="{ width: (popupW || 750) + 'rpx', minHeight: popupH + 'rpx',maxHeight: maxHeight + 'rpx' }"
>
<view class="tips-content">
<view
......@@ -82,6 +82,7 @@ export default {
},
popupW: {
type: Number,
default: 750
},
popupH: {
type: Number,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!