Commit 36bc1f12 by 胡悦

feat(接待中心): 新增接待中心功能模块

实现接待中心相关页面和组件,包括接待记录、客户档案、质检明细等功能
添加接待复盘、客户预录、话术标签等组件
实现接待记录保存、客户信息编辑、质检结果展示等功能
1 parent 0d9fa8ba
......@@ -69,6 +69,12 @@ export default {
name: 'HomeSlot'
},
{
label: "接待中心",
icon: "record",
name: 'ReceptionCenter',
eventCode: 'app_reception_center'
},
{
label: "订单",
icon: "scene",
name: 'Order'
......@@ -112,9 +118,6 @@ export default {
this.clickHome()
},
async changeIndex (index, item) {
if (item.eventCode) uni.$track.add({
eventCode: item.eventCode
})
this.$emit('update:tabIndex', index)
this.$emit("changeTab", {
item,
......
<template>
<view class="record-box">
<view class="record-content">
<view class="data-container">
<view class="control-box flex">
<view class="tabs">
<page-tabs
:list="dateList"
@changeTab="changeIndex"
/>
</view>
<view class="select-box-list select-component flex">
<view
class="add-btn flex"
@click="editItem(false)"
>
<view class="sprite-icon icon-customer-add"></view>
预录信息
</view>
</view>
</view>
<scroll-view
:class="['record-list']"
scroll-y
@scrolltolower="pageonReachBottom"
>
<view class="list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="(i,index) in list">
<template v-for="(item,cindex) in i">
<view
class="item"
:key="item.id"
@longpress="longPress(item,index,cindex)"
@click="jumpDetail(item.id)"
>
<view class="name">
{{ item.ownerName }}
</view>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="`${item.id}-${ind}`"
v-if="showItem(k.key)"
>
<view class="label">{{ k.label }}</view>
<view class="value text-hide">{{ item[k.key] || "-" }}</view>
</view>
</template>
<view
:class="['mask',{'show-mask':item.maskStatus}]"
@click.stop
>
<view
class="mask-close"
@click.stop="closeMask(index,cindex)"
>
<uni-icons
type="closeempty"
:size="16"
color="#fff"
></uni-icons>
</view>
<template v-if="item.showDel">
<view class="mask-del-box flex">
是否删除该客户档案
<view class="btns flex">
<view
class="btn cancel"
@click.stop="switchDel(index,cindex)"
>取消</view>
<view
class="btn"
@click.stop="delItem(item.id,index,cindex)"
>确定</view>
</view>
</view>
</template>
<template v-else>
<view class="mask-box flex">
<view
class="mask-item"
@click="editItem(item)"
>
<view class="sprite-icon icon-mask-edit"></view>
编辑
</view>
<view
class="mask-item"
@click.stop="switchDel(index,cindex, true)"
>
<view class="sprite-icon icon-mask-del"></view>
删除
</view>
</view>
</template>
</view>
</view>
</template>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../../../assets/images/home/nothing.webp"
/>
暂无预录记录
</view>
</template>
</template>
</view>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
</template>
</scroll-view>
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import PageTabs from '@/components/PageTabs.vue'
export default {
components: {
PageTabs
},
name: '',
props: {
show: Boolean
},
data () {
return {
dateList: [
{ text: '今日到店' },
{ text: '全部客户' },
],
itemObject: [
{ label: '车主电话', key: 'ownerPhone' },
{ label: '品牌车型', key: 'brandModel' },
{ label: '客户标签', key: 'customerTagName' },
{ label: '到店日期', key: 'arrivalDate' },
{ label: '接待时间', key: 'receptionTime' },
{ label: '接待人员', key: 'receptionist' },
],
dateIndex: 0,
pageNum: 1,
total: 0,
list: [],
flag: false,
nothing: false,
pageSize: 10,
loaded: false
}
},
computed: {
activeBtnStyle () {
let { dateIndex } = this,
val = dateIndex * 184
return {
transform: `translate(toRpx(${val}), -50%)`
}
},
},
watch: {
show: {
immediate: true,
handler (newval) {
if (newval && !this.loaded) {
this.init()
this.loaded = true
}
}
}
},
mounted () {
},
methods: {
refresh () {
this.flag = false
this.list = []
this.pageNum = 1;
this.nothing = false
this.getReceptionList()
},
init () {
this.dateList.map((e, index) => {
const tatget = ['day', 'all'][index]
const {
startTime,
endTime
} = this.getDateRange(tatget)
e.startTime = startTime
e.endTime = endTime
})
this.getReceptionList()
},
async getReceptionList () {
try {
uni.showLoading({
mask: true
})
let { dateList, dateIndex, pageNum, pageSize } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
{ startTime, endTime } = dateList[dateIndex],
params = {
pageNum,
pageSize,
receptionStatus: 1,
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 // 1.延保 2.轻改
}
if (startTime && endTime) {
params.startTime = startTime
params.endTime = endTime
}
const { list, total } = await uni.$api.customerApi.getCustomerFileList(params)
uni.hideLoading()
list?.length && list.map(e => {
let ownerPhone = e.ownerPhone
e.arrivalDate = dayjs(e.arrivalDate).format("YYYY.MM.DD")
e.receptionTime = dayjs(e.receptionTime).format("YYYY.MM.DD HH:mm")
e.ownerPhone = ownerPhone.slice(0, 3) + " " + ownerPhone.slice(3, 7) + " " + ownerPhone.slice(7)
e.customerTagName = e.customerTagName ? e.customerTagName.replace(/,/g, '|') : ''
e.maskStatus = false
})
this.list[pageNum - 1] = list
this.flag = true
this.total = total
} catch (error) {
uni.hideLoading()
this.flag = true
}
},
changeIndex (index) {
if (this.dateIndex == index) return
this.dateIndex = index
this.refresh()
},
pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing'
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
this.getReceptionList()
} else this.nothing = true
},
getDateRange (type) {
let now = new Date();
let startTime, endTime;
if (type === 'day') {
startTime = new Date(now.getFullYear(), now.getMonth(), now.getDate());
endTime = new Date(now.getFullYear(), now.getMonth(), now.getDate());
} else {
startTime = null
endTime = null
}
return {
startTime: startTime ? dayjs(startTime).format("YYYY-MM-DD") + ' 00:00:00' : '',
endTime: endTime ? dayjs(endTime).format("YYYY-MM-DD") + ' 23:59:59' : ''
};
},
showItem (key) {
let flag = true
if (['receptionTime', 'receptionist'].includes(key)) flag = false
return flag
},
longPress (item, index, ind) {
if (item.maskStatus) return
this.list[index][ind].maskStatus = true
this.$forceUpdate()
},
closeMask (index, ind) {
this.list[index][ind].maskStatus = false
this.switchDel(index, ind, false)
},
switchDel (index, ind, result) {
this.list[index][ind].showDel = result
this.$forceUpdate()
},
editItem (item) {
this.$emit('editCustomer', item.id || '')
},
async delItem (id, index, ind) {
try {
const res = await uni.$api.customerApi.delCustomerFile({ id })
if (res) {
this.list[index].splice(ind, 1)
this.$forceUpdate()
this.$emit('showSuccess')
}
} catch (error) {
uni.showToast({
title: error,
icon: 'none'
})
}
},
jumpDetail (id) {
uni.navigateTo({
url: `/pages/common/customerDetail?id=${id}`,
animationType: 'pop-in',
animationDuration: 100
})
},
}
}
</script>
<style scoped lang="scss">
.record-box {
box-sizing: border-box;
height: 100%;
.record-content {
height: 100%;
box-sizing: border-box;
.data-container {
background: #ffffff;
border-radius: toRpx(48);
height: 100%;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
position: relative;
overflow: hidden;
.control-box {
height: toRpx(164);
.tabs {
width: toRpx(392);
height: toRpx(84);
margin-left: toRpx(44);
}
.select-box-list {
margin-left: auto;
gap: 0 toRpx(40);
}
.select-component {
margin-right: toRpx(44);
}
}
}
}
.record-list {
height: calc(100% - #{toRpx(164)});
box-sizing: border-box;
position: relative;
z-index: 4;
}
.list {
display: flex;
flex-wrap: wrap;
gap: toRpx(40) toRpx(46);
padding: toRpx(2) toRpx(44) 0;
.item {
// width: toRpx(610);
width: calc(50% - #{toRpx(23)});
background: #ffffff;
box-sizing: border-box;
padding: toRpx(24) toRpx(32);
position: relative;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2c66f71a;
border-radius: toRpx(16);
.status {
position: absolute;
top: toRpx(24);
right: toRpx(32);
width: toRpx(88);
height: toRpx(44);
background: #fdece9;
color: #f24724;
border-radius: toRpx(4);
font-weight: 500;
font-size: toRpx(24);
justify-content: center;
}
.deal {
background: #eaf9f1;
color: #35c376;
}
.name {
font-weight: 500;
font-size: toRpx(32);
color: #292d33;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: toRpx(44);
max-width: 100%;
}
.info {
margin-top: toRpx(12);
font-size: toRpx(24);
color: #999ea8;
.value {
margin-left: auto;
color: #666666;
max-width: toRpx(388);
}
}
.mask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
border-radius: toRpx(16);
opacity: 0;
pointer-events: none;
&-close {
position: absolute;
right: toRpx(16);
top: toRpx(16);
z-index: 8;
}
&-box {
width: 100%;
height: 100%;
justify-content: center;
gap: 0 toRpx(96);
.mask-item {
font-size: toRpx(26);
color: #ffffff;
text-align: center;
line-height: toRpx(36);
.sprite-icon {
margin-bottom: toRpx(8);
}
}
}
&-del-box {
width: 100%;
height: 100%;
justify-content: center;
font-size: toRpx(28);
color: #ffffff;
line-height: toRpx(36);
flex-direction: column;
animation: opacity-0-1 0.5s forwards;
.btns {
justify-content: center;
gap: 0 toRpx(16);
margin-top: toRpx(56);
.btn {
width: toRpx(192);
height: toRpx(64);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(32);
box-sizing: border-box;
text-align: center;
line-height: toRpx(64);
font-size: toRpx(26);
color: #ffffff;
}
.cancel {
border: toRpx(2) solid #ffffff;
background-image: none;
}
}
}
}
.show-mask {
pointer-events: auto;
opacity: 1;
}
}
.case-item {
width: 22.8%;
height: toRpx(552);
}
}
}
.add-btn {
width: toRpx(244);
height: toRpx(72);
border-radius: toRpx(16);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
font-size: toRpx(30);
color: #ffffff;
justify-content: center;
.sprite-icon {
margin-right: toRpx(8);
zoom: 2;
}
}
.tabs-bottom {
background: #fff;
height: toRpx(48);
position: relative;
border-radius: toRpx(48) toRpx(48) 0 0;
position: absolute;
width: 100%;
top: toRpx(128);
}
.data-tabs-box {
position: relative;
top: 0;
margin-top: toMinusRpx(8);
.data-tabs {
display: flex;
justify-content: space-between;
width: fit-content;
height: toRpx(68);
background-color: #f2f2f2;
border-radius: toRpx(16);
margin-left: toRpx(64);
position: relative;
padding: toRpx(4);
box-sizing: content-box;
&::after {
position: absolute;
z-index: -2;
background: #ffffff;
width: 100%;
height: 100%;
left: 0;
top: 0;
content: '';
}
.tab {
width: toRpx(184);
height: toRpx(68);
justify-content: center;
font-size: toRpx(28);
color: #1f2133;
z-index: 10;
opacity: 0.7;
}
.active {
opacity: 1;
font-weight: 500;
}
.active-btn {
position: absolute;
width: toRpx(184);
height: toRpx(68);
background: #ffffff;
top: 50%;
transform: translateY(-50%);
border-radius: toRpx(16);
transition: all 0.15s;
}
.active-btn-0 {
left: toRpx(4);
}
.active-btn-1 {
left: toRpx(188);
}
.active-btn-2 {
left: toRpx(372);
}
.active-btn-3 {
left: toRpx(556);
}
}
}
.scene-box {
position: relative;
top: 0;
z-index: 3;
margin-top: toMinusRpx(8);
padding: 0 toRpx(64);
.scene-tabs {
gap: 0 toRpx(24);
.tab {
height: toRpx(80);
background: #f2f2f2;
border-radius: toRpx(16);
padding: 0 toRpx(32);
justify-content: center;
font-size: toRpx(28);
color: #666666;
transition: all 0.15s;
}
.active {
font-weight: 500;
color: #2d66f7;
background: #2d66f71a;
}
}
.btn-list {
margin-left: auto;
gap: 0 toRpx(48);
line-height: toRpx(48);
.search-btn {
&::after {
content: '';
border: toRpx(12) solid transparent;
border-left-color: #000;
margin-left: toRpx(12);
transform: translateY(toMinusRpx(2));
}
}
.check-box {
width: toRpx(32);
height: toRpx(32);
background: #ffffff;
border: toRpx(3) solid #999;
border-radius: toRpx(6);
box-sizing: border-box;
margin-right: toRpx(16);
justify-content: center;
overflow: hidden;
transition: all 0.25s;
flex-shrink: 0;
transform: translateY(toMinusRpx(2));
}
.checked {
background: #2c66f7;
border-color: #2c66f7;
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(260);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(676);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
@keyframes opacity-0-1 {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>
<template>
<view :class="['fixed-page',{'show-box':show}]">
<view :class="['customer-info-box',backClass]">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
客户档案
</view>
<view class="form-box flex">
<template v-for="(i,index) in customerForm">
<view
class="form-item flex"
:key="index"
>
<view class="label flex">
<view
class="required"
v-if="i.required"
>*</view>{{i.label}}
</view>
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input',{error:i.error}]"
placeholder="请选择"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/>
</template>
<template v-else-if="i.type == 'date'">
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
@change="bindDateChange"
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex',{placeholderStyle:!customerInfo[i.valueKey]}]">
<view class="value text-hide">{{customerInfo[i.valueKey] ||'请选择'}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</picker>
</template>
<template v-else>
<view
:class="['select flex',{placeholderStyle:!customerInfo[i.valueKey]}]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{customerInfo[i.valueKey] ||'请选择'}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</template>
</view>
</template>
</view>
<view class="btns flex">
<view
class="btn cancel"
@click="back"
>取消</view>
<view
:class="['btn',{disabled:check}]"
@click="submit"
>提交</view>
</view>
</view>
<view class="popup">
<car-brands
ref="carBrandVisible"
@select="handleSelect($event,'carBrandVisible')"
:echoData="customerInfo"
carBrandKey="carBrand"
carModelKey="brandModel"
customBoolean
/>
<customer-tags
ref="customerTagstVisible"
@select="handleSelect($event,'customerTagstVisible')"
:chooseList="tagsList"
></customer-tags>
<reception-sence
ref="receptionSceneVisible"
@select="handleSelect($event,'receptionSceneVisible')"
:customerInfo="customerInfo"
></reception-sence>
</view>
<uni-popup
ref="successRef"
type="message"
>
<uni-popup-message
type="success"
message="数据保存成功"
:duration="1500"
></uni-popup-message>
</uni-popup>
</view>
</template>
<script type='text/ecmascript-6'>
import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs'
import CustomerTags from './CustomerTags.vue'
import ReceptionSence from './ReceptionSence.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{
label: '车主姓名',
valueKey: 'ownerName',
key: 'ownerName',
type: 'input',
inputType: 'text',
required: true,
maxlength: 50
},
{
label: '车主电话',
valueKey: 'ownerPhone',
key: 'ownerPhone',
type: 'input',
inputType: 'tel',
required: true,
maxlength: 11,
error: false
},
{
label: '品牌车型',
valueKey: 'brandModel',
key: 'brandModel',
type: 'select',
required: true,
popKey: 'carBrandVisible'
},
{
label: '接待场景',
valueKey: 'receptionSceneName',
key: 'receptionScene',
type: 'select',
required: true,
popKey: 'receptionSceneVisible'
},
{
label: '到店日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
type: 'date',
required: true,
},
{
label: '客户标签',
valueKey: 'customerTagName',
key: 'customerTagName',
type: 'select',
required: true,
popKey: 'customerTagstVisible'
}]
export default {
props: {
customerId: [Number, String],
show: Boolean
},
name: 'CustomerInfo',
components: { CarBrands, CustomerTags, ReceptionSence },
watch: {
show: {
immediate: true,
handler (newval) {
if (!newval) return
const { sceneType } = uni.$storage.get("userInfo");
default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50
this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory")
this.customerForm = JSON.parse(JSON.stringify(default_customerForm))
this.customerInfo = {
ownerName: '',
ownerPhone: '',
brandModel: '',
receptionScene: '',
arrivalDate: '',
customerTagName: '',
receptionSceneName: ''
}
if (this.customerId) this.findVisitsInfo()
}
}
},
computed: {
check () {
let { customerForm, customerInfo } = this,
result = false
try {
customerForm.map(e => {
if (e.required && !customerInfo[e.key]) throw true
})
} catch (error) {
result = error
}
return result
},
tagsList () {
let list = [],
{ customerInfo, customerTag } = this,
names = customerInfo.customerTagName ? customerInfo.customerTagName.split('|') : [],
isd = customerTag ? customerTag.split(',') : []
names.map((e, index) => {
list.push({
labelName: e,
labelId: isd[index]
})
})
return list
}
},
data () {
return {
customerForm: [],
customerInfo: {},
startDate: '',
endDate: '',
customerTag: '',
backClass: ''
}
},
mounted () {
this.startDate = dayjs(dayjs().subtract(7, 'day')).format("YYYY-MM-DD")
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
},
methods: {
async findVisitsInfo () {
const res = await uni.$api.customerApi.findVisitsInfo({
id: this.customerId
})
if (res.customerTag) this.customerTag = res.customerTag
res.customerTagName = res.customerTagName.replace(/,/g, '|')
res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
this.customerInfo = res
},
back () {
this.backClass = 'backClass'
setTimeout(() => {
this.backClass = ''
this.$emit('update:show', false)
}, 300)
},
showPopup (e) {
this.$refs[e].open()
},
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close()
// this.customerInfo.brandModel = item.name
// this.customerInfo.carBrand = item.carChildsBrandName
Object.assign(this.customerInfo, {
brandModel: item.name,
carModelId: item.id,
carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId,
oneCarBrand: item.carBrand,
oneCarBrandId: item.carBrandId
})
} else if (popkey == 'customerTagstVisible') {
let names = [],
ids = []
item.map(i => {
names.push(i.labelName)
ids.push(i.labelId)
})
this.customerInfo.customerTagName = names.join('|')
this.customerTag = ids.join(',')
} else {
this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id
}
},
bindDateChange (e) {
this.customerInfo.arrivalDate = e.detail.value
},
async submit () {
if (this.check) return
try {
this.customerForm.map(e => {
e.error = false
})
let { customerInfo, customerForm, customerTag } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = {
customerTag,
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 // 1.延保 2.轻改
}
if (!phoneRex.test(customerInfo.ownerPhone)) throw 'ownerPhone'
customerForm.map(e => {
params[e.key] = customerInfo[e.key]
})
if (customerInfo.id) params.id = customerInfo.id
Object.assign(params, {
carModelId: customerInfo.carModelId,
carBrand: customerInfo.carBrand,
carBrandId: customerInfo.carBrandId,
oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId
})
params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi[targetApi](params),
_this = this
if (res) {
/**1:成功,2:重复 */
if (res == '1') {
this.$refs.successRef.open()
setTimeout(() => {
uni.hideLoading()
this.back()
this.$emit('refresh')
}, 1e3)
} else {
uni.showModal({
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
showCancel: false,
confirmText: '确认',
confirmColor: '#347BFF',
success (res) {
if (res.confirm) {
_this.back()
_this.$emit('refresh')
}
}
})
uni.hideLoading()
}
} else {
uni.hideLoading()
}
} catch (error) {
let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true
this.clickFlag = false
uni.hideLoading()
}
}
}
}
</script>
<style scoped lang='scss'>
.fixed-page {
display: none;
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
pointer-events: none;
z-index: 9;
.customer-info-box {
position: absolute;
top: toRpx(80);
left: toRpx(240);
width: 87.04%;
height: toRpx(1376);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48);
backdrop-filter: blur(toRpx(8));
pointer-events: auto;
animation: left-in 0.25s forwards;
.nav-bar {
width: 100%;
top: 0;
height: toRpx(96);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
position: relative;
margin-top: toRpx(16);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.form-box {
flex-wrap: wrap;
padding: toRpx(32) toRpx(40);
justify-content: space-between;
.form-item {
width: toRpx(934);
height: toRpx(80);
margin-bottom: toRpx(48);
font-size: toRpx(28);
}
.label {
width: toRpx(192);
color: #292d33;
justify-content: center;
.required {
color: #f24724;
font-size: toRpx(28);
}
}
.input,
.select {
width: toRpx(738);
height: toRpx(76);
background: #ffffff;
border-radius: toRpx(16);
border: toRpx(2) solid transparent !important;
outline: none;
color: #333333;
border-radius: toRpx(16);
box-sizing: border-box;
line-height: toRpx(76);
padding: 0 toRpx(32) !important;
box-sizing: border-box;
font-size: toRpx(28);
&::placeholder {
color: #33333333;
}
.value {
max-width: toRpx(598);
}
}
.placeholderStyle {
color: #33333333;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
.error {
border: toRpx(2) solid #f24724 !important;
}
}
.btns {
justify-content: center;
gap: 0 toRpx(34);
.btn {
width: toRpx(718);
height: toRpx(80);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(48);
display: flex;
justify-content: center;
align-items: center;
font-weight: 500;
font-size: toRpx(32);
color: #ffffff;
}
.cancel {
background: #dae9ff;
color: #2c66f7;
}
.disabled {
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
}
}
}
.backClass {
animation: left-out 0.25s forwards;
}
.popup {
pointer-events: auto;
}
}
.show-box {
display: block;
}
</style>
\ No newline at end of file
<template>
<view class="record-box">
<view class="data-container">
<view class="control-box flex">
<view class="tabs">
<page-tabs
:list="tabList"
@changeTab="changeTab"
/>
</view>
<view @click="jumpDetail()">11111</view>
<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')"
/>
</template>
</view>
<template v-if="tabIndex == 1">
<select-component
class="select-component"
:selectList="uploadTypeList"
@chooseType="changeUploadType"
/>
</template>
</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>
以下非正常结束的接待记录,需要进行信息确认后才能提交到系统。
</view>
<view class="list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="i in list">
<template>
<view
v-for="item in i"
class="item"
:key="item.id"
@click="jumpDetail(item)"
>
<view class="top-right-box flex">
<template v-if="tabIndex == 0">
<view :class="['status flex',`${item.reviewFlag == 0?'deal':'disabled'}`]">
{{item.reviewFlag == 0 ?'已复盘':'未复盘'}}
</view>
<view :class="['status flex', { 'deal': item.orderFinishFlag }]">
{{item.orderFinishFlag? '成交': '战败'}}
</view>
</template>
<!-- <template v-else>
<view :class="[
'status flex',
{'disabled':item.receptionStatus !== 1 && item.receptionStatus !== 0 },
{ 'deal': item.receptionStatus == 1 }
]">
<template v-if="item.receptionStatus === 1 || item.receptionStatus === 0">
{{ {
1: '成交',
0: '战败'
}[item.receptionStatus]}}
</template>
<template v-else>
未知
</template>
</view>
</template> -->
</view>
<view class="name">
{{ item.customerName ? item.customerName : '未填写姓名' }}
</view>
<view class="goods-name">{{ item.carModel ? item.carModel : '未选择车型' }}</view>
<template>
<view
v-for="(k, ind) in itemObject"
class="info flex"
:key="ind"
>
<view class="label">{{ k.label }}</view>
<view class="value">{{ formatValue(item[k.key], k.key) || '— —' }}</view>
</view>
</template>
</view>
</template>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../../../assets/images/home/nothing.webp"
/>
暂无接待记录
</view>
</template>
</template>
</view>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
</template>
</scroll-view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import SelectComponent from '@/components/SelectComponent.vue'
import PageTabs from '@/components/PageTabs.vue'
export default {
inject: ['getRecorder'],
name: '',
components: { SelectComponent, PageTabs },
inject: ['getRecorder'],
props: {
show: Boolean
},
data () {
return {
tabList: Object.freeze([
{ text: '已提交' },
{ text: '未提交', dot: () => this.preRecordFailList.length },
]),
orderTypeList: Object.freeze([
{ label: '战败', value: 0 },
{ label: '成交', value: 1 },
]),
receptionTypeList: Object.freeze([
{ label: '未复盘', value: 0 },
{ label: '已复盘', value: 1 },
]),
uploadTypeList: Object.freeze([
{ label: '待上传' },
{ label: '待提交' },
]),
itemObject: Object.freeze([
{ label: '客户电话', key: 'phoneNumber' },
{ label: '销售姓名', key: 'salesName' },
{ label: '接待时长', key: 'duration' },
{ label: '开始接待', key: 'startTime' },
{ label: '结束接待', key: 'endTime' },
]),
recordFailList: [],
preRecordFailList: [],
tabIndex: 0,
pageNum: 1,
total: 0,
list: [],
flag: false,
nothing: false,
pageSize: 10,
isPrePage: false,
reviewFlag: 0,
orderFinishFlag: 0,
loaded: false
}
},
watch: {
show: {
immediate: true,
handler (newval) {
if (newval && !this.loaded) {
this.init();
this.getRecordNum()
this.getPreRecordNum()
this.loaded = true
}
}
}
},
mounted () {
uni.$on('refreshRecord', () => {
this.changeTab(0)
})
},
methods: {
resetData () {
this.flag = false
this.nothing = false
this.total = 0
this.list = []
this.pageNum = 1
},
changeTab (index) {
if (this.tabIndex == index) return
this.resetData()
this.tabIndex = index
this.reviewFlag = 0
this.orderFinishFlag = 0
if (index == 0) this.getReceptionList()
else this.getRecordFail()
},
formatValue (val, k) {
if (!val) return
if (k == 'phoneNumber') {
val = val.toString()
return val.slice(0, 3) + " " + val.slice(3, 7) + " " + val.slice(7)
}
return val
},
jumpDetail (item) {
item = {
"id": null,
"merchantId": "44210895",
"customerName": "1211第五",
"phoneNumber": "13512110555",
"salesUuid": "77936e318e9844e4af0b099c7ccc98e4",
"salesName": "叶立庆",
"carBrandId": null,
"carBrand": "AITO 问界",
"carModel": "问界M8",
"receptionStartTime": 1765447430000,
"receptionEndTime": 1765449405000,
"recordUrlList": null,
"recCustomerId": null,
"loginPhone": null,
"receptionStatus": 0,
"endReasonType": null,
"staffUuid": "9ec5c68f73e84357a427da9503a5ee8b",
"staffName": null,
"serviceMerchantId": null,
"receptionCustomerPaySourceList": null,
"orderFlag": null,
"bussinessType": null,
"channelType": null,
"appCode": null,
"appVersion": null,
"merchantName": "波波的单店门店",
"customerVisitId": null,
"receptionCustomerMaterialPointList": null,
"carPurchaseMethod": null,
"checkHistoryFlag": 0,
"batchId": 62377,
"score": 35,
"recordingUrl": "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/176544865331017654474319060.mp3",
"recordId": null,
"recordingTagRelationList": null,
"sfjs": null,
"fwys": null,
"htjr": null,
"sqfx": null,
"zyzs": null,
"cjsz": null,
"alzs": null,
"gfnl": null,
"bdnl": null,
"reviewFlag": null,
"oneCarBrand": "鸿蒙智行",
"oneCarBrandId": null,
"bussinessTypeName": null,
"checkDate": null,
"isOrderFinishFlagName": "0",
"modelType": "1001",
"checkType": 1,
"orderFinishFlag": false,
"duration": "32分55秒",
"startTime": "2025.12.11 18:03:50",
"endTime": "2025.12.11 18:36:45",
"totalDuration": 1975
}
if (this.tabIndex == 0) { // 已上传 && 新质检
const { sceneType } = uni.$storage.get("userInfo");
if (sceneType == 1 || item.checkHistoryFlag != 0 || item.score == null) return uni.showToast({
title: '该接待尚不支持复盘',
icon: "none"
})
this.tabIndex = -1
uni.navigateTo({
url: `/pages/common/receptionDetail/index`,
success (res) {
res.eventChannel.emit('getData', item)
}
})
return
}
if (this.isPrePage) {
this.$emit('openRecordPage', item)
}
},
async getRecordNum () {
let recordFailListAll = await uni.$dbManager.getRecords();
if (typeof recordFailListAll == 'string') {
recordFailListAll = JSON.parse(recordFailListAll || '[]')
}
const { shopMerchantId, sceneType, phone } = uni.$storage.get("userInfo");
let recordFailList = recordFailListAll.filter(i => {
return i.merchantId == shopMerchantId && i.bussinessType == (sceneType == 0 ? 1 : 2) && i.loginPhone == phone
})
this.recordFailList = recordFailList.reverse();
},
async getPreRecordFail () {
await this.getPreRecordNum()
this.list[0] = this.preRecordFailList.map(i => {
return Object.assign(i, {
duration: 0,
startTime: i.receptionStartTime && i.receptionStartTime.replace(/\//g, '.')
})
})
this.isPrePage = true
this.flag = true
this.nothing = this.preRecordFailList.length ? true : false
},
async getPreRecordNum () {
const preRecordList = await this.recorder.getRecords()
this.preRecordFailList = preRecordList.reverse()
},
getRecordFail () {
this.getRecordNum()
this.list[0] = this.recordFailList.map(i => {
return {
receptionStatus: i.receptionStatus,
phoneNumber: i.phoneNumber,
salesName: i.salesName,
customerName: i.customerName,
carModel: i.carModel,
duration: this.formatSeconds(new Date(i.receptionEndTime).getTime() - new Date(i.receptionStartTime).getTime()),
startTime: i.receptionStartTime.replace(/\//g, '.'),
endTime: i.receptionEndTime.replace(/\//g, '.')
}
})
this.flag = true
this.isPrePage = false
this.nothing = this.recordFailList.length ? true : false
},
init () {
// this.getReceptionList()
this.recorder = this.getRecorder()
},
async getReceptionList () {
try {
await uni.$isNetWork()
} catch (error) {
const recordSuccessList = JSON.parse(uni.$storage.get("recordSuccessList") || "{}")
this.list[0] = recordSuccessList[this.tabIndex] || []
this.flag = true
return
}
try {
uni.showLoading({
mask: true
})
const { tabIndex, pageNum, pageSize, reviewFlag, orderFinishFlag } = this,
userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId, sceneType } = userInfo,
{ list, total } = await uni.$api.commonApi.getReceptionList({
merchantId: shopMerchantId,
pageNum,
pageSize,
reviewFlag,
orderFinishFlag,
bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
})
uni.hideLoading()
list?.length && list.map(e => {
e.duration = this.formatSeconds(e.receptionEndTime - e.receptionStartTime)
e.startTime = dayjs(e.receptionStartTime).format("YYYY.MM.DD HH:mm:ss")
e.endTime = dayjs(e.receptionEndTime).format("YYYY.MM.DD HH:mm:ss")
})
if (pageNum == 1) {
const record = {
[tabIndex]: list
}
const recordSuccessList = JSON.parse(uni.$storage.get("recordSuccessList") || "{}")
const mergeRecord = Object.assign(recordSuccessList, record)
uni.$storage.set("recordSuccessList", JSON.stringify(mergeRecord))
}
this.$set(this.list, pageNum - 1, list)
// this.list[pageNum - 1] = list
this.flag = true
this.total = total
} catch (error) {
this.flag = true
}
},
formatTime (num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return {
minutes,
seconds
}
},
formatSeconds (seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
}
},
pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this
if (this.tabIndex == 1) return
if (!nothing) nothing = 'nothing'
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
this.getReceptionList()
} else this.nothing = true
},
changeUploadType ({ index }) {
this.resetData()
if (index == 0) this.getRecordFail()
else this.getPreRecordFail()
},
async submitRecord (val) {
this.flag = false
delete val.duration
delete val.startTime
const { maxUploadNum = 10 } = uni.$storage.get('mock_data')
if (val.recordUrlList.length > maxUploadNum) {
const userInfo = uni.$storage.get('userInfo')
const { customerName, phoneNumber, carModel, salesName } = val || {}
const { name } = userInfo || {}
uni.$logger.error({
msg: `员工: ${name}, 客户: ${customerName}`,
extra: {
'手机号: ': phoneNumber,
'姓名: ': customerName,
'销售: ': salesName,
'车型: ': carModel,
'原因: ': '录音文件过长,数量' + val.recordUrlList.length
}
})
}
val.recordUrlList = val.recordUrlList.slice(0, maxUploadNum)
await this.recorder.save(val)
this.getRecordNum()
await this.getPreRecordFail()
},
searchReceptionList ({ item }, name) {
if (this[name] == item.value) return
this[name] = item.value
this.resetData()
this.getReceptionList()
}
}
}
</script>
<style scoped lang="scss">
.record-box {
box-sizing: border-box;
height: 100%;
overflow: hidden;
.data-container {
background: #ffffff;
border-radius: toRpx(48);
height: 100%;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
position: relative;
.control-box {
height: toRpx(164);
.tabs {
width: toRpx(336);
height: toRpx(84);
margin-left: toRpx(44);
}
.select-box-list {
margin-left: auto;
gap: 0 toRpx(40);
}
.select-component {
margin-right: toRpx(44);
}
}
}
.record-list {
box-sizing: border-box;
height: calc(100% - #{toRpx(164)});
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);
justify-content: center;
.icon {
margin-right: toRpx(8);
}
}
}
.list {
display: flex;
flex-wrap: wrap;
gap: toRpx(40) toRpx(46);
padding: toRpx(2) toRpx(44) 0;
.item {
// width: toRpx(610);
width: calc(50% - #{toRpx(23)});
background: #ffffff;
box-sizing: border-box;
padding: toRpx(24) toRpx(32);
position: relative;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2c66f71a;
border-radius: toRpx(16);
.top-right-box {
position: absolute;
top: toRpx(24);
right: toRpx(32);
gap: 0 toRpx(16);
.status {
width: toRpx(88);
height: toRpx(44);
background: #fdece9;
color: #f24724;
border-radius: toRpx(4);
font-weight: 500;
font-size: toRpx(24);
justify-content: center;
}
.disabled {
background: #f2f2f2;
color: #999999;
}
.deal {
background: #eaf9f1;
color: #35c376;
}
}
.name {
font-weight: 500;
font-size: toRpx(32);
color: #292d33;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 62%;
}
.goods-name {
font-weight: 500;
font-size: toRpx(32);
color: #2c66f7;
margin-top: toRpx(16);
}
.info {
margin-top: toRpx(16);
font-size: toRpx(24);
color: #999ea8;
.value {
margin-left: auto;
color: #666666;
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(260);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
</style>
<template>
<view class="reception-box">
<view :class="['record-box-content',`${showInfo || !showRecord?'hide-record':'show-record'}`]">
<view class="right box-class only-right">
<type-tab-component
:typeList="typeList"
:tabIndex.sync="tabIndex"
></type-tab-component>
<view :class="['right-content',`${tabIndex != 0?'hide-record':'show-record'}`]">
<record-list
@openRecordPage="openRecordPage"
ref="recordListRef"
:show="tabIndex == 0"
/>
</view>
<view :class="['right-content',`${tabIndex != 1?'hide-record':'show-record'}`]">
<customer-file
@showSuccess="$refs.successRef.open()"
ref="customerFile"
@editCustomer="editCustomer"
:show="tabIndex == 1"
/>
</view>
</view>
</view>
<template v-if="!showRecord">
<view :class="['save-record-box',backClass]">
<save-record
@cancel="handleCancel"
@submit="handleSubmit"
:customerInfoVal="customerInfo"
></save-record>
</view>
</template>
<uni-popup
ref="successRef"
type="message"
>
<uni-popup-message
type="success"
message="删除成功"
:duration="1500"
></uni-popup-message>
</uni-popup>
<customer-info
:customerId="customerId"
:show.sync="showInfo"
@refresh="$refs.customerFile.refresh()"
/>
</view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
// import LineBar from './LineBar.vue'
// import OutputValue from './OutputValue.vue'
import RecordList from './RecordList.vue'
import saveRecord from './saveRecord.vue'
import CustomerFile from './CustomerFile.vue'
// import CustomerInfo from './CustomerInfo.vue'
import TypeTabComponent from '@/components/TypeTabComponent.vue'
import SelectComponent from '@/components/SelectComponent.vue'
export default {
components: {
// LineBar,
// OutputValue,
RecordList,
saveRecord,
CustomerFile,
// CustomerInfo,
TypeTabComponent,
SelectComponent
},
name: '',
data () {
return {
backClass: '',
showRecord: true,
customerInfo: {},
dataShow: true,
timeProgress: '',
tabIndex: 0,
typeList: Object.freeze([
{ tabName: '接待复盘' },
// { tabName: '客户预录' },
]),
showInfo: false,
customerId: '',
bussinessType: 1
}
},
computed: {
isHarmony () {
const { channelType } = uni.$storage.get('userInfo')
return channelType == 1
},
performanceTypeList () {
let list = []
if (this.isHarmony) list = [
{ label: '问界', value: 1 },
{ label: '鸿蒙', value: 2 },
]
else list = [
{ label: '延保', value: 1 },
{ label: '权益', value: 3 },
]
return list
},
sceneType () {
return uni.$storage.get('userInfo').sceneType
}
},
mounted () {
this.setTimeProgress()
},
methods: {
setTimeProgress () {
let nowNum = dayjs().date(),
monthDayNum = dayjs().daysInMonth()
this.timeProgress = Math.round(nowNum / monthDayNum * 100)
},
changeType (index, name) {
if (this[name] == index) return // 点击同一个
},
openRecordPage (item) {
this.showRecord = false
this.customerInfo = item
},
handleCancel () {
this.backClass = 'backClass'
setTimeout(() => {
this.showRecord = true;
this.backClass = ''
}, 300)
},
handleSubmit (val) {
this.handleCancel()
this.$refs.recordListRef.submitRecord(val)
},
editCustomer (id) {
this.customerId = id
this.showInfo = true
},
}
}
</script>
<style scoped lang='scss'>
.reception-box {
.record-box-content {
position: relative;
height: 100vh;
box-sizing: border-box;
padding: toRpx(64) 0 toRpx(80);
display: flex;
gap: 0 toRpx(48);
visibility: visible;
transition: all 0.15s;
opacity: 1;
}
.hide-record {
opacity: 0;
z-index: -1;
visibility: hidden;
}
.show-record {
opacity: 1;
position: relative;
animation: show-box 0.15s forwards;
}
@keyframes show-box {
0% {
left: 100%;
}
100% {
left: 0;
}
}
.box-class {
height: 100%;
background: #ffffff59;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48);
overflow: hidden;
}
.left {
width: toRpx(656);
.common-title {
position: relative;
.sprite-icon {
margin-left: toRpx(16);
zoom: 1.5;
}
.time-box {
position: absolute;
left: toRpx(48);
bottom: toRpx(8);
color: #999999;
font-size: toRpx(20);
.time-bar {
width: toRpx(200);
height: toRpx(16);
border-radius: toRpx(8);
background: #ffffff;
overflow: hidden;
margin: 0 toRpx(12);
.time-line {
height: 100%;
border-radius: toRpx(8);
background: linear-gradient(90deg, #75bcff 0%, #2c66f7 100%);
}
}
.progress {
color: #4673ff;
font-weight: 500;
}
}
.reception-select {
position: absolute;
top: toRpx(36);
right: toRpx(32);
/deep/.select {
width: toRpx(148);
height: toRpx(48);
border-radius: toRpx(12);
background: #ffffff59;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
color: #333333;
font-size: toRpx(26);
padding-left: toRpx(32);
.icon-arrow-bottom {
zoom: 0.75;
}
}
/deep/.pop-box {
top: toRpx(64);
color: #292d33;
font-size: toRpx(28);
.type-item {
height: toRpx(56);
}
}
}
}
.box {
border-radius: toRpx(32);
background: #ffffff;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
margin: toRpx(20) toRpx(32) 0;
}
.customer-box {
margin: toRpx(24) toRpx(32) toRpx(20);
}
.loading {
width: 100%;
height: 100%;
justify-content: center;
.gif {
width: toRpx(64);
height: toRpx(64);
}
.icon {
animation: rotate 1s infinite;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
}
}
.right {
width: calc(100% - #{toRpx(752)});
border: toRpx(2) solid #fff;
box-sizing: border-box;
&.only-right {
width: calc(100% - #{toRpx(64)});
}
&-content {
width: 100%;
position: absolute;
border-radius: toRpx(48);
background: #ffffff;
height: calc(100% - #{toRpx(128)});
transform: translateY(toMinusRpx(32));
}
}
.save-record-box {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
animation: left-in 0.25s forwards;
}
.backClass {
animation: left-out 0.25s forwards;
}
@keyframes left-in {
0% {
left: 100%;
}
100% {
left: 0;
}
}
@keyframes left-out {
0% {
left: 0;
}
100% {
left: 100%;
}
}
}
</style>
<template>
<view class="data-container">
<view class="nav-bar" @click="$emit('cancel')">
<view class="back" @click="$emit('update:showPayPage', false)">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">接待记录</view>
</view>
<view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view>
<view class="form">
<template v-for="(i, index) in formObject">
<view :class="['form-item', { active: focusIndex == index }]" :key="index">
<view class="label required">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) }]">
<template v-if="i.type == 'input'">
<input :type="i.inputType" :maxlength="i.maxlength" v-model="customerInfo[i.key]" class="input" :placeholder="i.placeholder" @focus="focusIndex = index" @blur="resetFocusIndex" />
</template>
<template v-else>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.key] }]" @click="showPopup(i.popKey, index)">
<view class="text-hide">{{ customerInfo[i.key] || i.placeholder }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
</view>
</view>
</template>
</view>
<view class="footer-box">
<view class="cancel-btn" @click="$emit('cancel')">取消</view>
<view class="submit-btn" @click="handleSave">提交</view>
</view>
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" />
<employee ref="employeeBoxVisible" :salesPropsUuid="customerInfo.salesUuid" @select="handleSelect($event, 'employeeBoxVisible')" />
<MessageBox ref="receptionStatusVisible" position="bottom" :isFooter="false" title="请选择接待结果" :maxHeight="1000">
<view class="select-box">
<view class="select-item" :class="{ checked: customerInfo.receptionStatus == item.label }" @click="selectReception(item.label)" v-for="(item, index) in receptionList" :key="index">
{{ item.label }}
</view>
</view>
</MessageBox>
</view>
</template>
<script type="text/ecmascript-6">
import CarBrands from '@/components/CarBrands.vue'
import Employee from '@/components/Employee.vue'
import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
import utils from "@/utils/utils";
export default {
components: {
CarBrands,
Employee,
CustomerAutocomplete
},
props: {
customerInfoVal: {
type: Object,
default: () => ({})
}
},
data() {
return {
errorTip:false,
receptionList: Object.freeze([{
label: '成交',
value: 1
},
{
label: '战败',
value: 0
}
]),
formObject: Object.freeze([{
label: "车主姓名",
placeholder: '车主姓名',
key: 'customerName',
type: 'input',
inputType: 'text',
maxlength: 50
},
{
label: "车主电话",
placeholder: '车主电话',
key: 'phoneNumber',
type: 'input',
inputType: 'tel',
maxlength: 11
},
{
label: "品牌车型",
placeholder: '品牌车型',
key: 'carModel',
type: 'select',
popKey: 'carBrandListVisible'
},
{
label: "接待结果",
key: "receptionStatus",
type: "select",
popKey: "receptionStatusVisible",
placeholder: '请选择',
},
{
label: "销售姓名",
key: "salesName",
type: "select",
popKey: "employeeBoxVisible",
placeholder: '请选择',
},
]),
focusIndex: -1,
customerInfo:{}
}
},
mounted() {
this.customerInfo = utils.deepClone(this.customerInfoVal)
const i = this.receptionList.findIndex(e => e.value === this.customerInfo.receptionStatus)
this.$set(this.customerInfo, 'receptionStatus', i == -1?'':this.receptionList[i].label)
},
methods: {
selectReception(value) {
this.customerInfo.receptionStatus = value
this.$refs.receptionStatusVisible.close()
},
showError(key) {
let flag = !this.customerInfo[key]
if (key == 'phoneNumber' && this.customerInfo[key]) flag = !phoneRex.test(this.customerInfo[key])
return flag
},
handleSave() {
const result = this.check(true)
if (!result) return this.errorTip = true
const i = this.receptionList.findIndex(e => e.label == this.customerInfo.receptionStatus)
this.customerInfo.receptionStatus = this.receptionList[i].value
this.$emit('submit',this.customerInfo)
},
check(all = false) {
let flag = true
try {
this.formObject.map(e => {
if (!this.customerInfo[e.key]) throw false
if (!all && e.key == 'phoneNumber' && !phoneRex.test(this.customerInfo[e.key])) {
uni.showToast({
title: "请输入正确的车主电话",
icon: "none",
});
throw false
}
})
} catch (error) {
flag = error
}
return flag
},
handleSelect(item, popkey) {
this.$refs[popkey].close()
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.salesName = item.staffName
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.customerInfo.carBrand = item.carChildsBrandName
this.customerInfo.carBrandId = item.carChildsBrandId
this.customerInfo.oneCarBrand = item.carBrand
this.customerInfo.oneCarBrandId = item.carBrandId
}
this.resetFocusIndex()
this.errorTip = false
},
showPopup(e, index) {
this.focusIndex = index
this.$refs[e].open()
},
resetFocusIndex() {
this.focusIndex = -1
this.errorTip = false
}
}
}
</script>
<style scoped lang="scss">
.error-tip {
font-size: toRpx(28);
padding: toRpx(32) toRpx(60) toRpx(24);
margin-top: toRpx(100);
margin-bottom: toMinusRpx(80);
text-align: center;
background-color: rgb(254, 237, 234);
color: #f45c3d;
}
.data-container {
background: #ffffff59;
border-radius: toRpx(48);
margin: toRpx(80) toRpx(66) toRpx(80) 0;
height: calc(100% - #{toRpx(160)});
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff;
box-sizing: border-box;
position: relative;
.nav-bar {
position: absolute;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(28);
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;
}
}
.form {
display: flex;
flex-wrap: wrap;
gap: toRpx(80) toRpx(160);
padding: toRpx(80);
margin-top: toRpx(60);
&-item {
width: calc(50% - #{toRpx(80)});
display: flex;
align-items: center;
color: #6c6c70;
font-size: toRpx(30);
height: toRpx(80);
box-sizing: border-box;
.label {
position: relative;
margin-left: auto;
flex-shrink: 0;
width: toRpx(124);
margin-right: toRpx(30);
}
.required {
&::before {
content: '*';
color: #ff0000;
position: absolute;
left: toMinusRpx(20);
top: 50%;
transform: translate(0, -50%);
}
}
.value {
height: toRpx(80);
flex: 1;
border: toRpx(2) solid #e8e8ea;
background: #ffffff;
margin-left: toRpx(32);
box-sizing: border-box;
padding: 0 toRpx(40);
border-radius: toRpx(8);
&.error {
border: toRpx(2) solid #f24724;
border-radius: toRpx(8);
}
.input,
.select {
width: 100%;
height: 100%;
border: none !important;
outline: none;
padding: 0 !important;
font-size: toRpx(30);
color: #333;
&::placeholder {
color: #c9c9c9;
}
}
.placeholderStyle {
color: #999999;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
}
}
}
.footer-box {
display: flex;
align-items: center;
justify-content: center;
gap: toRpx(34);
padding: 0 toRpx(280);
.cancel-btn {
height: toRpx(80);
background: #dae9ff;
border-radius: toRpx(48);
line-height: toRpx(80);
text-align: center;
color: #2c66f7;
flex: 1;
}
.submit-btn {
height: toRpx(80);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(48);
line-height: toRpx(80);
text-align: center;
flex: 1;
color: #ffffff;
}
}
}
.select-box {
margin: toRpx(40) 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(20);
overflow-y: scroll;
max-height: 50vh;
padding-bottom: toRpx(60);
.select-item {
text-align: center;
height: toRpx(68);
line-height: toRpx(68);
opacity: 1;
border: toRpx(2) solid #dce0e6;
color: #292d33;
font-size: toRpx(28);
border-radius: toRpx(8);
&.checked {
border: toRpx(2) solid #292d33;
}
}
}
</style>
......@@ -82,6 +82,7 @@
</view>
</template>
<script>
import ReceptionCenter from './components/ReceptionCenter/index.vue'
// import myClick from '@/mixin/click'
import timeout from '@/mixin/timeout'
import recorder from '@/mixin/record/recorder'
......@@ -92,7 +93,7 @@ import LeftSide from './components/LeftSide.vue'
import Material from '@/components/MaterialIndex.vue'
export default {
mixins: [recorder, uploader, timeout, versionCheck],
components: { LeftSide, Material },
components: { LeftSide, Material, ReceptionCenter },
props: {
id: [String, Number],
finishDoneText: String,
......
<template>
<view class="select-box">
<view
class="select"
@click.stop="isSelect = !isSelect"
>
{{selectList[selectIndex].label}}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<view
class="pop-box"
v-if="isSelect"
>
<view
v-for="(i,index) in selectList"
:key="index"
class="type-item flex"
:class="index == selectIndex ? 'active' : ''"
@click="chooseType(index, i)"
>{{i[labelKey]}}</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
selectList: Array,
labelKey: {
type: String,
default: 'label'
}
},
name: '',
data () {
return {
selectIndex: 0,
isSelect: false
}
},
mounted () {
},
methods: {
hideSelect () {
this.isSelect = false
},
chooseType (index, item) {
this.selectIndex = index
this.isSelect = false
this.$emit('chooseType', { item, index })
},
}
}
</script>
<style scoped lang='scss'>
.select-box {
position: relative;
z-index: 5;
.select {
display: flex;
align-items: center;
justify-content: flex-end;
height: toRpx(84);
border-radius: toRpx(16);
opacity: 1;
background: #f2f2f2;
padding: 0 toRpx(24) 0 toRpx(40);
}
.arrow-bottom {
width: toRpx(48);
height: toRpx(48);
}
.pop-box {
position: absolute;
top: toRpx(100);
left: 0;
width: 100%;
background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16);
padding: toRpx(16) 0;
text-align: center;
animation: show-view-opacity 0.15s forwards;
.type-item {
padding: 0 toRpx(28);
margin-bottom: toRpx(8);
height: toRpx(84);
justify-content: center;
&:last-child {
margin-bottom: 0;
}
&.active {
background-color: #ecf1ff;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="type-tab">
<view class="type-box">
<view
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
>
<view
:class="['sprite-icon',tabClass(index)]"
:style="{
left:blockLeft
}"
></view>
<view
class="text"
:class="[tabIndex == index ? `active` : '']"
>
{{ i[nameKey] }}
</view>
</view>
</view>
<view class="mask-box"></view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
typeList: Array,
tabIndex: {
type: Number,
default: 0
},
nameKey: {
type: String,
default: 'tabName'
}
},
name: '',
data () {
return {
firstClass: Object.freeze(['first-nav', 'second-nav']),
}
},
computed: {
blockLeft () {
let { tabIndex } = this
return `${(tabIndex * 400) - (tabIndex == 0 ? 0 : 48)}rpx`
}
},
mounted () {
},
methods: {
tabClass (index) {
let className = ''
if (this.tabIndex == index) {
className = 'active icon-'
if (index == 0) className += 'first-nav'
else className += 'second-nav'
}
return className
},
tabClick (index) {
this.$emit('update:tabIndex', index)
this.$emit('tabClick',index)
}
}
}
</script>
<style scoped lang='scss'>
.type-tab {
position: relative;
.type-box {
position: relative;
display: flex;
width: 100%;
background-color: #eef4fe;
height: toRpx(160);
line-height: toRpx(128);
border-radius: toRpx(48) toRpx(48) 0 0;
overflow: hidden;
z-index: 0;
.tab-item {
width: toRpx(400);
text-align: center;
font-weight: 500;
font-size: toRpx(40);
color: #1f2133;
.text {
position: relative;
text-align: center;
width: toRpx(400);
}
.active {
position: absolute;
top: 0;
z-index: -1;
font-weight: 700;
font-size: toRpx(40);
color: #2c66f7;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: toRpx(48);
height: toRpx(8);
background-color: #2c66f7;
border-radius: toRpx(16);
}
}
.sprite-icon {
transition: left 0.15s;
}
}
}
.mask-box {
position: absolute;
height: 100vh;
width: 100%;
background: #fff;
left: 0;
top: toRpx(128);
border-radius: toRpx(48);
overflow: hidden;
}
}
</style>
\ No newline at end of file
......@@ -30,6 +30,12 @@
}
},
{
"path": "pages/common/receptionDetail/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
"style": {
"disableScroll": true,
......
<template>
<view class="view">
<scroll-view
class="scroll-view"
enhanced
scroll-y
scroll-with-animation
:scroll-into-view="toId"
@touchstart="touchstart"
@touchend="touchend"
>
<template v-if="dialogueList.length">
<block
v-for="(item,index) in dialogueList"
:key="index"
>
<view
:class="['item flex', {active:item.text_id == activeId}]"
:id="item.text_id"
@click="seekPlay({item,click:true})"
>
<view class="avatar-box">
<view :class="['sprite-icon',`icon-role-${item.role}`]"></view>
<view class="time">{{item.time}}</view>
</view>
<view class="text flex">{{item.content}}</view>
</view>
<!-- 意图匹配 -->
<block v-if="item.recordingCheckResultList && item.recordingCheckResultList.length">
<template v-for="(i, ind) in item.recordingCheckResultList">
<view
:class="['detail-box',i.detailClassName]"
:key="`text_${index}_${ind}`"
>
<view class="text-box">
<view
class="btn"
@click="changeDetailClassName(i)"
>
意图匹配
<view class="arrow sprite-icon icon-suggestions-arrow"></view>
</view>
{{i.tagGroupName}}
<view class="score">{{i.score}}分</view>
</view>
<view class="content-box">
<block v-if="!i.scriptRec">
<view class="suggestions-box no">
暂无话术推荐
</view>
</block>
<block v-else>
<view class="suggestions-box">
<view class="title">
<view class="sprite-icon icon-suggestions-icon"></view>
话术推荐
</view>
<view class="text">
<rich-text :nodes="i.scriptRec"></rich-text>
</view>
</view>
</block>
</view>
</view>
</template>
</block>
</block>
<view class="safeAreaInset">-已经到底了-</view>
</template>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等...
</view>
</template>
</scroll-view>
<view
class="axis-bar-area"
:hidden="!qualityData.length"
@click="barSeek"
>
<view class="axis-bar">
<view
class="progress-bar"
:style="[{height:`${progress}%`}]"
></view>
<template v-if="true">
<template v-for="(item,index) in axisList">
<block :key="index">
<view
:class="['axis-item',{'axis-active':activeId == item.text_id}]"
:style="[{top:`${item.docTop + 'px'}`}]"
>
<view :class="['axis-dot', `${!isPlayIng && !isScrolllIng?'':'radius'}`]"></view>
</view>
<template v-if="!isPlayIng && !isScrolllIng">
<view
:class="['axis-text',{'axis-text-active':activeId == item.text_id}]"
:style="[{top:`${item.top + 'px'}`}]"
@click.stop="seekPlay({
item,
scroll:true
})"
>
{{item.tagGroupName}}+{{item.score}}
</view>
</template>
</block>
</template>
<view class="hide-bar">
<block
v-for="(item,index) in axisList"
:key="index"
>
<block v-if="item.inspectionConversationDetailId">
<view
:class="['axis-line']"
:style="[{height:`${item.height + 20 + 'px'}`},{top:`${item.docTop - 10 + 'px'}`}]"
></view>
</block>
</block>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import utils from '@/utils/utils'
export default {
name: '',
props: {
batchId: [String, Number],
qualityData: {
type: Array,
default: () => []
},
totalDuration: {
type: Number,
default: 0
},
qualityAudio: {
type: Object,
default: () => ({})
}
},
watch: {
batchId: {
handler (n) {
const data = {
batchId: n,
};
this.findConversationDetailByBatchIdNew(data)
},
immediate: true
},
qualityData: {
handler (n) {
if (n.length) this.findCbByBatchId()
},
immediate: true
}
},
data () {
return {
dialogueList: [],
activeId: '',
progress: 0,
barTop: 0,
containerHeight: 0,
axisList: [],
isPlayIng: false,
isScrolllIng: false,
toId: '',
touchTimer: null
}
},
mounted () {
},
methods: {
formatTime (num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
transitionBr (text) {
let regex = new RegExp('</br>', 'g')
text = text.replace(regex, '<div></div>')
return text
},
changeDetailClassName (i) {
i.detailClassName = i.detailClassName == 'up' ? 'down' : 'up'
},
async findConversationDetailByBatchIdNew (params) {
const res = await uni.$api.receptionApi.findConversationDetailByBatchIdNew(params)
res.map(e => {
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
if (e?.recordingCheckResultList && e.recordingCheckResultList.length) {
e.recordingCheckResultList.map(i => {
i.detailClassName = 'down'
console.log(i.scriptRec)
let [scriptRec] = JSON.parse(i.scriptRec)
if (scriptRec) i.scriptRec = scriptRec.replace(/\n/g, '<br>')
else i.scriptRec = ''
})
}
})
this.dialogueList = res
},
async findCbByBatchId () {
let data = JSON.parse(JSON.stringify(this.qualityData))
let { totalDuration } = this,
margin = 20
utils.getViewInfo('.axis-bar', ({
height: containerHeight,
top: barTop
}) => {
if (containerHeight == 0) {
return setTimeout(() => {
this.findCbByBatchId()
}, 100)
}
this.barTop = barTop
this.containerHeight = containerHeight
let axisList = []
data?.sort((a, b) => a.offset - b.offset).forEach(e => {
const {
offset: mergedOffset,
id
} = e
e.top = mergedOffset / totalDuration * containerHeight
e.docTop = mergedOffset / totalDuration * containerHeight
e.text_id = `text_${mergedOffset}`
e.mergedOffset = mergedOffset
if (mergedOffset != null) axisList.push(e)
})
axisList.map((e, index) => {
// 检查并调整 top 值,避免重叠
for (let i = 0; i < index; i++) {
if (e.top < axisList[i].top + margin &&
e.top + margin > axisList[i].top) {
// 如果重叠,将当前元素的 top 设置为前一个元素的底部加上 margin
e.top = axisList[i].top + margin;
}
}
})
this.axisList = axisList
})
},
onTimeUpdate () {
const {
dialogueList,
} = this, {
paused
} = this.qualityAudio, {
mergedOffset
} = this.setProgress(),
item = dialogueList.find(e => e.mergedOffset == mergedOffset)
if (!paused) this.isPlayIng = true
if (this.isScrolllIng) return
if (item && item.id) this.setTopId(item, true)
},
setTopId (item, scroll = false) {
const {
dialogueList
} = this
let centerIndex = dialogueList.findIndex(e => e.text_id == item.text_id)
centerIndex -= 3
if (centerIndex < 0) centerIndex = 0
this.$nextTick(() => {
this.activeId = item.text_id
})
if (scroll) this.toId = dialogueList[centerIndex].text_id
},
setProgress () {
const {
duration,
currentTime
} = this.qualityAudio,
mergedOffset = Math.ceil(currentTime)
this.progress = mergedOffset / duration * 100
return {
currentTime,
mergedOffset
}
},
seekPlay (e) {
let {
item,
click,
scroll
} = e, {
activeId,
} = this
if (!item) return
this.$emit('seek', item.mergedOffset)
this.setTopId(item, scroll)
if (click && item.text_id == activeId) {
const {
paused
} = this.qualityAudio
if (paused) this.$emit('onPlay')
else this.$emit('onPause')
this.$emit('changeOperate', !paused)
} else {
this.$emit('onPlay')
this.$emit('changeOperate', false)
}
},
touchstart () {
this.isScrolllIng = true
this.clearTimer()
},
touchend () {
this.touchTimer = setTimeout(() => {
this.isScrolllIng = false
this.clearTimer()
}, 3e3)
},
clearTimer () {
if (this.touchTimer) {
clearTimeout(this.touchTimer)
this.touchTimer = null
}
},
barSeek (e) {
function findNearest (arr, target) {
let closest = arr[0];
let minDiff = Math.abs(target - arr[0]);
for (let i = 1; i < arr.length; i++) {
const diff = Math.abs(target - arr[i]);
if (diff < minDiff) {
minDiff = diff;
closest = arr[i];
}
}
return closest;
}
let [touches] = e.touches, {
barTop,
containerHeight
} = this, {
duration
} = this.qualityAudio, {
dialogueList
} = this
if (touches) {
let {
clientY
} = touches,
progress = (clientY - barTop) / containerHeight * 100,
offsetList = dialogueList.map(i => i.mergedOffset),
mergedOffset = findNearest(offsetList, duration * progress / 100),
item = dialogueList.find(i => i.mergedOffset == mergedOffset)
this.seekPlay({
item,
scroll: true
})
}
},
}
}
</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;
}
}
.detail-box {
background: #f5f8fc;
overflow: hidden;
opacity: 0;
.content-box {
transform: translateY(-100%);
}
.text-box {
height: toRpx(80);
display: flex;
align-items: center;
color: #133667;
font-size: toRpx(24);
padding: 0 toRpx(24);
border-bottom: toRpx(2) solid #e8f0ff;
position: relative;
background: #f5f8fc;
z-index: 2;
.btn {
display: flex;
align-items: center;
justify-content: center;
width: toRpx(172);
height: toRpx(56);
background: #ffffff;
border-radius: toRpx(28);
margin-right: toRpx(8);
.arrow {
transition: all 0.25s;
}
}
.score {
font-weight: 600;
margin-left: toRpx(8);
}
}
.suggestions-box {
width: toRpx(796);
background: #ffffff;
border-radius: toRpx(16);
margin: toRpx(24);
padding: toRpx(24) toRpx(28);
box-sizing: border-box;
.title {
display: flex;
align-items: center;
font-weight: 500;
font-size: toRpx(28);
color: #333333;
margin-bottom: toRpx(20);
.sprite-icon {
margin-right: toRpx(12);
}
}
.text {
color: #292d33;
font-size: toRpx(26);
line-height: toRpx(44);
}
.suggestions-text {
padding-bottom: toRpx(22);
border-bottom: toRpx(2) solid #f0f6ff;
margin-bottom: toRpx(24);
}
}
.no {
display: flex;
align-items: center;
justify-content: center;
height: toRpx(124);
font-size: toRpx(24);
color: #8a8c90;
}
}
.up {
height: auto;
opacity: 1;
.arrow {
transform: rotate(180deg);
}
.content-box {
animation: move-up 0.2s forwards;
}
}
.down {
animation: hide-box 0.2s 0.1s forwards;
.content-box {
animation: move-down 0.2s forwards;
}
}
@keyframes hide-box {
100% {
height: toRpx(80);
opacity: 1;
}
}
@keyframes move-up {
0% {
transform: translateY(-100%);
}
100% {
transform: translateY(0);
}
}
@keyframes move-down {
0% {
transform: translateY(0);
}
100% {
transform: translateY(-100%);
}
}
.safeAreaInset {
text-align: center;
line-height: toRpx(40);
color: #999;
font-size: toRpx(24);
padding-bottom: toRpx(20);
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #808291;
font-size: toRpx(28);
background: #fff;
}
.axis-bar-area {
position: absolute;
top: 50%;
height: toRpx(912);
transform: translateY(-50%);
z-index: 8;
width: toRpx(36);
right: toMinusRpx(20);
.axis-bar {
position: absolute;
top: 0;
left: 0;
width: toRpx(16);
height: 100%;
background-color: #e7e7e7;
border-radius: toRpx(8);
.hide-bar {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
border-radius: toRpx(8);
overflow: hidden;
z-index: 2;
.axis-line {
border-radius: toRpx(4);
position: absolute;
left: 50%;
transform: translateX(-50%);
z-index: -1;
width: toRpx(8);
background: #347bff;
}
}
.progress-bar {
position: absolute;
width: 100%;
background-color: #347bff;
top: 0;
left: 0;
border-radius: toRpx(8);
z-index: 3;
transition: all 0.1s;
}
.axis-item {
position: absolute;
left: 50%;
transform: translateX(-50%);
z-index: 3;
}
.axis-dot {
position: absolute;
left: 50%;
top: 0;
transform: translate(-50%, -50%);
width: toRpx(20);
height: toRpx(20);
background: #ffffff;
border: toRpx(4) solid #347bff;
box-shadow: 0 toRpx(4) toRpx(16) 0 #7a7a7a33;
border-radius: 100%;
box-sizing: border-box;
}
.default-axis-dot {
width: toRpx(36);
height: toRpx(36);
border: toRpx(6) solid #347bff;
z-index: 9;
}
.axis-text {
position: absolute;
right: toRpx(20);
font-size: toRpx(24);
color: #757980;
display: inline-flex;
align-items: center;
height: toRpx(36);
border-radius: toRpx(16);
padding: 0 toRpx(22) 0 toRpx(12);
transform: translateY(-50%);
white-space: nowrap;
background: #347bff1a;
/* 防止文本换行 */
}
.axis-active {
z-index: 4;
.axis-dot {
width: toRpx(36);
height: toRpx(36);
background: #347bff !important;
border: none;
box-shadow: 0 toRpx(4) toRpx(16) 0 #7a7a7a33;
border-radius: 0 100% 100% 0;
&::after {
position: absolute;
content: '';
border-radius: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #fff;
width: toRpx(26);
height: toRpx(26);
}
}
.radius {
border-radius: 100%;
}
}
.axis-text-active {
color: #ffffff !important;
background-color: #347bff !important;
border-radius: toRpx(16) 0 0 toRpx(16);
right: toRpx(18);
z-index: 2;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="view">
<template v-if="qualityData.length">
<view class="classify-wrap">
<template v-for="(item,index) in qualityData">
<view
:class="['classify-item flex',{active: index == activeIndex}]"
:key="index"
@click="tabClick(item,index)"
>
<view class="title">{{item.tagGroupName}}</view>
<view class="score">{{item.formatScore}}</view>
</view>
</template>
</view>
<scroll-view
class="scroll-view"
enhanced
scroll-y
scroll-with-animation
:scroll-into-view="activeId"
>
<template v-if="qualityData[activeIndex]">
<view class="quality-block">
<view class="title flex">
{{qualityData[activeIndex].tagGroupName}}
<view :class="['matched-btn flex', qualityData[activeIndex].matchedClass]">{{qualityData[activeIndex].matchedText}}</view>
</view>
<template v-for="(item,index) in qualityData[activeIndex].conversationDetailDTOList">
<block :key="index">
<view
v-if="item.text_id"
:id="item.text_id"
:class="['quality-item flex',{active:item.text_id == activeId}]"
@click="seekPlay(item)"
>
<view class="avatar-box">
<view :class="['sprite-icon',`icon-role-${item.role}`]"></view>
<view class="time">{{item.time}}</view>
</view>
<view class="text flex">{{item.content}}</view>
</view>
<template v-if="item.scriptRec">
<view class="script-rec">
<view class="suggestions-box">
<view class="suggestions-title">
<view class="sprite-icon icon-suggestions-icon"></view>
话术推荐
</view>
<view class="text">
<rich-text :nodes="item.scriptRec"></rich-text>
</view>
</view>
</view>
</template>
</block>
</template>
</view>
</template>
</scroll-view>
</template>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等...
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
props: {
qualityData: {
type: Array,
default: () => []
},
qualityAudio: {
type: Object,
default: () => ({})
},
disabled: {
type: Boolean,
default: false
},
disabledText: String
},
data () {
return {
activeIndex: 0,
activeId: ''
}
},
mounted () {
},
methods: {
onTimeUpdate () {
const {
mergedOffset
} = this.setProgress()
this.activeId = `text_${mergedOffset}`
},
setProgress () {
const {
currentTime
} = this.qualityAudio,
mergedOffset = Math.ceil(currentTime)
return {
currentTime,
mergedOffset
}
},
seekPlay (item) {
let { activeId } = this
this.$emit('seek', item.mergedOffset)
if (item.text_id == activeId) {
const {
paused
} = this.qualityAudio
if (paused) this.$emit('onPlay')
else this.$emit('onPause')
this.$emit('changeOperate', !paused)
} else {
this.$emit('onPlay')
this.$emit('changeOperate', false)
}
},
tabClick (item, index) {
if (this.activeIndex == index) return
if (this.disabled && this.disabledText) return uni.showToast({
title: this.disabledText,
icon: 'none',
mask: true,
duration: 2e3
})
this.activeIndex = index
this.$emit('tabClick', item)
}
}
}
</script>
<style scoped lang='scss'>
.view {
height: 100%;
width: 100%;
position: relative;
.classify-wrap {
width: 100%;
height: toRpx(112);
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
.classify-item {
min-width: toRpx(160);
height: 100%;
padding: 0 toRpx(24);
flex-shrink: 0;
justify-content: center;
flex-direction: column;
line-height: toRpx(40);
font-size: toRpx(28);
transition: all 0.15s;
background: #f5f9ff;
.title {
color: #757980;
}
.score {
color: #347bff;
font-weight: 600;
}
}
.active {
border-radius: toRpx(16) toRpx(16) 0 0;
background: #ffffff;
.title {
color: #292d33;
font-weight: 600;
}
}
}
.scroll-view {
height: calc(100% - #{toRpx(112)});
}
.quality-block {
.title {
height: toRpx(80);
background: linear-gradient(119.9deg, #e1f7fc 0%, #f3f7ff 27%, #f7f2ff 41%, #e8f1ff 66%, #f7f2ff 100%);
font-size: toRpx(28);
font-weight: 600;
padding: 0 toRpx(20);
&::before {
content: '';
width: toRpx(8);
height: toRpx(8);
background: #000000;
border-radius: 100%;
display: block;
margin-right: toRpx(16);
}
.matched-btn {
margin-left: auto;
height: toRpx(56);
border-radius: toRpx(28);
background: #ffffff;
padding: 0 toRpx(36);
color: #eb4e4e;
font-size: toRpx(24);
font-weight: 600;
}
.hit {
color: #35c376;
}
}
.quality-item {
padding: toRpx(20) toRpx(24);
background: #fff;
.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;
}
}
.script-rec {
padding: toRpx(24);
.suggestions-box {
background: #ffffff;
border-radius: toRpx(16);
padding: toRpx(24) toRpx(28);
box-sizing: border-box;
.suggestions-title {
display: flex;
align-items: center;
font-weight: 500;
font-size: toRpx(28);
color: #333333;
margin-bottom: toRpx(20);
.sprite-icon {
margin-right: toRpx(12);
}
}
.text {
color: #292d33;
font-size: toRpx(26);
line-height: toRpx(44);
}
.suggestions-text {
padding-bottom: toRpx(22);
border-bottom: toRpx(2) solid #f0f6ff;
margin-bottom: toRpx(24);
}
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #808291;
font-size: toRpx(28);
background: #fff;
}
}
</style>
\ 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
>
<template v-if="flag">
<template v-for="(i,index) in qualityData">
<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="key == 'hitTextList'">
<view class="text-two-line">
<template v-if="i[key] && i[key].length">
<template v-for="(k,kindex) in i[key]">
<rich-text
@click="open(i)"
:key="`text_${index}_${kindex}`"
:nodes="k"
></rich-text>
</template>
</template>
<template v-else>暂无命中文本</template>
</view>
</template>
<template v-else>
{{i[key]}}
</template>
</div>
</template>
</view>
</template>
</template>
</scroll-view>
</view>
</div>
<uni-popup
ref="popup"
type="bottom"
>
<view class="detail-box">
<view
class="close-box flex"
@click="close"
>
<uni-icons
type="clear"
:size="28"
color="#76787f"
></uni-icons>
</view>
<view class="title">{{hitTextDetail.tagGroupName}} {{hitTextDetail.formatScore}}</view>
<view class="content">
<template v-for="(k,kindex) in hitTextDetail.hitTextList">
<rich-text
:key="`text_${kindex}`"
:nodes="k"
></rich-text>
</template>
</view>
</view>
</uni-popup>
</div>
</template>
<script type='text/ecmascript-6'>
import ReceptionTitle from './ReceptionTitle.vue'
export default {
components: {
ReceptionTitle
},
name: '',
props: {
qualityData: {
type: Array,
default: () => []
}
},
data () {
return {
qualityTitle: Object.freeze(['一级分类', '质检得分', '命中文本']),
flag: true,
qualityList: [],
keyList: Object.freeze(['tagGroupName', 'formatScore', 'hitTextList']),
hitTextDetail: []
}
},
mounted () {
},
methods: {
open (hitTextDetail) {
this.hitTextDetail = hitTextDetail
this.$refs.popup.open("center");
},
close () {
this.$refs.popup.close()
}
}
}
</script>
<style scoped lang='scss'>
.quality-table-box {
height: calc(100% - #{toRpx(268)});
.quality-table {
height: calc(100% - #{toRpx(136)});
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);
line-height: toRpx(40);
.title-item {
height: toRpx(88);
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
color: #000;
}
}
.row-1 {
width: toRpx(272);
}
.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;
color: #333;
.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: toRpx(24) toRpx(48);
justify-content: flex-start;
}
}
}
}
}
}
.detail-box {
position: relative;
width: toRpx(1020);
max-height: toRpx(640);
border-radius: toRpx(40);
padding: 0 toRpx(64) toRpx(88);
box-sizing: border-box;
overflow: hidden;
&::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: toRpx(240);
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: toRpx(48);
right: toRpx(68);
}
.close-box {
position: absolute;
width: toRpx(136);
height: toRpx(136);
top: 0;
right: 0;
justify-content: center;
z-index: 2;
}
.title {
font-weight: 500;
font-size: toRpx(40);
color: #292d33;
line-height: toRpx(64);
padding: toRpx(24) 0;
}
.content {
max-height: toRpx(400);
font-size: toRpx(30);
color: #292d33;
line-height: toRpx(48);
overflow-y: auto;
word-break: break-all;
}
}
</style>
\ 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
<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: []
}
},
props: {
batchId: [String, Number]
},
watch: {
batchId: {
handler (val) {
if (val) this.getTags(val)
},
immediate: true
}
},
mounted () {
},
methods: {
async getTags (batchId) {
const res = await uni.$api.receptionApi.findRecordingTagByBatchId({
batchId
})
let tags = []
res.map(e =>{
tags.push(`${e.tagGroupName}-${e.tagName}`)
})
this.tags = tags
}
}
}
</script>
<style scoped lang='scss'>
.tags-box {
padding-bottom: toRpx(24);
.tags-flex {
gap: toRpx(20);
flex-wrap: wrap;
.tag {
height: toRpx(64);
border-radius: toRpx(16);
background: #edf3ff;
padding: 0 toRpx(20);
color: #4673ff;
font-size: toRpx(28);
}
}
}
</style>
\ 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>
<template v-if="pageData.customerName">
<view class="reception-content-box flex">
<view class="reception-left-box">
<view class="customer-info">
<view class="name flex">
<view class="name-text text-hide">
{{pageData.customerName}}
</view>
<view class="phone">{{desensitizePhoneNumber(pageData.phoneNumber)}}</view>
</view>
<view class="brand-box flex">
<view
class="brand flex"
v-if="pageData.carBrand"
>{{pageData.carBrand}}</view>
<view class="brand flex">{{pageData.carModel}}</view>
</view>
<view class="tips flex">
<view :class="['tips-text',{deal:pageData.orderFinishFlag}]">
{{pageData.orderFinishFlag? '成交': '未成交'}}
</view>
<view
class="score-box"
v-if="pageData.score != null"
>
{{pageData.score}}<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"
@click="share"
></view>
<template v-if="showPlayControl">
<view
class="play-box flex"
@click="onHandle"
>
<view :class="['sprite-icon', `icon-reception-${status=='pause'||status=='ending' ? 'play' :'pause'}`]"></view>
{{currentTime}}
</view>
</template>
</view>
<view class="component-box">
<!-- <dialogue
:class="['component-item',{hide: tabId != 1}]"
:batchId="pageData.batchId"
:qualityData="qualityData"
:totalDuration="pageData.totalDuration"
ref="dialogueRef"
:qualityAudio="qualityAudio"
@seek="seek"
@onPlay="onPlay"
@onPause="onPause"
@changeOperate="isOperate = $event"
/> -->
<quality
:qualityData="qualityData"
:class="['component-item',{hide: tabId != 2}]"
ref="qualityRef"
:qualityAudio="qualityAudio"
@seek="seek"
@onPlay="onPlay"
@onPause="onPause"
@changeOperate="isOperate = $event"
@tabClick="tabClick"
:disabled="isResponding || isRecording"
:disabledText="disabledText"
/>
</view>
</view>
</view>
<view class="reception-right-box">
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">AI导师</view>
<web-view
:src="AIUrl"
@message="handlerMessage"
></web-view>
</view>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等...
</view>
</template>
<!-- <template v-if="qualityData.length">
<tags :batchId="pageData.batchId" />
<quality-table :qualityData="qualityData" />
</template>-->
</view>
</view>
</template>
</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'
import dayjs from 'dayjs'
export default {
components: {
QualityTable,
Dialogue,
Quality,
Tags
},
mixins: [],
data () {
return {
tab: Object.freeze([
// {
// id: 1,
// name: '对话',
// componentName: 'dialogue'
// },
{
id: 2,
name: '质检',
componentName: 'quality'
}
]),
tabId: 2,
qualityData: [],
pageData: {},
qualityAudio: {},
currentTime: '00:00',
status: 'pause',
isOperate: true,
showPlayControl: false,
AIUrl: '',
wv: null,
disabledText: '',
isResponding: true,
isRecording: true,
}
},
onLoad () {
let _this = this
this.getOpenerEventChannel().on('getData', function (data) {
console.log(data)
data.totalDuration = (data.receptionEndTime - data.receptionStartTime) / 1000
_this.pageData = data || {}
if (data.batchId) _this.findCheckResultByBatchId(data.batchId)
_this.setAudio(data.recordingUrl)
})
},
onHide () {
this.qualityAudio.stop()
},
onUnload () {
this.qualityAudio.stop()
},
computed: {
// dialogueRef () {
// return this.$refs.dialogueRef
// },
qualityRef () {
return this.$refs.qualityRef
}
},
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back()
return true
}
// 其他情况允许正常返回
return false
},
methods: {
onHandle (e) {
let {
isOperate
} = this;
if (isOperate) {
this.onPlay()
} else {
this.onPause()
}
this.isOperate = !this.isOperate
},
//音频暂停
onPause () {
const {
tabId
} = this
// this.dialogueRef.isPlayIng = false
this.qualityAudio.pause()
},
//播放
onPlay () {
if (!this.showPlayControl) {
return uni.showToast({
title: '音频暂不能播放,稍等...',
icon: 'none'
})
}
const {
paused
} = this.qualityAudio
if (paused) this.qualityAudio.play()
},
setAudio (recordingUrl) {
this.qualityAudio = uni.createInnerAudioContext()
this.qualityAudio.src = recordingUrl
this.qualityAudio.onPause(() => {
this.status = 'pause'
})
//监听音频的播放事件
this.qualityAudio.onPlay(() => {
this.status = 'play'
})
this.qualityAudio.onCanplay(() => {
this.showPlayControl = true
})
this.qualityAudio.onTimeUpdate(this.onTimeUpdate)
this.qualityAudio.onEnded(() => {
this.status = 'ending'
this.currentTime = this.formatTime(this.qualityAudio.duration)
// this.dialogueRef.isPlayIng = false
this.isOperate = true
})
},
onTimeUpdate () {
const {
tabId
} = this
this.currentTime = this.formatTime(this.qualityAudio.currentTime)
// this.dialogueRef?.onTimeUpdate()
this.qualityRef?.onTimeUpdate()
},
formatTime (num) {
num = Math.round(num)
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
minutes = minutes < 10 ? `0${minutes}` : minutes
return `${minutes}:${seconds}`
},
//跳转到指定位置
seek (time) {
this.qualityAudio.seek(time)
},
back () {
uni.$emit('refreshRecord')
if (this.qualityAudio) this.qualityAudio?.pause()
uni.navigateBack()
},
async findCheckResultByBatchId (batchId) {
const res = await uni.$api.receptionApi.findCheckResultByBatchId({
batchId
})
res.map(item => {
item.formatScore = `${item.score || item.score === 0 ? item.score : '-'}/${item.sumScore || item.sumScore === 0 ? item.sumScore : '-'}`
let hitTextList = JSON.parse(item.hitText),
matchedClass = 'no-hit',
matchedText = '意图不匹配'
if (hitTextList && hitTextList.length) {
item.hitTextList = hitTextList.map(e => e.replace(/\n/g, '<br>'))
matchedClass = 'hit'
matchedText = '意图匹配'
}
item.matchedClass = matchedClass
item.matchedText = matchedText
let [scriptRec] = JSON.parse(item.scriptRec)
if (scriptRec) scriptRec = scriptRec.replace(/\n/g, '<br>')
if (item.conversationDetailDTOList && item.conversationDetailDTOList.length) {
item.conversationDetailDTOList.map(e => {
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
if (e.mergedOffset == item.offset && !item.matched) {
e.scriptRec = scriptRec
item.matched = true
}
})
if (item.conversationDetailDTOList.findIndex(e => e.scriptRec) == -1) {
/**时间戳都对不上时 话术推荐加到最后 */
item.conversationDetailDTOList[item.conversationDetailDTOList.length - 1].scriptRec = scriptRec
}
} else item.conversationDetailDTOList = [{
scriptRec: scriptRec || '暂无话术推荐'
}]
})
this.qualityData = res
this.getAiagent(res[0])
},
desensitizePhoneNumber (phoneNumber) {
return phoneNumber.replace(phoneNumber.slice(3, 7), '****')
},
async share () {
try {
const {
merchantName,
receptionStartTime,
receptionEndTime,
duration,
merchantId,
batchId,
receptionStatus
} = this.pageData,
receptionStatusText = {
1: '成交',
2: '战败',
3: '未知'
}[receptionStatus]
// 获取短链地址
const url = await uni.$api.receptionApi.getShortUrl({
merchantNo: merchantId,
batchId,
receptionStartTime: receptionStartTime
})
if (url) {
// 门店 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址(更换成短链)
let text = [
merchantName,
dayjs(receptionStartTime).format("YYYY年MM月DD日 HH:mm:ss"),
dayjs(receptionEndTime).format("YYYY年MM月DD日 HH:mm:ss"),
duration,
receptionStatusText,
url
].join(' - ')
uni.setClipboardData({
data: text,
})
} else uni.showToast({
title: "获取短链失败",
icon: "none",
})
} catch (error) {
uni.showToast({
title: error,
icon: "none",
})
}
},
async getAiagent (item) {
if (item) {
uni.showLoading({
mask: true
})
const { phone } = uni.$storage.get('userInfo'),
[data] = await uni.$api.sceneMarketApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode: 'AI7'
})
if (data) {
const { sceneType, uuid, phone, channelType = 1 } = uni.$storage.get('userInfo'),
bussinessType = sceneType == 0 ? 1 : 2,// sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
brand = {
1: '问界',
2: '比亚迪',
3: '其他'
}[channelType],
{ modelType } = this.pageData
let title = ''
if (item.sumScore > item.score) title = item.tagGroupName
let { agentUrl, domainName, taskStatus } = data
// agentUrl = 'https://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-zhangls/chat/0piVRFb1xn6OBTcv'
let url = `${agentUrl}?no_header=1&businessType=${bussinessType}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}&brandType=${modelType || 1001}`
url += `&phone=${phone}&brand=${brand}&date=${dayjs().format('YYYY-MM-DD')}`
if (taskStatus) url += `&practice_status=${taskStatus}`
this.AIUrl = url
this.setWebviewStyle()
} else uni.showToast({
title: '获取智能体失败',
icon: 'error'
})
}
},
setWebviewStyle () {
//修改UA为PC端
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
const [wv] = currentWebview.children()
if (wv) {
this.wv = wv
wv.setStyle({
left: '40.85%',
top: '16.65%',
height: '78.17%',
width: '56.52%'
});
// wv.setCssText( '.chat-panel-bg{background:#f5f9ff !important;}' )
return true; // 成功设置样式
} else {
return false; // 未找到wv
}
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
},
tabClick (item) {
if (this.wv) {
let message = item.sumScore > item.score ? item.tagGroupName : ''
this.wv.evalJS(`sendMessage({type:'reset_chat',payload:{message:'${message}'}})`)
}
},
handlerMessage ({ detail }) {
uni.hideLoading()
let [data] = detail.data
if (typeof data.isResponding == 'boolean') this.isResponding = data.isResponding
if (typeof data.isRecording == 'boolean') this.isRecording = data.isRecording
if (data.isResponding || data.isRecording) {
this.disabledText = data.isResponding ? '请等待内容生成后再切换其他质检点' : '请等待录音结束后再切换其他质检点'
}
}
}
}
</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);
overflow: hidden;
.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(1326)});
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);
flex-shrink: 0;
}
}
.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);
.tips-text {
color: #f24724;
}
.deal {
color: #2cca74;
}
&-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) 0 toRpx(4);
color: #757980;
font-size: toRpx(26);
.sprite-icon {
margin-right: 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)});
position: relative;
.component-item {
position: absolute;
top: 0;
left: 0;
transition: all 0.15s;
}
.hide {
opacity: 0;
z-index: -1;
}
}
}
}
.reception-right-box {
height: 100%;
width: toRpx(1326);
border-radius: toRpx(32);
opacity: 1;
background: #f5f9ff;
box-sizing: border-box;
position: relative;
.AI-window {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.AI-title {
height: toRpx(96);
font-size: toRpx(36);
font-weight: 500;
justify-content: center;
color: #333333;
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #808291;
font-size: toRpx(28);
background: #fff;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!