|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
- <view class="container" :style="{'top': (viewTop / 10) + 'vw', 'height': viewHeight + 'px'}">
|
|
|
+ <view class="container" :style="{'top': viewTop + 'px', 'height': viewHeight + 'px'}">
|
|
|
<view class="content">
|
|
|
- <scroll-view scroll-y="true" :show-scrollbar="false" :scroll-top="scroll_top" style="top: 0%;width: 80vw; height:65%;position: absolute;">
|
|
|
+ <scroll-view scroll-y="true" :show-scrollbar="false" :scroll-top="scroll_top" style="position: fixed; top: 70px;width: 80vw; bottom: 210upx;">
|
|
|
<view class="scroll-view-text">
|
|
|
<view style="margin-left: 13%; display: flex; align-items: center;justify-content: center;width: 100%; user-select: text;" v-for="(msgIndex,index) in recvMsgQueue " :key="index">
|
|
|
<!-- ai 的消息结构体 -->
|
|
@@ -27,10 +27,10 @@
|
|
|
</view>
|
|
|
|
|
|
|
|
|
-
|
|
|
- <view style=" display: flex;flex-wrap: wrap;width: 50%;">
|
|
|
- <view style="width: 23%;justify-content: center;align-items: center;display: flex;margin-top: 2%; margin-right: 2%;" v-for="(item,i) in recvMsgQueue[index].actions" key="key">
|
|
|
- <view @click="clickitem(recvMsgQueue[index].actions[i],recvMsgQueue[index].image_id)" style="background-color: #32B3AA;display: flex; box-sizing: border-box; border-radius: 5px;align-items: center;justify-content: center;width: 100%; padding: 2%; font-size: 1.7vw; word-break: break-all; text-overflow: ellipsis; word-wrap: break-word; white-space: pre-wrap; text-align: center;">{{recvMsgQueue[index].actions[i]}}</view>
|
|
|
+ <view style=" display: flex;flex-wrap: wrap;width: 400px;">
|
|
|
+ <view style="width: 23%;justify-content: center;align-items: center;display: flex;margin-top: 2%; margin-right: 2%;" v-for="(item,i) in recvMsgQueue[index].actions" :key="i">
|
|
|
+ <view @click="clickitem(recvMsgQueue[index].actions[i],recvMsgQueue[index].image_id)"
|
|
|
+ style="background-color: #32B3AA;display: flex; box-sizing: border-box; border-radius: 5px;align-items: center;justify-content: center;width: 100%; padding: 2%; font-size: 16px; word-break: break-all; text-overflow: ellipsis; word-wrap: break-word; white-space: pre-wrap; text-align: center;">{{recvMsgQueue[index].actions[i].text}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -208,7 +208,10 @@
|
|
|
return hljs.highlightAuto(code).value;
|
|
|
},
|
|
|
langPrefix:"hljs language-"
|
|
|
- });
|
|
|
+ });
|
|
|
+
|
|
|
+ this.recvMsgQueue = uni.getStorageSync('recvMsgQueue')
|
|
|
+ // console.log('this.recvMsgQueue[0].actions=',this.recvMsgQueue[0].actions)
|
|
|
},
|
|
|
props: {
|
|
|
viewTop: {
|
|
@@ -296,7 +299,7 @@
|
|
|
// reader.readAsDataURL(file) // 读取文件并启动onload回调函数
|
|
|
},
|
|
|
clickitem(action,image_id){
|
|
|
- switch(action){
|
|
|
+ switch(action.id){
|
|
|
case "upsample1":
|
|
|
break;
|
|
|
case "upsample2":
|
|
@@ -316,7 +319,14 @@
|
|
|
}
|
|
|
console.log("clickitem",this.recvStatus,action,image_id)
|
|
|
if(!this.recvStatus){
|
|
|
- this.sendSocketMessage(action,'','',action,image_id)
|
|
|
+ // this.sendSocketMessage(action,'','',action,image_id)
|
|
|
+ this.sendSocketMessage(action.text,'','',action.id,image_id)
|
|
|
+ // this.recvMsgQueue.push({who_msg:config.type_self,msg_type:0,msg_text:action.text,isFinish:true,'des_img':image_id})
|
|
|
+ // this.initAni()
|
|
|
+ let self = this
|
|
|
+ setTimeout(function() {
|
|
|
+ self.showLastMsg()
|
|
|
+ }, 500);
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -577,10 +587,45 @@
|
|
|
self.recvMsgQueue[self.recvMsgQueue.length-1].actions = [];
|
|
|
let list = [];
|
|
|
list = res.data.actions;
|
|
|
+ // for (var i = 0; i < list.length; i++) {
|
|
|
+ // self.recvMsgQueue[self.recvMsgQueue.length-1].actions.push(list[i])
|
|
|
+ // }
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
- self.recvMsgQueue[self.recvMsgQueue.length-1].actions.push(list[i])
|
|
|
+ let action = list[i]
|
|
|
+ let dic = {}
|
|
|
+ switch (action){
|
|
|
+ case 'upsample1':
|
|
|
+ dic = {'id': action, 'text': '放大1'}
|
|
|
+ break;
|
|
|
+ case 'upsample2':
|
|
|
+ dic = {'id': action, 'text': '放大2'}
|
|
|
+ break;
|
|
|
+ case 'upsample3':
|
|
|
+ dic = {'id': action, 'text': '放大3'}
|
|
|
+ break;
|
|
|
+ case 'upsample4':
|
|
|
+ dic = {'id': action, 'text': '放大4'}
|
|
|
+ break;
|
|
|
+ case 'variation1':
|
|
|
+ dic = {'id': action, 'text': '优化1'}
|
|
|
+ break;
|
|
|
+ case 'variation2':
|
|
|
+ dic = {'id': action, 'text': '优化2'}
|
|
|
+ break;
|
|
|
+ case 'variation3':
|
|
|
+ dic = {'id': action, 'text': '优化3'}
|
|
|
+ break;
|
|
|
+ case 'variation4':
|
|
|
+ dic = {'id': action, 'text': '优化4'}
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ dic = {'id': action, 'text': action}
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // console.log('action.dic=',dic)
|
|
|
+ self.recvMsgQueue[self.recvMsgQueue.length-1].actions.push(dic)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}else{
|
|
|
uni.showModal({
|
|
|
content:res.data.detail+":"+res.statusCode,
|