Commit 17eafcb8 by 李伟康

commit 修改客户档案交互

1 parent d63727d8
<template>
<view class="detail-box">
<view
class="detail-box"
@click="closeToolTip"
>
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
车主详情
</view>
......@@ -10,27 +20,60 @@
<view class="title">车主信息</view>
<view class="customer-info">
<template v-for="(item, index) in customerForm">
<view class="item flex" :key="index">
<view
class="item flex"
:key="index"
>
<view class="label">{{ item.label }}</view>
<view class="value text-hide">{{ customerInfo[item.key] }}</view>
<view
class="value text-hide"
:id="item.key"
>
{{ customerInfo[item.key] }}
</view>
<template v-if="item.showTooltipIcon">
<view
class="sprite-icon icon-customer-detail"
@click.stop="showTooltipBox(item)"
></view>
<view
class="tooltip-box"
v-if="item.showTooltip"
@click.stop
> {{ customerInfo[item.key] }}</view>
</template>
</view>
</template>
</view>
</view>
<view class="case-box box">
<view class="title flex">推荐套餐</view>
<scroll-view class="case-scroll-box" scroll-y @scrolltolower="pageonReachBottom">
<scroll-view
class="case-scroll-box"
scroll-y
@scrolltolower="pageonReachBottom"
>
<view class="case-list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="i in list">
<template v-for="item in i">
<view class="case-item" :key="item.id" @click="jumpDetail(item)">
<image class="img" :src="item.cover"></image>
<view
class="case-item"
:key="item.id"
@click="jumpDetail(item)"
>
<image
class="img"
:src="item.cover"
></image>
<view class="case-info">
<view class="case-name text-hide">{{ item.title }}</view>
<template v-for="(j, ind) in caseInfo">
<view class="case-text flex" :key="ind">
<view
class="case-text flex"
:key="ind"
>
<view class="case-label">{{ j.label }}:</view>
<view :class="['case-value', j.class]">
<template v-if="j.format">
......@@ -49,7 +92,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="@/assets/images/home/nothing.webp" />
<view class="icon"></view>
暂无推荐套餐
</view>
</template>
......@@ -101,6 +144,7 @@ export default {
{
label: '客户标签',
key: 'customerTagName',
hasTooltip: true
}],
caseInfo: [
{
......@@ -136,7 +180,7 @@ export default {
total: 0,
flag: false,
nothing: false,
pageSize: 8,
pageSize: 8
}
},
onLoad (options) {
......@@ -164,11 +208,15 @@ export default {
async findVisitsInfo (id) {
const customerInfo = await uni.$api.customerApi.findVisitsInfo({
id
})
}),
{ customerForm } = this
customerInfo.customerTagName = customerInfo.customerTagName.replace(/,/g, '|')
customerInfo.arrivalDate = dayjs(customerInfo.arrivalDate).format("YYYY.MM.DD")
this.customerInfo = customerInfo
this.getMaterialResponsePage()
this.$nextTick(() => {
this.checkTextWidth(customerForm.find(e => e.hasTooltip))
})
},
showPopup () {
this.arrowPopup = true
......@@ -198,7 +246,6 @@ export default {
showChannel: 2,
scene: sceneType
}
console.log(params)
const { list, total } = await uni.$api.customerApi.getMaterialResponsePage(params)
uni.hideLoading()
list.map(e => {
......@@ -220,7 +267,6 @@ export default {
this.$forceUpdate()
} catch (error) {
uni.hideLoading()
console.log(error)
this.flag = true
}
},
......@@ -261,6 +307,25 @@ export default {
this.getMaterialResponsePage()
} else this.nothing = true
},
checkTextWidth (item) {
if (!item) return
let query = uni.createSelectorQuery().in(this)
query.select(`#${item.key}`).boundingClientRect((data) => {
if (data.width > 410) item.showTooltipIcon = true
this.$forceUpdate()
}).exec()
},
showTooltipBox (item) {
item.showTooltip = !item.showTooltip
this.$forceUpdate()
},
closeToolTip () {
let item = this.customerForm.find(e => e.hasTooltip)
if (item.showTooltipIcon) {
item.showTooltip = false
this.$forceUpdate()
}
}
}
}
</script>
......@@ -338,17 +403,19 @@ export default {
.customer-box {
height: 292rpx;
margin-bottom: 32rpx;
position: relative;
z-index: 2;
.customer-info {
display: flex;
flex-wrap: wrap;
padding: 0 48rpx;
gap: 12rpx 38rpx;
.item {
width: 50%;
width: 1042rpx;
flex-shrink: 0;
font-size: 28rpx;
margin-bottom: 12rpx;
line-height: 44rpx;
position: relative;
.label {
color: #292d3399;
width: 160rpx;
......@@ -357,6 +424,25 @@ export default {
.value {
color: #292d33;
}
.icon-customer-detail {
flex-shrink: 0;
margin-left: 16rpx;
}
.tooltip-box {
position: absolute;
right: 0;
top: 60rpx;
width: 792rpx;
background: #ffffffcc;
box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 16rpx;
backdrop-filter: blur(8rpx);
box-sizing: border-box;
padding: 24rpx 28rpx;
font-size: 28rpx;
color: #292d33;
line-height: 44rpx;
}
}
}
}
......@@ -417,6 +503,8 @@ export default {
width: 676rpx;
height: 284rpx;
margin-bottom: 24rpx;
background-image: url('@/assets/images/home/nothing.webp');
background-size: 100% 100%;
}
}
.end-text {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!