This commit is contained in:
X1627315083
2023-12-12 15:17:54 +08:00
parent d2dfcd4c45
commit e6c8fe3866
3 changed files with 66 additions and 39 deletions

View File

@@ -3,21 +3,21 @@
<div class="robot_top" ref="robotDom" v-fade="robotTop,'block'">
<div :class="[item.state == 1?'text_right':'text_left',item.img?'white':'']" v-for="item,index in record" ref="robotChildDom">
<div class="robot_text">
<span>
<span v-if="!driver__.driver">
{{item.str}}
<a v-if="item.src" :href="item.src" target="_blank"><i class="fi fi-br-link-alt"></i></a>
</span>
<span class="driver__" v-if="driver__.driver">
{{item.str}}
<div class="driver__btn" v-if="item.driver">
<span @click="setDriver">
Yes
</span>
<span @click="removeDriver">
No
</span>
</div>
</span>
<div class="driver__btn" v-if="item.driver">
<span @click="setDriver">
Yes
</span>
<span @click="removeDriver">
No
</span>
</div>
<div class="robot_img" :class="[item.img ?'img':'']">
<div class="robot_img_item" v-for="imgItem,imgIndex in item.img">
<img :src="imgItem.presignedUrl" alt="">
@@ -57,7 +57,7 @@
import { defineComponent, createVNode,computed, ref,Ref} from "vue";
import { UserOutlined, DownOutlined } from "@ant-design/icons-vue";
import { Https } from "@/tool/https";
import { getCookie } from "@/tool/cookie";
import { getCookie,setCookie } from "@/tool/cookie";
import { useStore } from "vuex";
import { message } from "ant-design-vue";
import { openGuide,driverObj__ } from "@/tool/guide";
@@ -124,6 +124,8 @@ export default defineComponent({
str:"Welcome to AiDA. I am your friendly fashion design assistant. If you have any questions or need assistance, please don't hesitate to ask. ",
driver:false,
})
console.log(this.record);
this.textScroll()
setTimeout(() => {
this.record.push({
@@ -289,21 +291,34 @@ export default defineComponent({
// Https.axiosPost(Https.httpUrls.pythonChatStream, data,interaction).then(
(rv) => {
if(rv){
if(rv.chatRobotLibraryList != null){
if(rv.isTutorial){
this.record.push({
state:1,
img:rv.chatRobotLibraryList
str:"We need to refresh the page before starting the tutorial,Would you like to start the tutorial now?",
driver:true,
})
}else{
this.record.push({
state:1,
str:rv.output,
})
if(rv.chatRobotLibraryList != null){
this.record.push({
state:1,
img:rv.chatRobotLibraryList
})
}else{
this.record.push({
state:1,
str:rv.output,
})
}
}
sessionStorage.setItem('record', JSON.stringify(this.record));
this.createTimer()
this.textScroll()
this.getBloodBars()
// if(rv.isTutorial){
// window.location.reload()
// setCookie("isBeginner", true);
// }
}
}
).catch(res=>{
@@ -315,6 +330,10 @@ export default defineComponent({
driverObj__.moveNext();
this.robotTop = false
this.robotInput = false
}else{
window.location.reload()
setCookie("isBeginner", true);
setCookie("isBeginnerNum", 1);
}
},
removeDriver(){
@@ -429,17 +448,18 @@ export default defineComponent({
// margin-right: 5%;
}
}
.driver__{
.driver__btn{
width: 100%;
margin-top: 1rem;
display: flex;
justify-content: space-around;
span{
font-size: 1.4em;
color: #9efff4;
cursor: pointer;
}
// .driver__{
// }
.driver__btn{
width: 100%;
margin-top: 1rem;
display: flex;
justify-content: space-around;
span{
font-size: 1.4em;
color: #9efff4;
cursor: pointer;
}
}
}