|
|
|
|
@ -15,7 +15,6 @@ import { ref, computed, onMounted } from 'vue' |
|
|
|
|
import { storeToRefs } from 'pinia' |
|
|
|
|
import { useAppStore } from '@/store/app.js' |
|
|
|
|
import { Post } from '@/utils/https' |
|
|
|
|
import { jumpOpenWeb } from '@/utils' |
|
|
|
|
import footerBarBtnIcon from '@/assets/images/footer-bar-btn-icon.png' |
|
|
|
|
import footerBarBtnIcon2 from '@/assets/images/footer-bar-btn-icon2.png' |
|
|
|
|
import footerBarBtnIcon3 from '@/assets/images/footer-bar-btn-icon3.png' |
|
|
|
|
@ -24,8 +23,7 @@ import footerBarBtnIcon4 from '@/assets/images/footer-bar-btn-icon4.png' |
|
|
|
|
defineEmits(['onFooterBtnChoose']) |
|
|
|
|
|
|
|
|
|
const store = useAppStore() |
|
|
|
|
const { source, planCode, userInfo, manualService, mescrollContent, elder, isChatLoading } = |
|
|
|
|
storeToRefs(store) |
|
|
|
|
const { source, planCode, userInfo, manualService, mescrollContent, elder } = storeToRefs(store) |
|
|
|
|
|
|
|
|
|
const keywordslist = ref([ |
|
|
|
|
{ name: "查保单", icon: footerBarBtnIcon, URL: "https://yzsslfw.cpiccdn.com/accept_pad/index.html#/phone/base/wxxcxHomeSearch?source=wxxcx&bqtype=search&ticket=%s" }, |
|
|
|
|
@ -34,6 +32,8 @@ const keywordslist = ref([ |
|
|
|
|
{ name: "续期交费", icon: footerBarBtnIcon4, URL: "/packageAgent/pages/renewalPayment/renewalPayment?source_channel=GDFW&ticket=%s" }, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
const issubmit = ref(true) // 防止重复发送 |
|
|
|
|
|
|
|
|
|
const keyWordshow = computed(() => keywordslist.value.length > 0) |
|
|
|
|
const isRobotService = computed(() => String(manualService.value) === '1') |
|
|
|
|
|
|
|
|
|
@ -50,13 +50,25 @@ function scrollTopBody() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function keywordsClick(item) { |
|
|
|
|
// 只把问题写入对话气泡,不走对话接口 |
|
|
|
|
store.addSendMessageList({ msgText: item.name, reqAndResType: '1', sendLoading: false }) |
|
|
|
|
// 没有机器人回复来复位打字动画,这里手动复位,避免"正在输入"一直转 |
|
|
|
|
isChatLoading.value = false |
|
|
|
|
const sendParmas = { |
|
|
|
|
reqAndResType: '1', // 1文本 2图片 3问题评价 |
|
|
|
|
msgText: item.name, |
|
|
|
|
msgSource: manualService.value, // 1机器人 2人工 |
|
|
|
|
questionType: 1, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!issubmit.value) return |
|
|
|
|
issubmit.value = false |
|
|
|
|
scrollTopBody() |
|
|
|
|
|
|
|
|
|
jumpOpenWeb('YY_GWXCX', item.URL) |
|
|
|
|
store |
|
|
|
|
.sendingRobot(sendParmas) |
|
|
|
|
.catch((err) => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
.finally(() => { |
|
|
|
|
issubmit.value = true |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function initFooterBtn() { |
|
|
|
|
|