Compare commits

..

No commits in common. '0cec477441e41596bd33ba288aea5b6e1a669730' and '2ebc70e2642620cb0566062409e715a2b19dd198' have entirely different histories.

  1. 10
      src/components/abstract.vue
  2. 19
      src/components/business-handle.vue
  3. 6
      src/components/footer-bar-input.vue
  4. 16
      src/store/app.js
  5. 2
      src/utils/utils.js

@ -54,21 +54,11 @@ const businessHandle = (userId) => {
) { ) {
return Post("notify/info", { userInfoId: userId }) return Post("notify/info", { userInfoId: userId })
.then((res) => { .then((res) => {
if (import.meta.env.VITE_USER_NODE_ENV === 'development') {
businessHandleInfo.value = {
contents: [
{
name: '测试待办'
}
]
}
} else {
if (res.data?.contents?.length > 0) { if (res.data?.contents?.length > 0) {
businessHandleInfo.value = res.data businessHandleInfo.value = res.data
} else { } else {
businessHandleInfo.value = {} businessHandleInfo.value = {}
} }
}
store?.setBusinessHandleInfo?.(businessHandleInfo.value) store?.setBusinessHandleInfo?.(businessHandleInfo.value)
}) })
.catch((error) => { .catch((error) => {

@ -46,18 +46,18 @@
</template> </template>
<script setup> <script setup>
import { ref, computed, watch } from 'vue' import { ref, inject, computed, watch } from 'vue'
import { storeToRefs } from 'pinia'
import { Icon, Swipe, SwipeItem, Popup } from 'vant' import { Icon, Swipe, SwipeItem, Popup } from 'vant'
import { useAppStore } from '@/store/app.js'
const props = defineProps({ const props = defineProps({
businessHandleInfo: { type: Object, default: () => ({}) }, businessHandleInfo: { type: Object, default: () => ({}) },
autoOpen: { type: Boolean, default: true }, autoOpen: { type: Boolean, default: true },
}) })
const store = useAppStore() const store = inject('appStore', null)
const { userId, mescrollContent, manualService, businessHandleInfo: storeBusinessHandleInfo } = storeToRefs(store) const userId = inject('userId', ref(''))
const mescrollContent = inject('mescrollContent', ref(null))
const manualService = inject('manualService', ref('1'))
const Popupshow = ref(false) const Popupshow = ref(false)
const isBtnsubmit = ref(true) const isBtnsubmit = ref(true)
@ -66,7 +66,7 @@ const hasAutoOpened = ref(false)
const displayInfo = computed(() => { const displayInfo = computed(() => {
const fromProp = props.businessHandleInfo const fromProp = props.businessHandleInfo
if (fromProp && Array.isArray(fromProp.contents) && fromProp.contents.length) return fromProp if (fromProp && Array.isArray(fromProp.contents) && fromProp.contents.length) return fromProp
return storeBusinessHandleInfo.value || {} return store?.businessHandleInfo || {}
}) })
function getIconUrl(icon) { function getIconUrl(icon) {
@ -92,7 +92,7 @@ function richCallAnswer(item) {
serialNumber, serialNumber,
clickTime: new Date().getTime() clickTime: new Date().getTime()
} }
Promise.resolve(store.updateClickTime?.(mdParmas)).catch(err => { store?.dispatch?.('updateClickTime', mdParmas).catch(err => {
console.error(err) console.error(err)
}) })
@ -102,15 +102,14 @@ function richCallAnswer(item) {
msgText: '&' + text + '&', msgText: '&' + text + '&',
intentId: '', intentId: '',
msgSource: manualService.value, msgSource: manualService.value,
realText: text, questionType: 6
questionType: 6,
} }
if (isBtnsubmit.value) { if (isBtnsubmit.value) {
isBtnsubmit.value = false isBtnsubmit.value = false
Popupshow.value = false Popupshow.value = false
scrollTopBody() scrollTopBody()
const sending = store.sendingRobot(sendParmas) const sending = store?.sendingRobot?.(sendParmas) || store?.dispatch?.('sendingRobot', sendParmas)
Promise.resolve(sending).then(() => { Promise.resolve(sending).then(() => {
isBtnsubmit.value = true isBtnsubmit.value = true
}).catch(err => { }).catch(err => {

@ -8,7 +8,7 @@
v-for="(item, index) in wordList" :key="index" @click.stop="lenovoQuery(item.name)" v-for="(item, index) in wordList" :key="index" @click.stop="lenovoQuery(item.name)"
v-show="doesMatchMessage(item.name)"> v-show="doesMatchMessage(item.name)">
<div class="word-cell__bd word-cell_primary"> <div class="word-cell__bd word-cell_primary">
<span v-html="brightenKeyword(item.name)"></span> <p v-html="brightenKeyword(item.name)"></p>
</div> </div>
<span class="word-cell__ft"></span> <span class="word-cell__ft"></span>
</a> </a>
@ -1074,7 +1074,7 @@ textarea:-ms-input-placeholder {
height: 47rem; height: 47rem;
text-align: left; text-align: left;
font-family: SourceHanSansCN-Regular; font-family: SourceHanSansCN-Regular;
font-size: 14rem; font-size: 15rem;
color: #717985; color: #717985;
line-height: 47rem; line-height: 47rem;
overflow: hidden; overflow: hidden;
@ -1090,8 +1090,6 @@ textarea:-ms-input-placeholder {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
padding: 8rem;
color: #2c3562;
} }
.word-cell__ft { .word-cell__ft {

@ -370,15 +370,13 @@ export const useAppStore = defineStore('app', () => {
function getConversationMessageText(payload) { function getConversationMessageText(payload) {
if (typeof payload === 'string' || typeof payload === 'number') return String(payload) if (typeof payload === 'string' || typeof payload === 'number') return String(payload)
// 展示优先 realText(如待办发送的可读文案),接口仍用 msgText(如 &xxx&)
return ( return (
payload?.realText || payload?.msgText ??
payload?.msgText || payload?.answer ??
payload?.answer || payload?.answerText ??
payload?.answerText || payload?.content ??
payload?.content || payload?.text ??
payload?.text || payload?.message?.[0]?.options?.label ??
payload?.message?.[0]?.options?.label ||
'' ''
) )
} }
@ -722,7 +720,6 @@ export const useAppStore = defineStore('app', () => {
reqAndResType: payload.reqAndResType, // 1文本 2图片 3问提评价 reqAndResType: payload.reqAndResType, // 1文本 2图片 3问提评价
msgType: payload.msgType || '', msgType: payload.msgType || '',
msgText: payload.msgText, msgText: payload.msgText,
realText: payload.realText || '',
file: payload.file || '', file: payload.file || '',
filename: payload.filename || '', filename: payload.filename || '',
formData: payload.formData || '', formData: payload.formData || '',
@ -1044,7 +1041,6 @@ export const useAppStore = defineStore('app', () => {
reqAndResType: payload.reqAndResType, reqAndResType: payload.reqAndResType,
msgType: payload.msgType || '', msgType: payload.msgType || '',
msgText: payload.msgText, msgText: payload.msgText,
realText: payload.realText || '',
intentId: payload.intentId || '', intentId: payload.intentId || '',
source: source.value, source: source.value,
timestamp: payload.timestamp || Date.now(), timestamp: payload.timestamp || Date.now(),

@ -921,7 +921,7 @@ export default {
normalizeMessage: function (item) { normalizeMessage: function (item) {
if (!item || typeof item !== 'object') return item; if (!item || typeof item !== 'object') return item;
let msgText = item.realText || item.msgText || ''; let msgText = item.msgText || '';
// 保单时效性类型的答案,直接返回 // 保单时效性类型的答案,直接返回
if(!!item.cmd && (item.cmd == 'yhzzsx' || if(!!item.cmd && (item.cmd == 'yhzzsx' ||
item.cmd == 'fhzzsx' || item.cmd == 'fhzzsx' ||

Loading…
Cancel
Save