Commit 91549652 by 胡悦

Merge branch 'SAAS+V4.55.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V4.55.0

2 parents d3fc800d d3bc6ce9
......@@ -5,6 +5,7 @@ import boutiqueApi from './boutique'
import customerApi from './customerApi'
import pointApi from './point'
import receptionApi from './receptionApi'
import sceneMarketApi from './sceneMarketApi'
module.exports = {
commonApi,
systemApi,
......@@ -12,5 +13,6 @@ module.exports = {
boutiqueApi,
customerApi,
pointApi,
receptionApi
receptionApi,
sceneMarketApi
}
import http from '../request/http'
module.exports = {
/**查询所有业务场景 */
getSceneMarketMaterialMenu (data = {}) {
return http.post({
method: 'dj.api.carboutique.material.scenemarket.findAllLevel',
projectName: 'boutique',
...data
})
}, /**根据场景查询素材列表 */
getSceneMarketMaterialList (data = {}) {
return http.post({
method: 'dj.api.carboutique.material.scenemarket.findByOneCode',
projectName: 'boutique',
...data
})
},
/**获取智能体 */
getAiagent (data = {}) {
return http.post({
method: 'dj.pad.api.aiagent.get.special.agent',
projectName: 'pad',
...data
})
}
}
\ No newline at end of file
No preview for this file type
......@@ -123,6 +123,7 @@ export default {
carBrandList = [];
list?.map((e) => {
e.childs.map((i) => {
i.brandName = e.name
i.brandId = e.id;
carBrandList.push(i);
});
......@@ -199,7 +200,12 @@ export default {
handleSelect (item) {
const customerInfo = this.$store.state.user.customerInfo,
{ selectItem, linkage } = this
customerInfo.carBrand = selectItem.carChildsBrandName
Object.assign(customerInfo, {
carBrand: selectItem.carChildsBrandName,
carBrandId: selectItem.carChildsBrandId,
oneCarBrand: selectItem.carBrand,
oneCarBrandId: selectItem.carBrandId
})
if (linkage) {
this.$store.dispatch('setCustomerInfo', customerInfo)
this.$store.dispatch('updateViewKey')
......
......@@ -136,7 +136,6 @@ export default {
}
},
mounted(options) {
console.log('Calendar.adsfads')
this.init()
},
methods: {
......@@ -185,9 +184,8 @@ export default {
const params = this.getParams()
const res = await uni.$api.pointApi.newCalendar(params)
if (res) {
console.log(this.dates, 'dates')
this.dates.forEach(item => {
const clockData = res.clockInDateList.find(i => i.day == item)
const clockData = res?.clockInDateList?.find(i => i.day == item)
if (clockData && (this.currentInfo.month < this.defaultMonth || clockData.day < this.currentInfo.day)) {
if (clockData.dayState == 4) clockData.isDefault = true
clockData.clockInTime1 = clockData.clockInTime ? dayjs(new Date(clockData.clockInTime)).format('HH:mm') : null
......@@ -202,7 +200,6 @@ export default {
})
}
})
console.log(this.clockInDateList)
}
},
/** 申诉记录 */
......@@ -210,7 +207,6 @@ export default {
const params = this.getParams()
params.pageSize = 40
const res = await uni.$api.pointApi.getAppealList(params)
console.log(res)
this.recordList = res.list
},
// 切换月份
......
......@@ -202,7 +202,7 @@ export default {
let _this = this
uni.$api.commonApi.getUnreadCount({}).then(res => {
this.readCount = res.data
setTimeout(() => {
if (res.data) setTimeout(() => {
utils.getViewInfo('.tip-box', info => {
_this.$emit('showReadCountTips', {
style: `display:block;opacity:1;top: ${info.top}px; left: ${info.left}px;`,
......
......@@ -32,7 +32,6 @@ export default {
dataShow: {
immediate: true,
handler (newval) {
console.log(123)
this.getServerData()
}
}
......
......@@ -43,7 +43,6 @@ export default {
watchCustomerInfo: {
immediate: true,
handler (newval) {
console.log(newval)
this.id = newval.receptionScene
}
},
......
......@@ -38,23 +38,10 @@
</view>
</view>
<view class="right box-class">
<view class="type-box">
<view
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="tabIndex = index"
>
<view :class="['sprite-icon',tabIndex == index ? `icon-${firstClass[index]} active` : '', firstLeft[index]]"></view>
<view
class="text"
:class="[tabIndex == index ? `active` : '']"
>
{{ i.tabName }}
</view>
</view>
</view>
<view class="mask-box"></view>
<type-tab-component
:typeList="typeList"
:tabIndex.sync="tabIndex"
></type-tab-component>
<view :class="['right-content',`${tabIndex != 0?'hide-record':'show-record'}`]">
<customer-file
@showSuccess="$refs.successRef.open()"
......@@ -108,6 +95,7 @@ import RecordList from './RecordList.vue'
import saveRecord from './saveRecord.vue'
import CustomerFile from './CustomerFile.vue'
import CustomerInfo from './CustomerInfo.vue'
import TypeTabComponent from '../../../TypeTabComponent.vue'
export default {
components: {
CustomerFlow,
......@@ -117,6 +105,7 @@ export default {
saveRecord,
CustomerFile,
CustomerInfo,
TypeTabComponent
},
name: '',
......@@ -132,8 +121,6 @@ export default {
{ tabName: '客户预录' },
{ tabName: '接待复盘' },
]),
firstLeft: Object.freeze(['first', 'second']),
firstClass: Object.freeze(['first-nav', 'second-nav']),
showInfo: false,
customerId: '',
pageData: {
......@@ -267,15 +254,6 @@ export default {
}
.right {
width: toRpx(1354);
.mask-box {
position: absolute;
height: calc(100% - #{toRpx(128)});
width: 100%;
background: #fff;
left: 0;
top: toRpx(128);
border-radius: toRpx(48);
}
&-content {
width: 100%;
position: absolute;
......@@ -284,57 +262,6 @@ export default {
height: calc(100% - #{toRpx(128)});
transform: translateY(toMinusRpx(32));
}
.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;
.first {
left: 0;
}
.second {
left: toRpx(352);
}
.three {
left: toRpx(756);
}
.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);
}
}
}
}
}
.save-record-box {
......
<template>
<view
class="material-item flex"
@click="jump"
>
<!-- <view :class="['status', {'status-green':item.readStatus == 0}]">{{readStatusEnum[item.readStatus]}}</view> -->
<view class="icon">
<template v-if="item.cover">
<image
class="image"
:src="item.cover"
/>
</template>
<template v-else>
<image
class="image"
:src="imgUrl(item)"
/>
</template>
<view class="label">{{materialTypeEnum[item.type]}}</view>
</view>
<view class="text">
<view class="title">{{item.title}}</view>
<view class="tags">
<template v-for="i in item.sceneMarketTagsList">
<view
class="tag"
:key="i.id"
>{{i.tagName}}</view>
</template>
</view>
<view class="date">{{item.date||''}}</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
item: Object,
sceneMarketLevelTwoItem: Object
},
name: '',
data () {
return {
materialTypeEnum: Object.freeze({
0: '图片',
1: '视频',
2: 'PDF',
3: '富文本',
4: 'Excel',
5: 'Word'
}),
// readStatusEnum: Object.freeze({
// 0: '已查看',
// 1: '未查看'
// })
}
},
mounted () {
},
methods: {
imgUrl (item) {
return `https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/material-${item.type}.png`
},
async jump () {
let { item, sceneMarketLevelTwoItem } = this,
params = `id=${item.id}&specialFlag=1`
// params = `id=${item.id}&specialFlag=${sceneMarketLevelTwoItem.specialFlag ? 1 : 0}`
// 类型:0-图片;1-视频;2-pdf;3-富文本; 4-Excel; 5-Word
let url = `/pages/common/caseDetail?${params}`
if (item.type != 3) {
uni.showLoading({
mask: true
})
const data = await uni.$api.customerApi.getMaterialDetail({
id: item.id
})
uni.hideLoading()
let fileUrl = data?.detailInfos[0]?.image
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}&${params}`
else url = `/pages/common/materialDetail/index?fileUrl=${fileUrl}&title=${item.title}&${params}`
}
uni.navigateTo({
url: `${url}`
})
}
}
}
</script>
<style scoped lang='scss'>
.material-item {
display: flex;
position: relative;
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 16rpx;
.status {
position: absolute;
right: 0;
top: 0;
height: 40rpx;
line-height: 40rpx;
width: fit-content;
padding: 0 12rpx;
font-size: 22rpx;
color: #999999;
background: #9999991a;
border-radius: 4rpx;
}
.status-green {
color: #35c376;
background: #35c3761a;
}
.icon {
width: 128rpx;
height: 128rpx;
margin-right: 16rpx;
flex-shrink: 0;
position: relative;
.image {
width: 100%;
height: 100%;
border-radius: 8rpx;
overflow: hidden;
}
.label {
display: flex;
align-items: center;
padding: 0 6rpx;
position: absolute;
width: fit-content;
color: #ffffff;
left: 8rpx;
top: 8rpx;
height: 28rpx;
background: #00000066;
font-size: 20rpx;
}
}
.text {
width: calc(100% - 144rpx);
.title {
width: 100%;
// width: calc(100% - 98rpx);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #333333;
font-size: 30rpx;
font-weight: 700;
}
.tags {
display: flex;
align-items: center;
gap: 0 8rpx;
margin: 8rpx 0;
.tag {
display: flex;
align-items: center;
height: 40rpx;
background: #75bcff1a;
padding: 0 12rpx;
width: fit-content;
color: #2d66f7;
font-size: 22rpx;
border-radius: 4rpx;
}
}
.date {
color: #999999;
font-size: 24rpx;
}
}
}
</style>
\ No newline at end of file
<template>
<scroll-view
class="scene-list-box"
scroll-y
>
<template v-if="requestComplete">
<view class="material-box">
<template v-if="materialList.length">
<template v-for="(item,index) in materialList">
<view
class="item"
:key="index"
>
<material
:item="item"
:sceneMarketLevelTwoItem="sceneMarketLevelTwoItem"
></material>
</view>
</template>
<view class="bottom flex">-已经到底了-</view>
</template>
<template v-else>
<view class="list-nothing flex">
<image
class="icon"
src="../../../../../assets/images/home/nothing.webp"
/>
暂无内容
</view>
</template>
</view>
</template>
</scroll-view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
import Material from './Material.vue'
export default {
props: {
requestParams: Object,
sceneMarketLevelTwoItem:Object
},
components: {
Material
},
name: '',
data () {
return {
requestComplete: false,
materialList: []
}
},
mounted () {
},
methods: {
async getSceneMarketMaterialList () {
try {
uni.showLoading({
title: '加载中',
mask: true
})
const {
requestParams
} = this,
data = await uni.$api.sceneMarketApi.getSceneMarketMaterialList(requestParams)
uni.hideLoading()
data?.map(e => {
e.date = dayjs(e.createdDate).format('YYYY-MM-DD')
})
this.materialList = data
this.requestComplete = true
} catch (error) {
uni.hideLoading()
uni.showToast({
title: error,
icon: "error",
})
}
},
}
}
</script>
<style scoped lang='scss'>
.scene-list-box {
width: 100%;
height: 100%;
.material-box {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
gap: 28rpx 48rpx;
padding: 0 44rpx;
align-content: flex-start;
.item {
width: calc((100% - 96rpx) / 3);
height: 164rpx;
border-radius: 16rpx;
background: #ffffff;
box-shadow: 0 8rpx 24rpx 0 #2c66f71a;
}
.bottom {
margin-top: auto;
width: 100%;
justify-content: center;
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
}
.list-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);
}
}
}
</style>
\ No newline at end of file
<template>
<div>
</div>
<view class="scene-market-box">
<type-tab-component
:typeList="typeList"
:tabIndex="tabIndex"
@tabClick="tabBarClick"
nameKey="directoryName"
></type-tab-component>
<view class="scene-market-content">
<view class="tabs flex">
<template v-for="i in sceneMarketLevelTwoList">
<view
:class="['tab flex',{active: tagId == i.id}]"
:key="i.id"
@click="tabClick(i)"
>{{i.directoryName}}</view>
</template>
</view>
<scene-list
class="scene-list"
ref="sceneListRef"
:requestParams="requestParams"
:sceneMarketLevelTwoItem="sceneMarketLevelTwoItem"
/>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
import TypeTabComponent from '../../../TypeTabComponent.vue'
import SceneList from './compontens/SceneList.vue'
export default {
components: {
TypeTabComponent,
SceneList
},
name: '',
data () {
return {
typeList: [],
tabIndex: -1,
tagId: '',
requestParams: {}
}
},
computed: {
sceneListRef () {
return this.$refs.sceneListRef
},
mounted () {
sceneMarketLevelTwoList () {
return this.typeList[this.tabIndex]?.sceneMarketLevelTwoList || []
},
methods: {
sceneMarketLevelTwoItem () {
return this.sceneMarketLevelTwoList.find(e => e.id == this.tagId)
}
},
mounted () {
this.getSceneMarketMaterialMenu()
},
methods: {
async getSceneMarketMaterialMenu () {
const typeList = await uni.$api.sceneMarketApi.getSceneMarketMaterialMenu()
this.typeList = typeList
this.tabBarClick(0)
},
tabBarClick (index) {
if (this.tabIndex == index) return
const tabIndex = index,
{
typeList
} = this
this.tabIndex = tabIndex
let detail = typeList[tabIndex].code
if (typeList[tabIndex]?.sceneMarketLevelTwoList.length) detail = typeList[tabIndex].sceneMarketLevelTwoList[0]
this.tabClick(detail)
},
tabClick ({ code: businessCode, id }) {
this.tagId = id
if (this.requestParams.businessCode == businessCode) return
this.requestParams.businessCode = businessCode
this.sceneListRef.requestComplete = false
this.sceneListRef.getSceneMarketMaterialList()
},
}
}
</script>
<style scoped lang='scss'>
.scene-market-box {
height: calc(100vh - 144rpx);
margin: 64rpx 48rpx 0;
border-radius: 48rpx;
background: #ffffff59;
backdrop-filter: blur(16rpx);
box-shadow: inset 0 0 16rpx 0 #ffffff;
box-sizing: border-box;
overflow: hidden;
.scene-market-content {
width: 100%;
height: calc(100% - 128rpx);
background: #ffffff;
transform: translateY(-32rpx);
box-sizing: border-box;
.tabs {
gap: 24rpx;
padding: 40rpx 44rpx;
.tab {
height: 80rpx;
background: #f2f2f2;
padding: 0 32rpx;
color: #666666;
font-size: 28rpx;
border-radius: 16rpx;
}
.active {
background: #2d66f71a;
color: #2d66f7;
font-weight: 500;
}
}
.scene-list {
height: calc(100% - 160rpx);
}
}
}
</style>
\ No newline at end of file
......@@ -42,6 +42,14 @@
<view class="tool-box box-class">
<view class="common-title">展业工具</view>
<view class="content-box">
<view class="developing flex">
<image
class="developing-icon"
src="../../assets/images/common/developing.webp"
/>
功能开发中
</view>
</view>
</view>
</view>
......@@ -527,6 +535,16 @@ export default {
position: relative;
width: 100%;
height: calc(100% - #{toRpx(120)});
.developing {
height: 100%;
flex-direction: column;
color: #999999;
font-size: 20rpx;
&-icon {
width: 344rpx;
height: 208rpx;
}
}
}
.content-left,
.content-right {
......
......@@ -18,7 +18,7 @@
>
<image
class="image-block"
:src="item.imgKey"
:src="item.imgUrl"
@load="item.hide = true"
/>
<view :class="['error-block',{hide:item.hide}]">
......@@ -150,10 +150,9 @@ export default {
const dataIndex = index - 1 < 0 ? datalist.length - 1 : index - 1
item.isIndex = dataIndex
item.isToor = index
item.imgKey = datalist[dataIndex]?.[this.imgKey] || ''
item.imgUrl = datalist[dataIndex]?.[this.imgKey] || ''
item.x = 0
})
console.log(this.imagelist)
if (autoplay) this.autoPlayFunction()
},
autoPlayFunction () {
......@@ -187,6 +186,7 @@ export default {
(item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1
: (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1
item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class
item.x = 0
let isIndex = item.isIndex
......@@ -204,7 +204,7 @@ export default {
if (isIndex < 0) isIndex = len
}
item.isIndex = isIndex
item.imgKey = datalist[isIndex][this.imgKey] || ''
item.imgUrl = datalist[isIndex][this.imgKey] || ''
item.index = list[toor].index
})
let currentIndex = this.imagelist.findIndex(item => item.index == 1)
......
<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: calc(100% - #{toRpx(128)});
width: 100%;
background: #fff;
left: 0;
top: toRpx(128);
border-radius: toRpx(48);
}
}
</style>
\ No newline at end of file
export default {
data () {
return {
AIUrl: ''
}
},
mounted () {
},
methods: {
async getAiagent (options, agentCode = 'AI7') {
const { phone } = uni.$storage.get('userInfo'),
[data] = await uni.$api.sceneMarketApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode//AI6
})
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],
title = options.title || ''
let { agentUrl, domainName } = data
this.AIUrl = `${agentUrl}?no_header=1&business_type=${bussinessType}&phone=${phone}&brand=${brand}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}`
this.setWebviewStyle()
} else uni.showToast({
title: '获取智能体失败',
icon: 'error'
})
},
setWebviewStyle () {
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
let [wv1, wv2] = currentWebview.children()
let wv1Flag = false,
wv2Flag = false
if (wv2) {
if (wv1) {
wv1.setStyle({
left: '0',
top: '9.37%',
height: '90.63%',
width: '71.36%'
});
wv1Flag = true;
}
if (wv2) {
wv2.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
});
wv2Flag = true;
}
} else {
if (wv1) {
wv1.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
});
wv1Flag = true;
wv2Flag = true;
}
}
return wv1Flag && wv2Flag
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
}
}
}
import loginMixin from './loginMixin'
import receptionTrackMixin from './receptionTrackMixin'
import aiUrlMixin from './aiUrlMixin'
import report from './report'
module.exports = {
loginMixin,
receptionTrackMixin
receptionTrackMixin,
aiUrlMixin,
report
}
......@@ -12,12 +12,12 @@ import utils from '@/utils/utils.js'
import { storageApi } from '@/utils/cache'
import permision from '@/js_sdk/wa-permission/permission.js'
export default {
provide() {
provide () {
return {
getRecorder: () => this.record
}
},
async mounted() {
async mounted () {
this.audioManager = new AudioManager(this.onAudioStart, this.onAudioStop, this.onError)
this.initDto()
this.record = new TempRecord(this.tempRecord, this.triggleTempNumber)
......@@ -34,31 +34,31 @@ export default {
// },
// deep: true
// },
customerKey:{
handler() {
customerKey: {
handler () {
this.handler(this.customerInfo, this.updateCustomerInfo)
},
deep: true
},
booksList: {
handler(val) {
handler (val) {
this.handler(val, this.updateBookList)
}
},
receptionStatus: {
handler(val) {
handler (val) {
this.handler(val, this.updateReceptionStatus)
}
},
receptionKey: {
handler(val) {
handler (val) {
this.handler(this.receptionTrack, this.updateMaterialPointList)
}
}
},
computed: {
...mapState(['user.customerInfo']),
...mapGetters(['customerInfo', 'receptionStatus', 'booksList', 'receptionTrack', 'receptionKey','customerKey'])
...mapGetters(['customerInfo', 'receptionStatus', 'booksList', 'receptionTrack', 'receptionKey', 'customerKey'])
},
methods: {
...mapMutations('audio', ['setReceptionStatus', 'setBooks', 'setPerRecordNumber']),
......@@ -72,20 +72,20 @@ export default {
this.audioManager.start()
}, 300),
initReception() {
initReception () {
this.setBooks([])
this.clearCustomerInfo()
this.setReceptionStatus('')
this.initTime()
},
async onAudioStart() {
async onAudioStart () {
if (this.audioManager.counter === 0) {
await this.record.add()
} else {
this.record.addAudio()
}
},
async onAudioStop() {
async onAudioStop () {
if (this.audioManager.isRecording) {
uni.$logger.local.info('〖接待管理Recorder〗 == 接待中,再次开启录音! ')
this.audioManager.start()
......@@ -93,7 +93,7 @@ export default {
uni.$logger.local.info('〖接待管理Recorder〗 == 断开录音! ')
}
},
onAudioError(error) {
onAudioError (error) {
const message = error.message
this.reportError(`录音异常: error: ${message}`, message)
},
......@@ -102,12 +102,12 @@ export default {
* @params {boolean} status true 不保存记录/AUDIO_STATUS.ABNORMAL 只要断开录音
* @returns {void}
*/
async stopAudio(isNotSave = false) {
async stopAudio (isNotSave = false) {
uni.$logger.local.info('〖接待管理Recorder〗 == 结束接待! ')
this.stop()
await this.saveAndClearRecord(isNotSave)
},
async saveAndClearRecord(isNotSave = false) {
async saveAndClearRecord (isNotSave = false) {
if (isNotSave) {
uni.$logger.local.info('〖接待管理Recorder〗 == 不保存记录! ')
return this.record.clearLocalRecord()
......@@ -116,24 +116,24 @@ export default {
//如果不需要保存记录
await this.record.save()
},
stop() {
stop () {
this.endWatchClick()
this.record.clearLoopTimer()
if (this.audioManager.isRecording) {
this.audioManager.stop()
}
},
handler(params, fn) {
handler (params, fn) {
if (this.audioManager.isRecording || this.record?.currentRecord?.endReasonType == 1) {
fn.call(this, params)
}
},
reset() {
reset () {
this.audioManager = null
this.record = null
this.tempRecord = null
},
initDto() {
initDto () {
const { shopMerchantId, phone, sceneType, uuid, name, merchantId, channelType, merchantName } = storageApi.getUserInfo()
const { deviceId: appCode } = uni.getDeviceInfo()
const dto = new RecordDto({
......@@ -146,22 +146,26 @@ export default {
merchantId: shopMerchantId,
merchantName,
bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
channelType: channelType || 1 //1问界 2 比亚迪 3 其他
channelType: channelType || 1,//1问界 2 比亚迪 3 其他
})
this.sceneType = sceneType
this.tempRecord = dto
},
updateCustomerInfo(customerInfo = {}) {
const { customerName, phoneNumber, salesUuid, carModel, staffName: salesName } = customerInfo
updateCustomerInfo (customerInfo = {}) {
const { customerName, phoneNumber, salesUuid, carModel, staffName: salesName, carBrand, carBrandId, oneCarBrand, oneCarBrandId } = customerInfo
this.record.updatePreRecords({
customerName,
phoneNumber,
carModel,
salesUuid,
salesName
salesName,
carBrand,
carBrandId,
oneCarBrand,
oneCarBrandId
})
},
updateBookList(booksList) {
updateBookList (booksList) {
const receptionCustomerPaySourceList = booksList.map(item => {
return {
id: item.id,
......@@ -171,7 +175,7 @@ export default {
})
this.record.updatePreRecords({ receptionCustomerPaySourceList })
},
updateMaterialPointList(receptionTrack) {
updateMaterialPointList (receptionTrack) {
const { merchantId, staffUuid, staffName } = this.tempRecord
let receptionCustomerMaterialPointList = []
Object.keys(receptionTrack).map(key => {
......@@ -185,17 +189,17 @@ export default {
})
this.record.updatePreRecords({ receptionCustomerMaterialPointList })
},
updateReceptionStatus(status) {
updateReceptionStatus (status) {
this.record.updatePreRecords({ receptionStatus: status })
},
getRecorder() {
getRecorder () {
return this.record
},
async triggleTempNumber() {
async triggleTempNumber () {
const _records = await this.record.getRecords()
this.setPerRecordNumber(_records.length)
},
async isPermission(hintText = '为了记录语音通话,请打开录音权限') {
async isPermission (hintText = '为了记录语音通话,请打开录音权限') {
const result = await permision.requestAndroidPermission('android.permission.RECORD_AUDIO')
await helpler.sleep(0)
if (result !== 1) {
......@@ -206,13 +210,13 @@ export default {
}
return result === 1
},
async checkBeforeStart() {
async checkBeforeStart () {
const isPermission = await this.isPermission()
const isRecording = this.audioManager.isRecording
return isPermission && !isRecording
}
},
beforeDestroy() {
beforeDestroy () {
this.stop()
this.reset()
}
......
......@@ -3,7 +3,7 @@ export default {
return {
goodsId: '',
visitsId: '',
source: 1
source: ''
}
},
onLoad (options) {
......@@ -15,22 +15,22 @@ export default {
methods: {
addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
if(!merchantId) return
if (!merchantId || !this.goodsId) return
const params = {
goodsId: this.goodsId,
goodsType: 0,
merchantId,
merchantName,
searchSource: this.source
}
if (this.visitsId) params.visitsId = this.visitsId
if (this.source) params.searchSource = this.source
uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res
})
}
},
onUnload () {
if(!this.addId) return
if (!this.addId) return
const params = {
id: this.addId
}
......
......@@ -177,11 +177,17 @@
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/materialDetail/index",
"style": {
"navigationStyle": "custom"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "生意助手",
"navigationBarTitleText": "展业助手",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"pageOrientation": "landscape",
......
<template>
<view class="popup-box" v-if="popupShow">
<view
class="popup-box"
v-if="popupShow"
>
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#fff"></uni-icons>
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#fff"
></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
<view class="popup-body">
<video ref="videoPlayer" :src="detailUrl" controls v-if="sourceType == 2"></video>
<view class="img-detail" v-else>
<image @click="back" :src="detailUrl" mode="heightFix" />
<view :class="['popup-body',{'has-ai':AIUrl}]">
<video
ref="videoPlayer"
:src="detailUrl"
controls
v-if="sourceType == 2"
></video>
<view
class="img-detail"
v-else
>
<image
@click="back"
:src="detailUrl"
mode="heightFix"
/>
</view>
</view>
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">场景二拓</view>
<web-view :src="AIUrl"></web-view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import report from "@/mixin/report.js";
import { aiUrlMixin, report } from '@/mixin/index.js'
export default {
mixins: [report, aiUrlMixin],
props: {
isComponents: Boolean,
show: Boolean,
......@@ -26,11 +57,12 @@ export default {
return {
title: '',
sourceType: '',
detailUrl: ''
detailUrl: '',
}
},
watch:{
show:{
watch: {
show: {
immediate: true,
handler (n) {
if (n) {
......@@ -47,16 +79,17 @@ export default {
return status
},
},
mixins: [report],
onLoad (options) {
this.init(options)
},
methods: {
init (options) {
const { tabName, sourceType, detailUrl } = options
const { tabName, sourceType, detailUrl, specialFlag } = options
this.title = tabName
this.sourceType = sourceType
this.detailUrl = detailUrl
options.title = tabName
if (specialFlag == 1) this.getAiagent(options)
},
back () {
if (this.isComponents) this.$emit('previewBack')
......@@ -112,5 +145,24 @@ export default {
}
}
}
.has-ai {
width: 71.36% !important;
}
}
.AI-window {
width: 28.3vw;
height: 90.63vh;
position: fixed;
top: 9.37vh;
right: 0;
background: #f5f9ff;
.AI-title {
height: 5.73vh;
padding-top: 2.08vh;
font-size: 34rpx;
font-weight: 500;
justify-content: center;
color: #333333;
}
}
</style>
<template>
<view class="material-detail">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
{{ title }}
</view>
<web-view :src="url"></web-view>
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">场景二拓</view>
<web-view :src="AIUrl"></web-view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import { aiUrlMixin, report } from '@/mixin/index.js'
export default {
name: '',
mixins: [report , aiUrlMixin],
data () {
return {
url: '',
viewerUrl: Object.freeze('/hybrid/html/web/viewer.html'),
AIUrl: '',
title: ''
}
},
onLoad (options) {
console.log(options)
if (options.fileUrl) this.url = `${this.viewerUrl}?file=${options.fileUrl}`
else this.url = options.url
if (options.title) this.title = options.title
if (options.specialFlag == 1) this.getAiagent(options)
},
mounted () {
},
methods: {
back () {
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
}
}
</script>
<style scoped lang="scss">
.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;
}
}
.AI-window {
width: 28.3vw;
height: 90.63vh;
position: fixed;
top: 9.37vh;
right: 0;
background: #f5f9ff;
.AI-title {
height: 5.73vh;
padding-top: 2.08vh;
font-size: 34rpx;
font-weight: 500;
justify-content: center;
color: #333333;
}
}
</style>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<view
:class="['classify-item flex',{active: index == activeIndex}]"
:key="index"
@click="activeIndex = index"
@click="tabClick(item,index)"
>
<view class="title">{{item.tagGroupName}}</view>
<view class="score">{{item.formatScore}}</view>
......@@ -121,6 +121,10 @@ export default {
this.$emit('onPlay')
this.$emit('changeOperate', false)
}
},
tabClick (item, index) {
this.activeIndex = index
this.$emit('tabClick', item)
}
}
}
......
......@@ -88,25 +88,33 @@
@onPlay="onPlay"
@onPause="onPause"
@changeOperate="isOperate = $event"
@tabClick="tabClick"
/>
</view>
</view>
</view>
<view class="reception-right-box">
<!-- <template v-if="qualityData.length">
<tags :batchId="pageData.batchId" />
<quality-table :qualityData="qualityData" />
</template>
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">AI导师</view>
<web-view :src="AIUrl"></web-view>
</view>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等...
</view>
</template> -->
</template>
<!-- <template v-if="qualityData.length">
<tags :batchId="pageData.batchId" />
<quality-table :qualityData="qualityData" />
</template>-->
</view>
</view>
</template>
<web-view :src="AIUrl"></web-view>
</view>
</template>
......@@ -146,10 +154,11 @@ export default {
status: 'pause',
isOperate: true,
showPlayControl: false,
AIUrl: 'https://www.baidu.com'
AIUrl: '',
wv: null
}
},
onLoad (options) {
onLoad () {
let _this = this
this.getOpenerEventChannel().on('getData', function (data) {
console.log(data)
......@@ -157,8 +166,6 @@ export default {
_this.pageData = data || {}
if (data.batchId) _this.findCheckResultByBatchId(data.batchId)
_this.setAudio(data.recordingUrl)
_this.setWebviewStyle()
})
},
onHide () {
......@@ -290,6 +297,7 @@ export default {
}]
})
this.qualityData = res
this.getAiagent(res[0])
},
desensitizePhoneNumber (phoneNumber) {
return phoneNumber.replace(phoneNumber.slice(3, 7), '****')
......@@ -341,17 +349,49 @@ export default {
})
}
},
async getAiagent (item) {
if (item) {
const { phone } = uni.$storage.get('userInfo'),
[data] = await uni.$api.sceneMarketApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode: 'AI7' //AI6
})
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]
let title = ''
if (item.sumScore > item.score) title = item.tagGroupName
let { agentUrl, domainName, checkDate, taskStatus } = data,
url = `${agentUrl}?no_header=1&business_type=${bussinessType}&phone=${phone}&brand=${brand}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}`
if (checkDate) url += `&date=${checkDate}`
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()[0]
const [wv] = currentWebview.children()
if (wv) {
this.wv = wv
wv.setStyle({
left: '40.75%',
top: '10.4%',
height: '85.42%',
width: '56.52%'
left: '40.85%',
top: '16.65%',
height: '78.17%',
width: '56.52%',
});
return true; // 成功设置样式
} else {
......@@ -370,6 +410,12 @@ export default {
};
setTimeout(retrySetWebviewStyle, 100);
},
tabClick (item) {
if (item.sumScore > item.score && this.wv) {
// item.tagGroupName
// this.wv.evalJS()
}
}
}
}
......@@ -568,10 +614,23 @@ export default {
width: toRpx(1326);
border-radius: toRpx(32);
opacity: 1;
background: #ffffff;
background: #f5f9ff;
box-sizing: border-box;
overflow-y: auto;
padding: 0 toRpx(40);
position: relative;
.AI-window {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.AI-title {
height: 96rpx;
font-size: 36rpx;
font-weight: 500;
justify-content: center;
color: #333333;
}
}
.nothing {
width: 100%;
height: 100%;
......
......@@ -211,6 +211,12 @@ export default {
if (this.id) this.setPageData()
}
},
id: {
immediate: true,
handler (newval) {
if(!this.pageToolList.length) this.pageToolList = this.toolList
}
}
// toolList: {
// immediate: true,
// handler (newval) {
......
......@@ -115,6 +115,7 @@ export default {
subBrandIdList = []
list?.map(e => {
e.childs.map(i => {
i.brandName = e.name
i.brandId = e.id
carBrandList.push(i)
subBrandIdList.push(i.id)
......
......@@ -20,8 +20,10 @@ export default {
staffName: "",
newCarFare: '',
carModelId: '',
carBuyers:'',
carPurchaseMethod:''
carBuyers: '',
carPurchaseMethod: '',
oneCarBrand: '',
oneCarBrandId: ''
},
historyStatus: Date.now(),
carBrands: [],
......@@ -32,11 +34,11 @@ export default {
receptionTrack: {}, //接待记录埋点
boutiqueDefaultCarBrandId: '',
viewKey: Date.now(),
boutiqueCarList:[],
receptionKey:Date.now(), //接待记录埋点KEY
defaultCarId:'',
customerKey:Date.now(), //客户信息KEY
currentCarInfo:{},//当前选中的车品牌车系
boutiqueCarList: [],
receptionKey: Date.now(), //接待记录埋点KEY
defaultCarId: '',
customerKey: Date.now(), //客户信息KEY
currentCarInfo: {},//当前选中的车品牌车系
};
},
mutations: {
......@@ -60,7 +62,12 @@ export default {
phoneNumber: "",
salesUuid: "",
staffName: "",
newCarFare: ''
newCarFare: '',
carModelId: '',
carBuyers: '',
carPurchaseMethod: '',
oneCarBrand: '',
oneCarBrandId: ''
};
uni.$storage.set("customerInfo", JSON.stringify(info));
state.customerInfo = info
......@@ -98,7 +105,7 @@ export default {
state.receptionTrack = {}
state.receptionKey = Date.now()
},
updateViewKey({ state }){
updateViewKey ({ state }) {
state.viewKey = Date.now();
},
......
......@@ -19,15 +19,42 @@ class DBManager {
db_table_name = 'records'
db_description = 'zyzs db'
db_size = 50 * 1024 * 1024
table_columns = [`id TEXT PRIMARY KEY`, `staffUuid TEXT`, `staffName TEXT`, `serviceMerchantId INTEGER`, 'carModel TEXT', 'endReasonType INTEGER', 'customerName TEXT', 'phoneNumber TEXT', 'appCode TEXT', 'loginPhone TEXT', 'salesName TEXT', 'salesUuid TEXT', 'receptionStatus INTEGER', 'receptionStartTime TEXT', 'receptionEndTime TEXT', 'receptionCustomerPaySourceList TEXT', 'merchantId INTEGER', 'merchantName TEXT', 'bussinessType INTEGER', 'channelType INTEGER', 'receptionCustomerMaterialPointList TEXT', 'recordUrlList TEXT']
table_columns = [
`id TEXT PRIMARY KEY`,
`staffUuid TEXT`,
`staffName TEXT`,
`serviceMerchantId INTEGER`,
'carModel TEXT',
'endReasonType INTEGER',
'customerName TEXT',
'phoneNumber TEXT',
'appCode TEXT',
'loginPhone TEXT',
'salesName TEXT',
'salesUuid TEXT',
'receptionStatus INTEGER',
'receptionStartTime TEXT',
'receptionEndTime TEXT',
'receptionCustomerPaySourceList TEXT',
'merchantId INTEGER',
'merchantName TEXT',
'bussinessType INTEGER',
'channelType INTEGER',
'receptionCustomerMaterialPointList TEXT',
'recordUrlList TEXT',
'carBrand TEXT',
'carBrandId INTEGER',
'oneCarBrand TEXT',
'oneCarBrandId INTEGER'
]
sqlite = null
isTableExists = false
constructor(table_name, table_columns) {
constructor(table_name, table_columns) {
this.table_name = table_name || this.db_table_name
this.table_columns = table_columns || this.table_columns
this.db = new SQLite(this.db_name, this.db_version, this.db_description, this.db_size)
}
async init() {
async init () {
try {
const isOpen = await this.db.isOpen()
if (!isOpen) {
......@@ -43,8 +70,8 @@ class DBManager {
throw new Error(error.message)
}
}
async openDB(){
async openDB () {
}
/**
* 将一条新记录添加到当前对象的记录列表中
......@@ -52,7 +79,7 @@ class DBManager {
* @param {Object} record - 要添加的新记录对象
* @returns {Array} - 包含新记录的更新后的记录列表
*/
async addRecord(record) {
async addRecord (record) {
await this.db.insert(this.table_name, record)
}
/**
......@@ -61,7 +88,7 @@ class DBManager {
* @param {number} id - 要移除的记录的ID
* @returns {Array} - 移除记录后的更新后的记录列表
*/
async removeRecord(id) {
async removeRecord (id) {
return this.db.delete(this.table_name, { id })
}
/**
......@@ -71,7 +98,7 @@ class DBManager {
* @returns {Object} - 具有给定 ID 的记录对象,如果没有找到符合条件的记录,则返回 undefined
*
*/
async getRecordById(id) {
async getRecordById (id) {
const records = await this.db.select(this.table_name, { id })
return Array.isArray(records) ? records[0] : records // sqlite 返回数组
}
......@@ -80,7 +107,7 @@ class DBManager {
*
* @returns {Array} - 从 storageApi 获取的记录列表
*/
async getRecords() {
async getRecords () {
return this.db.select(this.table_name)
}
/**
......@@ -89,7 +116,7 @@ class DBManager {
* @param {Array} records - 要设置的记录列表
* @returns {void} - 此函数不返回任何值
*/
async setRecords(records) {
async setRecords (records) {
return records.forEach(async record => {
this.addRecord(record)
})
......@@ -102,17 +129,17 @@ class DBManager {
* @param {Object} record - 要更新的记录对象,必须包含一个唯一的 id 属性
* @throws {Error} 如果记录数组中找不到具有给定 id 的记录,将抛出错误
*/
async updateRecord(setData, where) {
async updateRecord (setData, where) {
const { id, ...record } = setData
if (!where) {
where = { id }
}
return this.db.update(this.table_name, record, where)
}
async isOpen() {
async isOpen () {
return this.db.isOpen()
}
async isTableExists() {
async isTableExists () {
return this.db.isTableExists(this.table_name)
}
/**
......@@ -120,10 +147,10 @@ class DBManager {
*
* @returns {void} - 此函数不返回任何值
*/
async clearRecords() {
async clearRecords () {
this.db.delete(this.table_name)
}
async drop() {
async drop () {
this.db.drop(this.table_name)
}
}
......
......@@ -28,6 +28,11 @@ export default class RecordDto {
bussinessType = 0 // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
channelType = 1 //1问界 2 比亚迪 3 其他
receptionCustomerMaterialPointList = []
carBrand = ''
carBrandId = ''
oneCarBrand = ''
oneCarBrandId = ''
constructor(options) {
Object.assign(this, options)
}
......
......@@ -9,7 +9,35 @@
*/
import DBManager from '../DBManager.js'
class DBRecord {
table_columns = [`id TEXT PRIMARY KEY`, `staffUuid TEXT`, `staffName TEXT`, `serviceMerchantId INTEGER`, 'carModel TEXT', 'endReasonType INTEGER', 'customerName TEXT', 'phoneNumber TEXT', 'appCode TEXT', 'loginPhone TEXT', 'salesName TEXT', 'salesUuid TEXT', 'receptionStatus INTEGER', 'receptionStartTime TEXT', 'receptionEndTime TEXT', 'receptionCustomerPaySourceList TEXT', 'merchantId INTEGER', 'merchantName TEXT', 'bussinessType INTEGER', 'channelType INTEGER', 'receptionCustomerMaterialPointList TEXT', 'recordUrlList TEXT', 'tempFilePath TEXT']
table_columns = [
`id TEXT PRIMARY KEY`,
`staffUuid TEXT`,
`staffName TEXT`,
`serviceMerchantId INTEGER`,
'carModel TEXT',
'endReasonType INTEGER',
'customerName TEXT',
'phoneNumber TEXT',
'appCode TEXT',
'loginPhone TEXT',
'salesName TEXT',
'salesUuid TEXT',
'receptionStatus INTEGER',
'receptionStartTime TEXT',
'receptionEndTime TEXT',
'receptionCustomerPaySourceList TEXT',
'merchantId INTEGER',
'merchantName TEXT',
'bussinessType INTEGER',
'channelType INTEGER',
'receptionCustomerMaterialPointList TEXT',
'recordUrlList TEXT',
'tempFilePath TEXT',
'carBrand TEXT',
'carBrandId INTEGER',
'oneCarBrand TEXT',
'oneCarBrandId INTEGER'
]
table_name = 'temp_records'
constructor() {
this.db = new DBManager(this.table_name, this.table_columns)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!