小助理

This commit is contained in:
liuye
2024-08-13 10:30:27 +08:00
parent 6baf49350c
commit bc5c1063ff
6 changed files with 67 additions and 1740 deletions

View File

@@ -79,6 +79,9 @@
</div>
</div>
</u-popup> -->
<div class="load-content" v-if="showLoad">
<img src="https://cdn.sinoecare.com/i/2024/08/07/66b2cfd4d220d.gif" alt="">
</div>
</div>
</template>
<script>
@@ -123,6 +126,8 @@ export default {
aiConfigName: '',
showType: false,
showPopup: true,
showLoad: false,
latLng: ''
}
},
computed: {
@@ -141,7 +146,7 @@ export default {
this.getHistoryList()
},
methods: {
...mapActions(['autoLogin', 'getUserInfo']),
...mapActions(['autoLogin', 'getUserInfo', 'injectJWeixin',]),
startRecord() {
this.isStart = true
this.recorder = Recorder({
@@ -193,8 +198,9 @@ export default {
if(!this.user.token) {
return this.$u.toast("请先进行登录")
}
this.$loading()
this.$http.post("/app/appaicopilotinfo/add", {content: this.content, appType: 0, areaId: this.areaId, aiConfigId: this.aiConfigId}).then(res => {
// this.$loading()
this.showLoad = true
this.$http.post("/app/appaicopilotinfo/add", {content: this.content, appType: 0, areaId: this.areaId, aiConfigId: this.aiConfigId, supplementContent: this.latLng}).then(res => {
if(res.code == 0) {
this.content = ''
this.messageList.push(res.data[0])
@@ -205,7 +211,8 @@ export default {
selector: `.item${this.messageList.length-1}`
});
})
this.$hideLoading()
// this.$hideLoading()
this.showLoad = false
}
})
},
@@ -213,7 +220,8 @@ export default {
if(!this.user.token) {
return this.$u.toast("请先进行登录")
}
this.$loading()
// this.$loading()
this.showLoad = true
this.$http.post("/app/appaicopilotinfo/add", {sdkFileUrl: this.voiceUrl, fileId: this.voiceId, appType: 0, aiConfigId: this.aiConfigId}).then(res => {
if(res.code == 0) {
this.voiceUrl = ''
@@ -229,7 +237,8 @@ export default {
duration: 300,
selector: `.item${this.messageList.length-1}`
});
this.$hideLoading()
// this.$hideLoading()
this.showLoad = false
}
})
},
@@ -237,7 +246,8 @@ export default {
if(!this.user.token) {
return this.$u.toast("请先进行登录")
}
this.$loading()
// this.$loading()
this.showLoad = true
this.$http.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) => {
@@ -254,7 +264,8 @@ export default {
});
})
this.pages = res.data.pages
this.$hideLoading()
// this.$hideLoading()
this.showLoad = false
}
})
},
@@ -315,6 +326,15 @@ export default {
this.aiConfigId = val[0].value
this.aiConfigName = val[0].label
this.messageList = []
this.typeList.map((item) => {
if(item.dictValue == this.aiConfigId) {
if(item.ability == 1) {
this.getLocation()
}else {
this.latLng = ''
}
}
})
},
getAiTypeList() {
this.$http.post(`/app/appaiconfiginfo/list?status=1`).then(res => {
@@ -326,10 +346,30 @@ export default {
this.typeList = res.data.records
this.aiConfigId = this.typeList[0].dictValue
this.aiConfigName = this.typeList[0].dictName
if(this.typeList[0].ability == 1) {
this.getLocation()
}else {
this.latLng = ''
}
// this.getHistoryList()
}
})
}
},
getLocation() {
this.injectJWeixin(['getLocation']).then(() => {
wx.getLocation({
type: 'wgs84',
success: res => {
this.latLng = `${res.latitude},${res.longitude}`
},
error: res => {
console.log(res)
}
})
}).catch(e => {
})
},
},
}
</script>
@@ -666,5 +706,23 @@ page {
}
}
}
.load-content {
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, .8);
position: fixed;
top: 0;
left: 0;
z-index: 99;
text-align: center;
img {
width: 560px;
height: 560px;
position: relative;
top: 50%;
margin-top: -280px;
}
}
}
</style>