Commit d94e392c by 前端

安心包

1 parent 5a6eed05
...@@ -200,7 +200,9 @@ export default { ...@@ -200,7 +200,9 @@ export default {
behaviorSave(data) { behaviorSave(data) {
return api.post("dj.api.carboutique.ai.sparring.staff.behavior.save", data,[],"/rop-dj-pairexc/router"); 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");
},
/** /**
* 获取客户角色 * 获取客户角色
*/ */
......
...@@ -430,7 +430,8 @@ Page({ ...@@ -430,7 +430,8 @@ Page({
async handleScript(message) { 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;
...@@ -454,6 +455,9 @@ Page({ ...@@ -454,6 +455,9 @@ Page({
const index = Math.floor(Math.random() * scriptList.length); const index = Math.floor(Math.random() * scriptList.length);
if(!message || message.type) { if(!message || message.type) {
message = scriptList[index].content; 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,
...@@ -474,6 +478,9 @@ Page({ ...@@ -474,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,
...@@ -481,12 +488,8 @@ Page({ ...@@ -481,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: "",
}); });
}, },
...@@ -649,13 +652,16 @@ Page({ ...@@ -649,13 +652,16 @@ 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,
}); });
...@@ -663,11 +669,6 @@ Page({ ...@@ -663,11 +669,6 @@ Page({
} }
if (inspirationContent) return; if (inspirationContent) return;
const { const {
batch_id,
roleDetail,
objection_id
} = this.data;
const {
uuid uuid
} = wx.$util.getUserInfo(); } = wx.$util.getUserInfo();
const history_message = objection_id?this.getHistoryAll():this.getHistory(); const history_message = objection_id?this.getHistoryAll():this.getHistory();
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<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>
对练建议 对练建议
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!