Commit 3e4bbf38 by 李伟康

commit 场景集市

1 parent f6b6f700
...@@ -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

2.42 MB | W: | H:

2.42 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -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
<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
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ 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,
......
<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">
...@@ -26,11 +55,12 @@ export default { ...@@ -26,11 +55,12 @@ export default {
return { return {
title: '', title: '',
sourceType: '', sourceType: '',
detailUrl: '' detailUrl: '',
AIUrl: ''
} }
}, },
watch:{ watch: {
show:{ show: {
immediate: true, immediate: true,
handler (n) { handler (n) {
if (n) { if (n) {
...@@ -53,15 +83,70 @@ export default { ...@@ -53,15 +83,70 @@ export default {
}, },
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
if (specialFlag == 1) this.getAiagent(options)
}, },
back () { back () {
if (this.isComponents) this.$emit('previewBack') if (this.isComponents) this.$emit('previewBack')
else uni.navigateBack() else uni.navigateBack()
}, },
async getAiagent (options) {
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],
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 () {
//修改UA为PC端
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
const [wv1] = currentWebview.children()
let wv1Flag = false
if (wv1) {
wv1.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
});
wv2Flag = true; // 成功设置样式
}
return wv1Flag
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
}
} }
} }
</script> </script>
...@@ -112,5 +197,24 @@ export default { ...@@ -112,5 +197,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,6 +163,15 @@ ...@@ -162,6 +163,15 @@
</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">
...@@ -186,10 +196,11 @@ export default { ...@@ -186,10 +196,11 @@ export default {
caseObject: {}, caseObject: {},
imgLength: 0, imgLength: 0,
contentScrollNumber: 0, contentScrollNumber: 0,
AIUrl: '',
} }
}, },
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,6 +403,60 @@ export default { ...@@ -391,6 +403,60 @@ export default {
this.imgLength -= 1 this.imgLength -= 1
if (this.imgLength == 0) uni.hideLoading() if (this.imgLength == 0) uni.hideLoading()
this.initScrollListTop() this.initScrollListTop()
},
async getAiagent (options) {
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],
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 () {
//修改UA为PC端
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
const [wv1] = currentWebview.children()
let wv1Flag = false
if (wv1) {
wv1.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
});
wv2Flag = true; // 成功设置样式
}
return wv1Flag
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
} }
} }
} }
...@@ -434,8 +500,8 @@ export default { ...@@ -434,8 +500,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 +583,9 @@ export default { ...@@ -517,9 +583,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 +622,7 @@ export default { ...@@ -556,7 +622,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 +642,24 @@ export default { ...@@ -576,5 +642,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 report from "@/mixin/report.js";
export default {
name: '',
mixins: [report],
data () {
return {
url: '',
viewerUrl: '/hybrid/html/web/viewer.html',
AIUrl: '',
title: ''
}
},
onLoad (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
})
},
async getAiagent (options) {
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],
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 () {
//修改UA为PC端
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
const [wv1, wv2] = currentWebview.children()
let wv1Flag = false,
wv2Flag = false
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; // 成功设置样式
}
return wv1Flag && wv2Flag
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 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,36 @@ ...@@ -88,25 +88,36 @@
@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"
class="webview"
></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 +157,11 @@ export default { ...@@ -146,10 +157,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 +169,6 @@ export default { ...@@ -157,8 +169,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 +300,7 @@ export default { ...@@ -290,6 +300,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 +352,50 @@ export default { ...@@ -341,17 +352,50 @@ 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%',
// margin: '0 0 1% 0'
}); });
return true; // 成功设置样式 return true; // 成功设置样式
} else { } else {
...@@ -370,6 +414,12 @@ export default { ...@@ -370,6 +414,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 +618,27 @@ export default { ...@@ -568,10 +618,27 @@ 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; overflow-y: auto;
padding: 0 toRpx(40); .AI-window {
width: 100%;
.AI-title {
height: 96rpx;
font-size: 36rpx;
font-weight: 500;
justify-content: center;
color: #333333;
}
.webview {
iframe {
border-radius: 0 0 32rpx 32rpx;
overflow: hidden;
}
}
}
.nothing { .nothing {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!