Commit 4e1e8380 by 李伟康

feat(common): 新增客户接待详情页面

- 添加接待详情页面组件和相关子组件
- 实现对话和质检功能模块
- 集成标签和质检表格组件
- 优化页面样式和布局
1 parent 26e63ce0
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
inject: ['getRecorder'], inject: ['getRecorder'],
data () { data () {
return { return {
dataList: [ dataList: Object.freeze([
{ {
label: '客户接待数', label: '客户接待数',
type: 'day', type: 'day',
...@@ -188,15 +188,15 @@ export default { ...@@ -188,15 +188,15 @@ export default {
type: 'month', type: 'month',
icon: monthImgUrl icon: monthImgUrl
} }
], ]),
typeList: Object.freeze([ typeList: Object.freeze([
{ tabName: '已上传', num: () => '' }, { tabName: '已上传', num: () => '' },
{ tabName: '待上传', num: this.getTabCount('recordFailList') }, { tabName: '待上传', num: this.getTabCount('recordFailList') },
{ tabName: '待提交', num: this.getTabCount('preRecordFailList'), dot: () => this.preRecordFailList.length }, { tabName: '待提交', num: this.getTabCount('preRecordFailList'), dot: () => this.preRecordFailList.length },
]), ]),
firstIndex: 0, firstIndex: 0,
firstLeft: ['first', 'second', 'three'], firstLeft: Object.freeze(['first', 'second', 'three']),
firstClass: ['first-nav', 'second-nav', 'second-nav'], firstClass: Object.freeze(['first-nav', 'second-nav', 'second-nav']),
dateList: Object.freeze([ dateList: Object.freeze([
{ text: '今日' }, { text: '今日' },
{ text: '本周' }, { text: '本周' },
...@@ -274,6 +274,12 @@ export default { ...@@ -274,6 +274,12 @@ export default {
await this.getPreRecordFail() await this.getPreRecordFail()
}, },
jumpDetail (item) { jumpDetail (item) {
if(this.firstIndex == 0){
uni.navigateTo({
url: `/pages/common/receptionDetail/index?id=${item.id}`
})
return
}
if (this.firstIndex != 2) return if (this.firstIndex != 2) return
this.showRecord = false; this.showRecord = false;
this.customerInfo = item this.customerInfo = item
......
...@@ -147,6 +147,12 @@ ...@@ -147,6 +147,12 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/common/receptionDetail/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<template>
<view class="view">
<scroll-view
class="scroll-view"
enhanced
scroll-y
scroll-with-animatio
>
<template v-if="dialogueList.length">
<template v-for="(i,index) in dialogueList">
<view
:key="index"
:class="['item flex', {active:i.text_id == activeId}]"
:id="i.text_id"
@click="seekPlay({item:i,click:true})"
>
<view class="avatar-box">
<view :class="['sprite-icon',`icon-role-${i.role}`]"></view>
<view class="time">{{i.time}}</view>
</view>
<view class="text flex">{{i.content}}</view>
</view>
</template>
<view class="safeAreaInset">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
export default {
name: '',
props: {
batchId: [String, Number]
},
watch: {
batchId: {
handler (n) {
const data = {
batchId: n,
currentPage: 1,
pageSize: 999999,
};
this.findConversationDetailByBatchId(data)
},
immediate: true
}
},
data () {
return {
dialogueList: [],
activeId: 'text_10'
}
},
mounted () {
},
methods: {
formatTime (num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
async findConversationDetailByBatchId (params) {
const res = await uni.$api.customerApi.findConversationDetailByBatchId(params)
res.map(e => {
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.id}`
})
this.dialogueList = res
},
seekPlay (e, report = true) {
console.log(e)
return
let {
item,
click,
scroll
} = e, {
activeId
} = this.data
if (!item) return
thisPage.seek(item.mergedOffset)
this.setTopId(item, scroll)
if (report) this.setTrackData('dialogue_time_point')
if (click && item.text_id == activeId) {
const {
paused
} = this.innerAudioContext
if (paused) this.triggerEvent('play')
else thisPage.onPause()
thisPage.setData({
isOperate: !paused
})
} else {
this.triggerEvent('play')
thisPage.setData({
isOperate: false
})
}
},
}
}
</script>
<style scoped lang='scss'>
.view {
height: 100%;
width: 100%;
position: relative;
.scroll-view {
height: 100%;
width: 100%;
border-radius: toRpx(28);
background: #fff;
.item {
padding: toRpx(20) toRpx(24);
.avatar-box {
position: relative;
width: toRpx(68);
height: toRpx(96);
flex-shrink: 0;
display: flex;
align-items: center;
flex-direction: column;
.sprite-icon {
border-radius: 100%;
overflow: hidden;
flex-shrink: 0;
}
.time {
width: toRpx(70);
height: toRpx(28);
background: #ffffff;
border: toRpx(2) solid #f0f6ff;
border-radius: toRpx(28);
font-size: toRpx(20);
color: #999ea8;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
}
.text {
width: toRpx(722);
min-height: toRpx(80);
color: #292d33;
font-size: toRpx(26);
margin-left: toRpx(16);
line-height: toRpx(44);
}
}
.active{
background: #F0F6FF;
.text {
font-weight: 500;
}
}
.safeAreaInset {
text-align: center;
line-height: toRpx(40);
color: #999;
font-size: toRpx(24);
padding-bottom: toRpx(20);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="view">
123
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="quality-table-box">
<reception-title
title="质检明细"
icon="reception-2"
/>
<div class="quality-table">
<view class="quality-title-box flex">
<template v-for="(i,index) in qualityTitle">
<view
:class="['title-item flex',`row-${index + 1}`]"
:key="index"
>{{i}}</view>
</template>
</view>
<view class="quality-content">
<scroll-view
class="table"
scroll-y
:scroll-top="scrollTop"
>
<template v-if="flag">
<template v-for="(i,index) in qualityList">
<view
class="quality-item"
:key="index"
>
<template v-for="(key,ind) in keyList">
<div
:key="`${index}-${ind}`"
:class="['flex item',`row-${ind + 1}`]"
>
<template v-if="ind != 2">
{{i[key]}}
</template>
<template v-else>
<view class="text-two-line">
{{i[key]}}
</view>
</template>
</div>
</template>
</view>
</template>
</template>
</scroll-view>
</view>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import ReceptionTitle from './ReceptionTitle.vue'
export default {
components: {
ReceptionTitle
},
name: '',
data () {
return {
qualityTitle: Object.freeze(['一级分类', '质检得分', '命中文本']),
scrollTop: 0,
flag: true,
qualityList: [
{
name: '身份介绍',
score: '2/5',
text: '我是一个测试文本'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},{
name: '身份介绍',
score: '2/5',
text: '我是一个测试文本'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},{
name: '身份介绍',
score: '2/5',
text: '我是一个测试文本'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
],
keyList: Object.freeze(['name', 'score', 'text'])
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.quality-table-box {
.quality-table {
height: 864rpx;
width: 100%;
box-sizing: border-box;
border-radius: toRpx(16);
overflow: hidden;
.quality-title-box {
height: toRpx(88);
background: #edf3ff;
border-radius: toRpx(16) toRpx(16) 0 0;
font-size: toRpx(26);
color: #333333;
line-height: toRpx(40);
.title-item {
height: toRpx(88);
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
}
}
.row-1 {
width: 272rpx;
}
.row-2 {
width: toRpx(248);
border-right: toRpx(4) solid #fff;
border-left: toRpx(4) solid #fff;
}
.row-3 {
width: calc(100% - #{toRpx(520)})
}
.quality-content {
height: calc(100% - #{toRpx(88)});
display: flex;
box-sizing: border-box;
border-top: toRpx(4) solid #ffffff;
.table {
height: 100%;
.quality-item {
display: flex;
border-bottom: toRpx(4) solid #ffffff;
.item {
min-height: toRpx(84);
background: #f7f8fa;
height: auto;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-sizing: border-box;
}
.row-3 {
padding: 24rpx 48rpx;
justify-content: flex-start;
}
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="title flex">
<div :class="['sprite-icon',`icon-${icon}`]"></div>
{{title}}
</div>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
title: String,
icon: String
},
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.title {
padding: toRpx(24) 0;
color: #333333;
font-size: toRpx(32);
font-weight: 500;
line-height: toRpx(40);
.sprite-icon {
margin-right: toRpx(12);
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="tags-box">
<reception-title
title="话术标签"
icon="reception-1"
/>
<div class="tags-flex flex">
<template v-for="(i ,index) in tags">
<div
:key="index"
class="tag flex"
>{{i}}</div>
</template>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import ReceptionTitle from './ReceptionTitle.vue'
export default {
components: {
ReceptionTitle
},
data () {
return {
tags: ['场景塑造-优秀', '逼单技巧-薄弱','场景塑造-优秀', '逼单技巧-薄弱','场景塑造-优秀', '逼单技巧-薄弱','场景塑造-优秀', '逼单技巧-薄弱','场景塑造-优秀', '逼单技巧-薄弱']
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.tags-box {
padding-bottom: 24rpx;
.tags-flex {
gap: 20rpx;
flex-wrap: wrap;
.tag {
height: 64rpx;
border-radius: 16rpx;
background: #edf3ff;
padding: 0 20rpx;
color: #4673ff;
font-size: 28rpx;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="reception-box">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
接待详情
</view>
<view class="reception-content-box flex">
<view class="reception-left-box">
<view class="customer-info">
<view class="name flex">恒河猴<view class="phone">18812345678</view>
</view>
<view class="brand-box flex">
<view class="brand flex">AITO问界</view>
<view class="brand">M8</view>
</view>
<view class="tips flex">
<view :class="['tips-text']">成交</view>
<view class="score-box">
88<view class="unit">分</view>
</view>
</view>
</view>
<view class="content-box">
<view class="content-tab-box flex">
<template v-for="i in tab">
<view
:key="i.id"
:class="['tab flex',{'active-tab': tabId == i.id}]"
@click="tabId = i.id"
>
{{i.name}}
</view>
</template>
</view>
<view class="control-box flex">
<view class="sprite-icon icon-reception-share"></view>
<view class="play-box flex">
<view class="sprite-icon icon-reception-pause"></view>
00:24
</view>
</view>
<view class="component-box">
<!-- <component
:is="tab.find(e => e.id == tabId).componentName"
:batchId="61757"
></component> -->
<dialogue
:batchId="61757"
:hidden="tabId != 1"
/>
<quality
:batchId="61757"
:hidden="tabId != 2"
/>
</view>
</view>
</view>
<view class="reception-right-box">
<tags />
<quality-table />
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import Dialogue from './components/Dialogue.vue'
import Quality from './components/Quality.vue'
import Tags from './components/Tags.vue'
import QualityTable from './components/QualityTable.vue'
export default {
components: {
QualityTable,
Dialogue,
Quality,
Tags
},
mixins: [],
data () {
return {
tab: Object.freeze([
{
id: 1,
name: '对话',
componentName: 'dialogue'
},
{
id: 2,
name: '质检',
componentName: 'quality'
}
]),
tabId: 1
}
},
onLoad (options) {
this.getReceptionDetail(options.id)
},
watch: {
currentId (n) {
if (!n) return
const query = uni.createSelectorQuery()
query.select(`#menu-${n}`).boundingClientRect((data) => {
let top = data.top - (view_padding_top + menuHeight) + this.menuScrollTop
this.blockTop = `transform:translateY(${top * 2}rpx);`
}).exec()
}
},
computed: {
},
methods: {
async getReceptionDetail (id) {
return
try {
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi.getReceptionDetail({
id
})
} catch (error) {
}
},
back () {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.reception-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: linear-gradient(180deg, #ebf2ff 0%, #f1f6ff 100%);
box-sizing: border-box;
padding-top: toRpx(160);
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.reception-content-box {
padding: 0 toRpx(64) toRpx(64);
box-sizing: border-box;
height: 100%;
.reception-left-box {
width: calc(100% - #{toRpx(1362)});
height: 100%;
box-sizing: border-box;
padding-right: toRpx(32);
.customer-info {
width: 100%;
height: toRpx(156);
border-radius: toRpx(24);
background: linear-gradient(180deg, #f0f6ff 0%, #ffffff 100%);
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
padding: toRpx(32) toRpx(32) 0;
position: relative;
.name {
color: #333333;
font-size: toRpx(36);
font-weight: 500;
line-height: toRpx(44);
.phone {
color: #79859e;
font-size: toRpx(26);
font-weight: normal;
margin-left: toRpx(16);
}
}
.brand-box {
margin-top: toRpx(18);
gap: toRpx(12);
.brand {
height: toRpx(32);
border-radius: toRpx(4);
border: toRpx(2) solid #e8ecf0;
padding: 0 toRpx(8);
color: #79859e;
font-size: toRpx(22);
}
}
.tips {
position: absolute;
right: toRpx(32);
bottom: toRpx(28);
line-height: toRpx(40);
&-box {
opacity: 0.85;
color: #2cca74;
font-size: toRpx(32);
}
.score-box {
opacity: 0.85;
color: #292d33;
font-size: toRpx(48);
font-weight: 700;
line-height: toRpx(44);
margin-left: toRpx(16);
padding-left: toRpx(16);
position: relative;
display: flex;
align-items: baseline;
&::before {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
content: '';
width: toRpx(2);
height: toRpx(14);
background: #979797;
}
.unit {
font-size: toRpx(24);
font-weight: 400;
margin-left: toRpx(4);
}
}
}
}
.content-box {
width: 100%;
height: calc(100% - #{toRpx(192)});
margin-top: toRpx(36);
border-radius: toRpx(32);
background: #ffffff33;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
position: relative;
.control-box {
position: absolute;
right: toRpx(32);
top: toRpx(28);
.play-box {
height: toRpx(60);
border-radius: toRpx(28);
border: toRpx(2) solid #f0f6ff;
background: #ffffff;
margin-left: toRpx(8);
padding: 0 toRpx(12);
color: #757980;
font-size: toRpx(26);
.sprite-icon {
margin-left: toRpx(4);
}
}
}
.content-tab-box {
height: toRpx(112);
padding: 0 toRpx(32);
gap: toRpx(24);
.tab {
width: toRpx(172);
height: toRpx(72);
border-radius: toRpx(16);
border: toRpx(2) solid #ffffffcc;
background: #ffffff;
backdrop-filter: blur(toRpx(12));
box-sizing: border-box;
justify-content: center;
color: #666666;
font-size: toRpx(30);
transition: all 0.1s;
}
.active-tab {
background: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
color: #fff;
font-weight: 500;
}
}
.component-box {
width: 100%;
height: calc(100% - #{toRpx(112)});
}
}
}
.reception-right-box {
height: 100%;
width: toRpx(1362);
border-radius: toRpx(32);
opacity: 1;
background: #ffffff;
box-sizing: border-box;
overflow-y: auto;
padding: 0 40rpx;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!