Commit 952a11b4 by 李伟康

增加游客模式、修改限制次数

1 parent e5b5b2b8
<template>
<div
class="chat-gpt-box"
:class="['chat-gpt-box',{'guestMode':guestMode}]"
v-show="show"
>
<div
......@@ -10,7 +10,7 @@
<div class="content-item left">
<div class="sprite-icon icon-ai icon"></div>
<div class="content">
您可以向我提问公司的业务产品或销售等相关问题,我将给您组织语言并提供建议,您可以复制段落稍作润色并答复给您的客户。
您可以向我提问汽车后市场领域(如汽车精品/汽车保险/延保服务等)的业务相关问题,AI助手将给您提供方案建议。
</div>
</div>
<template v-for="(i,index) in contentList">
......@@ -95,18 +95,23 @@ export default {
issue: '',
scriptLibraryAIId: '',
todayQuestionLeft: 0,
questionCountTotal: 20,
questionCountTotal: 999,
lastQuestionTime: '',
padding: false
}
},
computed: {
guestMode () {
return this.$store.state.app.guestMode
}
},
watch: {
issue (newText) {
this.issue = this.filterText(newText);
}
},
mounted () {
this.getAiId()
if (!this.guestMode) this.getAiId()
},
methods: {
filterText (text) {
......@@ -143,12 +148,13 @@ export default {
}
},
send (val) {
const { issue, todayQuestionLeft, questionCountTotal, padding } = this,
const { issue, todayQuestionLeft, questionCountTotal, padding, guestMode } = this,
content = val || issue
try {
if (!content) throw false
if (padding) throw '请等待回复后再试'
if (todayQuestionLeft < 1) throw `每天每个用户最多发送提问${questionCountTotal}个问题`
//游客模式不限制次数
if (todayQuestionLeft < 1 && !guestMode) throw `每天每个用户最多发送提问${questionCountTotal}个问题`
} catch (error) {
if (error) this.showToast(error)
return
......@@ -208,6 +214,7 @@ export default {
addRecord (id) {
const { contentList, scriptLibraryAIId, lastQuestionTime } = this,
item = contentList.find(i => i.id == id)
if (this.guestMode) return //游客模式不上报
delete item.id
let params = {
lastQuestionTime,
......@@ -329,8 +336,8 @@ export default {
}
}
.input-box {
padding: 7px 11px 7px 16px;
background: #ffffff;
padding: 7px 11px 7px 16px !important;
background: #ffffff !important;
.van-field {
width: 278px;
padding: 9px 16px;
......@@ -359,4 +366,8 @@ export default {
// bottom: 0;
}
}
.guestMode{
height: calc(100vh - var(--constantSafeAreaInsetBottom));
height: calc(100vh - var(--envSafeAreaInsetBottom));
}
</style>
\ No newline at end of file
......@@ -8,11 +8,11 @@
*/
// 本地环境配置
module.exports = {
title: '嘻嘻',
title: '话术库',
envVersion: 'trial',
request: {
// baseURL: '//192.168.3.191:7860', // 本地测试项目地址,
baseURL: '//scrm.test.glsx.com.cn', // 本地测试项目地址,
baseURL: 'https://scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
......@@ -53,16 +53,15 @@ module.exports = {
},
vconsole: true,
issuesList: [
'你这个保险有点贵啊,好像别人那里都没有那么高的价格。',
'我这个保险在外面朋友买没那么便宜。',
'什么是太阳膜',
'为什么车子要贴膜',
'如何衡量一张膜是好膜',
'太阳膜的参数说明',
'这个保费怎么那么贵,我第二年的保费多少钱?',
'座位险/驾乘险可以不要吗?',
'你这个保险有点贵啊,好像别人那里都没有那么高的价格。',
'第三者怎么要买300万,我买200万/100万就可以了?',
'这个保险我可以不买吗?', '这个保险怎么理赔的?',
'你说的那些服务我也不一定能用上啊',
'我之前开车那么多年,没有过爆胎这些情况的。',
'我家里有其他车了,你们的补贴我不需要。',
'这个保险我买2年的话,第二年你买其他保险也可以的吗?',
'我这个车用车比较少,车辆那么新,不会爆胎的。'
'座位险/驾乘险可以不要吗?',
'我这个车用车比较少,车辆那么新,不会爆胎的。',
'我这个买2年的话,第二你买其他保险也可以的吗?',
]
}
\ No newline at end of file
......@@ -13,7 +13,8 @@ import { Notify } from 'vant'
const state = {
pageMeta: '',
keepAlives: [],
lastPath: ''
lastPath: '',
guestMode: false
}
const mutations = {
SET_PAGE_META (state, meta) {
......@@ -129,7 +130,13 @@ const actions = {
}
},
navigation ({ dispatch }) {
let { sessionId, corpId, agentId } = getParams()
let { sessionId, corpId, agentId, guestMode } = getParams()
if (guestMode) {
dispatch('registerHttp')
state.guestMode = true
state.showWindow = true
return
}
const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
if (!corpId) corpId = storage_corpId && storage_corpId.corpId
if (corpId && storage_corpId) {
......
<template>
<div class="layout">
<div class="sticky">
<tab
:list="tabList"
@change="change"
>
</tab>
<template v-if="!guestMode">
<tab
:list="tabList"
@change="change"
>
</tab>
</template>
<search-box
v-show="tabIndex == 1"
@search="search"
......@@ -86,8 +88,13 @@ export default {
tabIndex: 0
}
},
computed: {
guestMode () {
return this.$store.state.app.guestMode
}
},
async mounted () {
try {
if (!this.guestMode) try {
await wxConfig.init(['sendChatMessage'])
} catch (error) {
this.sendChatMessageDisabled = true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!