小助理

This commit is contained in:
liuye
2024-07-12 17:59:43 +08:00
parent 41b36c7784
commit fc8720fc40
2 changed files with 50 additions and 20 deletions

View File

@@ -2,9 +2,9 @@
<div class="AppDialogue">
<u-navbar title="Copilot小助理" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar" :is-back="false" height="88"></u-navbar>
<!-- <scroll-view scroll-y="true" class="scroll-Y" @scroll="scroll"> -->
<!-- <div class="top-select" @click="showType=true">
{{typeList[type].dictName || '选择应用'}} <u-icon name="arrow-down" color="#fff" size="28"></u-icon>
</div> -->
<div class="top-select" @click="showType=true">
{{aiConfigName || '选择应用'}} <u-icon name="arrow-down" color="#fff" size="28"></u-icon>
</div>
<div class="service-content" v-if="!messageList.length">
<div class="text-content">
<div class="text-left">
@@ -118,13 +118,11 @@ export default {
pages: 2,
areaId: '',
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
typeList: [
{dictValue: '1', dictName: '文本助理'},
{dictValue: '2', dictName: '日常助理'}
],
type: '',
typeList: [],
aiConfigId: '',
aiConfigName: '',
showType: false,
showPopup: true
showPopup: true,
}
},
computed: {
@@ -136,6 +134,7 @@ export default {
});
},
onShow() {
this.getAiTypeList()
this.getHistoryList()
},
onPullDownRefresh() {
@@ -218,7 +217,7 @@ export default {
return this.$u.toast("请先进行登录")
}
this.$loading()
this.$instance.post("/app/appaicopilotinfo/add", {content: this.content, appType: 0, areaId: this.areaId}).then(res => {
this.$instance.post("/app/appaicopilotinfo/add", {content: this.content, appType: 0, areaId: this.areaId, aiConfigId: this.aiConfigId}).then(res => {
if(res.code == 0) {
this.content = ''
this.messageList.push(res.data[0])
@@ -238,7 +237,7 @@ export default {
return this.$u.toast("请先进行登录")
}
this.$loading()
this.$instance.post("/app/appaicopilotinfo/add", {sdkFileUrl: this.voiceUrl, fileId: this.voiceId, appType: 0}).then(res => {
this.$instance.post("/app/appaicopilotinfo/add", {sdkFileUrl: this.voiceUrl, fileId: this.voiceId, appType: 0, aiConfigId: this.aiConfigId}).then(res => {
if(res.code == 0) {
this.voiceUrl = ''
this.voiceId = ''
@@ -262,7 +261,7 @@ export default {
return this.$u.toast("请先进行登录")
}
this.$loading()
this.$instance.post(`/app/appaicopilotinfo/list?current=${this.current}&size=10`).then(res => {
this.$instance.post(`/app/appaicopilotinfo/list?current=${this.current}&size=10&aiConfigId=${this.aiConfigId}`).then(res => {
if(res.code == 0 && res.data.records.length) {
res.data.records.map((item) => {
if(item.sdkFileUrl) {
@@ -322,8 +321,23 @@ export default {
}
},
confirmType(val) {
this.type = val[0].value;
this.aiConfigId = val[0].value
this.aiConfigName = val[0].label
},
getAiTypeList() {
this.$instance.post(`/app/appaiconfiginfo/list?status=1`).then(res => {
if(res.code == 0) {
res.data.records.map((item) => {
item.dictName = item.appName
item.dictValue = item.id
})
this.typeList = res.data.records
this.aiConfigId = this.typeList[0].dictValue
this.aiConfigName = this.typeList[0].dictName
this.getHistoryList()
}
})
}
},
}
</script>