更新
This commit is contained in:
parent
a6a14e8ebb
commit
d9fa16c70a
@ -370,7 +370,6 @@ export default {
|
|||||||
msgInfo() {
|
msgInfo() {
|
||||||
if (this.msgSocket) {
|
if (this.msgSocket) {
|
||||||
this.msgSocket.onMessage(res => {
|
this.msgSocket.onMessage(res => {
|
||||||
console.log('this.messagesList', this.messagesList[this.messagesList.length - 1])
|
|
||||||
if (this.info.conversation == 'Translator') {
|
if (this.info.conversation == 'Translator') {
|
||||||
if (this.messagesList[this.messagesList.length - 1].inputs.type != 'image') {
|
if (this.messagesList[this.messagesList.length - 1].inputs.type != 'image') {
|
||||||
this.messagesList[this.messagesList.length - 1].answer = this.messagesList[this
|
this.messagesList[this.messagesList.length - 1].answer = this.messagesList[this
|
||||||
@ -411,7 +410,6 @@ export default {
|
|||||||
this.goBottom()
|
this.goBottom()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('this.messagesList', this.messagesList)
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -564,7 +562,6 @@ export default {
|
|||||||
'type': '',
|
'type': '',
|
||||||
'filePath': inputData.filePath,
|
'filePath': inputData.filePath,
|
||||||
};
|
};
|
||||||
console.log(msgItem)
|
|
||||||
if (this.info.conversation == 'Translator') {
|
if (this.info.conversation == 'Translator') {
|
||||||
msgItem.response_mode = 'blocking'
|
msgItem.response_mode = 'blocking'
|
||||||
msgItem.inputs.lang = this.lang
|
msgItem.inputs.lang = this.lang
|
||||||
@ -597,22 +594,30 @@ export default {
|
|||||||
'answer': '',
|
'answer': '',
|
||||||
'socketId': this.socketId,
|
'socketId': this.socketId,
|
||||||
};
|
};
|
||||||
console.log(this.info.conversation, 259)
|
|
||||||
if (this.info.conversation == 'Translator') {
|
if (this.info.conversation == 'Translator') {
|
||||||
requestData.response_mode = 'blocking'
|
requestData.response_mode = 'blocking'
|
||||||
requestData.inputs.lang = this.lang
|
requestData.inputs.lang = this.lang
|
||||||
requestData.inputs.sayLang = this.sayLang
|
requestData.inputs.sayLang = this.sayLang
|
||||||
} else if (this.info.conversation == 'Trip') {
|
} else if (this.info.conversation == 'Trip') {
|
||||||
// requestData.query = "描述图片"
|
if (requestData.inputs.type == 'image') {
|
||||||
// requestData.inputs = {}
|
requestData.query = "描述图片"
|
||||||
// requestData.files = [
|
// requestData.inputs = {}
|
||||||
// {
|
requestData.files = [
|
||||||
// "type": "image",
|
{
|
||||||
// "transfer_method": "local_file",
|
"type": "image",
|
||||||
// "url": '',
|
// "type": "image/jpeg",
|
||||||
// "upload_file_id": inputData.message
|
"transfer_method": "local_file",
|
||||||
// }
|
"url": '',
|
||||||
// ]
|
"upload_file_id": inputData.message
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
sendMsg(that.msgSocket, JSON.stringify(requestData))
|
||||||
|
requestData.query = inputData.base64
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
sendMsg(that.msgSocket, JSON.stringify(requestData))
|
sendMsg(that.msgSocket, JSON.stringify(requestData))
|
||||||
@ -665,8 +670,9 @@ page {
|
|||||||
|
|
||||||
.po_i {
|
.po_i {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
//top: -60px;
|
|
||||||
left: 0px;
|
left: 0px;
|
||||||
|
top: -55px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
@ -760,6 +766,7 @@ page {
|
|||||||
padding: 18rpx 24rpx;
|
padding: 18rpx 24rpx;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.msg-img {
|
.msg-img {
|
||||||
|
@ -223,7 +223,22 @@ export default {
|
|||||||
//将res.data转为json
|
//将res.data转为json
|
||||||
let json = JSON.parse(res.data)
|
let json = JSON.parse(res.data)
|
||||||
console.log(json.id,'上传图片返回结果')
|
console.log(json.id,'上传图片返回结果')
|
||||||
that.send(json.id, 1, res.data)
|
upload({
|
||||||
|
filePath: tempFilePaths[0],
|
||||||
|
url: 'base64Api/upload',
|
||||||
|
name: 'file',
|
||||||
|
}).then(res1 => {
|
||||||
|
request({
|
||||||
|
url: 'base64Api/inputBase64',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
base64: res1.base64
|
||||||
|
}
|
||||||
|
}).then(res2 => {
|
||||||
|
that.send(json.id, 1, res1.base64)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// that.send(json.id, 1, res.data)
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err,'上传报错')
|
console.log(err,'上传报错')
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user