Commit 57bf66e7 by 李伟康

feat(boutique): 添加客户档案查询功能并优化界面组件

- 新增客户档案查询API接口getCustomerInfoListApi
- 实现客户档案自动补全组件CustomerAutocomplete
- 添加历史订单列表查询功能getOrderListPage
- 集成门店保险权益查询getMerchantInsuranceListApi
- 更新登录路由路径从/pages/common/login改为/pages/common/login/index
- 优化CarBrands组件布局为flexbox网格系统
- 调整弹窗组件尺寸单位从vw/vh改为百分比
- 修复场景选择页面数据传递逻辑问题
- 添加权益详情案例中心组件CaseCenter
- 集成dayjs和number-precision依赖库
- 更新应用启动配置为标准模式
- 添加多项媒体背景图片资源文件
1 parent ed536890
Showing 37 changed files with 864 additions and 59 deletions
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"configurations" : [ "configurations" : [
{ {
"customPlaygroundType" : "local", "customPlaygroundType" : "local",
"playground" : "custom", "playground" : "standard",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
}, },
{ {
......
...@@ -20,3 +20,12 @@ export function getBoutiquePackageList(data: UTSJSONObject): Promise<any> { ...@@ -20,3 +20,12 @@ export function getBoutiquePackageList(data: UTSJSONObject): Promise<any> {
...data ...data
} as UTSJSONObject) } as UTSJSONObject)
} }
// 新历史订单列表
export function getOrderListPage(data: UTSJSONObject): Promise<any> {
return http.post({
'method': 'dj.pad.api.history.order.page',
'projectName': 'pad',
...data
} as UTSJSONObject)
}
\ No newline at end of file \ No newline at end of file
import http from '@/api/request/http.uts'
/**查询客户档案列表 */
export function getCustomerInfoListApi(data: UTSJSONObject): Promise<any> {
return http.post({
'method': 'dj.api.smartcarlife.customervisits.customerInfoList',
'projectName': 'boutique',
...data
} as UTSJSONObject)
}
\ No newline at end of file \ No newline at end of file
...@@ -218,9 +218,9 @@ class Request { ...@@ -218,9 +218,9 @@ class Request {
const pages = getCurrentPages(); const pages = getCurrentPages();
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
uni.hideLoading(); uni.hideLoading();
if (currentPage.route != "pages/common/login") { if (currentPage.route != "pages/common/login/index") {
uni.reLaunch({ uni.reLaunch({
url: "/pages/common/login" url: "/pages/common/login/index"
}); });
} }
} else { } else {
......
...@@ -91,9 +91,9 @@ export function gscPost(url: string, data: UTSJSONObject, config: GscPostConfig ...@@ -91,9 +91,9 @@ export function gscPost(url: string, data: UTSJSONObject, config: GscPostConfig
const pages = getCurrentPages(); const pages = getCurrentPages();
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
uni.hideLoading(); uni.hideLoading();
if (currentPage.route != "pages/common/login") { if (currentPage.route != "pages/common/login/index") {
uni.reLaunch({ uni.reLaunch({
url: "/pages/common/login" url: "/pages/common/login/index"
}); });
} }
reject(resData); reject(resData);
......
...@@ -89,3 +89,15 @@ export async function apiGetMerchantBrand(params: UTSJSONObject): Promise<any> { ...@@ -89,3 +89,15 @@ export async function apiGetMerchantBrand(params: UTSJSONObject): Promise<any> {
} }
return await http.post(data, true, 'dj', null) return await http.post(data, true, 'dj', null)
} }
/**
* 查询门店保险权益
*/
export function getMerchantInsuranceListApi(data: UTSJSONObject): Promise<any> {
return http.post({
'method': 'dj.api.smartcarlife.recepiton.findMerchantItem',
'projectName': 'boutique',
...data
} as UTSJSONObject)
}
...@@ -302,14 +302,16 @@ defineExpose({ ...@@ -302,14 +302,16 @@ defineExpose({
<style scoped lang='scss'> <style scoped lang='scss'>
.select-box { .select-box {
margin: 40rpx 0; margin: 40rpx 0;
display: grid; display: flex;
grid-template-columns: repeat(4, 1fr); flex-wrap: wrap;
gap: 32rpx;
overflow-y: scroll; overflow-y: scroll;
max-height: 50vh; max-height: 800rpx;
padding-bottom: 60rpx; padding-bottom: 60rpx;
flex-direction: row;
.select-item { .select-item {
width: 23.5%;
margin-right: 2%;
margin-bottom: 32rpx;
text-align: center; text-align: center;
height: 68rpx; height: 68rpx;
line-height: 44rpx; line-height: 44rpx;
...@@ -319,6 +321,10 @@ defineExpose({ ...@@ -319,6 +321,10 @@ defineExpose({
font-size: 32rpx; font-size: 32rpx;
border-radius: 8rpx; border-radius: 8rpx;
&:nth-child(4n) {
margin-right: 0;
}
&.checked { &.checked {
border: 2rpx solid #292d33; border: 2rpx solid #292d33;
} }
......
...@@ -91,8 +91,8 @@ defineExpose({ ...@@ -91,8 +91,8 @@ defineExpose({
.popup-box { .popup-box {
width: 700px; width: 700px;
max-height: 80vh; max-height: 80%;
min-height: 32vh; min-height: 32%;
background: #ffffff; background: #ffffff;
border-radius: var(--l-radius-xl); border-radius: var(--l-radius-xl);
overflow: hidden; overflow: hidden;
......
...@@ -191,7 +191,7 @@ defineExpose({ ...@@ -191,7 +191,7 @@ defineExpose({
left: 0; left: 0;
transform: translateX(-100%) translateY(-50%); transform: translateX(-100%) translateY(-50%);
height: 100%; height: 100%;
max-width: 80vw; max-width: 80%;
border-top-right-radius: 20rpx; border-top-right-radius: 20rpx;
border-bottom-right-radius: 20rpx; border-bottom-right-radius: 20rpx;
...@@ -205,7 +205,7 @@ defineExpose({ ...@@ -205,7 +205,7 @@ defineExpose({
right: 0; right: 0;
transform: translateX(100%) translateY(-50%); transform: translateX(100%) translateY(-50%);
height: 100%; height: 100%;
max-width: 80vw; max-width: 80%;
border-top-left-radius: 20rpx; border-top-left-radius: 20rpx;
border-bottom-left-radius: 20rpx; border-bottom-left-radius: 20rpx;
......
<template>
<view :class="['customer-box',{'is-show':showCustomerBox}]">
<view class="customer-title">客户档案的记录</view>
<scroll-view
scroll-y
class="scroll-box"
>
<template v-if="loading">
<view class="loading flex">
<uni-icons
type="refreshempty"
:size="46"
color="#3773F8"
class="icon"
></uni-icons>
</view>
</template>
<template v-else>
<template v-if="searchList.length">
<template v-for="(i,index) in searchList" :key="index">
<view
class="item flex"
hover-class="active"
@click="chooseItem(i)"
>
{{ `${showType == 'tel'?i.ownerPhone:i.ownerName}`}}
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<view class="icon"></view>
未匹配到客户信息
</view>
</template>
</template>
</scroll-view>
</view>
</template>
<script setup lang="uts">
import { storage } from '@/utils/storage.uts'
import { state } from '@/store/index.uts'
import { getCustomerInfoListApi } from '@/api/customer-api.uts'
interface CustomerInfo {
ownerPhone?: string
ownerName?: string
[key: string]: any
}
interface UserInfo {
shopMerchantId: string
sceneType: number
[key: string]: any
}
interface SearchParams {
merchantId: string
bussinessScene: number
ownerPhone?: string
ownerName?: string
}
const props = defineProps({
searchValue: String,
showType: String,
show: Boolean
})
const emit = defineEmits(['choose'])
const loading = ref<boolean>(true)
const searchList = ref<Array<CustomerInfo>>([])
const showCustomerBox = computed<boolean>(() => {
return props.show && state.user?.haveCustomerAccess && props.searchValue
})
watch(() => showCustomerBox.value, (newval) => {
if (newval) {
getCustomerInfoList(props.searchValue || '', props.showType || '')
}
}, { immediate: true })
async function getCustomerInfoList(val: string, type: string): Promise<void> {
try {
loading.value = true
const userInfo: UserInfo = storage.get("userInfo") || { shopMerchantId: '', sceneType: 0 }
const params: SearchParams = {
merchantId: userInfo.shopMerchantId,
bussinessScene: userInfo.sceneType == 0 ? 1 : 2
}
if (type == 'tel') {
params.ownerPhone= val
} else {
params.ownerName = val
}
const result = await getCustomerInfoListApi(params)
searchList.value = result || []
loading.value = false
} catch (error) {
loading.value = false
console.error('获取客户信息失败:', error)
}
}
function chooseItem(item: CustomerInfo): void {
emit('choose', item)
}
</script>
<style scoped lang='scss'>
.customer-box {
position: absolute;
left: 0;
top: 88rpx;
width: 100%;
height: 352rpx;
background: #ffffff;
border-radius: 16rpx;
z-index: -1;
opacity: 0;
.customer-title {
font-size: 24rpx;
color: #999999;
line-height: 40rpx;
padding: 16rpx 24rpx 8rpx;
}
.scroll-box {
height: calc(100% - 64rpx);
.loading {
width: 100%;
height: 100%;
justify-content: center;
.icon {
animation: rotate-loading 1s linear infinite;
}
}
.nothing {
width: 100%;
height: 100%;
font-size: 24rpx;
color: #c7ccd7;
flex-direction: column;
.icon {
margin-top: 52rpx;
width: 96rpx;
height: 96rpx;
/* background-image: url('@/assets/images/common/nothing.webp'); */
background-size: 100%;
}
}
.item {
width: 100%;
height: 48rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
padding-left: 24rpx;
margin-bottom: 8rpx;
}
.active {
background: #ecf1ff;
}
@keyframes rotate-loading {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
}
}
.is-show {
z-index: 1;
opacity: 1;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -659,7 +659,7 @@ ...@@ -659,7 +659,7 @@
@media screen and (orientation: portrait) { @media screen and (orientation: portrait) {
.canvas-box { .canvas-box {
width: 100vw; width: 100%;
position: relative; position: relative;
.board-canvas { .board-canvas {
......
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
"@types/echarts": "^5.0.0", "@types/echarts": "^5.0.0",
"@types/uni-app": "^1.4.8", "@types/uni-app": "^1.4.8",
"@weapp-tailwindcss/merge": "^2.0.1", "@weapp-tailwindcss/merge": "^2.0.1",
"dayjs": "^1.11.19",
"echarts": "^6.0.0", "echarts": "^6.0.0",
"glsk-toolkit": "^1.0.5", "glsk-toolkit": "^1.0.5",
"number-precision": "^1.6.0",
"sql.js": "^1.13.0", "sql.js": "^1.13.0",
"tslib": "^2.8.1", "tslib": "^2.8.1",
"vue": "^3.5.13", "vue": "^3.5.13",
......
...@@ -54,8 +54,8 @@ defineExpose({ ...@@ -54,8 +54,8 @@ defineExpose({
.popup-box { .popup-box {
width: 700px; width: 700px;
max-height: 80vh; max-height: 80%;
min-height: 32vh; min-height: 32%;
background: #ffffff; background: #ffffff;
border-radius: var(--l-radius-xl); border-radius: var(--l-radius-xl);
overflow: hidden; overflow: hidden;
......
...@@ -367,7 +367,7 @@ onShow(async () => { ...@@ -367,7 +367,7 @@ onShow(async () => {
if (userInfo == null) { if (userInfo == null) {
storage.remove("userInfo"); storage.remove("userInfo");
storage.remove("sessionId"); storage.remove("sessionId");
uni.reLaunch({ url: "/pages/common/login" }); uni.reLaunch({ url: "/pages/common/login/index" });
return; return;
} }
...@@ -378,7 +378,7 @@ onShow(async () => { ...@@ -378,7 +378,7 @@ onShow(async () => {
if (shopMerchantId == null || shopMerchantId == "" || shopMerchantName == null || shopMerchantName == "") { if (shopMerchantId == null || shopMerchantId == "" || shopMerchantName == null || shopMerchantName == "") {
storage.remove("userInfo"); storage.remove("userInfo");
storage.remove("sessionId"); storage.remove("sessionId");
uni.reLaunch({ url: "/pages/common/login" }); uni.reLaunch({ url: "/pages/common/login/index" });
return; return;
} }
......
...@@ -52,7 +52,7 @@ onShow(() => { ...@@ -52,7 +52,7 @@ onShow(() => {
if (userInfo == null) { if (userInfo == null) {
storage.remove('userInfo') storage.remove('userInfo')
storage.remove('sessionId') storage.remove('sessionId')
uni.reLaunch({ url: '/pages/common/login' }) uni.reLaunch({ url: '/pages/common/login/index' })
return return
} }
...@@ -63,7 +63,7 @@ onShow(() => { ...@@ -63,7 +63,7 @@ onShow(() => {
if (shopMerchantId == null || shopMerchantId == '' || shopMerchantName == null || shopMerchantName == '') { if (shopMerchantId == null || shopMerchantId == '' || shopMerchantName == null || shopMerchantName == '') {
storage.remove('userInfo') storage.remove('userInfo')
storage.remove('sessionId') storage.remove('sessionId')
uni.reLaunch({ url: '/pages/common/login' }) uni.reLaunch({ url: '/pages/common/login/index' })
return return
} }
......
...@@ -182,8 +182,8 @@ function selectScene(item: SceneItem, index: number): void { ...@@ -182,8 +182,8 @@ function selectScene(item: SceneItem, index: number): void {
merchantId: shopMerchantId ?? '', merchantId: shopMerchantId ?? '',
merchantName: shopMerchantName ?? '', merchantName: shopMerchantName ?? '',
sceneType: sceneType sceneType: sceneType
}).then((data: any): void => { }).then(({data}: any): void => {
jump(userInfo, data) jump({...data,...userInfo}, data)
}).catch((err) => { }).catch((err) => {
uni.hideLoading() uni.hideLoading()
console.error('selectMerchantScene 失败:', err) console.error('selectMerchantScene 失败:', err)
......
<template>
<CustomPopup
:visible="visible"
ref="popup"
position="center"
>
<view class="detail-box">
<view
class="close-box flex"
@click="close"
>
<uni-icons
type="clear"
:size="28"
color="#76787f"
></uni-icons>
</view>
<view class="sprite-icon icon-bao"></view>
<view class="title text-hide">
{{item.itemName}}
</view>
<view class="type">{{item.main}}</view>
<view class="content">
<rich-text :nodes="item.itemDesc"></rich-text>
</view>
</view>
</CustomPopup>
</template>
<script setup lang="uts">
import CustomPopup from '@/components/CustomPopup.uvue'
interface Item {
itemName: string
main: string
itemDesc: string
[key: string]: any
}
const props = defineProps({
item: Object
})
const visible = ref<boolean>(false)
const popup = ref<any>(null)
function open(): void {
visible.value = true
}
function close(): void {
visible.value = false
}
defineExpose({ open, close })
</script>
<style scoped lang='scss'>
.detail-box {
position: relative;
width: 720rpx;
max-height: 640rpx;
border-radius: 40rpx;
padding: 48rpx 64rpx 88rpx;
box-sizing: border-box;
overflow: hidden;
&::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 240rpx;
background-image: linear-gradient(180deg, #e5edfe 0%, #ffffff 100%);
content: '';
z-index: -1;
}
&::after {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: '';
background-color: #fff;
z-index: -2;
}
.icon-bao {
position: absolute;
top: 48rpx;
right: 68rpx;
}
.close-box {
position: absolute;
width: 136rpx;
height: 136rpx;
top: 0;
right: 0;
justify-content: center;
z-index: 2;
align-items: center;
}
.title {
font-weight: 500;
font-size: 40rpx;
color: #292d33;
line-height: 64rpx;
padding: 48rpx 0 24rpx;
}
.type {
background: #f2f2f2;
border-radius: 6rpx;
padding: 2rpx 16rpx;
font-size: 26rpx;
color: #666666;
line-height: 40rpx;
width: fit-content;
}
.content {
margin-top: 48rpx;
max-height: 276rpx;
font-size: 30rpx;
color: #292d33;
line-height: 48rpx;
overflow-y: auto;
word-break: break-all;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<MessageBox
ref="carBuyersVisible"
position="bottom"
:isFooter="false"
:title="`请选择${title}`"
:maxHeight="1000"
@close="onClose"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked: carBuyers == item.name }"
@click="handleSelect(item)"
v-for="(item, index) in carBuyersList"
:key="index"
>
{{ item.name }}
</view>
</view>
</MessageBox>
</template>
<script setup lang="uts">
import MessageBox from '@/components/MessageBox.uvue'
import { state } from '@/store/index.uts'
const props = defineProps({
title: {
type: String,
default: '购车方式'
},
salesPropsUuid: {
type: String,
default: ''
}
})
const emit = defineEmits(['close', 'select'])
const carBuyersVisible = ref<any>(null)
const carBuyersList = ref<Array<{name: string, id: number}>>([
{
name: '全款',
id: 1
},
{
name: '按揭',
id: 2
}
])
const watchStatus = computed(() => {
return state.user.historyStatus
})
const carBuyers = computed(() => {
return state.user.customerInfo.carBuyers
})
watch(() => watchStatus.value, (newval) => {
close()
}, { immediate: true })
function open(): void {
;(carBuyersVisible.value as any).open()
}
function handleSelect(item: {name: string, id: number}): void {
close()
emit('select', item)
}
function close(): void {
;(carBuyersVisible.value as any)?.close()
}
function onClose(): void {
emit('close')
}
defineExpose({ open, close })
</script>
<style scoped lang="scss">
.select-box {
margin: 40rpx 0;
display: flex;
flex-wrap: wrap;
overflow-y: scroll;
max-height: 50%;
padding-bottom: 60rpx;
flex-direction:row;
.select-item {
width: 23%;
margin-right: 2.67%;
margin-bottom: 32rpx;
text-align: center;
height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
&:nth-child(4n) {
margin-right: 0;
}
&.checked {
border: 2rpx solid #292d33;
}
}
}
</style>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<image <image
:key="viewKey" :key="viewKey"
class="content" class="content"
:src="views[customerInfo.carModelId] || require('@/assets/images/media/nothing.webp')" :src="views[customerInfo.carModelId] || nothingImage"
/> />
</template> </template>
<template v-else> <template v-else>
...@@ -38,8 +38,9 @@ ...@@ -38,8 +38,9 @@
<script setup lang="uts"> <script setup lang="uts">
import PageTitle from './PageTitle.uvue' import PageTitle from './PageTitle.uvue'
import wnCanvas from '@/components/PanCanvas/index.uts' import wnCanvas from '@/components/PanCanvas/index.uvue'
import { state } from "@/store/index.uts" import { state } from "@/store/index.uts"
import nothingImage from '@/assets/images/media/nothing.webp'
interface Views { interface Views {
detailUrl?: string detailUrl?: string
...@@ -94,7 +95,6 @@ defineExpose({ ...@@ -94,7 +95,6 @@ defineExpose({
&-content { &-content {
height: 100%; height: 100%;
position: relative; position: relative;
margin: 40rpx;
} }
.content { .content {
...@@ -105,8 +105,8 @@ defineExpose({ ...@@ -105,8 +105,8 @@ defineExpose({
} }
.bg { .bg {
width: 100vw; width: 100%;
height: 100vh; height: 100%;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<script setup lang="uts"> <script setup lang="uts">
import CarBrands from '@/components/CarBrands.uvue' import CarBrands from '@/components/CarBrands.uvue'
import { state } from "@/store/index.uts" import { state , store } from "@/store/index.uts"
import { storage } from '@/utils/storage.uts' import { storage } from '@/utils/storage.uts'
interface CustomerInfo { interface CustomerInfo {
...@@ -73,7 +73,7 @@ function handleSelect(item: any): void { ...@@ -73,7 +73,7 @@ function handleSelect(item: any): void {
carBrandListVisible.value?.close() carBrandListVisible.value?.close()
customerInfo.value.carModel = item.name customerInfo.value.carModel = item.name
customerInfo.value.carModelId = item.id customerInfo.value.carModelId = item.id
uni.$store?.dispatch('setCustomerInfo', customerInfo.value) store.dispatch('setCustomerInfo', customerInfo.value)
} }
function openCarBrand(): void { function openCarBrand(): void {
...@@ -95,11 +95,13 @@ defineExpose({ ...@@ -95,11 +95,13 @@ defineExpose({
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #333; color: #333;
text-align: center;
width: 100%; width: 100%;
z-index: 2; z-index: 2;
flex-direction: row;
align-items: center;
.car-options { .car-options {
align-items: center;
flex-direction: row;;
&::before { &::before {
content: ''; content: '';
width: 2rpx; width: 2rpx;
......
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
@focus="focusIndex = index" @focus="focusIndex = index"
@blur="resetFocusIndex" @blur="resetFocusIndex"
/> />
<!-- <customer-autocomplete <customer-autocomplete
:showType="i.inputType" :showType="i.inputType"
:searchValue="customerInfo[i.key]" :searchValue="customerInfo[i.key]"
:show="focusIndex == index" :show="focusIndex == index"
@choose="onChooseCustomer" @choose="onChooseCustomer"
/> --> />
</template> </template>
<template v-else> <template v-else>
<view <view
...@@ -81,10 +81,10 @@ ...@@ -81,10 +81,10 @@
<script setup lang="uts"> <script setup lang="uts">
import CarBrands from '@/components/CarBrands.uvue' import CarBrands from '@/components/CarBrands.uvue'
// import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue' import CustomerAutocomplete from '@/components/CustomerAutocomplete.uvue'
import { store } from '@/store/index.uts' import { store } from '@/store/index.uts'
import { storage } from '@/utils/storage.uts' import { storage } from '@/utils/storage.uts'
import wnCanvas from '@/components/PanCanvas/index.uts' import wnCanvas from '@/components/PanCanvas/index.uvue'
interface FormItem { interface FormItem {
placeholder: string placeholder: string
...@@ -165,6 +165,7 @@ ...@@ -165,6 +165,7 @@
}, { immediate: true }) }, { immediate: true })
watch(() => props.show, (n) => { watch(() => props.show, (n) => {
if (n && !customerInfo.value.carModel && isAito.value) { if (n && !customerInfo.value.carModel && isAito.value) {
setTimeout(() => { setTimeout(() => {
carBrandListVisibleRef.value.$callMethod('autoSelect') carBrandListVisibleRef.value.$callMethod('autoSelect')
......
<!--
* @Description:
* @Author: huyue
* @Date: 2024-06-24 16:35:00
* @LastEditors: huyue
* @LastEditTime: 2024-07-04 16:02:54
-->
<template>
<view
class="layout"
:style="detail.pageStyle"
>
<image
class="icon-car"
:src="detail.carIcon"
/>
<wnCanvas
:drawStatus="penSwitch"
:canvasId="`c-${madiaId}`"
custom
@scale="onScale"
ref="threeGuarantees"
>
<template #customContent>
<view class="layout-content">
<view class="title flex">{{title}}</view>
<view class="container">
<view class="left-tab">
<view
class="tab-item"
v-for="item in detail.tabList"
:key="item.id"
@click="tabChange(item)"
:class="[item.id == activeIndex ? 'active' : '']"
>{{item.name}}</view>
</view>
<div class="content-bg"></div>
<view class="content">
<template v-if="detail.viewActiveIndex.includes(activeIndex)">
<image
:key="imgKey"
:class="direction"
class="content-image"
:src="viewsImg()"
/>
<view class="content-tab">
<template v-for="(item,index) in imgIdList" :key="index">
<view
class="tab-item"
@click="tabSwitch(item)"
></view>
</template>
</view>
</template>
<template v-else>
<image
:key="imgKey"
:class="direction"
class="content-image"
:src="viewsImg()"
/>
</template>
</view>
</view>
</view>
</template>
</wnCanvas>
</view>
</template>
<script setup lang="uts">
import wnCanvas from '@/components/PanCanvas/index.uvue'
import { store } from '@/store/index.uts'
interface TabItem {
id: number | string
name: string
imgIdList?: any[]
}
interface Detail {
tabList: TabItem[]
viewActiveIndex: number[]
defultActiveId?: number
defultTabId?: number
pageStyle?: string
carIcon?: string
[key: string]: any
}
const props = defineProps({
views: Object,
penSwitch: Boolean,
title: String,
madiaId: Number,
detail: Object,
})
const emit = defineEmits(['scale'])
const activeIndex = ref<number>(1)
const direction = ref<string>('bottom')
const imgKey = ref<number>(Date.now())
const tabIndex = ref<number>(2)
const threeGuarantees = ref<any>(null)
const watchStatus = computed(() => {
return store.state.user.historyStatus
})
const imgIdList = computed(() => {
return (props.detail as Detail).tabList.find(item => item.id == activeIndex.value).imgIdList
})
watch(() => watchStatus.value, () => {
activeIndex.value = (props.detail as Detail).defultActiveId || 0
tabIndex.value = (props.detail as Detail).defultTabId
})
function tabChange(item: TabItem): void {
const { id } = item
if (activeIndex.value === id) return
direction.value = ''
direction.value = id > activeIndex.value ? 'bottom' : 'top'
activeIndex.value = id
imgKey.value = Date.now()
threeGuarantees.value.clearBoard()
}
function tabSwitch(val: any): void {
if (val == tabIndex.value) return
tabIndex.value = val
threeGuarantees.value.clearBoard()
}
function viewsImg(): any {
const { detail, views } = props
const currentIndex = activeIndex.value
const currentTabIndex = tabIndex.value
if ((detail as Detail).viewActiveIndex.includes(currentIndex)) return views[currentTabIndex]
return views[currentIndex]
}
function onScale(e: any): void {
emit('scale', e)
}
</script>
<style scoped lang='scss'>
.layout {
width: 100%;
height: 100%;
position: relative;
// background-image: url('@/assets/images/media/media-bg.webp');
background-size: 100%;
&-content {
height: 100%;
position: relative;
}
.title {
justify-content: center;
position: absolute;
height: 96rpx;
left: 0;
top: 48rpx;
font-weight: 500;
font-size: 36rpx;
color: #333;
text-align: center;
width: 100%;
z-index: 2;
}
.container {
display: flex;
align-items: center;
padding-top: 248rpx;
padding-bottom: 96rpx;
height: 100%;
margin: 0 80rpx;
position: relative;
flex-direction:row;
.left-tab {
width: 360rpx;
margin-right: 48rpx;
.tab-item {
display: flex;
padding: 0 76rpx;
box-sizing: border-box;
align-items: center;
// justify-content: center;
flex-direction: row;
width: 100%;
height: 312rpx;
background: #f2f5ff;
border: 4rpx solid hsl(0, 80%, 100%);
box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 32rpx;
margin-bottom: 48rpx;
font-weight: 500;
font-size: 40rpx;
color: #1a1a1a;
text-align: center;
&:last-child {
margin-bottom: 0;
}
&.active {
color: #fff;
background-image: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
box-shadow: 32rpx 32rpx 48rpx 0 #849dc240, inset 0 0 32rpx 0 #ffffff;
}
}
}
.content-bg {
position: absolute;
right: 0;
z-index: -1;
width: 1778rpx;
height: 1192rpx;
background-color: rgba(255, 255, 255, 0.4);
backdrop-filter: blur(8rpx);
z-index: 0;
border-radius: 64rpx;
}
.content {
position: relative;
&-tab {
display: flex;
position: absolute;
width: 100%;
top: 0;
height: 112rpx;
z-index: 1;
flex-direction: row;
.tab-item {
width: 50%;
height: 100%;
}
}
}
.content-image {
width: 1778rpx;
height: 1192rpx;
}
}
.icon-car {
position: absolute;
bottom: 0;
right: 0;
width: 952rpx;
height: 248rpx;
z-index: 2;
}
}
.top {
animation: show-view-top 0.5s;
}
.bottom {
animation: show-view-bottom 0.3s;
}
@keyframes show-view-top {
0% {
opacity: 0;
transform: translateY(-224rpx);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes show-view-bottom {
0% {
opacity: 0;
transform: translateY(100%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -48,23 +48,60 @@ ...@@ -48,23 +48,60 @@
:views="item.receptionSourceDetailList || []" :views="item.receptionSourceDetailList || []"
:penSwitch="penSwitch" :penSwitch="penSwitch"
:show="id == item.id" :show="id == item.id"
:ref="'media' + item.id" :ref="(el) => setMediaRef(item.id, el)"
:title="item.detailTitle || ''" :title="item.detailTitle || ''"
/> />
</template> </template>
<template v-else-if="item.componentName == 'media-component'"> <template v-else-if="item.componentName == 'history'">
<history
:show="id == item.id"
:ref="(el) => setMediaRef(item.id, el)"
:title="item.detailTitle || ''"
:madiaId="item.id"
/>
</template>
<template v-else-if="item.componentName == 'three-guarantees'">
<three-guarantees
:views="item.receptionSourceDetailList || []"
:penSwitch="penSwitch"
:show="id == item.id"
:ref="(el) => setMediaRef(item.id, el)"
:title="item.detailTitle || ''"
:madiaId="item.id"
:detail="item"
/>
</template>
<template v-else-if="item.componentName == 'insurance'">
<insurance
:show="id == item.id"
:ref="(el) => setMediaRef(item.id, el)"
:title="item.detailTitle || ''"
:madiaId="item.id"
:penSwitch="penSwitch"
:isPreview="isPreview"
/>
</template>
<template v-else-if="item.componentName == 'CaseCenter'">
<case-center
:detail="item"
:ref="(el) => setMediaRef(item.id, el)"
:title="item.detailTitle || ''"
:show="id == item.id"
/>
</template>
<template v-else>
{{ item.componentName }}
<media-component <media-component
:views="item.receptionSourceDetailList || []" :views="item.receptionSourceDetailList || []"
:penSwitch="penSwitch" :penSwitch="penSwitch"
:show="id == item.id" :show="id == item.id"
:ref="'media' + item.id" :ref="(el) => setMediaRef(item.id, el)"
:title="item.detailTitle || ''" :title="item.detailTitle || ''"
:madiaId="item.id" :madiaId="item.id"
:hasCarBrand="item.hasCarBrand" :hasCarBrand="item.hasCarBrand"
/> />
</template> </template>
</view> </view>
</template> </template>
<template v-if="type != 'preview'"> <template v-if="type != 'preview'">
...@@ -110,17 +147,17 @@ ...@@ -110,17 +147,17 @@
import ToolBox from '@/components/ToolBox.uvue' import ToolBox from '@/components/ToolBox.uvue'
import Reception from './components/Reception.uvue' import Reception from './components/Reception.uvue'
// import CaseCenter from './components/CaseCenter.vue' import CaseCenter from './components/CaseCenter.uvue'
import MediaComponent from './components/MediaComponent.uvue' import MediaComponent from './components/MediaComponent.uvue'
// import History from './components/History.vue' import History from './components/History.uvue'
// import ThreeGuarantees from './components/ThreeGuarantees.vue' import ThreeGuarantees from './components/ThreeGuarantees.uvue'
// import payPop from './components/payPop.vue' // import payPop from './components/payPop.vue'
// import FinishStep from '@/components/FinishStep.vue' // import FinishStep from '@/components/FinishStep.vue'
// import informationEntry from './components/informationEntry.vue' // import informationEntry from './components/informationEntry.vue'
// import insurance from '@/components/Insurance/Insurance.vue' import insurance from './components/Insurance/index.uvue'
// import { receptionTrackMixin } from '@/mixin/index.js' // import { receptionTrackMixin } from '@/mixin/index.js'
import { ref, getCurrentInstance, ComponentPublicInstance } from 'vue' import { ref, getCurrentInstance, ComponentPublicInstance } from 'vue'
import { state } from "@/store/index.uts" import { state , store} from "@/store/index.uts"
const backZindex = ref<number>(9) const backZindex = ref<number>(9)
const drawStatus = ref<boolean>(false) const drawStatus = ref<boolean>(false)
...@@ -140,6 +177,15 @@ ...@@ -140,6 +177,15 @@
const type = ref<string>('') const type = ref<string>('')
const media = ref<Array>([]) const media = ref<Array>([])
const toolList = ref<Array>([]) const toolList = ref<Array>([])
// 用于存储动态 ref 的对象
const mediaRefs = ref<Record<string, any>>({})
// 设置动态 ref 的函数
const setMediaRef = (id: string | number, component: any): void => {
if (component) {
mediaRefs.value[`media${id}`] = component
}
}
const channelType = computed(() => { const channelType = computed(() => {
const { channelType } = storage.get('userInfo') const { channelType } = storage.get('userInfo')
return channelType return channelType
...@@ -186,9 +232,7 @@ ...@@ -186,9 +232,7 @@
return type.value == 'preview' return type.value == 'preview'
}) })
const customerInfo = computed(() => {
return state.user.customerInfo
})
const viewKey = computed(() => { const viewKey = computed(() => {
return state.user.viewKey return state.user.viewKey
...@@ -212,6 +256,7 @@ ...@@ -212,6 +256,7 @@
screenWidth.value = systemInfo.screenWidth screenWidth.value = systemInfo.screenWidth
}) })
onLoad((options: OnLoadOptions) => { onLoad((options: OnLoadOptions) => {
store.dispatch('setCustomerInfo', {})
const storageKey = `source_${sceneType.value}_${shopMerchantId.value}` const storageKey = `source_${sceneType.value}_${shopMerchantId.value}`
const data = uni.getStorageSync(storageKey) const data = uni.getStorageSync(storageKey)
id.value = options.id id.value = options.id
...@@ -247,8 +292,7 @@ ...@@ -247,8 +292,7 @@
currentList.forEach(item => { currentList.forEach(item => {
const refName = `media${item.id}` const refName = `media${item.id}`
const refValue = (getCurrentInstance()?.proxy?.$refs as any)?.[refName] const refValue = mediaRefs.value[refName]
if (refValue) { if (refValue) {
// 处理可能是数组的情况(v-for 生成的 ref 通常是数组) // 处理可能是数组的情况(v-for 生成的 ref 通常是数组)
const componentInstance = Array.isArray(refValue) ? refValue[0] : refValue const componentInstance = Array.isArray(refValue) ? refValue[0] : refValue
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
if (userInfo == null) { if (userInfo == null) {
storage.remove('userInfo') storage.remove('userInfo')
storage.remove('sessionId') storage.remove('sessionId')
uni.reLaunch({ url: '/pages/common/login' }) uni.reLaunch({ url: '/pages/common/login/index' })
return return
} }
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
if (shopMerchantId == null || shopMerchantId == '' || shopMerchantName == null || shopMerchantName == '') { if (shopMerchantId == null || shopMerchantId == '' || shopMerchantName == null || shopMerchantName == '') {
storage.remove('userInfo') storage.remove('userInfo')
storage.remove('sessionId') storage.remove('sessionId')
uni.reLaunch({ url: '/pages/common/login' }) uni.reLaunch({ url: '/pages/common/login/index' })
return return
} }
......
...@@ -117,7 +117,7 @@ onShow(() => { ...@@ -117,7 +117,7 @@ onShow(() => {
if (userInfo == null) { if (userInfo == null) {
storage.remove('userInfo') storage.remove('userInfo')
storage.remove('sessionId') storage.remove('sessionId')
uni.reLaunch({ url: '/pages/common/login' }) uni.reLaunch({ url: '/pages/common/login/index' })
return return
} }
...@@ -128,7 +128,7 @@ onShow(() => { ...@@ -128,7 +128,7 @@ onShow(() => {
if (shopMerchantId == null || shopMerchantId == '' || shopMerchantName == null || shopMerchantName == '') { if (shopMerchantId == null || shopMerchantId == '' || shopMerchantName == null || shopMerchantName == '') {
storage.remove('userInfo') storage.remove('userInfo')
storage.remove('sessionId') storage.remove('sessionId')
uni.reLaunch({ url: '/pages/common/login' }) uni.reLaunch({ url: '/pages/common/login/index' })
return return
} }
......
...@@ -125,8 +125,8 @@ $uni-font-size-paragraph: 15px; ...@@ -125,8 +125,8 @@ $uni-font-size-paragraph: 15px;
&::before { &::before {
content: ""; content: "";
position: absolute; position: absolute;
left: toMinusRpx(20); left: -20rpx;
top: toMinusRpx(28); top: -28rpx;
z-index: -1; z-index: -1;
width: 136rpx; width: 136rpx;
height: 136rpx; height: 136rpx;
...@@ -163,8 +163,8 @@ $uni-font-size-paragraph: 15px; ...@@ -163,8 +163,8 @@ $uni-font-size-paragraph: 15px;
&::before { &::before {
content: ""; content: "";
position: absolute; position: absolute;
left: toMinusRpx(20); left: -20rpx;
top: toMinusRpx(28); top: -28rpx;
z-index: -1; z-index: -1;
width: 136rpx; width: 136rpx;
height: 136rpx; height: 136rpx;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!