Commit e6dada03 by liimin

feat(组件): 重构接待中心界面及新增组件

新增StoreAddress、BusinessTypeSelector、FinishReceptionDialog等组件
重构ReceptionCenter界面样式和交互逻辑
优化MaterialIndex轮播组件动画效果
提取RightContent为独立组件
调整整体布局和样式细节
1 parent 87ac4430
<template>
<view class="button-group">
<view
v-for="(item, index) in selectList"
:key="index"
class="button-item"
:class="{ active: index === selectIndex }"
@click="chooseType(index, item)"
:style="{ width: itemWidth + 'rpx', marginRight: index === selectList.length - 1 ? 0 : gap + 'rpx' }"
>
<text class="label">{{ item[labelKey] }}</text>
<!-- 选中时的背景动画元素 -->
<view class="active-bg" v-if="index === selectIndex"></view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
selectList: {
type: Array,
default: () => []
},
labelKey: {
type: String,
default: 'label'
}
},
data() {
return {
selectIndex: 0,
itemWidth: 104, // 按钮固定宽度
gap: 16 // 按钮间距
}
},
methods: {
chooseType(index, item) {
if (this.selectIndex === index) return
this.selectIndex = index
this.$emit('chooseType', { item, index })
}
}
}
</script>
<style scoped lang='scss'>
.button-group {
display: flex;
align-items: center;
/* 移除容器背景,因为现在由外部 filter-container 提供 */
background: transparent;
height: toRpx(64); /* 略微减小高度 */
.button-item {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
/* width由行内样式控制 */
/* margin-right由行内样式控制 */
padding: 0;
font-size: toRpx(26);
color: #555;
border-radius: toRpx(32); /* 胶囊形状 */
transition: all 0.2s ease;
cursor: pointer;
background: #ffffff; /* 默认白底 */
border: 1px solid #ebedf0; /* 默认浅色边框 */
position: relative;
box-sizing: border-box;
overflow: hidden; /* 确保动画不溢出 */
.label {
position: relative;
z-index: 2; /* 文字在最上层 */
}
/* 激活状态的背景层 */
.active-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #eef4ff;
z-index: 1;
animation: pulse-fade 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) forwards;
}
&.active {
color: #3773f8;
font-weight: 500;
border-color: #3773f8;
box-shadow: 0 toRpx(2) toRpx(8) rgba(55, 115, 248, 0.15);
}
}
}
@keyframes pulse-fade {
0% {
opacity: 0;
transform: scale(0.8);
}
100% {
opacity: 1;
transform: scale(1);
}
}
</style>
<template>
<MessageBox :popupW="704" ref="bizTypeBox" :isFooter="false" title="请选择类型">
<view class="footer">
<template v-for="(i, index) in businessTypeList">
<view class="footer-btn confirm flex" :key="index" @click="chooseBusinessType(i)">
{{ i.typeName }}
</view>
</template>
</view>
</MessageBox>
</template>
<script>
export default {
data() {
return {
businessTypeList: []
}
},
methods: {
async open() {
const res = await uni.$api.commonApi.getPadBusinessTypeList()
const list = Array.isArray(res?.data) ? res.data : (Array.isArray(res) ? res : [])
this.businessTypeList = list
this.$refs.bizTypeBox.open()
},
chooseBusinessType(item) {
this.$refs.bizTypeBox.close()
this.$emit('choose', item)
}
}
}
</script>
<style scoped lang="scss">
.footer {
border-top: toRpx(2) solid #eff0f2;
font-weight: 600;
font-size: toRpx(32);
margin-top: toRpx(48);
.footer-btn {
justify-content: center;
margin: toRpx(16) auto 0;
}
.confirm {
width: toRpx(608);
height: toRpx(80);
background: #2c66f7;
border-radius: toRpx(40);
color: #fff;
}
}
</style>
<template>
<MessageBox :popupW="704" ref="finish" :content="content" :isFooter="false">
<view class="footer">
<view class="footer-btn confirm flex" @click="handleConfirm">
完成接待
<text>(推荐)</text>
</view>
<view class="footer-btn cancel flex" @click="handleCancel">
仍要退出
<text>(不推荐)</text>
</view>
</view>
</MessageBox>
</template>
<script>
export default {
data() {
return {
content: '当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」'
}
},
methods: {
open() {
this.$refs.finish.open()
},
close() {
this.$refs.finish.close()
},
handleConfirm() {
this.$emit('confirm')
},
handleCancel() {
this.$emit('cancel')
}
}
}
</script>
<style scoped lang="scss">
.footer {
border-top: toRpx(2) solid #eff0f2;
font-weight: 600;
font-size: toRpx(32);
margin-top: toRpx(48);
.footer-btn {
justify-content: center;
margin: toRpx(16) auto 0;
}
.confirm {
width: toRpx(608);
height: toRpx(80);
background: #2c66f7;
border-radius: toRpx(40);
color: #fff;
}
.cancel {
width: toRpx(608);
height: toRpx(80);
background: #f5f6fa;
border-radius: toRpx(40);
color: #5b6b8c;
}
}
</style>
<template>
<uni-popup
ref="popup"
type="bottom"
>
<view class="popup-box">
<view class="popup-header">
<text class="title">客户标签</text>
<view
class="close-btn"
@click="close"
>
<uni-icons
type="closeempty"
size="20"
color="#999"
></uni-icons>
</view>
</view>
<view class="content">
<view class="tags-container">
<view
v-for="(item, index) in list"
:key="index"
:class="['tag-item', { active: isSelected(item) }]"
@click="toggleTag(item)"
>
{{ item.labelName }}
</view>
</view>
</view>
<view class="footer">
<button
class="btn cancel"
@click="close"
>取消</button>
<button
class="btn confirm"
@click="confirm"
>确定</button>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
name: 'CustomerTags',
props: {
chooseList: {
type: Array,
default: () => []
}
},
data() {
return {
list: [],
selectedTags: []
}
},
watch: {
chooseList: {
immediate: true,
handler(val) {
this.selectedTags = [...val]
}
}
},
methods: {
open() {
this.getList()
this.$refs.popup.open()
},
close() {
this.$refs.popup.close()
},
async getList() {
try {
const { shopMerchantId, sceneType } = uni.$storage.get("userInfo")
const params = {
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 // 1.延保 2.轻改
}
const res = await uni.$api.customerApi.findCustomerTags(params)
this.list = res || []
} catch (error) {
console.error(error)
}
},
isSelected(item) {
return this.selectedTags.some(tag => tag.labelId === item.labelId)
},
toggleTag(item) {
const index = this.selectedTags.findIndex(tag => tag.labelId === item.labelId)
if (index > -1) {
this.selectedTags.splice(index, 1)
} else {
this.selectedTags.push(item)
}
},
confirm() {
this.$emit('select', this.selectedTags)
this.close()
}
}
}
</script>
<style lang="scss" scoped>
.popup-box {
background-color: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
padding-bottom: env(safe-area-inset-bottom);
max-height: 80vh;
display: flex;
flex-direction: column;
.popup-header {
padding: 30rpx;
text-align: center;
position: relative;
border-bottom: 1rpx solid #eee;
.title {
font-size: 32rpx;
font-weight: bold;
}
.close-btn {
position: absolute;
right: 30rpx;
top: 30rpx;
}
}
.content {
flex: 1;
overflow-y: auto;
padding: 30rpx;
.tags-container {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
.tag-item {
padding: 10rpx 30rpx;
background-color: #f5f5f5;
border-radius: 30rpx;
font-size: 28rpx;
color: #333;
border: 1rpx solid transparent;
&.active {
background-color: #e6f0ff;
color: #007aff;
border-color: #007aff;
}
}
}
}
.footer {
padding: 20rpx 30rpx;
display: flex;
gap: 30rpx;
border-top: 1rpx solid #eee;
.btn {
flex: 1;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
&.cancel {
background-color: #f5f5f5;
color: #666;
}
&.confirm {
background-color: #007aff;
color: #fff;
}
&::after {
border: none;
}
}
}
}
</style>
<template>
<uni-popup
ref="popup"
type="bottom"
>
<view class="popup-box">
<view class="popup-header">
<text class="title">接待场景</text>
<view
class="close-btn"
@click="close"
>
<uni-icons
type="closeempty"
size="20"
color="#999"
></uni-icons>
</view>
</view>
<view class="content">
<view class="scene-container">
<view
v-for="(item, index) in list"
:key="index"
:class="['scene-item', { active: isSelected(item) }]"
@click="selectScene(item)"
>
{{ item.receptionSceneName }}
</view>
</view>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
name: 'ReceptionSence',
props: {
customerInfo: {
type: Object,
default: () => ({})
}
},
data() {
return {
list: []
}
},
methods: {
open() {
this.getList()
this.$refs.popup.open()
},
close() {
this.$refs.popup.close()
},
async getList() {
try {
const { shopMerchantId, sceneType } = uni.$storage.get("userInfo")
const params = {
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 // 1.延保 2.轻改
}
const res = await uni.$api.customerApi.findAllSence(params)
this.list = res || []
} catch (error) {
console.error(error)
}
},
isSelected(item) {
return this.customerInfo.receptionScene === item.id
},
selectScene(item) {
this.$emit('select', item)
this.close()
}
}
}
</script>
<style lang="scss" scoped>
.popup-box {
background-color: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
padding-bottom: env(safe-area-inset-bottom);
max-height: 80vh;
display: flex;
flex-direction: column;
.popup-header {
padding: 30rpx;
text-align: center;
position: relative;
border-bottom: 1rpx solid #eee;
.title {
font-size: 32rpx;
font-weight: bold;
}
.close-btn {
position: absolute;
right: 30rpx;
top: 30rpx;
}
}
.content {
flex: 1;
overflow-y: auto;
padding: 30rpx;
.scene-container {
display: flex;
flex-direction: column;
gap: 20rpx;
.scene-item {
padding: 30rpx;
background-color: #f9f9f9;
border-radius: 12rpx;
font-size: 30rpx;
color: #333;
text-align: center;
border: 1rpx solid transparent;
&.active {
background-color: #e6f0ff;
color: #007aff;
border-color: #007aff;
}
}
}
}
}
</style>
......@@ -5,16 +5,28 @@
<view class="tabs">
<page-tabs :list="tabList" @changeTab="changeTab" />
</view>
<!-- 次级筛选区域容器 -->
<view class="filter-container">
<view class="select-box-list select-component flex">
<template v-if="tabIndex == 0">
<select-component :selectList="orderTypeList" @chooseType="searchReceptionList($event, 'orderFinishFlag')" />
<select-component :selectList="receptionTypeList" @chooseType="searchReceptionList($event, 'reviewFlag')" />
<view class="filter-group">
<button-group :selectList="orderTypeList" @chooseType="searchReceptionList($event, 'orderFinishFlag')" />
</view>
<view class="divider"></view>
<view class="filter-group">
<button-group :selectList="receptionTypeList" @chooseType="searchReceptionList($event, 'reviewFlag')" />
</view>
</template>
</view>
<template v-if="tabIndex == 1">
<select-component class="select-component" :selectList="uploadTypeList" @chooseType="changeUploadType" />
<view class="filter-group">
<button-group class="select-component" :selectList="uploadTypeList" @chooseType="changeUploadType" />
</view>
</template>
</view>
</view>
<scroll-view class="record-list" scroll-y @scrolltolower="pageonReachBottom">
<view class="record-tips flex" v-if="tabIndex == 1 && isPrePage && list.length && list[0] && list[0].length">
<uni-icons type="info" :size="16" color="#FF9D0A" class="icon"></uni-icons>
......@@ -85,12 +97,12 @@
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import SelectComponent from '@/components/SelectComponent.vue'
import ButtonGroup from '@/components/ButtonGroup.vue'
import PageTabs from '@/components/PageTabs.vue'
export default {
inject: ['getRecorder'],
name: '',
components: { SelectComponent, PageTabs },
components: { ButtonGroup, PageTabs },
props: {
show: Boolean
},
......@@ -419,46 +431,86 @@ export default {
</script>
<style scoped lang="scss">
.record-box {
box-sizing: border-box;
width: 100%;
height: 100%;
overflow: hidden;
box-sizing: border-box;
.data-container {
background: #ffffff;
border-radius: toRpx(48);
width: 100%;
height: 100%;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
position: relative;
border-radius: toRpx(24);
background: #ffffff;
/* padding: toRpx(32); 移除容器内边距,改由内部元素控制 */
box-sizing: border-box;
display: flex;
flex-direction: column;
.control-box {
height: toRpx(164);
justify-content: space-between;
align-items: center;
/* margin-bottom: toRpx(32); 移除底部间距 */
margin: toRpx(32) toRpx(32) 0; /* 仅保留上左右外边距 */
flex-shrink: 0;
z-index: 10; /* 确保投影覆盖在列表之上 */
position: relative;
/* 新增设计样式 */
background: #ffffff;
border-radius: toRpx(24);
padding: toRpx(24) toRpx(32);
box-shadow: 0 toRpx(4) toRpx(16) rgba(0, 0, 0, 0.04); /* 减轻投影 */
border: 1px solid #f5f6f8;
.tabs {
width: toRpx(336);
flex-shrink: 0;
width: toRpx(336); /* 恢复固定宽度,防止被挤压 */
height: toRpx(84);
margin-left: toRpx(44);
}
.select-box-list {
margin-left: auto;
gap: 0 toRpx(40);
.filter-container {
display: flex;
align-items: center;
background: transparent; /* 移除容器背景,因为现在有了外层大卡片 */
border: none; /* 移除边框 */
padding: 0;
height: toRpx(88);
box-sizing: border-box;
.filter-group {
display: flex;
align-items: center;
}
.divider {
width: 1px;
height: toRpx(32);
background: #ebedf0;
margin: 0 toRpx(32);
}
.select-component {
margin-right: toRpx(44);
margin-left: 0;
}
}
}
}
.record-list {
box-sizing: border-box;
height: calc(100% - #{toRpx(164)});
/* height: calc(100% - #{toRpx(164)}); 使用 flex 自适应高度 */
flex: 1;
height: 0; /* 配合 flex: 1 启用滚动 */
position: relative;
z-index: 4;
.record-tips {
height: toRpx(76);
background: #f58e341a;
border-radius: toRpx(16);
font-size: toRpx(28);
color: #f58e34;
width: calc(100% - #{toRpx(88)});
margin: 0 auto toRpx(40);
width: calc(100% - #{toRpx(64)}); /* 调整宽度匹配边距 */
margin: toRpx(32) auto toRpx(20); /* 增加顶部边距,使内容不顶着头部 */
justify-content: center;
.icon {
margin-right: toRpx(8);
......@@ -469,7 +521,7 @@ export default {
display: flex;
flex-wrap: wrap;
gap: toRpx(40) toRpx(46);
padding: toRpx(2) toRpx(44) 0;
padding: toRpx(32) toRpx(32) 0; /* 调整内边距,给顶部留出空间 */
.item {
// width: toRpx(610);
width: calc(50% - #{toRpx(23)});
......
<template>
<view class="reception-box">
<view :class="['record-box-content',`${showInfo || !showRecord?'hide-record':'show-record'}`]">
<view :class="['record-box-content',`${showInfo || !showRecord?'hide-record':''}`]">
<view class="right box-class only-right">
<type-tab-component
:typeList="typeList"
......@@ -59,7 +59,7 @@ import dayjs from 'dayjs'
import RecordList from './RecordList.vue'
import saveRecord from './saveRecord.vue'
import CustomerFile from './CustomerFile.vue'
// import CustomerInfo from './CustomerInfo.vue'
import CustomerInfo from './CustomerInfo.vue'
import TypeTabComponent from '@/components/TypeTabComponent.vue'
import SelectComponent from '@/components/SelectComponent.vue'
......@@ -70,7 +70,7 @@ export default {
RecordList,
saveRecord,
CustomerFile,
// CustomerInfo,
CustomerInfo,
TypeTabComponent,
SelectComponent
},
......
<template>
<view class="right-side">
<view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 0 }]">
<view class="start" @click="$emit('start')">
<view class="sprite-icon icon-start-text"></view>
</view>
<view class="right-content-box flex">
<view class="content-left">
<view class="module-box box-class">
<view class="common-title">
<text class="title-text">{{ currentType.typeName }}产品介绍</text>
<view class="switch-btn" @click="changeType">
<view class="sprite-icon icon-scene-change icon-exchange"></view>
<text>切换</text>
</view>
</view>
<view class="content-box">
<template>
<Material ref="materialRef" :moduleList="moduleList"></Material>
</template>
</view>
</view>
</view>
</view>
</view>
<template v-if="tabIndex != 0 && tabIndex != 99">
<component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage"
:isPermissionFunction="isPermission" />
</template>
<!-- 业务类型选择器 -->
<business-type-selector ref="bizTypeSelector" @choose="chooseBusinessType" />
</view>
</template>
<script>
import Material from '@/components/MaterialIndex.vue'
import ReceptionCenter from '../components/ReceptionCenter/index.vue'
import BusinessTypeSelector from './BusinessTypeSelector.vue'
export default {
components: { Material, ReceptionCenter, BusinessTypeSelector },
props: {
tabIndex: {
type: Number,
default: 0
},
moduleList: {
type: Array,
default: () => []
},
componentName: {
type: String,
default: ''
},
isPermission: {
type: [Boolean, Function],
default: false
}
},
data() {
return {
currentType: {},
userInfo: {}
}
},
mounted() {
this.userInfo = uni.$storage.get('userInfo') || {}
this.currentType = uni.$storage.get('typeItem') || {}
},
methods: {
handleShowPage(name, transfer) {
this.$emit('showPage', name, transfer)
},
changeType() {
this.$refs.bizTypeSelector.open()
},
chooseBusinessType(item) {
this.currentType = item
uni.$storage.set('typeItem', item)
this.$emit('changeType')
}
}
}
</script>
<style scoped lang="scss">
.right-side {
flex: 1;
position: relative;
width: calc(100vw - #{toRpx(240)});
.right-content {
height: 100vh;
box-sizing: border-box;
position: relative;
animation: show-box 0.15s forwards;
overflow: hidden;
}
@keyframes show-box {
0% {
left: 100%;
}
100% {
left: 0;
}
}
.start {
height: toRpx(232);
box-sizing: border-box;
margin-right: toRpx(64);
position: relative;
background: url('@/assets/images/home/start-btn.png') no-repeat;
background-size: 100% 100%;
padding-top: toRpx(60);
display: flex;
justify-content: center;
.sprite-icon {
zoom: 2;
}
}
.right-content-box {
width: 100%;
// height: calc(100% - #{toRpx(232)});
height: 100%;
gap: toRpx(48);
box-sizing: border-box;
padding: toRpx(32) 0 toRpx(80);
.box-class {
background: #ffffff59;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48);
overflow: hidden;
}
.content-box {
position: relative;
width: 100%;
height: calc(100% - #{toRpx(160)});
.message-box {
height: 100%;
}
}
.content-left,
.content-right {
height: 100%;
flex-shrink: 0;
}
.content-left {
width: calc(100% - #{toRpx(48)});
.common-title {
display: flex;
align-items: center;
/* justify-content: space-between; 不需要space-between,左对齐自然排列 */
padding-right: toRpx(48); /* 保持右侧边距 */
.title-text {
flex: 1; /* 标题占据剩余空间 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.switch-btn {
display: flex;
align-items: center;
background: rgba(255, 255, 255, 0.4); /* 半透明白底,融入蓝底 */
border: 1px solid rgba(255, 255, 255, 0.6);
border-radius: toRpx(26);
padding: 0 toRpx(20);
height: toRpx(52);
box-sizing: border-box;
margin-left: toRpx(24);
transition: all 0.2s ease;
cursor: pointer;
text {
font-size: toRpx(24);
color: #5b6b8c; /* 蓝灰色,低调且协调 */
font-weight: 400;
margin-left: toRpx(8);
}
.icon-exchange {
/* 复用 sprite 图标 */
zoom: 0.7;
opacity: 0.7;
/* 移除去色滤镜,让图标自然的色调显露,或者保持微调 */
}
/* 移除之前的 SVG 图标样式 */
&::before {
display: none;
}
&:active {
background: rgba(255, 255, 255, 0.7);
transform: scale(0.98);
}
}
}
.module-box {
height: calc(100% - #{toRpx(235)});
margin-bottom: toRpx(48);
}
.tool-box {
height: calc(100% - #{toRpx(712)});
.content-box {
width: calc(100% - #{toRpx(96)});
margin: 0 toRpx(48);
}
}
}
.content-right {
width: calc(100% - #{toRpx(1322)});
// width: toRpx(800);
}
}
.app-content-box {
width: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
z-index: -999;
}
.show-content-box {
opacity: 1;
z-index: 1;
}
}
</style>
<template>
<view class="store-addr">
<view class="icon-addr sprite-icon icon-addr"></view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
</template>
<script>
export default {
data() {
return {
userInfo: {}
}
},
mounted() {
this.userInfo = uni.$storage.get('userInfo') || {}
}
}
</script>
<style scoped lang="scss">
.store-addr {
position: absolute;
left: 50%;
bottom: toRpx(24);
transform: translateX(-50%);
display: flex;
align-items: center;
.icon-addr {
width: toRpx(32);
height: toRpx(32);
flex-shrink: 0;
}
.addr-text {
font-size: toRpx(24);
color: #999999;
word-wrap: break-word;
white-space: normal;
line-height: toRpx(32);
margin-left: toRpx(4);
flex-shrink: 0;
}
&::before,
&::after {
content: '';
width: toRpx(600);
height: toRpx(2);
margin: 0 toRpx(40);
}
&::before {
background-image: linear-gradient(270deg, #eeeeee 0%, #d8d8d800 100%);
}
&::after {
background-image: linear-gradient(90deg, #eeeeee 0%, #d8d8d800 100%);
}
}
</style>
<template>
<view class="container" @click="handleTouchStart">
<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="right-side">
<view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 0 }]">
......@@ -12,10 +11,11 @@
<view class="right-content-box flex">
<view class="content-left">
<view class="module-box box-class">
<view class="common-title"> {{ currentType.typeName }}产品介绍
<view class="select-type" @click="changeType">
<text class="text">切换接待类型</text>
<view class="icon-arrow"></view>
<view class="common-title">
<text class="title-text">{{ currentType.typeName }}产品介绍</text>
<view class="switch-btn" @click="changeType">
<view class="sprite-icon icon-scene-change icon-exchange"></view>
<text>切换</text>
</view>
</view>
<view class="content-box">
......@@ -28,51 +28,18 @@
</view>
</view>
<template v-if="tabIndex != 0 && tabIndex != 99">
<component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage"
:isPermissionFunction="isPermission" />
<component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" :isPermissionFunction="isPermission" />
</template>
</view>
<view class="store-addr" v-if="footerBox">
<view class="icon-addr sprite-icon icon-addr"></view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
<store-address v-if="footerBox" />
</view>
<view :class="['detail', { show: id }]">
<slot name="detail" />
</view>
<!-- 未点击开始接待,弹窗 -->
<MessageBox ref="previewRef" @confirm="previewHandler('preview', true)" :popupW="704"
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="previewHandler('previewCancel')"
@close="previewHandler('previewClose')"></MessageBox>
<!-- 停留弹框 -->
<!-- <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox> -->
<!-- 退出弹框 -->
<MessageBox :popupW="704" ref="finish" :content="finishContene" :isFooter="false">
<view class="footer">
<view class="footer-btn confirm flex" @click="$emit('openStep')">
<template v-if="finishDoneText">
{{ finishDoneText }}
</template>
<template v-else>
完成接待
<text>(推荐)</text>
</template>
</view>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
仍要退出
<text>(不推荐)</text>
</view>
</view>
</MessageBox>
<MessageBox :popupW="704" ref="bizTypeBox" :isFooter="false" title="请选择类型">
<view class="footer">
<template v-for="(i, index) in businessTypeList">
<view class="footer-btn confirm flex" :key="index" @click="chooseBusinessType(i)">
{{ i.typeName }}
</view>
</template>
</view>
</MessageBox>
<MessageBox ref="previewRef" @confirm="previewHandler('preview', true)" :popupW="704" content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="previewHandler('previewCancel')" @close="previewHandler('previewClose')"></MessageBox>
<finish-reception-dialog ref="finish" @confirm="$emit('openStep')" @cancel="$emit('backHome')" />
<business-type-selector ref="bizTypeSelector" @choose="chooseBusinessType" />
<!-- 升级弹框 -->
<update-box />
<slot name="content" />
......@@ -86,17 +53,18 @@
</template>
<script>
import ReceptionCenter from './components/ReceptionCenter/index.vue'
// import myClick from '@/mixin/click'
import BusinessTypeSelector from './components/BusinessTypeSelector.vue'
import FinishReceptionDialog from './components/FinishReceptionDialog.vue'
import StoreAddress from './components/StoreAddress.vue'
import timeout from '@/mixin/timeout'
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 merge from '@/mixin/record/merge.js'
import Material from '@/components/MaterialIndex.vue'
export default {
mixins: [recorder, uploader, timeout, versionCheck],
components: { LeftSide, Material, ReceptionCenter },
components: { LeftSide, Material, ReceptionCenter, BusinessTypeSelector, FinishReceptionDialog, StoreAddress },
props: {
id: [String, Number],
finishDoneText: String,
......@@ -115,7 +83,7 @@ export default {
type: Boolean,
default: true
},
swiperCustom: Boolean,
swiperCustom: Boolean
},
data() {
return {
......@@ -131,7 +99,6 @@ export default {
tipsObject: {},
autoplay: true,
previewOff: false,
businessTypeList: [],
currentType: {}
}
},
......@@ -151,13 +118,12 @@ export default {
finishRef() {
return this.$refs.finish
},
componentName () {
componentName() {
let tabs = this.$refs.leftBox?.tabs
return tabs ? tabs[this.tabIndex].name : ''
},
}
},
methods: {
async changeTab({ item, index }) {
this.previewOff = index != 0
this.$emit('changeTab', index)
......@@ -188,20 +154,15 @@ export default {
this.$emit('start')
},
async changeType() {
const res = await uni.$api.commonApi.getPadBusinessTypeList()
console.log(res, 'res')
const list = Array.isArray(res?.data) ? res.data : (Array.isArray(res) ? res : [])
this.businessTypeList = list
this.$refs.bizTypeBox.open()
this.$refs.bizTypeSelector.open()
},
chooseBusinessType(item) {
this.$refs.bizTypeBox.close()
this.currentType = item
uni.$storage.set('typeItem', item)
this.$emit('changeType')
},
}
}
}
</script>
<style scoped lang="scss">
.container {
......@@ -397,6 +358,58 @@ export default {
.content-left {
width: calc(100% - #{toRpx(48)});
.common-title {
display: flex;
align-items: center;
/* justify-content: space-between; 不需要space-between,左对齐自然排列 */
padding-right: toRpx(48); /* 保持右侧边距 */
.title-text {
flex: 1; /* 标题占据剩余空间 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.switch-btn {
display: flex;
align-items: center;
background: rgba(255, 255, 255, 0.4); /* 半透明白底,融入蓝底 */
border: 1px solid rgba(255, 255, 255, 0.6);
border-radius: toRpx(26);
padding: 0 toRpx(20);
height: toRpx(52);
box-sizing: border-box;
margin-left: toRpx(24);
transition: all 0.2s ease;
cursor: pointer;
text {
font-size: toRpx(24);
color: #5b6b8c; /* 蓝灰色,低调且协调 */
font-weight: 400;
margin-left: toRpx(8);
}
.icon-exchange {
/* 复用 sprite 图标 */
zoom: 0.7;
opacity: 0.7;
/* 移除去色滤镜,让图标自然的色调显露,或者保持微调 */
}
/* 移除之前的 SVG 图标样式 */
&::before {
display: none;
}
&:active {
background: rgba(255, 255, 255, 0.7);
transform: scale(0.98);
}
}
}
.module-box {
height: calc(100% - #{toRpx(235)});
margin-bottom: toRpx(48);
......@@ -425,7 +438,7 @@ export default {
line-height: 1.2;
text-align: center;
width: toRpx(80);
text-shadow: 0 2px 4px rgba(0,0,0,0.2);
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.icon-arrow {
......@@ -446,7 +459,9 @@ export default {
border-right-color: rgba(255, 255, 255, 0.6);
border-bottom-color: rgba(138, 110, 245, 0.4);
/* 光影辉光效果 */
box-shadow: 0 0 toRpx(16) rgba(97, 135, 231, 0.6), inset 0 0 toRpx(10) rgba(255, 255, 255, 0.2);
box-shadow:
0 0 toRpx(16) rgba(97, 135, 231, 0.6),
inset 0 0 toRpx(10) rgba(255, 255, 255, 0.2);
filter: drop-shadow(0 0 toRpx(6) rgba(255, 255, 255, 0.8));
animation: rotate-ring 4s linear infinite;
}
......@@ -460,7 +475,7 @@ export default {
width: 100%;
height: 100%;
border-radius: 50%;
background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5) 0%, transparent 60%);
background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5) 0%, transparent 60%);
}
&:active {
......@@ -470,13 +485,24 @@ export default {
}
@keyframes breathe {
0%, 100% { transform: translateY(-50%) scale(1); box-shadow: 0 toRpx(8) toRpx(20) rgba(97, 135, 231, 0.5); }
50% { transform: translateY(-50%) scale(1.05); box-shadow: 0 toRpx(12) toRpx(30) rgba(97, 135, 231, 0.7); }
0%,
100% {
transform: translateY(-50%) scale(1);
box-shadow: 0 toRpx(8) toRpx(20) rgba(97, 135, 231, 0.5);
}
50% {
transform: translateY(-50%) scale(1.05);
box-shadow: 0 toRpx(12) toRpx(30) rgba(97, 135, 231, 0.7);
}
}
@keyframes rotate-ring {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.tool-box {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!