Commit d0cdb7a9 by 前端

Merge branch 'develop' into 'master'

上线合并

See merge request !345
2 parents 0132f569 e938f7b5
Showing 27 changed files with 805 additions and 97 deletions
...@@ -161,7 +161,8 @@ ...@@ -161,7 +161,8 @@
"pages/receptionRecords/receptionRecords", "pages/receptionRecords/receptionRecords",
"pages/aiCheck/redundance/redundance", "pages/aiCheck/redundance/redundance",
"pages/aiCheck/detail/detail", "pages/aiCheck/detail/detail",
"pages/receptionDetail/receptionDetail" "pages/receptionDetail/receptionDetail",
"pages/aiCheck/defense/defense"
] ]
}, },
{ {
......
...@@ -11,6 +11,17 @@ export default { ...@@ -11,6 +11,17 @@ export default {
false false
); );
}, },
//异议对话接口
objectionSparring(data = {}) {
return api.post(
"",
data,
[],
"/router/objection/sparring/1.0.0",
"AI",
false
);
},
//获取防守建议 //获取防守建议
defense(data = {}) { defense(data = {}) {
return api.post( return api.post(
...@@ -31,6 +42,16 @@ export default { ...@@ -31,6 +42,16 @@ export default {
"AI" "AI"
); );
}, },
//异议灵感调用接口
objectionInspiration(data = {}) {
return api.post(
"",
data,
[],
"/router/objection/inspiration/1.0.0",
"AI"
);
},
//异步函数,通过分析历史消息来获取改进建议和润色表达的提示。 //异步函数,通过分析历史消息来获取改进建议和润色表达的提示。
enhancement(data = {}) { enhancement(data = {}) {
return api.post( return api.post(
...@@ -42,6 +63,16 @@ export default { ...@@ -42,6 +63,16 @@ export default {
false false
); );
}, },
objectionEnhancement(data = {}) {
return api.post(
"",
data,
[],
"/router/objection/enhancement/1.0.0",
"AI",
false
);
},
//根据提供的历史消息、用户ID、批次ID和持续时间,获取销售能力模拟评测的结果,并将结果数据存储数据库。 //根据提供的历史消息、用户ID、批次ID和持续时间,获取销售能力模拟评测的结果,并将结果数据存储数据库。
scoring(data = {}) { scoring(data = {}) {
return api.post( return api.post(
...@@ -52,6 +83,15 @@ export default { ...@@ -52,6 +83,15 @@ export default {
"AI" "AI"
); );
}, },
objectionScoring(data = {}) {
return api.post(
"",
data,
[],
"/router/objection/scoring/1.0.0",
"AI"
);
},
getVoiceConfig(data = {}) { getVoiceConfig(data = {}) {
return api.post( return api.post(
"", "",
......
...@@ -197,6 +197,12 @@ export default { ...@@ -197,6 +197,12 @@ export default {
sparringCommit(data) { sparringCommit(data) {
return api.post("dj.api.carboutique.ai.sparring.detail.commit", data,[],"/rop-dj-pairexc/router"); return api.post("dj.api.carboutique.ai.sparring.detail.commit", data,[],"/rop-dj-pairexc/router");
}, },
behaviorSave(data) {
return api.post("dj.api.carboutique.ai.sparring.staff.behavior.save", data,[],"/rop-dj-pairexc/router");
},
objectionPage(data) {
return api.post("dj.api.carboutique.ai.sparring.objection.page", data,[],"/rop-dj-pairexc/router");
},
/** /**
* 获取客户角色 * 获取客户角色
*/ */
......
...@@ -317,7 +317,10 @@ Page({ ...@@ -317,7 +317,10 @@ Page({
sparringTaskId, sparringTaskId,
roleType, roleType,
step:sparringLink, step:sparringLink,
entry entry,
batch_id,
recordName,
objection_id:objectionId
} = this.data; } = this.data;
const { const {
merchantId, merchantId,
...@@ -367,9 +370,13 @@ Page({ ...@@ -367,9 +370,13 @@ Page({
carLifeApi carLifeApi
.sparringCommit({ .sparringCommit({
openId, openId,
objectionId,
sparringType:objectionId?2:1,
staffUuid: uuid, staffUuid: uuid,
recordName: recordName?recordName:'话术演练 · 驻店延保',
sparringTaskId: sparringTaskId || -1, sparringTaskId: sparringTaskId || -1,
roleType, roleType,
batchId:batch_id,
sparringDuration: sparringDuration * 1000, sparringDuration: sparringDuration * 1000,
yqMerchantId: merchantId, yqMerchantId: merchantId,
fluency, fluency,
...@@ -381,6 +388,7 @@ Page({ ...@@ -381,6 +388,7 @@ Page({
.then((res) => { .then((res) => {
const id = res.data.sparringRecordId const id = res.data.sparringRecordId
wx.$util.hideLoading() wx.$util.hideLoading()
this.behaviorSave(1)
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: ["WH1kEKtvU_RbHFu6_DRm3G9sqUhky_hZHjevxrz8GK8"], tmplIds: ["WH1kEKtvU_RbHFu6_DRm3G9sqUhky_hZHjevxrz8GK8"],
success(res) { success(res) {
...@@ -419,10 +427,11 @@ Page({ ...@@ -419,10 +427,11 @@ Page({
}); });
}, },
//选择攻防话术 //选择攻防话术
async handleScript() { async handleScript(message) {
const { const {
attackScript, attackScript,
scriptList scriptList,
objection_id
} = this.data; } = this.data;
const audioBox = this.selectComponent("#audioBox"); const audioBox = this.selectComponent("#audioBox");
const list = audioBox.data.list; const list = audioBox.data.list;
...@@ -444,7 +453,12 @@ Page({ ...@@ -444,7 +453,12 @@ Page({
}; };
audioBox.addList(addVal, 1); audioBox.addList(addVal, 1);
const index = Math.floor(Math.random() * scriptList.length); const index = Math.floor(Math.random() * scriptList.length);
const message = scriptList[index].content; if(!message || message.type) {
message = scriptList[index].content;
}else {
const objectionPage = await carLifeApi.objectionPage({id:objection_id})
message = objectionPage.data.list[0].commonQuestion
}
const Phrases = await aiApi.getPhrases({ const Phrases = await aiApi.getPhrases({
message, message,
}); });
...@@ -464,6 +478,9 @@ Page({ ...@@ -464,6 +478,9 @@ Page({
point.forEach((i, k) => { point.forEach((i, k) => {
main_point = main_point + (k + 1) + "." + i + "\r\n"; main_point = main_point + (k + 1) + "." + i + "\r\n";
}); });
const Inspiration = attackScript[index].sale_message
.replace(/,/g, ",")
.replace(/。/g, "。")
this.setData({ this.setData({
reject_reason: content, reject_reason: content,
defense_step: -1, defense_step: -1,
...@@ -471,12 +488,8 @@ Page({ ...@@ -471,12 +488,8 @@ Page({
step: "defense", step: "defense",
showScenePopup: false, showScenePopup: false,
main_point, main_point,
roleInspiration: attackScript[index].sale_message roleInspiration: objection_id ? '' :Inspiration,
.replace(/,/g, ",") inspirationContent: objection_id ? '' :Inspiration,
.replace(/。/g, "。"),
inspirationContent: attackScript[index].sale_message
.replace(/,/g, ",")
.replace(/。/g, "。"),
popType: "", popType: "",
}); });
}, },
...@@ -572,17 +585,25 @@ Page({ ...@@ -572,17 +585,25 @@ Page({
//获取改进建议和润色表达 //获取改进建议和润色表达
getEnhancement(last_message, idx, retryCount = 0) { getEnhancement(last_message, idx, retryCount = 0) {
const { const {
batch_id batch_id,
objection_id
} = this.data; } = this.data;
const { const {
uuid, uuid,
name name
} = wx.$util.getUserInfo(); } = wx.$util.getUserInfo();
aiApi let api_params = 'enhancement'
.enhancement({ let history_message = ''
if(objection_id) {
api_params = 'objectionEnhancement'
history_message = this.getHistoryAll()
}
aiApi[api_params]({
last_message, last_message,
user_id: uuid, user_id: uuid,
history_message,
batch_id, batch_id,
objection_id
}) })
.then((res) => { .then((res) => {
let { let {
...@@ -631,42 +652,45 @@ Page({ ...@@ -631,42 +652,45 @@ Page({
getInspiration() { getInspiration() {
const { const {
step, step,
objection_id,
inspirationContent, inspirationContent,
roleInspiration, roleInspiration,
attackScript attackScript,
batch_id,
roleDetail,
} = } =
this.data; this.data;
console.log(inspirationContent, roleInspiration, "inspirationContent"); console.log(inspirationContent, roleInspiration, "inspirationContent");
if (step == "defense") { if (step == "defense" && !objection_id) {
this.setData({ this.setData({
inspirationContent: roleInspiration || attackScript[0].sale_message, inspirationContent: roleInspiration || attackScript[0].sale_message,
}); });
return; return;
} }
if (inspirationContent) return; if (inspirationContent) return;
const history_message = this.getHistory();
const {
batch_id,
roleDetail
} = this.data;
const { const {
uuid uuid
} = wx.$util.getUserInfo(); } = wx.$util.getUserInfo();
const history_message = objection_id?this.getHistoryAll():this.getHistory();
const user_info = JSON.stringify({ const user_info = JSON.stringify({
user_sex: roleDetail.replace(/.*性别:(.).*/, "$1"), user_sex: roleDetail.replace(/.*性别:(.).*/, "$1"),
}); });
aiApi let api_params = 'inspiration'
.inspiration({ if(objection_id) {
api_params = 'objectionInspiration'
}
aiApi[api_params]({
history_message, history_message,
batch_id, batch_id,
step, step,
uuid, user_id: uuid,
inspiration: "", inspiration: "",
user_info, user_info,
objection_id
}) })
.then((res) => { .then((res) => {
this.setData({ this.setData({
inspirationContent: res, inspirationContent: objection_id?res.sale_message:res,
}); });
}); });
}, },
...@@ -681,6 +705,7 @@ Page({ ...@@ -681,6 +705,7 @@ Page({
roleInspiration, roleInspiration,
round, round,
person_type, person_type,
objection_id
} = this.data; } = this.data;
this.data.isSend = false; this.data.isSend = false;
let history_message = this.getHistory(); let history_message = this.getHistory();
...@@ -696,8 +721,11 @@ Page({ ...@@ -696,8 +721,11 @@ Page({
const { const {
uuid uuid
} = wx.$util.getUserInfo(); } = wx.$util.getUserInfo();
aiApi let api_params = 'sparring'
.sparring({ if(objection_id) {
api_params = 'objectionSparring'
}
aiApi[api_params]({
person_type, person_type,
user_message, user_message,
history_message, history_message,
...@@ -829,18 +857,46 @@ Page({ ...@@ -829,18 +857,46 @@ Page({
}, },
}); });
}, },
behaviorSave(sparringResult = 0) {
if(sparringResult == 1) {
clearInterval(this.timer_save)
}
const {objection_id,taskId} = this.data
const {
uuid
} = wx.$util.getUserInfo();
carLifeApi.behaviorSave({
id: taskId,
staffUuid:uuid,
sparringType:objection_id?2:1,
sparringDuration: duration*1000,
sparringResult
}).then(res=>{
this.data.taskId = res.data.sparringBehaviorId
})
},
setBehaviorSave() {
this.behaviorSave()
this.timer_save = setInterval(this.behaviorSave,10*1000)
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {
this.setBehaviorSave()
this.getIsPlay(); this.getIsPlay();
let { let {
roleType: type, roleType: type,
stage, stage,
roleName: name, roleName: name,
isDemo, isDemo,
entry entry,
recordName,
objection_id,
title,
product_name
} = options; } = options;
console.log(recordName)
let params = { let params = {
roleType: type, roleType: type,
}; };
...@@ -876,11 +932,13 @@ Page({ ...@@ -876,11 +932,13 @@ Page({
this.getScriptList(attackScript); this.getScriptList(attackScript);
const findChain = linkChainList.find((link) => link.name == stage); const findChain = linkChainList.find((link) => link.name == stage);
this.setData({ this.setData({
stage: findChain.name, objection_id,
stage: product_name || `${findChain.name}环节`,
step: findChain.type, step: findChain.type,
avatar, avatar,
isDemo: isDemo === "true", isDemo: isDemo === "true",
person_type, person_type,
recordName,
voice: VOICE[roleType], voice: VOICE[roleType],
roleDesc: findChain.desc, roleDesc: findChain.desc,
roleName, roleName,
...@@ -888,6 +946,9 @@ Page({ ...@@ -888,6 +946,9 @@ Page({
roleDetail, roleDetail,
batch_id: (Math.random() + "").slice(2), batch_id: (Math.random() + "").slice(2),
}); });
if(title) {
this.handleScript(title)
}
}, },
async getIsPlay() { async getIsPlay() {
const { const {
...@@ -925,6 +986,7 @@ Page({ ...@@ -925,6 +986,7 @@ Page({
onUnload() { onUnload() {
duration = 0; duration = 0;
clearInterval(timer); clearInterval(timer);
clearInterval(this.timer_save)
this.deleteAudio(); this.deleteAudio();
wx.setKeepScreenOn({ wx.setKeepScreenOn({
keepScreenOn: false, keepScreenOn: false,
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
<view class="chat-left"> <view class="chat-left">
<image class="avatar-icon" src="{{avatar}}"></image> <image class="avatar-icon" src="{{avatar}}"></image>
<view class="chat-box"> <view class="chat-box">
<view class="content-box">你已选择:<text class="font-b">{{roleName}}、{{stage}}环节</text></view> <view class="content-box">你已选择:<text class="font-b">{{roleName}}、{{stage}}</text></view>
<view class="operation"> <view class="operation" wx:if="{{!objection_id}}">
<view class="operation-top"> <view class="operation-top">
<gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image> <gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
对练建议 对练建议
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</view> </view>
</view> </view>
</view> </view>
<audio-tts wx:if="{{roleName}}" isDemo="{{isDemo}}" showSpeechPopup="{{showSpeechPopup}}" roleName="{{roleName}}" <audio-tts objection_id="{{objection_id}}" wx:if="{{roleName}}" isDemo="{{isDemo}}" showSpeechPopup="{{showSpeechPopup}}" roleName="{{roleName}}"
chatList="{{chatList}}" voice="{{voice}}" avatar="{{avatar}}" id="audioBox"></audio-tts> chatList="{{chatList}}" voice="{{voice}}" avatar="{{avatar}}" id="audioBox"></audio-tts>
</scroll-view> </scroll-view>
</view> </view>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<gl-image class="icon" <gl-image class="icon"
src="/aiCheck/{{popType == 'inspiration' ? 'inspiration-icon-white' : 'inspiration-icon'}}.png"></gl-image> src="/aiCheck/{{popType == 'inspiration' ? 'inspiration-icon-white' : 'inspiration-icon'}}.png"></gl-image>
</view> </view>
<view class="inspiration-btn {{popType == 'script' ? 'active' : ''}}" bindtap="handleScript" data-type="script"> <view wx:if="{{!objection_id}}" class="inspiration-btn {{popType == 'script' ? 'active' : ''}}" bindtap="handleScript" data-type="script">
<gl-image class="icon" src="/aiCheck/{{popType == 'script' ? 'script-icon-white' : 'script-icon'}}.png"> <gl-image class="icon" src="/aiCheck/{{popType == 'script' ? 'script-icon-white' : 'script-icon'}}.png">
</gl-image> </gl-image>
</view> </view>
......
...@@ -31,6 +31,7 @@ Component({ ...@@ -31,6 +31,7 @@ Component({
avatar: String, avatar: String,
voice: String, voice: String,
roleName: String, roleName: String,
objection_id:String,
isDemo: { isDemo: {
value: false, value: false,
type: Boolean, type: Boolean,
...@@ -245,7 +246,7 @@ Component({ ...@@ -245,7 +246,7 @@ Component({
toBottom() { toBottom() {
const pages = getCurrentPages() const pages = getCurrentPages()
const curPage = pages[pages.length - 1]; const curPage = pages[pages.length - 1];
curPage.toBottom() if(curPage) curPage.toBottom()
}, },
setAudio(index, filePath, type) { setAudio(index, filePath, type) {
if (!this.data['ctx_' + index]) if (!this.data['ctx_' + index])
......
<!--packageEquity/pages/aiCheck/components/AudioTts/AudioTts.wxml--> <!--packageEquity/pages/aiCheck/components/AudioTts/AudioTts.wxml-->
<view class="chat-item" wx:for="{{list}}"> <view class="chat-item" wx:for="{{list}}">
<block wx:if="{{item.role == 1}}"> <block wx:if="{{item.role == 1}}">
<view class="chat-defense" wx:if="{{item.isOpenDefense}}"> <view class="chat-defense" wx:if="{{item.isOpenDefense && !objection_id}}">
<view class="defense-box"> <view class="defense-box">
<view class="defense-img"> <view class="defense-img">
<gl-image class="icon" src="/aiCheck/defense.png"></gl-image> <gl-image class="icon" src="/aiCheck/defense.png"></gl-image>
......
/*
* @Description:
* @Author: huyue
* @Date: 2024-10-22 16:22:25
* @LastEditors: huyue
* @LastEditTime: 2024-10-23 15:37:14
*/
const defenseData = {
2: [
{
id: '2-1-1',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“家里有电车不需要”',
},
{
id: '2-1-2',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“上一部车开了很多年都没修过”',
},
{
id: '2-1-3',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“车开个2-3年就换”',
},
{
id: '2-1-4',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“有了解过延保了,不需要”',
},
{
id: '2-1-5',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“车用的少”',
},
{
id: '2-1-6',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“那我车有保险,买你们这个延保就没有意义了”',
},
{
id: '2-2-7',
type: 2,
title: '客户一直拿不定主意',
childTitle: '“朋友没买所以不想买”',
},
{
id: '2-2-8',
type: 2,
title: '客户一直拿不定主意',
childTitle: '“觉得挺好的,但是要等以后再买”',
},
{
id: '2-2-9',
type: 2,
title: '客户一直拿不定主意',
childTitle: '“做不了主,需要问家人”',
},
{
id: '2-3-10',
type: 3,
title: '客户对产品价格有疑问',
childTitle: '“花钱的先不考虑了”',
},
{
id: '2-3-11',
type: 3,
title: '客户对产品价格有疑问',
childTitle: '“我不办可以吗,不升不行吗?”',
},
{
id: '2-3-12',
type: 3,
title: '客户对产品价格有疑问',
childTitle: '“我今天没带钱”',
},
{
id: '2-3-13',
type: 3,
title: '客户对产品价格有疑问',
childTitle: '“价格太贵了”',
},
{
id: '2-4-14',
type: 4,
title: '客户觉得此项服务用不上',
childTitle: '“我有做汽修的朋友”',
},
],
3: [
{
id: '3-1-1',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“安心包只有两年的,时间太短了不买”',
},
{
id: '3-1-2',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“假如我触发了换新了,那我延保这一块的钱不是白花了,也用不上了?”',
},
{
id: '3-1-3',
type: 1,
title: '客户对产品的内容价值不认可',
childTitle: '“我是老司机了,安心包这些根本不需要”',
},
{
id: '3-4-4',
type: 4,
title: '客户觉得此项服务用不上',
childTitle: '“我有了保险了这个不需要了”'
}
]
}
const typeList = [
{
id: 0,
name: '全部',
icon: 'all',
ids: [2,3]
},
{
id: 1,
name: '产品异议',
icon: 'product',
ids: [2,3]
},
{
id: 2,
name: '决策异议',
icon: 'decision',
ids: [2]
},
{
id: 3,
name: '价格异议',
icon: 'price',
ids: [2]
},
{
id: 4,
name: '服务异议',
icon: 'service',
ids: [2,3]
}
]
export { defenseData, typeList }
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/defense/defense.js
// import { defenseData, typeList } from './constants/data'
import carLifeApi from '../../../carEquityApi'
import {
setConfigInfo
} from "~/store/index";
Page({
/**
* 页面的初始数据
*/
data: {
navBarHeight: 0,
tabList: [],
currentTab: 0,
customeTypeList:[],
linkChainList: [{
id: 1,
name: '接待',
iconUrl: 'icon-reception',
type: 'reception',
suggest: '此环节模拟交付专员把客户介绍给驻店专员,建议使用敬语,尊称客户,恭喜客户提车,主动向客户介绍工作环节并进行自我介绍!'
},
{
id: 2,
name: '车辆交付',
iconUrl: 'icon-car',
type: 'delivery',
suggest: '此环节模拟驻店专员已完成对于客户的接待,即将向客户介绍新车使用注意事项、保养要求和基础质保政策,建议在介绍过程中主动了解客户的用车周期,用车环境,给介绍延保产品时进行铺垫!'
},
{
id: 3,
name: '需求挖掘',
iconUrl: 'icon-demand',
type: 'defense',
suggest: '此环节模拟驻店专员已完成了新车使用、保养要求和基础质保政策的介绍,即将向客户介绍延保产品,此环节容易触发攻防,建议多以延保相对基础质保的优势,当天购买价格有优惠,大部分客户均选择购买等为主进行推荐!'
},
{
id: 4,
name: '促成交',
iconUrl: 'icon-dear',
type: 'referral',
suggest: '此环节模拟驻店专员已完成了延保产品的介绍,即将根据客户是否展示购买意愿进行话术演练,建议对明显展示不想购买意愿的客户使用逼单话术进行进一步沟通!'
}
],
scrollIntoView: 0,
list: [],
id: '',
scrollTop: 0,
defenseData: [],
typeList: []
},
// 头部返回上一级
back() {
wx.$router.back()
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
switchTab(e) {
const { index, type } = e.currentTarget.dataset
const { defenseData } = this.data
const { id } = this.data
console.log(index,type, id)
if (index) {
this.setData({
currentTab: index,
scrollLeft: index > 2 ? index * 60 : 0,
list: defenseData[id].filter(item => item.type == type),
scrollTop: 0
})
} else {
this.setData({
currentTab: index,
scrollLeft: index > 2 ? index * 60 : 0,
list: defenseData[id],
scrollTop: 0
})
}
},
toChat(e) {
const { id,title } = e.currentTarget.dataset
const objection_id = id.split('-').pop()
const type_id = id.split('-')[1]
const {customeTypeList,isDemo,linkChainList,recordName, typeList} = this.data
console.log(customeTypeList)
const selectedIndex = Math.floor(Math.random()*customeTypeList.length)
const linkIndex = Math.floor(Math.random()*linkChainList.length)
const { roleType } = customeTypeList[selectedIndex]
const { name: stage, suggest } = linkChainList[linkIndex]
const product_name = typeList.find(item => item.id == type_id)?.name
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/chat/chat?roleType=${roleType}&stage=${stage}&suggest=${suggest}&isDemo=${isDemo}&isInspiration=1&objection_id=${objection_id}&recordName=${recordName}&title=${title}&product_name=${product_name}`
})
// wx.navigateTo({
// url: `/packageEquity/pages/aiCheck/chat/chat?id=${id}`
// })
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.initData().then(r => {
const { id } = options
const recordName = `攻防演练 · ${id==2?'延保':'安心包'}`
const { typeList, defenseData } = this.data
const result = typeList.filter(item => item.ids.includes(+id))
console.log(result, 'result')
this.setData({
list: defenseData[id],
id,
recordName,
tabList: result
})
})
},
initData() {
return new Promise(async(resolve, reject) => {
const {
aiPhone,
defenseData,
typeList
} = await setConfigInfo({});
this.setData({
defenseData,
typeList
})
const {
phone
} = wx.$util.getUserInfo()
this.setData({
isDemo: aiPhone.includes(phone)
})
this.getRole()
resolve()
})
},
getRole() {
carLifeApi.sparringRole({
currentPage: 1,
pageSize: 100,
}).then(res => {
const customeTypeList = res.data.list
customeTypeList.forEach(item => {
if (item.roleName.includes('客户'))
item.roleName = item.roleName.slice(0, -2)
})
this.setData({
customeTypeList
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/defense/defense.wxss */
page {
background-color: #fff;
position: fixed;
left: 0;
right: 0;
}
.navigation-header .navigation-bar {
background-color: transparent;
box-shadow: none;
}
.bg {
box-sizing: border-box;
width: 100%;
height: 538rpx;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
.bg2 {
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/aiCheck/defense/product1-bg.webp') no-repeat;
background-size: 100%;
}
.bg3 {
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/aiCheck/defense/product2-bg.webp') no-repeat;
background-size: 100%;
}
.navigation-header .navigation-bar {
position: relative;
box-shadow: none;
.end-btn {
position: absolute;
left: 32rpx;
bottom: 12rpx;
width: 164rpx;
height: 64rpx;
background-color: #fff;
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
color: #333333;
font-weight: 500;
font-size: 28rpx;
.icon {
width: 28rpx;
height: 28rpx;
margin-right: 15rpx;
}
}
}
.introduce-section {
margin-top: 152rpx;
background: rgba(255, 255, 255, 0.6);
border-radius: 48rpx 48rpx 0 0;
.introduce-box {
width: 100%;
height: 144rpx;
background: linear-gradient(180deg, rgba(255, 255, 255, .6) 0%, rgba(235, 237, 242, .5) 18%);
.type-tab {
display: flex;
width: 100%;
flex-wrap: nowrap;
padding: 32rpx 0;
box-sizing: border-box;
.tab-item {
display: inline-flex;
align-items: center;
box-sizing: border-box;
height: 72rpx;
background: #FFFFFF;
border: 2rpx solid #F8F3E9;
border-radius: 12rpx;
font-size: 28rpx;
color: #949494;
margin-right: 16rpx;
padding: 0 20rpx 0 16rpx;
&:last-child {
margin-right: 32rpx;
}
&:first-child {
margin-left: 32rpx;
}
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 4rpx;
}
&.active {
font-weight: 500;
color: #140A00;
background-image: linear-gradient(90deg, #F4FCFF 0%, #FFF9F2 100%);
border: 4rpx solid #FCDEB0;
}
}
}
}
}
scroll-view {
width: 100%;
white-space: nowrap; // 不让它换行
}
.content {
width: 100%;
height: calc(100% - 144rpx);
box-sizing: border-box;
background-color: rgba(235, 237, 242, .5);
.content-list {
padding: 0 32rpx 40rpx;
box-sizing: border-box;
}
&-item {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
// height: 168rpx;
box-sizing: border-box;
border-radius: 16rpx;
background-color: #fff;
padding: 28rpx 20rpx 28rpx 28rpx;
margin-bottom: 20rpx;
&:last-child {
margin-bottom: 24rpx;
}
.title {
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.child-title {
display: inline-flex;
align-items: center;
font-size: 24rpx;
color: #333333;
// line-height: 56rpx;
background-image: linear-gradient(93deg, #F0FCFF 0%, #F0F5FF 51%, #F8F5FF 100%);
border-radius: 48rpx 48rpx 48rpx 2rpx;
margin-top: 16rpx;
padding: 12rpx 24rpx;
max-width: 518rpx;
box-sizing: border-box;
word-wrap:break-word;
word-break:normal;
white-space: normal;
}
.right {
width: 96rpx;
height: 96rpx;
}
}
}
.end {
font-size: 24rpx;
color: #999999;
text-align: center;
padding-bottom: 20rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- packageEquity/pages/aiCheck/scene/scene.wxml -->
<view class="bg {{id == 2 ? 'bg2' : id == 3 ? 'bg3' : ''}}"></view>
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{!showChat}}" bindback="back"></navigation-bar>
<view class="introduce-section" style="height: calc(100vh - {{navBarHeight}}px - 152rpx);">
<view class="introduce-box">
<!-- <view class="type-tab"> -->
<scroll-view class="type-tab" scroll-x="true" show-scrollbar="{{false}}" enhanced="true" scroll-left="{{scrollLeft}}">
<view wx:for="{{tabList}}" wx:key="id" class="tab-item {{currentTab == index ? 'active' : ''}}" bindtap="switchTab" data-index="{{index}}" data-type="{{item.id}}">
<gl-image class="icon" src="/aiCheck/defense/{{currentTab == index ? item.icon + '-check' : item.icon}}.webp"></gl-image>
{{item.name}}
</view>
</scroll-view>
<!-- </view> -->
</view>
<view class="content">
<scroll-view scroll-y="true" style="height: 100%;" scroll-top="{{scrollTop}}">
<view class="content-list">
<block wx:for="{{list}}" wx:key="id">
<view class="content-item" bindtap="toChat" data-id="{{item.id}}" data-title="{{item.childTitle}}">
<view class="left">
<view class="title"># {{item.title}}</view>
<view class="child-title">{{item.childTitle}}</view>
</view>
<gl-image class="right" webp src="/aiCheck/defense/extended-{{item.type}}.webp"></gl-image>
</view>
</block>
<view class="end">- 已加载全部 -</view>
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -113,11 +113,11 @@ Page({ ...@@ -113,11 +113,11 @@ Page({
} }
}, },
again() { again() {
const { id, entry } = this.data; const { id, entry, sector, sparringType } = this.data;
if (id) { if (id) {
wx.navigateTo({ // 都为延保 sparringType 1.话术演练 2.攻防演练 ,暂时只有延保、安心包,再多需修改代码
url: `/packageEquity/pages/aiCheck/scene/scene`, sector == '延保' ? sparringType == 1 ?
}); wx.navigateTo({url: `/packageEquity/pages/aiCheck/scene/scene`}) : wx.navigateTo({url: `/packageEquity/pages/aiCheck/defense/defense?id=2`}) : wx.navigateTo({url: `/packageEquity/pages/aiCheck/defense/defense?id=3`})
} else if (entry == "other") { } else if (entry == "other") {
wx.navigateTo({ wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene`, url: `/packageEquity/pages/aiCheck/scene/scene`,
...@@ -269,7 +269,7 @@ Page({ ...@@ -269,7 +269,7 @@ Page({
wx.$router.reLaunch('packageEquity.equityPage') wx.$router.reLaunch('packageEquity.equityPage')
return return
} }
const { descriptionList, reportItem, sparringDuration, score } = const { descriptionList, reportItem, sparringDuration, level, sector, sparringType } =
res.data || {}; res.data || {};
let { minutes, seconds } = this.formatTime(sparringDuration || 0); let { minutes, seconds } = this.formatTime(sparringDuration || 0);
this.setData({ this.setData({
...@@ -278,7 +278,9 @@ Page({ ...@@ -278,7 +278,9 @@ Page({
reportItem, reportItem,
minutes, minutes,
seconds, seconds,
score, level,
sector,
sparringType,
duration: true, duration: true,
}); });
this.setDetail(reportItem); this.setDetail(reportItem);
...@@ -550,8 +552,8 @@ Page({ ...@@ -550,8 +552,8 @@ Page({
}, },
jump(e) { jump(e) {
let { item } = e.currentTarget.dataset, let { item } = e.currentTarget.dataset,
{ reportItem, avatar, score, id, entry } = this.data; { reportItem, avatar, level, id, entry } = this.data;
if (score == null) return; if (level == null) return;
wx.$router.go("/packageEquity/pages/aiCheck/detail/detail", { wx.$router.go("/packageEquity/pages/aiCheck/detail/detail", {
reportItem, reportItem,
avatar, avatar,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</navigation-bar> </navigation-bar>
<view class="wrapper" style="margin-top: {{navBarHeight}}px;height: calc(100vh - {{navBarHeight + footerHeight}}px);" wx:if="{{tabId == 1}}"> <view class="wrapper" style="margin-top: {{navBarHeight}}px;height: calc(100vh - {{navBarHeight + footerHeight}}px);" wx:if="{{tabId == 1}}">
<block wx:if="{{duration}}"> <block wx:if="{{duration}}">
<view class="canvas-box type-{{reportItem.length}} {{score == null?'pending':''}}"> <view class="canvas-box type-{{reportItem.length}} {{level == null?'pending':''}}">
<view style="position: relative;"> <view style="position: relative;">
<view class="canvas-view"> <view class="canvas-view">
<block wx:if="{{radarImg}}"> <block wx:if="{{radarImg}}">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<block wx:for="{{reportItem}}" wx:key="index"> <block wx:for="{{reportItem}}" wx:key="index">
<view class="categories categories-{{index + 1}}" bindtap="jump" data-item="{{item}}"> <view class="categories categories-{{index + 1}}" bindtap="jump" data-item="{{item}}">
<view class="title">{{item.reportItem}}</view> <view class="title">{{item.reportItem}}</view>
<block wx:if="{{score == null && item.reportItem == '服务态度'}}"> <block wx:if="{{level == null && item.reportItem == '服务态度'}}">
<view class="pending-text">分析中...</view> <view class="pending-text">分析中...</view>
</block> </block>
<block wx:else> <block wx:else>
...@@ -45,12 +45,12 @@ ...@@ -45,12 +45,12 @@
<view class="score-box"> <view class="score-box">
<view class="score-item"> <view class="score-item">
<view>总得分</view> <view>总得分</view>
<view class="score" wx:if="{{score != null}}"> <view class="score" wx:if="{{level != null}}">
<view class="score-num">{{score || 0}}</view> <view class="score-num">{{level || '-'}}</view>
/100 <!-- /100 -->
</view> </view>
<view wx:else class="no-score">计算中...</view> <view wx:else class="no-score">计算中...</view>
<text class="score-tips">90%的使用者在\n75-85之间</text> <text class="score-tips">80%的使用者\n总体评级为B</text>
</view> </view>
<view class="score-item"> <view class="score-item">
<view>练习时长</view> <view>练习时长</view>
......
/*
* @Description:
* @Author: huyue
* @Date: 2024-06-14 13:57:29
* @LastEditors: huyue
* @LastEditTime: 2024-10-22 15:33:21
*/
// packageEquity/pages/aiCheck/scene/scene.js // packageEquity/pages/aiCheck/scene/scene.js
import carLifeApi from '../../../carEquityApi' import carLifeApi from '../../../carEquityApi'
import { import {
......
...@@ -5,13 +5,13 @@ refresher-enabled="{{true}}" ...@@ -5,13 +5,13 @@ refresher-enabled="{{true}}"
refresher-threshold="104" scroll-top="{{scrollTop}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="restPageNum" bindscrolltolower="onBottomRefresh" class="record-list"> refresher-threshold="104" scroll-top="{{scrollTop}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="restPageNum" bindscrolltolower="onBottomRefresh" class="record-list">
<view class="record-item" wx:for="{{recordList}}" data-role="{{item.roleType}}" wx:key="id" bindtap="toReport" data-id="{{item.id}}"> <view class="record-item" wx:for="{{recordList}}" data-role="{{item.roleType}}" wx:key="id" bindtap="toReport" data-id="{{item.id}}">
<view class="record-left"> <view class="record-left">
<view class="record-title">驻店延保</view> <view class="record-title">{{item.recordName}}</view>
<view class="record-time" wx:if="{{item.sparringDuration}}">时长:{{item.sparringDuration}}</view> <view class="record-time" wx:if="{{item.sparringDuration}}">时长:{{item.sparringDuration}}</view>
<view class="record-date">时间:{{item.createdDate}}</view> <view class="record-date">时间:{{item.createdDate}}</view>
</view> </view>
<view class="record-right"> <view class="record-right">
<view class="under-way" wx:if="{{item.sparringStatus == 0}}">报告生成中...</view> <view class="under-way" wx:if="{{item.sparringStatus == 0}}">报告生成中...</view>
<view class="score" wx:else><view class="score-num">{{item.score}}</view>分</view> <view class="score" wx:else><view class="score-num">{{item.level}}</view></view>
<gl-image class="arrow-right" src="/equity/arrow-right.png"></gl-image> <gl-image class="arrow-right" src="/equity/arrow-right.png"></gl-image>
</view> </view>
</view> </view>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-05-16 10:43:18 * @Date: 2024-05-16 10:43:18
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-07-16 11:37:49 * @LastEditTime: 2024-10-22 15:22:57
*/ */
// packageEquity/pages/aiCheck/start/components/introduction.js // packageEquity/pages/aiCheck/start/components/introduction.js
import aiApi from "../../../../../aiApi" import aiApi from "../../../../../aiApi"
...@@ -34,25 +34,49 @@ Component({ ...@@ -34,25 +34,49 @@ Component({
id: 1, id: 1,
name: '驻店延保', name: '驻店延保',
description: '模拟驻店人员向车主推销延保产品', description: '模拟驻店人员向车主推销延保产品',
imgName: 'extended-warranty', type: 1,
isAvailable: true imgName: 'product-1',
isAvailable: true,
bg: 'bg1'
}, },
{ {
id: 2, id: 2,
name: '延保',
description: '模拟客户在驻店售卖延保过程中的各类问题',
type: 2,
imgName: 'product-2',
isAvailable: true,
bg: 'bg2'
},
{
id: 3,
name: '安心包',
description: '模拟客户在驻店售卖安心包过程中的各类问题',
type: 2,
imgName: 'product-3',
isAvailable: true,
bg: 'bg2'
},
{
id: 4,
name: '权益升级', name: '权益升级',
description: '快速获取车主需求,推荐权益产品', description: '快速获取车主需求,推荐权益产品',
imgName: 'rights-upgrade', type: 1,
isAvailable: false imgName: 'product-4',
isAvailable: false,
bg: 'bg3'
}, },
{ {
id: 3, id: 5,
name: '轻改升级', name: '轻改升级',
description: '通过精品礼券,引导客户到店轻改升级', description: '通过精品礼券,引导客户到店轻改升级',
imgName: 'minor-upgrade', type: 1,
isAvailable: false imgName: 'product-5',
isAvailable: false,
bg: 'bg3'
} }
], ],
isVisible: false, popVisible: false,
userName: null userName: null
}, },
/** /**
...@@ -62,20 +86,29 @@ Component({ ...@@ -62,20 +86,29 @@ Component({
// 我知道了 // 我知道了
confirm() { confirm() {
this.setData({ this.setData({
isVisible: false popVisible: false
}) })
}, },
toExperience:wx.$util.throttle(function(e) { toExperience:wx.$util.throttle(function(e) {
console.log(11, e) console.log(11, e)
const {id, available} = e.currentTarget.dataset const {id, available, type} = e.currentTarget.dataset
if (type == 1) {
if (available) { if (available) {
// 调用接口 // 调用接口
this.setSparringVerify(id) this.setSparringVerify(id)
} else { } else {
wx.showToast({ this.setData({
title: '更多功能正在开发中...', popVisible: true
icon: 'none', })
duration: 2000 // wx.showToast({
// title: '更多功能正在开发中...',
// icon: 'none',
// duration: 2000
// })
}
} else if (type == 2) {
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/defense/defense?id=${id}`
}) })
} }
},1000), },1000),
......
...@@ -49,25 +49,15 @@ ...@@ -49,25 +49,15 @@
box-sizing: border-box; box-sizing: border-box;
padding: 40rpx 32rpx; padding: 40rpx 32rpx;
width: 47.8%; width: 47.8%;
height: 456rpx; height: 344rpx;
border: 3rpx solid #FFFFFF;
box-shadow: 0 8rpx 24rpx 0 #d3dbeb80; box-shadow: 0 8rpx 24rpx 0 #d3dbeb80;
border-radius: 16rpx; border-radius: 16rpx;
&-bg1 {
background-image: linear-gradient(139deg, #F2F8FF 0%, #DBECFF 100%);
}
&-bg2 {
background-image: linear-gradient(140deg, #F7F7FF 0%, #E8E8FF 100%);
}
&-bg3 {
background-image: linear-gradient(139deg, #F2FCFC 0%, #DFF7F7 100%);
}
.bg-image { .bg-image {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 216rpx; height: 344rpx;
z-index: -1; z-index: -1;
} }
.item-left { .item-left {
...@@ -79,6 +69,9 @@ ...@@ -79,6 +69,9 @@
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
} }
.gray {
color:#7A8299;
}
.product-description { .product-description {
font-size: var(--fontSize24); font-size: var(--fontSize24);
margin-top: 16rpx; margin-top: 16rpx;
...@@ -106,10 +99,17 @@ ...@@ -106,10 +99,17 @@
} }
.product-icon { .product-icon {
position: absolute; position: absolute;
right: 0; right: 20rpx;
bottom: 0; bottom: 20rpx;
width: 180rpx; width: 128rpx;
height: 180rpx; height: 128rpx;
}
.product-type {
position: absolute;
right: 16rpx;
top: 12rpx;
font-size: 22rpx;
color: #333333;
} }
} }
.extended-warranty { .extended-warranty {
......
...@@ -17,17 +17,16 @@ ...@@ -17,17 +17,16 @@
<!-- 介绍列表 --> <!-- 介绍列表 -->
<view class="introduction-list"> <view class="introduction-list">
<block wx:for="{{productList}}" wx:key="imgName"> <block wx:for="{{productList}}" wx:key="imgName">
<view class="list-item list-item-bg{{item.id}}" bindtap="toExperience" data-id="{{item.id}}" data-available="{{item.isAvailable}}"> <view class="list-item" bindtap="toExperience" data-type="{{item.type}}" data-id="{{item.id}}" data-available="{{item.isAvailable}}">
<!-- <gl-image webp class="bg-image" src="/aiCheck/{{item.imgName}}-bg.png"></gl-image> -->
<view class="item-left"> <view class="item-left">
<view class="product-name">{{item.name}}</view> <view class="product-name {{item.isAvailable ? '':'gray'}}">{{item.name}}</view>
<view class="product-description">{{item.description}}</view> <view class="product-description">{{item.description}}</view>
<view class="btn experience-btn" wx:if="{{item.isAvailable}}">立即体验</view>
<view class="btn stay-tuned" wx:else>敬请期待</view>
</view> </view>
<!-- <view wx:if="{{!item.isAvailable}}" class="stay-tuned">敬请期待</view> --> <gl-image webp class="product-icon" src="/aiCheck/home/{{item.imgName}}.webp"></gl-image>
<gl-image webp class="product-icon" src="/aiCheck/icon-{{item.imgName}}.png"></gl-image> <gl-image webp class="bg-image" src="/aiCheck/home/{{item.bg}}.webp"></gl-image>
<view class="product-type">{{item.type == 1 ? '话术' : '攻防'}}</view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<tipsPop isVisible="{{popVisible}}" bindconfirm="confirm"></tipsPop>
\ No newline at end of file \ No newline at end of file
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 590rpx; width: 590rpx;
height: 432rpx; height: 416rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 -8rpx 12rpx 0 rgba(0, 0, 0, 0.05); box-shadow: 0 -8rpx 12rpx 0 rgba(0, 0, 0, 0.05);
border-radius: 32rpx; border-radius: 32rpx;
text-align: center; text-align: center;
.title { .title {
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 34rpx;
color: #292D33; color: #292D33;
margin-top: 112rpx; margin-top: 112rpx;
} }
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
padding: 0 70rpx; padding: 0 70rpx;
} }
.btn { .btn {
margin: 48rpx auto; margin: 56rpx auto;
width: 333rpx; width: 333rpx;
height: 80rpx; height: 80rpx;
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%); background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<view class="wrapper-pop" wx:if="{{isVisible}}"> <view class="wrapper-pop" wx:if="{{isVisible}}">
<view class="wrapper-content"> <view class="wrapper-content">
<gl-image class="icon-tips" webp src="/aiCheck/icon-tips.webp"></gl-image> <gl-image class="icon-tips" webp src="/aiCheck/icon-tips.webp"></gl-image>
<view class="title">温馨提示</view> <view class="title">敬请期待</view>
<view class="content">您的对练试用次数已用完,请等待</view> <view class="content">该模块正在开发中,即将上线~</view>
<view class="content">管理员为您分配对练任务</view> <!-- <view class="content">管理员为您分配对练任务</view> -->
<view class="btn" bind:tap="confirm">我知道了</view> <view class="btn" bind:tap="confirm">好的</view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<RecordList wx:else></RecordList> <RecordList wx:else></RecordList>
</view> </view>
<view class="footer" id="footer"> <view class="footer" id="footer">
<view class="tab-item" bindtap="selectTab" data-type="{{item.type}}" wx:for="{{tab}}"> <view class="tab-item" bindtap="selectTab" data-type="{{item.type}}" wx:for="{{tab}}" wx:key="type">
<view class="tab-icon"><gl-image webp class="tab-icon" src="{{tabIndex == item.type?item.icon_check:item.icon}}"></gl-image></view> <view class="tab-icon"><gl-image webp class="tab-icon" src="{{tabIndex == item.type?item.icon_check:item.icon}}"></gl-image></view>
<view class="tab-text {{tabIndex == item.type?'checked':''}}">{{item.title}}</view> <view class="tab-text {{tabIndex == item.type?'checked':''}}">{{item.title}}</view>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!