Commit 17eafcb8 by 李伟康

commit 修改客户档案交互

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