Commit 3e88e253 by liimin

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

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

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