居民助手

This commit is contained in:
liuye
2024-01-05 16:09:30 +08:00
parent fe8384f1d7
commit e982b33d50

View File

@@ -21,7 +21,7 @@
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/recording-white.png" alt="" v-if="item.userType == 1"> <img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/recording-white.png" alt="" v-if="item.userType == 1">
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/recording-gray.png" alt="" v-else> <img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/recording-gray.png" alt="" v-else>
</div> </div>
<p>{{item.content}}</p> <p>{{item.content || ''}}</p>
</div> </div>
</div> </div>
</div> </div>
@@ -69,21 +69,14 @@ export default {
isStart: false, isStart: false,
content: '', content: '',
isFlag: false, isFlag: false,
voiceUrl: 'http://test87ftp.cunwuyun.cn/20240104/tmp_b07b802b794a05a3d887c2fbe0af67d9642eff6d78e75f4e-20240104102324.mp3', voiceUrl: '',
voiceId: 'bd1f18e183e544ad9bc1c90203321545', voiceId: '',
messageList: [ messageList: [
{ // {
sdkFileUrl: 'http://test87ftp.cunwuyun.cn/20240104/tmp_c37efa0c4f079bd10b32a52ee7565d35087d82a49d33be69-20240104151440.m4a', // userType: 0,
content: '123456', // sdkFileUrl: 'http://test87ftp.cunwuyun.cn/20240104/output.mp3',
userType: 0, // isPlay: false
isPlay: false // }
},
{
sdkFileUrl: 'http://test87ftp.cunwuyun.cn/20240104/tmp_c37efa0c4f079bd10b32a52ee7565d35087d82a49d33be69-20240104151440.m4a',
content: '123456',
userType: 1,
isPlay: false
}
], ],
current: 1, current: 1,
pages: 2 pages: 2
@@ -94,9 +87,10 @@ export default {
}, },
onLoad() { onLoad() {
recorderManager.onStop((res)=> { recorderManager.onStop((res)=> {
console.log(res)
this.upLoad(res.tempFilePath) this.upLoad(res.tempFilePath)
}); });
// this.getHistoryList() this.getHistoryList()
}, },
onPullDownRefresh() { onPullDownRefresh() {
if(this.current > this.pages) { if(this.current > this.pages) {
@@ -123,7 +117,7 @@ export default {
const options = { const options = {
duration: 60000, duration: 60000,
sampleRate: 16000, sampleRate: 16000,
format: 'm4a' format: 'PCM'
} }
recorderManager.start(options); recorderManager.start(options);
@@ -202,7 +196,7 @@ export default {
this.$loading() this.$loading()
this.$instance.post(`/app/appaigccopilotinfo/list?current=${this.current}&size=10`).then(res => { this.$instance.post(`/app/appaigccopilotinfo/list?current=${this.current}&size=10`).then(res => {
if(res.code == 0 && res.data.records.length) { if(res.code == 0 && res.data.records.length) {
res.data.records((item) => { res.data.records.map((item) => {
if(item.sdkFileUrl) { if(item.sdkFileUrl) {
item.isPlay = false item.isPlay = false
} }
@@ -218,7 +212,6 @@ export default {
this.pages = res.data.pages this.pages = res.data.pages
this.$hideLoading() this.$hideLoading()
} }
}) })
}, },
play(src, index) { play(src, index) {