|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<view-full-screen :is-full-screen="true" class="right">
|
|
<view-full-screen :is-full-screen="true" class="right">
|
|
<div :class="bodyClass">
|
|
<div :class="bodyClass">
|
|
- <div ref="scrollView" class="chatBubbleContainer" :style="{ 'height': 'calc(100% - ' + (52 + safeAreaInsets.bottom) + 'px)' }">
|
|
|
|
|
|
+ <div ref="scrollView" class="chatBubbleContainer" :style="{ 'height': 'calc(100% - ' + (environmentInfo.hasInputBar ? (52 + safeAreaInsets.bottom) : 0) + 'px)' }">
|
|
<template v-if="environmentInfo.hasTopTitle">
|
|
<template v-if="environmentInfo.hasTopTitle">
|
|
<CCDTitleCell :title="botInfo.botName" :image="botInfo.botIcon"></CCDTitleCell>
|
|
<CCDTitleCell :title="botInfo.botName" :image="botInfo.botIcon"></CCDTitleCell>
|
|
</template>
|
|
</template>
|
|
@@ -11,7 +11,7 @@
|
|
</template>
|
|
</template>
|
|
<div style="height: 30px; display: table-row; width: 100%; float: left"></div>
|
|
<div style="height: 30px; display: table-row; width: 100%; float: left"></div>
|
|
</div>
|
|
</div>
|
|
- <div class="bottomAskBar" style="height: 50px; padding-right: 4px" :hidden="!enableInput">
|
|
|
|
|
|
+ <div v-if="environmentInfo.hasInputBar" class="bottomAskBar" style="height: 50px; padding-right: 4px" :hidden="!enableInput">
|
|
<div style="height: 50px; width: calc(100% - 50px);">
|
|
<div style="height: 50px; width: calc(100% - 50px);">
|
|
<input :style="{
|
|
<input :style="{
|
|
marginTop: isHostInApp ? '-4px' : '0px'
|
|
marginTop: isHostInApp ? '-4px' : '0px'
|
|
@@ -156,7 +156,9 @@ export default {
|
|
markdown: "",
|
|
markdown: "",
|
|
prompt: "",
|
|
prompt: "",
|
|
exists: false
|
|
exists: false
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ hasInputBar: true,
|
|
|
|
+ variant: "none"
|
|
},
|
|
},
|
|
allowInput: true,
|
|
allowInput: true,
|
|
model: [
|
|
model: [
|
|
@@ -173,7 +175,8 @@ export default {
|
|
inAppPendingCard: null,
|
|
inAppPendingCard: null,
|
|
inAppSSEHandle: null,
|
|
inAppSSEHandle: null,
|
|
abortController: null,
|
|
abortController: null,
|
|
- enableInput: true
|
|
|
|
|
|
+ enableInput: true,
|
|
|
|
+ hasSuccessRequest: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -181,7 +184,8 @@ export default {
|
|
self.botInfo.botId = self.$route.params.botId
|
|
self.botInfo.botId = self.$route.params.botId
|
|
if (!isNil(xcwk)) {
|
|
if (!isNil(xcwk)) {
|
|
self.environmentInfo.hasTopTitle = boolValue(nilDefault(self.$route.query.hasTopTitle, true))
|
|
self.environmentInfo.hasTopTitle = boolValue(nilDefault(self.$route.query.hasTopTitle, true))
|
|
- console.log("!!!!!XC" + self.$route.query.askFirst)
|
|
|
|
|
|
+ self.environmentInfo.hasInputBar = boolValue(nilDefault(self.$route.query.hasInputBar, true))
|
|
|
|
+ self.environmentInfo.variant = nilDefault(self.$route.query.variant, "none")
|
|
if (self.$route.query.askFirst) {
|
|
if (self.$route.query.askFirst) {
|
|
self.environmentInfo.askFirst = JSON.parse(self.$route.query.askFirst)
|
|
self.environmentInfo.askFirst = JSON.parse(self.$route.query.askFirst)
|
|
self.environmentInfo.askFirst.exists = !isNilOrEmpty(self.environmentInfo.askFirst.markdown) && !isNilOrEmpty(self.environmentInfo.askFirst.prompt)
|
|
self.environmentInfo.askFirst.exists = !isNilOrEmpty(self.environmentInfo.askFirst.markdown) && !isNilOrEmpty(self.environmentInfo.askFirst.prompt)
|
|
@@ -217,6 +221,22 @@ export default {
|
|
self.doubleSelectTabBar(params.dict)
|
|
self.doubleSelectTabBar(params.dict)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else if (key == "ailc.forceStop") {
|
|
|
|
+ self.doShutdownManually()
|
|
|
|
+ }
|
|
|
|
+ else if (key == "ailc.sendMessage") {
|
|
|
|
+ self.startCompletionWithMessage(params.dict.message)
|
|
|
|
+ }
|
|
|
|
+ else if (key == "fe.loginStatusChanged") {
|
|
|
|
+ if (!self.hasSuccessRequest) {
|
|
|
|
+ if (params.dict.status) {
|
|
|
|
+ if (self.environmentInfo.askFirst.exists) {
|
|
|
|
+ self.model = []
|
|
|
|
+ self.startCompletionWithMarkdownAndPrompt(self.environmentInfo.askFirst.markdown, self.environmentInfo.askFirst.prompt)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
xcwk.std.isLogin({ }, function (params) {
|
|
xcwk.std.isLogin({ }, function (params) {
|
|
if (!params.isLogin) {
|
|
if (!params.isLogin) {
|
|
@@ -455,7 +475,13 @@ export default {
|
|
}
|
|
}
|
|
}, function (params) {
|
|
}, function (params) {
|
|
self.inAppSSEHandle = params.sseId
|
|
self.inAppSSEHandle = params.sseId
|
|
|
|
+ self.hasSuccessRequest = true
|
|
IntentManager.llmResponseBegin()
|
|
IntentManager.llmResponseBegin()
|
|
|
|
+ if (!isNil(xcwk.ailc)) {
|
|
|
|
+ xcwk.ailc.markAnswerOutputing({
|
|
|
|
+ "output" : true
|
|
|
|
+ })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
doInAppSSE_ReceiveMessage(message) {
|
|
doInAppSSE_ReceiveMessage(message) {
|
|
@@ -519,6 +545,9 @@ export default {
|
|
// id--;
|
|
// id--;
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
+ xcwk.ailc.markAnswerOutputing({
|
|
|
|
+ "output" : false
|
|
|
|
+ })
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -641,6 +670,11 @@ export default {
|
|
self.allowInput = true
|
|
self.allowInput = true
|
|
self.abortController = null
|
|
self.abortController = null
|
|
self.inAppPendingCard = null
|
|
self.inAppPendingCard = null
|
|
|
|
+ if (!isNil(xcwk.ailc)) {
|
|
|
|
+ xcwk.ailc.markAnswerOutputing({
|
|
|
|
+ "output" : false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
// for (let id = 0; id < self.model.length; id++) {
|
|
// for (let id = 0; id < self.model.length; id++) {
|
|
// if (self.model[id].type == "answerTyping") {
|
|
// if (self.model[id].type == "answerTyping") {
|
|
// self.model.splice(id, 1)
|
|
// self.model.splice(id, 1)
|