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' ...@@ -5,6 +5,7 @@ import boutiqueApi from './boutique'
import customerApi from './customerApi' import customerApi from './customerApi'
import pointApi from './point' import pointApi from './point'
import receptionApi from './receptionApi' import receptionApi from './receptionApi'
import sceneMarketApi from './sceneMarketApi'
module.exports = { module.exports = {
commonApi, commonApi,
systemApi, systemApi,
...@@ -12,5 +13,6 @@ module.exports = { ...@@ -12,5 +13,6 @@ module.exports = {
boutiqueApi, boutiqueApi,
customerApi, customerApi,
pointApi, 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 newline at end of file
No preview for this file type
...@@ -123,6 +123,7 @@ export default { ...@@ -123,6 +123,7 @@ export default {
carBrandList = []; carBrandList = [];
list?.map((e) => { list?.map((e) => {
e.childs.map((i) => { e.childs.map((i) => {
i.brandName = e.name
i.brandId = e.id; i.brandId = e.id;
carBrandList.push(i); carBrandList.push(i);
}); });
...@@ -199,7 +200,12 @@ export default { ...@@ -199,7 +200,12 @@ export default {
handleSelect (item) { handleSelect (item) {
const customerInfo = this.$store.state.user.customerInfo, const customerInfo = this.$store.state.user.customerInfo,
{ selectItem, linkage } = this { selectItem, linkage } = this
customerInfo.carBrand = selectItem.carChildsBrandName Object.assign(customerInfo, {
carBrand: selectItem.carChildsBrandName,
carBrandId: selectItem.carChildsBrandId,
oneCarBrand: selectItem.carBrand,
oneCarBrandId: selectItem.carBrandId
})
if (linkage) { if (linkage) {
this.$store.dispatch('setCustomerInfo', customerInfo) this.$store.dispatch('setCustomerInfo', customerInfo)
this.$store.dispatch('updateViewKey') this.$store.dispatch('updateViewKey')
......
...@@ -136,7 +136,6 @@ export default { ...@@ -136,7 +136,6 @@ export default {
} }
}, },
mounted(options) { mounted(options) {
console.log('Calendar.adsfads')
this.init() this.init()
}, },
methods: { methods: {
...@@ -185,9 +184,8 @@ export default { ...@@ -185,9 +184,8 @@ export default {
const params = this.getParams() const params = this.getParams()
const res = await uni.$api.pointApi.newCalendar(params) const res = await uni.$api.pointApi.newCalendar(params)
if (res) { if (res) {
console.log(this.dates, 'dates')
this.dates.forEach(item => { 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 && (this.currentInfo.month < this.defaultMonth || clockData.day < this.currentInfo.day)) {
if (clockData.dayState == 4) clockData.isDefault = true if (clockData.dayState == 4) clockData.isDefault = true
clockData.clockInTime1 = clockData.clockInTime ? dayjs(new Date(clockData.clockInTime)).format('HH:mm') : null clockData.clockInTime1 = clockData.clockInTime ? dayjs(new Date(clockData.clockInTime)).format('HH:mm') : null
...@@ -202,7 +200,6 @@ export default { ...@@ -202,7 +200,6 @@ export default {
}) })
} }
}) })
console.log(this.clockInDateList)
} }
}, },
/** 申诉记录 */ /** 申诉记录 */
...@@ -210,7 +207,6 @@ export default { ...@@ -210,7 +207,6 @@ export default {
const params = this.getParams() const params = this.getParams()
params.pageSize = 40 params.pageSize = 40
const res = await uni.$api.pointApi.getAppealList(params) const res = await uni.$api.pointApi.getAppealList(params)
console.log(res)
this.recordList = res.list this.recordList = res.list
}, },
// 切换月份 // 切换月份
......
...@@ -202,7 +202,7 @@ export default { ...@@ -202,7 +202,7 @@ export default {
let _this = this let _this = this
uni.$api.commonApi.getUnreadCount({}).then(res => { uni.$api.commonApi.getUnreadCount({}).then(res => {
this.readCount = res.data this.readCount = res.data
setTimeout(() => { if (res.data) setTimeout(() => {
utils.getViewInfo('.tip-box', info => { utils.getViewInfo('.tip-box', info => {
_this.$emit('showReadCountTips', { _this.$emit('showReadCountTips', {
style: `display:block;opacity:1;top: ${info.top}px; left: ${info.left}px;`, style: `display:block;opacity:1;top: ${info.top}px; left: ${info.left}px;`,
......
...@@ -32,7 +32,6 @@ export default { ...@@ -32,7 +32,6 @@ export default {
dataShow: { dataShow: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
console.log(123)
this.getServerData() this.getServerData()
} }
} }
......
...@@ -43,7 +43,6 @@ export default { ...@@ -43,7 +43,6 @@ export default {
watchCustomerInfo: { watchCustomerInfo: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
console.log(newval)
this.id = newval.receptionScene this.id = newval.receptionScene
} }
}, },
......
...@@ -38,23 +38,10 @@ ...@@ -38,23 +38,10 @@
</view> </view>
</view> </view>
<view class="right box-class"> <view class="right box-class">
<view class="type-box"> <type-tab-component
<view :typeList="typeList"
class="tab-item" :tabIndex.sync="tabIndex"
v-for="(i, index) in typeList" ></type-tab-component>
: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>
<view :class="['right-content',`${tabIndex != 0?'hide-record':'show-record'}`]"> <view :class="['right-content',`${tabIndex != 0?'hide-record':'show-record'}`]">
<customer-file <customer-file
@showSuccess="$refs.successRef.open()" @showSuccess="$refs.successRef.open()"
...@@ -108,6 +95,7 @@ import RecordList from './RecordList.vue' ...@@ -108,6 +95,7 @@ import RecordList from './RecordList.vue'
import saveRecord from './saveRecord.vue' import saveRecord from './saveRecord.vue'
import CustomerFile from './CustomerFile.vue' import CustomerFile from './CustomerFile.vue'
import CustomerInfo from './CustomerInfo.vue' import CustomerInfo from './CustomerInfo.vue'
import TypeTabComponent from '../../../TypeTabComponent.vue'
export default { export default {
components: { components: {
CustomerFlow, CustomerFlow,
...@@ -117,6 +105,7 @@ export default { ...@@ -117,6 +105,7 @@ export default {
saveRecord, saveRecord,
CustomerFile, CustomerFile,
CustomerInfo, CustomerInfo,
TypeTabComponent
}, },
name: '', name: '',
...@@ -132,8 +121,6 @@ export default { ...@@ -132,8 +121,6 @@ export default {
{ tabName: '客户预录' }, { tabName: '客户预录' },
{ tabName: '接待复盘' }, { tabName: '接待复盘' },
]), ]),
firstLeft: Object.freeze(['first', 'second']),
firstClass: Object.freeze(['first-nav', 'second-nav']),
showInfo: false, showInfo: false,
customerId: '', customerId: '',
pageData: { pageData: {
...@@ -267,15 +254,6 @@ export default { ...@@ -267,15 +254,6 @@ export default {
} }
.right { .right {
width: toRpx(1354); 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 { &-content {
width: 100%; width: 100%;
position: absolute; position: absolute;
...@@ -284,57 +262,6 @@ export default { ...@@ -284,57 +262,6 @@ export default {
height: calc(100% - #{toRpx(128)}); height: calc(100% - #{toRpx(128)});
transform: translateY(toMinusRpx(32)); 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 { .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 \ 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 \ No newline at end of file
<template> <template>
<div> <view class="scene-market-box">
</div> <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> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { import TypeTabComponent from '../../../TypeTabComponent.vue'
import SceneList from './compontens/SceneList.vue'
export default {
components: {
TypeTabComponent,
SceneList
},
name: '', name: '',
data () { data () {
return { return {
typeList: [],
tabIndex: -1,
tagId: '',
requestParams: {}
}
},
computed: {
sceneListRef () {
return this.$refs.sceneListRef
},
sceneMarketLevelTwoList () {
return this.typeList[this.tabIndex]?.sceneMarketLevelTwoList || []
},
sceneMarketLevelTwoItem () {
return this.sceneMarketLevelTwoList.find(e => e.id == this.tagId)
} }
}, },
mounted () { mounted () {
this.getSceneMarketMaterialMenu()
}, },
methods: { 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> </script>
<style scoped lang='scss'> <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> </style>
\ No newline at end of file \ No newline at end of file
...@@ -42,6 +42,14 @@ ...@@ -42,6 +42,14 @@
<view class="tool-box box-class"> <view class="tool-box box-class">
<view class="common-title">展业工具</view> <view class="common-title">展业工具</view>
<view class="content-box"> <view class="content-box">
<view class="developing flex">
<image
class="developing-icon"
src="../../assets/images/common/developing.webp"
/>
功能开发中
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -527,6 +535,16 @@ export default { ...@@ -527,6 +535,16 @@ export default {
position: relative; position: relative;
width: 100%; width: 100%;
height: calc(100% - #{toRpx(120)}); height: calc(100% - #{toRpx(120)});
.developing {
height: 100%;
flex-direction: column;
color: #999999;
font-size: 20rpx;
&-icon {
width: 344rpx;
height: 208rpx;
}
}
} }
.content-left, .content-left,
.content-right { .content-right {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
> >
<image <image
class="image-block" class="image-block"
:src="item.imgKey" :src="item.imgUrl"
@load="item.hide = true" @load="item.hide = true"
/> />
<view :class="['error-block',{hide:item.hide}]"> <view :class="['error-block',{hide:item.hide}]">
...@@ -150,10 +150,9 @@ export default { ...@@ -150,10 +150,9 @@ export default {
const dataIndex = index - 1 < 0 ? datalist.length - 1 : index - 1 const dataIndex = index - 1 < 0 ? datalist.length - 1 : index - 1
item.isIndex = dataIndex item.isIndex = dataIndex
item.isToor = index item.isToor = index
item.imgKey = datalist[dataIndex]?.[this.imgKey] || '' item.imgUrl = datalist[dataIndex]?.[this.imgKey] || ''
item.x = 0 item.x = 0
}) })
console.log(this.imagelist)
if (autoplay) this.autoPlayFunction() if (autoplay) this.autoPlayFunction()
}, },
autoPlayFunction () { autoPlayFunction () {
...@@ -187,6 +186,7 @@ export default { ...@@ -187,6 +186,7 @@ export default {
(item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1 (item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1
: (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1 : (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1
item.isToor = toor item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class item.class = list[toor].class
item.x = 0 item.x = 0
let isIndex = item.isIndex let isIndex = item.isIndex
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
if (isIndex < 0) isIndex = len if (isIndex < 0) isIndex = len
} }
item.isIndex = isIndex item.isIndex = isIndex
item.imgKey = datalist[isIndex][this.imgKey] || '' item.imgUrl = datalist[isIndex][this.imgKey] || ''
item.index = list[toor].index item.index = list[toor].index
}) })
let currentIndex = this.imagelist.findIndex(item => item.index == 1) 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 \ 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 loginMixin from './loginMixin'
import receptionTrackMixin from './receptionTrackMixin' import receptionTrackMixin from './receptionTrackMixin'
import aiUrlMixin from './aiUrlMixin'
import report from './report'
module.exports = { module.exports = {
loginMixin, loginMixin,
receptionTrackMixin receptionTrackMixin,
aiUrlMixin,
report
} }
...@@ -12,12 +12,12 @@ import utils from '@/utils/utils.js' ...@@ -12,12 +12,12 @@ import utils from '@/utils/utils.js'
import { storageApi } from '@/utils/cache' import { storageApi } from '@/utils/cache'
import permision from '@/js_sdk/wa-permission/permission.js' import permision from '@/js_sdk/wa-permission/permission.js'
export default { export default {
provide() { provide () {
return { return {
getRecorder: () => this.record getRecorder: () => this.record
} }
}, },
async mounted() { async mounted () {
this.audioManager = new AudioManager(this.onAudioStart, this.onAudioStop, this.onError) this.audioManager = new AudioManager(this.onAudioStart, this.onAudioStop, this.onError)
this.initDto() this.initDto()
this.record = new TempRecord(this.tempRecord, this.triggleTempNumber) this.record = new TempRecord(this.tempRecord, this.triggleTempNumber)
...@@ -34,31 +34,31 @@ export default { ...@@ -34,31 +34,31 @@ export default {
// }, // },
// deep: true // deep: true
// }, // },
customerKey:{ customerKey: {
handler() { handler () {
this.handler(this.customerInfo, this.updateCustomerInfo) this.handler(this.customerInfo, this.updateCustomerInfo)
}, },
deep: true deep: true
}, },
booksList: { booksList: {
handler(val) { handler (val) {
this.handler(val, this.updateBookList) this.handler(val, this.updateBookList)
} }
}, },
receptionStatus: { receptionStatus: {
handler(val) { handler (val) {
this.handler(val, this.updateReceptionStatus) this.handler(val, this.updateReceptionStatus)
} }
}, },
receptionKey: { receptionKey: {
handler(val) { handler (val) {
this.handler(this.receptionTrack, this.updateMaterialPointList) this.handler(this.receptionTrack, this.updateMaterialPointList)
} }
} }
}, },
computed: { computed: {
...mapState(['user.customerInfo']), ...mapState(['user.customerInfo']),
...mapGetters(['customerInfo', 'receptionStatus', 'booksList', 'receptionTrack', 'receptionKey','customerKey']) ...mapGetters(['customerInfo', 'receptionStatus', 'booksList', 'receptionTrack', 'receptionKey', 'customerKey'])
}, },
methods: { methods: {
...mapMutations('audio', ['setReceptionStatus', 'setBooks', 'setPerRecordNumber']), ...mapMutations('audio', ['setReceptionStatus', 'setBooks', 'setPerRecordNumber']),
...@@ -72,20 +72,20 @@ export default { ...@@ -72,20 +72,20 @@ export default {
this.audioManager.start() this.audioManager.start()
}, 300), }, 300),
initReception() { initReception () {
this.setBooks([]) this.setBooks([])
this.clearCustomerInfo() this.clearCustomerInfo()
this.setReceptionStatus('') this.setReceptionStatus('')
this.initTime() this.initTime()
}, },
async onAudioStart() { async onAudioStart () {
if (this.audioManager.counter === 0) { if (this.audioManager.counter === 0) {
await this.record.add() await this.record.add()
} else { } else {
this.record.addAudio() this.record.addAudio()
} }
}, },
async onAudioStop() { async onAudioStop () {
if (this.audioManager.isRecording) { if (this.audioManager.isRecording) {
uni.$logger.local.info('〖接待管理Recorder〗 == 接待中,再次开启录音! ') uni.$logger.local.info('〖接待管理Recorder〗 == 接待中,再次开启录音! ')
this.audioManager.start() this.audioManager.start()
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
uni.$logger.local.info('〖接待管理Recorder〗 == 断开录音! ') uni.$logger.local.info('〖接待管理Recorder〗 == 断开录音! ')
} }
}, },
onAudioError(error) { onAudioError (error) {
const message = error.message const message = error.message
this.reportError(`录音异常: error: ${message}`, message) this.reportError(`录音异常: error: ${message}`, message)
}, },
...@@ -102,12 +102,12 @@ export default { ...@@ -102,12 +102,12 @@ export default {
* @params {boolean} status true 不保存记录/AUDIO_STATUS.ABNORMAL 只要断开录音 * @params {boolean} status true 不保存记录/AUDIO_STATUS.ABNORMAL 只要断开录音
* @returns {void} * @returns {void}
*/ */
async stopAudio(isNotSave = false) { async stopAudio (isNotSave = false) {
uni.$logger.local.info('〖接待管理Recorder〗 == 结束接待! ') uni.$logger.local.info('〖接待管理Recorder〗 == 结束接待! ')
this.stop() this.stop()
await this.saveAndClearRecord(isNotSave) await this.saveAndClearRecord(isNotSave)
}, },
async saveAndClearRecord(isNotSave = false) { async saveAndClearRecord (isNotSave = false) {
if (isNotSave) { if (isNotSave) {
uni.$logger.local.info('〖接待管理Recorder〗 == 不保存记录! ') uni.$logger.local.info('〖接待管理Recorder〗 == 不保存记录! ')
return this.record.clearLocalRecord() return this.record.clearLocalRecord()
...@@ -116,24 +116,24 @@ export default { ...@@ -116,24 +116,24 @@ export default {
//如果不需要保存记录 //如果不需要保存记录
await this.record.save() await this.record.save()
}, },
stop() { stop () {
this.endWatchClick() this.endWatchClick()
this.record.clearLoopTimer() this.record.clearLoopTimer()
if (this.audioManager.isRecording) { if (this.audioManager.isRecording) {
this.audioManager.stop() this.audioManager.stop()
} }
}, },
handler(params, fn) { handler (params, fn) {
if (this.audioManager.isRecording || this.record?.currentRecord?.endReasonType == 1) { if (this.audioManager.isRecording || this.record?.currentRecord?.endReasonType == 1) {
fn.call(this, params) fn.call(this, params)
} }
}, },
reset() { reset () {
this.audioManager = null this.audioManager = null
this.record = null this.record = null
this.tempRecord = null this.tempRecord = null
}, },
initDto() { initDto () {
const { shopMerchantId, phone, sceneType, uuid, name, merchantId, channelType, merchantName } = storageApi.getUserInfo() const { shopMerchantId, phone, sceneType, uuid, name, merchantId, channelType, merchantName } = storageApi.getUserInfo()
const { deviceId: appCode } = uni.getDeviceInfo() const { deviceId: appCode } = uni.getDeviceInfo()
const dto = new RecordDto({ const dto = new RecordDto({
...@@ -146,22 +146,26 @@ export default { ...@@ -146,22 +146,26 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
merchantName, merchantName,
bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改 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.sceneType = sceneType
this.tempRecord = dto this.tempRecord = dto
}, },
updateCustomerInfo(customerInfo = {}) { updateCustomerInfo (customerInfo = {}) {
const { customerName, phoneNumber, salesUuid, carModel, staffName: salesName } = customerInfo const { customerName, phoneNumber, salesUuid, carModel, staffName: salesName, carBrand, carBrandId, oneCarBrand, oneCarBrandId } = customerInfo
this.record.updatePreRecords({ this.record.updatePreRecords({
customerName, customerName,
phoneNumber, phoneNumber,
carModel, carModel,
salesUuid, salesUuid,
salesName salesName,
carBrand,
carBrandId,
oneCarBrand,
oneCarBrandId
}) })
}, },
updateBookList(booksList) { updateBookList (booksList) {
const receptionCustomerPaySourceList = booksList.map(item => { const receptionCustomerPaySourceList = booksList.map(item => {
return { return {
id: item.id, id: item.id,
...@@ -171,7 +175,7 @@ export default { ...@@ -171,7 +175,7 @@ export default {
}) })
this.record.updatePreRecords({ receptionCustomerPaySourceList }) this.record.updatePreRecords({ receptionCustomerPaySourceList })
}, },
updateMaterialPointList(receptionTrack) { updateMaterialPointList (receptionTrack) {
const { merchantId, staffUuid, staffName } = this.tempRecord const { merchantId, staffUuid, staffName } = this.tempRecord
let receptionCustomerMaterialPointList = [] let receptionCustomerMaterialPointList = []
Object.keys(receptionTrack).map(key => { Object.keys(receptionTrack).map(key => {
...@@ -185,17 +189,17 @@ export default { ...@@ -185,17 +189,17 @@ export default {
}) })
this.record.updatePreRecords({ receptionCustomerMaterialPointList }) this.record.updatePreRecords({ receptionCustomerMaterialPointList })
}, },
updateReceptionStatus(status) { updateReceptionStatus (status) {
this.record.updatePreRecords({ receptionStatus: status }) this.record.updatePreRecords({ receptionStatus: status })
}, },
getRecorder() { getRecorder () {
return this.record return this.record
}, },
async triggleTempNumber() { async triggleTempNumber () {
const _records = await this.record.getRecords() const _records = await this.record.getRecords()
this.setPerRecordNumber(_records.length) this.setPerRecordNumber(_records.length)
}, },
async isPermission(hintText = '为了记录语音通话,请打开录音权限') { async isPermission (hintText = '为了记录语音通话,请打开录音权限') {
const result = await permision.requestAndroidPermission('android.permission.RECORD_AUDIO') const result = await permision.requestAndroidPermission('android.permission.RECORD_AUDIO')
await helpler.sleep(0) await helpler.sleep(0)
if (result !== 1) { if (result !== 1) {
...@@ -206,13 +210,13 @@ export default { ...@@ -206,13 +210,13 @@ export default {
} }
return result === 1 return result === 1
}, },
async checkBeforeStart() { async checkBeforeStart () {
const isPermission = await this.isPermission() const isPermission = await this.isPermission()
const isRecording = this.audioManager.isRecording const isRecording = this.audioManager.isRecording
return isPermission && !isRecording return isPermission && !isRecording
} }
}, },
beforeDestroy() { beforeDestroy () {
this.stop() this.stop()
this.reset() this.reset()
} }
......
...@@ -3,7 +3,7 @@ export default { ...@@ -3,7 +3,7 @@ export default {
return { return {
goodsId: '', goodsId: '',
visitsId: '', visitsId: '',
source: 1 source: ''
} }
}, },
onLoad (options) { onLoad (options) {
...@@ -15,22 +15,22 @@ export default { ...@@ -15,22 +15,22 @@ export default {
methods: { methods: {
addRecord () { addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo') const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
if(!merchantId) return if (!merchantId || !this.goodsId) return
const params = { const params = {
goodsId: this.goodsId, goodsId: this.goodsId,
goodsType: 0, goodsType: 0,
merchantId, merchantId,
merchantName, merchantName,
searchSource: this.source
} }
if (this.visitsId) params.visitsId = this.visitsId if (this.visitsId) params.visitsId = this.visitsId
if (this.source) params.searchSource = this.source
uni.$api.commonApi.addRecord(params).then(res => { uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res this.addId = res
}) })
} }
}, },
onUnload () { onUnload () {
if(!this.addId) return if (!this.addId) return
const params = { const params = {
id: this.addId id: this.addId
} }
......
...@@ -177,11 +177,17 @@ ...@@ -177,11 +177,17 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/common/materialDetail/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "生意助手", "navigationBarTitleText": "展业助手",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8",
"pageOrientation": "landscape", "pageOrientation": "landscape",
......
<template> <template>
<view class="popup-box" v-if="popupShow"> <view
class="popup-box"
v-if="popupShow"
>
<view class="nav-bar"> <view class="nav-bar">
<view class="back" @click="back"> <view
<uni-icons type="left" :size="20" color="#fff"></uni-icons> class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#fff"
></uni-icons>
</view> </view>
<view class="title">{{ title }}</view> <view class="title">{{ title }}</view>
</view> </view>
<view class="popup-body"> <view :class="['popup-body',{'has-ai':AIUrl}]">
<video ref="videoPlayer" :src="detailUrl" controls v-if="sourceType == 2"></video> <video
<view class="img-detail" v-else> ref="videoPlayer"
<image @click="back" :src="detailUrl" mode="heightFix" /> :src="detailUrl"
controls
v-if="sourceType == 2"
></video>
<view
class="img-detail"
v-else
>
<image
@click="back"
:src="detailUrl"
mode="heightFix"
/>
</view> </view>
</view> </view>
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">场景二拓</view>
<web-view :src="AIUrl"></web-view>
</view>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import report from "@/mixin/report.js"; import { aiUrlMixin, report } from '@/mixin/index.js'
export default { export default {
mixins: [report, aiUrlMixin],
props: { props: {
isComponents: Boolean, isComponents: Boolean,
show: Boolean, show: Boolean,
...@@ -26,11 +57,12 @@ export default { ...@@ -26,11 +57,12 @@ export default {
return { return {
title: '', title: '',
sourceType: '', sourceType: '',
detailUrl: '' detailUrl: '',
} }
}, },
watch:{ watch: {
show:{ show: {
immediate: true, immediate: true,
handler (n) { handler (n) {
if (n) { if (n) {
...@@ -47,16 +79,17 @@ export default { ...@@ -47,16 +79,17 @@ export default {
return status return status
}, },
}, },
mixins: [report],
onLoad (options) { onLoad (options) {
this.init(options) this.init(options)
}, },
methods: { methods: {
init (options) { init (options) {
const { tabName, sourceType, detailUrl } = options const { tabName, sourceType, detailUrl, specialFlag } = options
this.title = tabName this.title = tabName
this.sourceType = sourceType this.sourceType = sourceType
this.detailUrl = detailUrl this.detailUrl = detailUrl
options.title = tabName
if (specialFlag == 1) this.getAiagent(options)
}, },
back () { back () {
if (this.isComponents) this.$emit('previewBack') if (this.isComponents) this.$emit('previewBack')
...@@ -112,5 +145,24 @@ export default { ...@@ -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> </style>
<template> <template>
<view class="case-layout">
<view class="case-box"> <view class="case-box">
<view class="nav-bar"> <view class="nav-bar">
<view <view
...@@ -13,7 +14,7 @@ ...@@ -13,7 +14,7 @@
</view> </view>
{{ caseObject.title }} {{ caseObject.title }}
</view> </view>
<view class="case-content"> <view :class="['case-content',{'has-ai':AIUrl}]">
<view class="left-menu"> <view class="left-menu">
<view class="title">方案目录</view> <view class="title">方案目录</view>
<scroll-view <scroll-view
...@@ -162,18 +163,28 @@ ...@@ -162,18 +163,28 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">场景二拓</view>
<web-view :src="AIUrl"></web-view>
</view>
</view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import AudioComponent from './components/AudioComponent.vue' import AudioComponent from './components/AudioComponent.vue'
import report from "@/mixin/report.js"; import { aiUrlMixin, report } from '@/mixin/index.js'
let view_padding_top = 88, let view_padding_top = 88,
menuHeight = 68 menuHeight = 68
export default { export default {
components: { components: {
AudioComponent AudioComponent
}, },
mixins: [report], mixins: [report, aiUrlMixin],
data () { data () {
return { return {
detailInfo: [], detailInfo: [],
...@@ -189,7 +200,7 @@ export default { ...@@ -189,7 +200,7 @@ export default {
} }
}, },
onLoad (options) { onLoad (options) {
this.getMaterialDetail(options.id) this.getMaterialDetail(options)
}, },
watch: { watch: {
currentId (n) { currentId (n) {
...@@ -205,17 +216,18 @@ export default { ...@@ -205,17 +216,18 @@ export default {
}, },
methods: { methods: {
async getMaterialDetail (id) { async getMaterialDetail (options) {
try { try {
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
const res = await uni.$api.customerApi.getMaterialDetail({ const res = await uni.$api.customerApi.getMaterialDetail({
id id: options.id
}) })
let detailInfo = [] let detailInfo = []
, imgLength = 0 , imgLength = 0
this.caseObject = res this.caseObject = res
if (options.specialFlag == 1) this.getAiagent(res)
res.richTextInfoList?.map(e => { res.richTextInfoList?.map(e => {
let imgList = [] let imgList = []
if (e.content) e.content = this.highlightText(e.content) if (e.content) e.content = this.highlightText(e.content)
...@@ -391,7 +403,7 @@ export default { ...@@ -391,7 +403,7 @@ export default {
this.imgLength -= 1 this.imgLength -= 1
if (this.imgLength == 0) uni.hideLoading() if (this.imgLength == 0) uni.hideLoading()
this.initScrollListTop() this.initScrollListTop()
} },
} }
} }
</script> </script>
...@@ -434,8 +446,8 @@ export default { ...@@ -434,8 +446,8 @@ export default {
.left-menu { .left-menu {
position: absolute; position: absolute;
top: 0; top: 0;
left: toRpx(64); left: 2.7;
width: toRpx(480); width: 20.4%;
height: toRpx(1296); height: toRpx(1296);
border-radius: toRpx(16); border-radius: toRpx(16);
background-color: #fff; background-color: #fff;
...@@ -517,9 +529,9 @@ export default { ...@@ -517,9 +529,9 @@ export default {
} }
} }
.right-content { .right-content {
width: calc(100% - #{toRpx(624)}); width: 73.4%;
height: 100%; height: 100%;
margin-left: toRpx(624); margin-left: 26.6%;
/deep/.uni-scroll-view-content { /deep/.uni-scroll-view-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -556,7 +568,7 @@ export default { ...@@ -556,7 +568,7 @@ export default {
word-wrap: break-word; word-wrap: break-word;
} }
.picture { .picture {
width: toRpx(1360); width: 78.9%;
margin: 0 auto toRpx(24); margin: 0 auto toRpx(24);
min-height: toRpx(100); min-height: toRpx(100);
} }
...@@ -576,5 +588,24 @@ export default { ...@@ -576,5 +588,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> </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 \ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view <view
:class="['classify-item flex',{active: index == activeIndex}]" :class="['classify-item flex',{active: index == activeIndex}]"
:key="index" :key="index"
@click="activeIndex = index" @click="tabClick(item,index)"
> >
<view class="title">{{item.tagGroupName}}</view> <view class="title">{{item.tagGroupName}}</view>
<view class="score">{{item.formatScore}}</view> <view class="score">{{item.formatScore}}</view>
...@@ -121,6 +121,10 @@ export default { ...@@ -121,6 +121,10 @@ export default {
this.$emit('onPlay') this.$emit('onPlay')
this.$emit('changeOperate', false) this.$emit('changeOperate', false)
} }
},
tabClick (item, index) {
this.activeIndex = index
this.$emit('tabClick', item)
} }
} }
} }
......
...@@ -88,25 +88,33 @@ ...@@ -88,25 +88,33 @@
@onPlay="onPlay" @onPlay="onPlay"
@onPause="onPause" @onPause="onPause"
@changeOperate="isOperate = $event" @changeOperate="isOperate = $event"
@tabClick="tabClick"
/> />
</view> </view>
</view> </view>
</view> </view>
<view class="reception-right-box"> <view class="reception-right-box">
<!-- <template v-if="qualityData.length"> <view
<tags :batchId="pageData.batchId" /> class="AI-window"
<quality-table :qualityData="qualityData" /> v-if="AIUrl"
</template> >
<view class="AI-title flex">AI导师</view>
<web-view :src="AIUrl"></web-view>
</view>
<template v-else> <template v-else>
<view class="nothing flex"> <view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view> <view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等... 分析中,稍等...
</view> </view>
</template> --> </template>
<!-- <template v-if="qualityData.length">
<tags :batchId="pageData.batchId" />
<quality-table :qualityData="qualityData" />
</template>-->
</view> </view>
</view> </view>
</template> </template>
<web-view :src="AIUrl"></web-view>
</view> </view>
</template> </template>
...@@ -146,10 +154,11 @@ export default { ...@@ -146,10 +154,11 @@ export default {
status: 'pause', status: 'pause',
isOperate: true, isOperate: true,
showPlayControl: false, showPlayControl: false,
AIUrl: 'https://www.baidu.com' AIUrl: '',
wv: null
} }
}, },
onLoad (options) { onLoad () {
let _this = this let _this = this
this.getOpenerEventChannel().on('getData', function (data) { this.getOpenerEventChannel().on('getData', function (data) {
console.log(data) console.log(data)
...@@ -157,8 +166,6 @@ export default { ...@@ -157,8 +166,6 @@ export default {
_this.pageData = data || {} _this.pageData = data || {}
if (data.batchId) _this.findCheckResultByBatchId(data.batchId) if (data.batchId) _this.findCheckResultByBatchId(data.batchId)
_this.setAudio(data.recordingUrl) _this.setAudio(data.recordingUrl)
_this.setWebviewStyle()
}) })
}, },
onHide () { onHide () {
...@@ -290,6 +297,7 @@ export default { ...@@ -290,6 +297,7 @@ export default {
}] }]
}) })
this.qualityData = res this.qualityData = res
this.getAiagent(res[0])
}, },
desensitizePhoneNumber (phoneNumber) { desensitizePhoneNumber (phoneNumber) {
return phoneNumber.replace(phoneNumber.slice(3, 7), '****') return phoneNumber.replace(phoneNumber.slice(3, 7), '****')
...@@ -341,17 +349,49 @@ export default { ...@@ -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 () { setWebviewStyle () {
//修改UA为PC端 //修改UA为PC端
const setWebviewStyleWithRetry = () => { const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview() const currentWebview = this.$scope.$getAppWebview()
const wv = currentWebview.children()[0] const [wv] = currentWebview.children()
if (wv) { if (wv) {
this.wv = wv
wv.setStyle({ wv.setStyle({
left: '40.75%', left: '40.85%',
top: '10.4%', top: '16.65%',
height: '85.42%', height: '78.17%',
width: '56.52%' width: '56.52%',
}); });
return true; // 成功设置样式 return true; // 成功设置样式
} else { } else {
...@@ -370,6 +410,12 @@ export default { ...@@ -370,6 +410,12 @@ export default {
}; };
setTimeout(retrySetWebviewStyle, 100); setTimeout(retrySetWebviewStyle, 100);
},
tabClick (item) {
if (item.sumScore > item.score && this.wv) {
// item.tagGroupName
// this.wv.evalJS()
}
} }
} }
} }
...@@ -568,10 +614,23 @@ export default { ...@@ -568,10 +614,23 @@ export default {
width: toRpx(1326); width: toRpx(1326);
border-radius: toRpx(32); border-radius: toRpx(32);
opacity: 1; opacity: 1;
background: #ffffff; background: #f5f9ff;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; position: relative;
padding: 0 toRpx(40); .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 { .nothing {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -211,6 +211,12 @@ export default { ...@@ -211,6 +211,12 @@ export default {
if (this.id) this.setPageData() if (this.id) this.setPageData()
} }
}, },
id: {
immediate: true,
handler (newval) {
if(!this.pageToolList.length) this.pageToolList = this.toolList
}
}
// toolList: { // toolList: {
// immediate: true, // immediate: true,
// handler (newval) { // handler (newval) {
......
...@@ -115,6 +115,7 @@ export default { ...@@ -115,6 +115,7 @@ export default {
subBrandIdList = [] subBrandIdList = []
list?.map(e => { list?.map(e => {
e.childs.map(i => { e.childs.map(i => {
i.brandName = e.name
i.brandId = e.id i.brandId = e.id
carBrandList.push(i) carBrandList.push(i)
subBrandIdList.push(i.id) subBrandIdList.push(i.id)
......
...@@ -20,8 +20,10 @@ export default { ...@@ -20,8 +20,10 @@ export default {
staffName: "", staffName: "",
newCarFare: '', newCarFare: '',
carModelId: '', carModelId: '',
carBuyers:'', carBuyers: '',
carPurchaseMethod:'' carPurchaseMethod: '',
oneCarBrand: '',
oneCarBrandId: ''
}, },
historyStatus: Date.now(), historyStatus: Date.now(),
carBrands: [], carBrands: [],
...@@ -32,11 +34,11 @@ export default { ...@@ -32,11 +34,11 @@ export default {
receptionTrack: {}, //接待记录埋点 receptionTrack: {}, //接待记录埋点
boutiqueDefaultCarBrandId: '', boutiqueDefaultCarBrandId: '',
viewKey: Date.now(), viewKey: Date.now(),
boutiqueCarList:[], boutiqueCarList: [],
receptionKey:Date.now(), //接待记录埋点KEY receptionKey: Date.now(), //接待记录埋点KEY
defaultCarId:'', defaultCarId: '',
customerKey:Date.now(), //客户信息KEY customerKey: Date.now(), //客户信息KEY
currentCarInfo:{},//当前选中的车品牌车系 currentCarInfo: {},//当前选中的车品牌车系
}; };
}, },
mutations: { mutations: {
...@@ -60,7 +62,12 @@ export default { ...@@ -60,7 +62,12 @@ export default {
phoneNumber: "", phoneNumber: "",
salesUuid: "", salesUuid: "",
staffName: "", staffName: "",
newCarFare: '' newCarFare: '',
carModelId: '',
carBuyers: '',
carPurchaseMethod: '',
oneCarBrand: '',
oneCarBrandId: ''
}; };
uni.$storage.set("customerInfo", JSON.stringify(info)); uni.$storage.set("customerInfo", JSON.stringify(info));
state.customerInfo = info state.customerInfo = info
...@@ -98,7 +105,7 @@ export default { ...@@ -98,7 +105,7 @@ export default {
state.receptionTrack = {} state.receptionTrack = {}
state.receptionKey = Date.now() state.receptionKey = Date.now()
}, },
updateViewKey({ state }){ updateViewKey ({ state }) {
state.viewKey = Date.now(); state.viewKey = Date.now();
}, },
......
...@@ -19,7 +19,34 @@ class DBManager { ...@@ -19,7 +19,34 @@ class DBManager {
db_table_name = 'records' db_table_name = 'records'
db_description = 'zyzs db' db_description = 'zyzs db'
db_size = 50 * 1024 * 1024 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 sqlite = null
isTableExists = false isTableExists = false
constructor(table_name, table_columns) { constructor(table_name, table_columns) {
...@@ -27,7 +54,7 @@ class DBManager { ...@@ -27,7 +54,7 @@ class DBManager {
this.table_columns = table_columns || this.table_columns this.table_columns = table_columns || this.table_columns
this.db = new SQLite(this.db_name, this.db_version, this.db_description, this.db_size) this.db = new SQLite(this.db_name, this.db_version, this.db_description, this.db_size)
} }
async init() { async init () {
try { try {
const isOpen = await this.db.isOpen() const isOpen = await this.db.isOpen()
if (!isOpen) { if (!isOpen) {
...@@ -43,7 +70,7 @@ class DBManager { ...@@ -43,7 +70,7 @@ class DBManager {
throw new Error(error.message) throw new Error(error.message)
} }
} }
async openDB(){ async openDB () {
} }
/** /**
...@@ -52,7 +79,7 @@ class DBManager { ...@@ -52,7 +79,7 @@ class DBManager {
* @param {Object} record - 要添加的新记录对象 * @param {Object} record - 要添加的新记录对象
* @returns {Array} - 包含新记录的更新后的记录列表 * @returns {Array} - 包含新记录的更新后的记录列表
*/ */
async addRecord(record) { async addRecord (record) {
await this.db.insert(this.table_name, record) await this.db.insert(this.table_name, record)
} }
/** /**
...@@ -61,7 +88,7 @@ class DBManager { ...@@ -61,7 +88,7 @@ class DBManager {
* @param {number} id - 要移除的记录的ID * @param {number} id - 要移除的记录的ID
* @returns {Array} - 移除记录后的更新后的记录列表 * @returns {Array} - 移除记录后的更新后的记录列表
*/ */
async removeRecord(id) { async removeRecord (id) {
return this.db.delete(this.table_name, { id }) return this.db.delete(this.table_name, { id })
} }
/** /**
...@@ -71,7 +98,7 @@ class DBManager { ...@@ -71,7 +98,7 @@ class DBManager {
* @returns {Object} - 具有给定 ID 的记录对象,如果没有找到符合条件的记录,则返回 undefined * @returns {Object} - 具有给定 ID 的记录对象,如果没有找到符合条件的记录,则返回 undefined
* *
*/ */
async getRecordById(id) { async getRecordById (id) {
const records = await this.db.select(this.table_name, { id }) const records = await this.db.select(this.table_name, { id })
return Array.isArray(records) ? records[0] : records // sqlite 返回数组 return Array.isArray(records) ? records[0] : records // sqlite 返回数组
} }
...@@ -80,7 +107,7 @@ class DBManager { ...@@ -80,7 +107,7 @@ class DBManager {
* *
* @returns {Array} - 从 storageApi 获取的记录列表 * @returns {Array} - 从 storageApi 获取的记录列表
*/ */
async getRecords() { async getRecords () {
return this.db.select(this.table_name) return this.db.select(this.table_name)
} }
/** /**
...@@ -89,7 +116,7 @@ class DBManager { ...@@ -89,7 +116,7 @@ class DBManager {
* @param {Array} records - 要设置的记录列表 * @param {Array} records - 要设置的记录列表
* @returns {void} - 此函数不返回任何值 * @returns {void} - 此函数不返回任何值
*/ */
async setRecords(records) { async setRecords (records) {
return records.forEach(async record => { return records.forEach(async record => {
this.addRecord(record) this.addRecord(record)
}) })
...@@ -102,17 +129,17 @@ class DBManager { ...@@ -102,17 +129,17 @@ class DBManager {
* @param {Object} record - 要更新的记录对象,必须包含一个唯一的 id 属性 * @param {Object} record - 要更新的记录对象,必须包含一个唯一的 id 属性
* @throws {Error} 如果记录数组中找不到具有给定 id 的记录,将抛出错误 * @throws {Error} 如果记录数组中找不到具有给定 id 的记录,将抛出错误
*/ */
async updateRecord(setData, where) { async updateRecord (setData, where) {
const { id, ...record } = setData const { id, ...record } = setData
if (!where) { if (!where) {
where = { id } where = { id }
} }
return this.db.update(this.table_name, record, where) return this.db.update(this.table_name, record, where)
} }
async isOpen() { async isOpen () {
return this.db.isOpen() return this.db.isOpen()
} }
async isTableExists() { async isTableExists () {
return this.db.isTableExists(this.table_name) return this.db.isTableExists(this.table_name)
} }
/** /**
...@@ -120,10 +147,10 @@ class DBManager { ...@@ -120,10 +147,10 @@ class DBManager {
* *
* @returns {void} - 此函数不返回任何值 * @returns {void} - 此函数不返回任何值
*/ */
async clearRecords() { async clearRecords () {
this.db.delete(this.table_name) this.db.delete(this.table_name)
} }
async drop() { async drop () {
this.db.drop(this.table_name) this.db.drop(this.table_name)
} }
} }
......
...@@ -28,6 +28,11 @@ export default class RecordDto { ...@@ -28,6 +28,11 @@ export default class RecordDto {
bussinessType = 0 // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改 bussinessType = 0 // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
channelType = 1 //1问界 2 比亚迪 3 其他 channelType = 1 //1问界 2 比亚迪 3 其他
receptionCustomerMaterialPointList = [] receptionCustomerMaterialPointList = []
carBrand = ''
carBrandId = ''
oneCarBrand = ''
oneCarBrandId = ''
constructor(options) { constructor(options) {
Object.assign(this, options) Object.assign(this, options)
} }
......
...@@ -9,7 +9,35 @@ ...@@ -9,7 +9,35 @@
*/ */
import DBManager from '../DBManager.js' import DBManager from '../DBManager.js'
class DBRecord { 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' table_name = 'temp_records'
constructor() { constructor() {
this.db = new DBManager(this.table_name, this.table_columns) 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!