Commit d94e392c by 前端

安心包

1 parent 5a6eed05
......@@ -200,7 +200,9 @@ export default {
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");
},
/**
* 获取客户角色
*/
......
......@@ -430,7 +430,8 @@ Page({
async handleScript(message) {
const {
attackScript,
scriptList
scriptList,
objection_id
} = this.data;
const audioBox = this.selectComponent("#audioBox");
const list = audioBox.data.list;
......@@ -454,6 +455,9 @@ Page({
const index = Math.floor(Math.random() * scriptList.length);
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({
message,
......@@ -474,6 +478,9 @@ Page({
point.forEach((i, k) => {
main_point = main_point + (k + 1) + "." + i + "\r\n";
});
const Inspiration = attackScript[index].sale_message
.replace(/,/g, ",")
.replace(/。/g, "。")
this.setData({
reject_reason: content,
defense_step: -1,
......@@ -481,12 +488,8 @@ Page({
step: "defense",
showScenePopup: false,
main_point,
roleInspiration: attackScript[index].sale_message
.replace(/,/g, ",")
.replace(/。/g, "。"),
inspirationContent: attackScript[index].sale_message
.replace(/,/g, ",")
.replace(/。/g, "。"),
roleInspiration: objection_id ? '' :Inspiration,
inspirationContent: objection_id ? '' :Inspiration,
popType: "",
});
},
......@@ -649,13 +652,16 @@ Page({
getInspiration() {
const {
step,
objection_id,
inspirationContent,
roleInspiration,
attackScript
attackScript,
batch_id,
roleDetail,
} =
this.data;
console.log(inspirationContent, roleInspiration, "inspirationContent");
if (step == "defense") {
if (step == "defense" && !objection_id) {
this.setData({
inspirationContent: roleInspiration || attackScript[0].sale_message,
});
......@@ -663,11 +669,6 @@ Page({
}
if (inspirationContent) return;
const {
batch_id,
roleDetail,
objection_id
} = this.data;
const {
uuid
} = wx.$util.getUserInfo();
const history_message = objection_id?this.getHistoryAll():this.getHistory();
......
......@@ -19,7 +19,7 @@
<view class="chat-box">
<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">
<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!