parent
2dfd94a5e3
commit
d86cb71a0e
@ -1,115 +1,206 @@ |
|||||||
<template> |
<template> |
||||||
<div class="product-card-container" v-if="productList && productList.length > 0"> |
<div class="product-card-list"> |
||||||
<div class="product-card" v-for="(product, index) in productList" :key="index"> |
<!-- 空状态 --> |
||||||
<div class="card-header"> |
<div v-if="!products || products.length === 0" class="empty-state"> |
||||||
<h3 class="product-name">{{ product.productName || product.name }}</h3> |
暂未配置,请稍后再来看吧~ |
||||||
<span class="product-code" v-if="product.productCode">{{ product.productCode }}</span> |
|
||||||
</div> |
</div> |
||||||
<div class="card-body"> |
|
||||||
<div class="product-desc" v-if="product.description">{{ product.description }}</div> |
<!-- 产品列表 --> |
||||||
<div class="product-features" v-if="product.features && product.features.length"> |
<template v-else> |
||||||
<span class="feature-tag" v-for="(tag, idx) in product.features" :key="idx">{{ tag }}</span> |
<div class="product-card" v-for="item in displayProducts" :key="item.id"> |
||||||
|
<div class="product-info"> |
||||||
|
<div class="product-name">{{ item.productName }}</div> |
||||||
|
<div class="product-desc"> |
||||||
|
<span v-if="shouldTruncate(item)"> |
||||||
|
{{ item.productDesc.substring(0, textLimit) }}... |
||||||
|
<span class="expand-btn" @click.stop="expandItem(item.id)">点击查看全部</span> |
||||||
|
</span> |
||||||
|
<span v-else> |
||||||
|
{{ item.productDesc }} |
||||||
|
</span> |
||||||
</div> |
</div> |
||||||
|
|
||||||
|
<!-- 按钮区域 --> |
||||||
|
<div class="product-actions"> |
||||||
|
<button v-if="item.introQuestion" class="action-btn" |
||||||
|
@click="handleActionClick(item.productName, item.productCode, item.introQuestion, '产品咨询')"> |
||||||
|
产品咨询 |
||||||
|
</button> |
||||||
|
<button v-if="item.reserveQuestion" class="action-btn" |
||||||
|
@click="handleActionClick(item.productName, item.productCode, item.reserveQuestion, '投保预约')"> |
||||||
|
投保预约 |
||||||
|
</button> |
||||||
</div> |
</div> |
||||||
<div class="card-footer" v-if="product.price || product.actionText"> |
|
||||||
<span class="price" v-if="product.price">{{ product.price }}</span> |
|
||||||
<button class="action-btn" v-if="product.actionText" @click="handleAction(product)">{{ product.actionText |
|
||||||
}}</button> |
|
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
|
|
||||||
|
<!-- 查看更多按钮 --> |
||||||
|
<div v-if="products.length > maxDisplay" class="view-more" @click="handleViewMore"> |
||||||
|
查看更多 |
||||||
|
</div> |
||||||
|
</template> |
||||||
</div> |
</div> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script setup> |
<script setup> |
||||||
|
import { ref, computed, inject } from 'vue' |
||||||
|
import { messageSend } from '@/utils/api' |
||||||
|
|
||||||
const props = defineProps({ |
const props = defineProps({ |
||||||
productList: { type: Array, default: () => [] } |
products: { type: Array, default: () => [] }, |
||||||
}) |
}) |
||||||
|
|
||||||
const emit = defineEmits(['action']) |
const store = inject('appStore', null) |
||||||
|
const maxDisplay = ref(3) |
||||||
|
const expandedMap = ref({}) |
||||||
|
const textLimit = 25 |
||||||
|
|
||||||
|
const displayProducts = computed(() => props.products.slice(0, maxDisplay.value)) |
||||||
|
|
||||||
function handleAction(product) { |
function handleViewMore() { |
||||||
emit('action', product) |
maxDisplay.value += 3 |
||||||
} |
} |
||||||
</script> |
|
||||||
|
|
||||||
<style scoped> |
// 是否需要截断 |
||||||
.product-card-container { |
function shouldTruncate(item) { |
||||||
padding: 8px 0; |
if (!item.productDesc) return false |
||||||
|
if (expandedMap.value[item.id]) return false |
||||||
|
return item.productDesc.length > textLimit |
||||||
} |
} |
||||||
|
|
||||||
.product-card { |
// 展开单个条目 |
||||||
background: #fff; |
function expandItem(id) { |
||||||
border-radius: 12px; |
expandedMap.value[id] = true |
||||||
padding: 16px; |
|
||||||
margin-bottom: 12px; |
|
||||||
border: 1px solid #f0f0f0; |
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); |
|
||||||
} |
} |
||||||
|
|
||||||
.card-header { |
// 处理按钮点击事件 |
||||||
display: flex; |
function handleActionClick(productName, productCode, question, buttonName) { |
||||||
align-items: center; |
if (!question) { |
||||||
justify-content: space-between; |
console.warn('问句为空,无法发送') |
||||||
margin-bottom: 8px; |
return |
||||||
|
} |
||||||
|
sendQuestion(question) |
||||||
} |
} |
||||||
|
|
||||||
.product-name { |
// 发送问句 |
||||||
font-size: 16px; |
function sendQuestion(text) { |
||||||
font-weight: 600; |
// sendingRobot 内部 addSendMessageList 会把用户消息写入 chatArr,无需重复 pushUserMessage |
||||||
color: #333; |
messageSend(text, { questionType: 10 }) |
||||||
margin: 0; |
.then(() => { |
||||||
|
console.log('产品卡片问句发送成功') |
||||||
|
}) |
||||||
|
.catch((err) => { |
||||||
|
console.log(err) |
||||||
|
}) |
||||||
} |
} |
||||||
|
</script> |
||||||
|
|
||||||
.product-code { |
<style lang="scss" scoped> |
||||||
font-size: 12px; |
.product-card-list { |
||||||
|
width: 100%; |
||||||
|
|
||||||
|
.empty-state { |
||||||
|
padding: 24px 16px; |
||||||
|
text-align: center; |
||||||
color: #999; |
color: #999; |
||||||
|
font-size: 14px; |
||||||
|
background: #f9f9f9; |
||||||
|
border-radius: 8px; |
||||||
} |
} |
||||||
|
|
||||||
.card-body { |
.product-card { |
||||||
margin-bottom: 12px; |
display: flex; |
||||||
|
align-items: flex-start; |
||||||
|
background: #fff; |
||||||
|
border-radius: 8px; |
||||||
|
overflow: hidden; |
||||||
|
margin-bottom: 10px; |
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); |
||||||
|
|
||||||
|
.product-cover { |
||||||
|
width: 80px; |
||||||
|
height: 80px; |
||||||
|
flex-shrink: 0; |
||||||
|
background: linear-gradient(135deg, #1a2b4a 0%, #2c3e5d 100%); |
||||||
|
|
||||||
|
img { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.product-info { |
||||||
|
flex: 1; |
||||||
|
padding: 8px 12px; |
||||||
|
min-width: 0; |
||||||
|
|
||||||
|
.product-name { |
||||||
|
font-size: 15px; |
||||||
|
font-weight: 600; |
||||||
|
color: #333; |
||||||
|
margin-bottom: 10px; |
||||||
|
word-break: break-all; |
||||||
} |
} |
||||||
|
|
||||||
.product-desc { |
.product-desc { |
||||||
font-size: 13px; |
font-size: 13px; |
||||||
color: #666; |
color: #777; |
||||||
line-height: 1.5; |
line-height: 1.4; |
||||||
|
word-break: break-all; |
||||||
|
|
||||||
|
.expand-btn { |
||||||
|
color: #4f95fd; |
||||||
|
cursor: pointer; |
||||||
|
margin-left: 2px; |
||||||
|
display: inline-block; |
||||||
|
} |
||||||
} |
} |
||||||
|
|
||||||
.product-features { |
.product-actions { |
||||||
display: flex; |
display: flex; |
||||||
flex-wrap: wrap; |
flex-wrap: wrap; |
||||||
gap: 6px; |
gap: 7px; |
||||||
margin-top: 8px; |
margin-top: 10px; |
||||||
} |
} |
||||||
|
|
||||||
.feature-tag { |
.action-btn { |
||||||
display: inline-block; |
height: auto; |
||||||
padding: 2px 8px; |
padding: 4px 0; |
||||||
background: #f0f6ff; |
width: 77px; |
||||||
color: #025CEA; |
text-align: center; |
||||||
border-radius: 4px; |
border-radius: 15px; |
||||||
font-size: 11px; |
font-family: PingFangSC-Regular, "PingFang SC", sans-serif; |
||||||
} |
font-size: 12px; |
||||||
|
letter-spacing: -1px; |
||||||
.card-footer { |
background: #ffffff; |
||||||
|
color: #17204D; |
||||||
|
border: 1px solid #7E849F; |
||||||
|
cursor: pointer; |
||||||
|
transition: all 0.2s ease; |
||||||
display: flex; |
display: flex; |
||||||
|
justify-content: center; |
||||||
align-items: center; |
align-items: center; |
||||||
justify-content: space-between; |
|
||||||
} |
} |
||||||
|
|
||||||
.price { |
.action-btn:active { |
||||||
font-size: 18px; |
background: #f5f5f5; |
||||||
font-weight: 600; |
} |
||||||
color: #ff4757; |
} |
||||||
} |
} |
||||||
|
|
||||||
.action-btn { |
.view-more { |
||||||
padding: 6px 16px; |
text-align: center; |
||||||
background: #025CEA; |
padding: 12px; |
||||||
color: #fff; |
color: #4f95fd; |
||||||
border: none; |
font-size: 14px; |
||||||
border-radius: 20px; |
background: #f0f7ff; |
||||||
font-size: 13px; |
border-radius: 8px; |
||||||
cursor: pointer; |
cursor: pointer; |
||||||
|
|
||||||
|
&:active { |
||||||
|
background: #e0efff; |
||||||
|
} |
||||||
|
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
|||||||
@ -1,131 +1,629 @@ |
|||||||
<template> |
<template> |
||||||
<div class="product-component"> |
<div> |
||||||
<div class="product-wrapper" v-if="productData"> |
<div class="product_body"> |
||||||
<div class="product-header" v-if="productData.title"> |
<div :class="{ hiddenMore: showTotal }" class="bg_white" ref="productEl"> |
||||||
<h3>{{ productData.title }}</h3> |
<!-- 产品头部 --> |
||||||
|
<div class="product_top"> |
||||||
|
<div class="title_body"> |
||||||
|
<div class="title"> |
||||||
|
<span class="text_content">{{ resultData.productName }}</span> |
||||||
|
<span class="mark">{{ resultData.isSale }}</span> |
||||||
</div> |
</div> |
||||||
<div class="product-body"> |
|
||||||
<div class="product-item" v-for="(item, index) in productData.list" :key="index" |
|
||||||
@click="handleProductClick(item)"> |
|
||||||
<div class="product-icon" v-if="item.icon"> |
|
||||||
<img :src="item.icon" :alt="item.name" /> |
|
||||||
</div> |
</div> |
||||||
<div class="product-info"> |
<div class="labels_body"> |
||||||
<div class="product-title">{{ item.name }}</div> |
<div class="label" v-if="!!resultData.coreOne"> |
||||||
<div class="product-subtitle" v-if="item.subtitle">{{ item.subtitle }}</div> |
<img :src="labelesImg" /> |
||||||
|
<span>{{ resultData.coreOne }}</span> |
||||||
</div> |
</div> |
||||||
<div class="product-arrow"> |
<div class="label" v-if="!!resultData.coreTwo"> |
||||||
<van-icon name="arrow" /> |
<img :src="labelesImg" /> |
||||||
|
<span>{{ resultData.coreTwo }}</span> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
|
<div v-if="!!resultData.insClausesFlag" class="product_exemption"> |
||||||
|
此险种有多个版本,点击“条款原文”查看其它历史版本 |
||||||
|
</div> |
||||||
|
<!-- 产品内容部分 --> |
||||||
|
<div class="product_main"> |
||||||
|
<div class="product_modules"> |
||||||
|
<div class="base_module"> |
||||||
|
<!-- 列表集合 --> |
||||||
|
<div class="list" v-for="item in baseModuleData" :key="item.id" v-show="!!item.val"> |
||||||
|
<div class="list_label">{{ item.key }}:</div> |
||||||
|
<div class="list_content"> |
||||||
|
<span class="value" :class="{ noBtn: !item.tkywValue }" v-html="item.val"></span> |
||||||
|
<div @click="showGraph(item)" v-show="!!item.tkywValue" class="tkk_btn"> |
||||||
|
条款原文 |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<!-- 保险责任 --> |
||||||
|
<div class="more_module"> |
||||||
|
<div class="top_right_bg"> |
||||||
|
<!-- 列表集合 --> |
||||||
|
<div class="list" v-for="item in resultData.insDuty" :key="item.key"> |
||||||
|
<div class="list_label"> |
||||||
|
<span class="list_label_span"> |
||||||
|
{{ item.key }}: |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<div class="list_content" v-if="item.isRender" v-html="item.completedData"></div> |
||||||
|
<div class="list_content" v-else> |
||||||
|
<template v-for="(completedItem, cIdx) in item.completedData" :key="cIdx"> |
||||||
|
<span class="more_text" v-if="typeof completedItem === 'string'" |
||||||
|
v-html="completedItem"></span> |
||||||
|
<span class="more_button" v-else @click="showImgPopup(completedItem.urlValue)"> |
||||||
|
{{ completedItem.urlkey }} |
||||||
|
</span> |
||||||
|
</template> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="tip">具体以条款为准</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<!-- 产品底部 --> |
||||||
|
<div class="product_bottom"> |
||||||
|
<div class="bottom_modules"> |
||||||
|
<div class="img_module" :class="bottomModuleNum ? 'min_witch' : ''" v-show="!!item.url" |
||||||
|
v-for="item in bottomModulesData" :key="item.id"> |
||||||
|
<img @click="clickBottomBtn(item.name)" :src="item.src" /> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<!-- 关联问 --> |
||||||
|
<div class="content-question-answer" v-if="intents && intents.length > 0"> |
||||||
|
<button :class="hasClicked ? 'answer-items setGrey' : 'answer-items'" |
||||||
|
v-for="(items, index) in intents" :key="index" @click.stop="richCallAnswer(items)"> |
||||||
|
{{ items.intent }} |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<!-- 展开拉起 --> |
||||||
|
<div class="unfold-box" :class="exchangeButton ? 'unfold-bg' : 'unfold-style'" v-if="showExchangeButton"> |
||||||
|
<a href="javascript:;" @click="showTotalIntro">{{ exchangeButton ? "展开" : "收起" |
||||||
|
}}<em class="look-more-icon" :class="!exchangeButton ? 'active' : ''"></em></a> |
||||||
|
</div> |
||||||
|
<!-- 弹出层 --> |
||||||
|
<van-popup class="popup" :style="{ height: '85%', borderRadius: '10px 10px 0px 0px' }" |
||||||
|
v-model:show="popUpFlag" teleport="body" position="bottom"> |
||||||
|
<div class="detaill_body"> |
||||||
|
<div class="detaill_title"> |
||||||
|
{{ detaillTitle }} |
||||||
|
</div> |
||||||
|
<!-- 条款原文 --> |
||||||
|
<div class="detaill_content" v-show="nowPopType === 'tkyw'"> |
||||||
|
<div v-html="tkywValue"></div> |
||||||
|
</div> |
||||||
|
<img :style="{ width: '100%', maxWidth: 'none' }" class="product_img" :src="productImgUrl" |
||||||
|
v-if="!!productImgUrl && nowPopType === 'img'" /> |
||||||
|
</div> |
||||||
|
</van-popup> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script setup> |
<script setup> |
||||||
import { ref, inject, onMounted } from 'vue' |
import { ref, computed, inject } from 'vue' |
||||||
import { Icon } from 'vant' |
import { useRouter } from 'vue-router' |
||||||
|
import _ from 'lodash' |
||||||
|
import wx from 'weixin-js-sdk' |
||||||
|
import Utils from '@/utils/utils' |
||||||
|
import labelesImg from '@/assets/images/product/icon_yes.png' |
||||||
|
import bottomTkywImg from '@/assets/images/product/bottom_tkyw.png' |
||||||
|
|
||||||
const props = defineProps({ |
const props = defineProps({ |
||||||
data: { type: Object, default: () => ({}) }, |
responseData: { type: Object, default: () => ({}) }, |
||||||
productId: { type: String, default: '' } |
intents: { type: Array, default: () => [] }, |
||||||
|
itemlist: { type: Object, default: () => ({}) }, |
||||||
}) |
}) |
||||||
|
|
||||||
|
const router = useRouter() |
||||||
const store = inject('appStore', null) |
const store = inject('appStore', null) |
||||||
const productData = ref(null) |
|
||||||
|
|
||||||
onMounted(() => { |
const resultData = ref({}) // 处理后的数据 |
||||||
if (props.data && props.data.specialData) { |
const baseModuleData = ref([]) |
||||||
productData.value = { |
const popUpFlag = ref(false) |
||||||
title: props.data.specialData.title || '', |
const productImgUrl = ref('') |
||||||
list: props.data.specialData.list || props.data.specialData.data || [] |
const bottomModulesData = ref([ |
||||||
|
{ id: 1, name: 'TKYW', src: bottomTkywImg, url: '' }, |
||||||
|
]) |
||||||
|
const exchangeButton = ref(true) // 是否显示展开收起按钮 |
||||||
|
const showExchangeButton = ref(true) |
||||||
|
const showTotal = ref(true) // 显示展开还是收起 |
||||||
|
const isBtnsubmit = ref(true) // 防止关联问发送 |
||||||
|
const nowPopType = ref('') |
||||||
|
const tkywValue = ref('') |
||||||
|
const detaillTitle = ref('') |
||||||
|
const hasClicked = ref(false) |
||||||
|
|
||||||
|
const bottomModuleNum = computed( |
||||||
|
() => bottomModulesData.value.filter((item) => !!item.url).length > 3, |
||||||
|
) |
||||||
|
|
||||||
|
// —— created:解析产品模板数据 —— |
||||||
|
const allData = _.cloneDeep(_.get(props.responseData, 'productInfo')) || {} |
||||||
|
const originProDuctData = allData.insDuty || {} |
||||||
|
const originalText = _.cloneDeep(_.get(props.responseData, 'originalText')) // 图谱数据 |
||||||
|
resultData.value = allData |
||||||
|
// 格式化保险责任:按 | 与 ; 拆分为文本/链接 |
||||||
|
const dutyList = [] |
||||||
|
for (const i in originProDuctData) { |
||||||
|
const result = {} |
||||||
|
result.key = i |
||||||
|
const productVal = originProDuctData[i] |
||||||
|
if (String(productVal).includes('|')) { |
||||||
|
result.isRender = false |
||||||
|
const beforeData = String(productVal).split('|') |
||||||
|
result.completedData = beforeData.map((item) => { |
||||||
|
if (item.includes(':')) { |
||||||
|
const urlData = item.split(';') |
||||||
|
return { urlkey: urlData[0], urlValue: urlData[1] } |
||||||
|
} |
||||||
|
return item |
||||||
|
}) |
||||||
|
} else { |
||||||
|
result.isRender = true |
||||||
|
result.completedData = originProDuctData[i] |
||||||
|
} |
||||||
|
dutyList.push(result) |
||||||
|
} |
||||||
|
allData.insDuty = dutyList |
||||||
|
resultData.value = allData |
||||||
|
// 基本保额等模块,其中含条款原文对应数据 |
||||||
|
baseModuleData.value = [ |
||||||
|
{ key: '保险类型', val: _.get(resultData.value, 'insType'), id: 0 }, |
||||||
|
{ key: '开停办时间', val: _.get(resultData.value, 'osTime'), id: 1 }, |
||||||
|
{ key: '投保年龄', val: _.get(resultData.value, 'insdAge'), id: 2 }, |
||||||
|
{ key: '保险期间', val: _.get(resultData.value, 'insPeriod'), id: 3 }, |
||||||
|
{ key: '交费方式', val: _.get(resultData.value, 'payType'), id: 4 }, |
||||||
|
{ key: '犹豫期', val: _.get(resultData.value, 'hesPeriod'), id: 5 }, |
||||||
|
{ key: '观察期', val: _.get(resultData.value, 'obsPeriod'), id: 6 }, |
||||||
|
{ key: '销售地区', val: _.get(resultData.value, 'saleArea'), id: 7 }, |
||||||
|
{ key: '销售渠道', val: _.get(resultData.value, 'salesChannels'), id: 8 }, |
||||||
|
{ key: '基本保额', val: _.get(resultData.value, 'basicInsAmo'), id: 9 }, |
||||||
|
{ key: '每份保费', val: _.get(resultData.value, 'basicPremium'), id: 10 }, |
||||||
|
{ key: '最低保证利率', val: _.get(resultData.value, 'minGuaRate'), id: 11 }, |
||||||
|
{ key: '红利领取方式', val: _.get(resultData.value, 'bonClaType'), id: 12 }, |
||||||
|
{ key: '免赔额', val: _.get(resultData.value, 'deductible'), id: 13 }, |
||||||
|
] |
||||||
|
const originalArr = _.get(originalText, '[0].properties') |
||||||
|
if (Array.isArray(originalArr) && originalArr.length > 0) { |
||||||
|
baseModuleData.value.forEach((item) => { |
||||||
|
originalArr.forEach((tkyw) => { |
||||||
|
if (tkyw.propName === item.key) { |
||||||
|
item.tkywValue = tkyw.propValue |
||||||
} |
} |
||||||
|
}) |
||||||
|
}) |
||||||
} |
} |
||||||
|
// 设置模块的url |
||||||
|
bottomModulesData.value.forEach((item) => { |
||||||
|
if (item.name === 'TKYW') item.url = resultData.value.clauseText |
||||||
}) |
}) |
||||||
|
|
||||||
function handleProductClick(item) { |
function showImgPopup(url) { |
||||||
if (item.url) { |
popUpFlag.value = true |
||||||
window.location.href = item.url |
productImgUrl.value = url |
||||||
|
nowPopType.value = 'img' |
||||||
|
} |
||||||
|
|
||||||
|
function clickBottomBtn(name) { |
||||||
|
let url = '' |
||||||
|
if (name === 'TKYW') { |
||||||
|
url = resultData.value.clauseText |
||||||
|
} |
||||||
|
if (/\.pdf$/.test(url)) { |
||||||
|
// 安卓/鸿蒙小程序环境跳转预览页 |
||||||
|
let isMiniProgram = false |
||||||
|
try { |
||||||
|
wx.miniProgram.getEnv((res) => { |
||||||
|
if (res.miniprogram) { |
||||||
|
isMiniProgram = true |
||||||
|
} |
||||||
|
}) |
||||||
|
} catch (e) { |
||||||
|
console.log(e) |
||||||
|
} |
||||||
|
if ((Utils.getSystemType() === 'android' || Utils.getSystemType() === 'harmonyos') && isMiniProgram) { |
||||||
|
router.push({ |
||||||
|
name: 'previewPdf', |
||||||
|
params: { |
||||||
|
url: url, |
||||||
|
}, |
||||||
|
}) |
||||||
|
} else { |
||||||
|
location.href = url |
||||||
|
} |
||||||
|
return |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function showTotalIntro() { |
||||||
|
showTotal.value = !showTotal.value |
||||||
|
exchangeButton.value = !exchangeButton.value |
||||||
} |
} |
||||||
if (item.cmd) { |
|
||||||
store?.dispatch?.('sendingRobot', { |
// 点击关联问按钮发送问句 |
||||||
reqAndResType: '1', |
function richCallAnswer(item) { |
||||||
msgText: item.cmd, |
const sendParmas = { |
||||||
msgSource: '1' |
reqAndResType: '1', // 1文本 2图片 3问提评价 |
||||||
|
msgText: item.intent, |
||||||
|
intentId: item.intentId, |
||||||
|
msgSource: store?.manualService, // 1机器人 2人工 |
||||||
|
questionType: |
||||||
|
props.itemlist?.reqAndResType == '02' |
||||||
|
? 5 |
||||||
|
: props.itemlist?.reqAndResType == '06' |
||||||
|
? 4 |
||||||
|
: props.itemlist?.reqAndResType == '11' |
||||||
|
? 8 |
||||||
|
: '', |
||||||
|
} |
||||||
|
if (isBtnsubmit.value) { |
||||||
|
isBtnsubmit.value = false |
||||||
|
const request = store?.sendingRobot?.(sendParmas) |
||||||
|
if (request && typeof request.then === 'function') { |
||||||
|
request |
||||||
|
.then(() => { |
||||||
|
isBtnsubmit.value = true |
||||||
|
}) |
||||||
|
.catch((err) => { |
||||||
|
isBtnsubmit.value = true |
||||||
|
console.log(err) |
||||||
}) |
}) |
||||||
|
} else { |
||||||
|
isBtnsubmit.value = true |
||||||
} |
} |
||||||
} |
} |
||||||
|
} |
||||||
|
|
||||||
|
function showGraph(item) { |
||||||
|
popUpFlag.value = true |
||||||
|
nowPopType.value = 'tkyw' |
||||||
|
detaillTitle.value = item.key |
||||||
|
tkywValue.value = String(item.tkywValue || '').replace(/(\n)/g, '<br/>') |
||||||
|
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped> |
<style lang="scss" scoped> |
||||||
.product-component { |
.hiddenMore { |
||||||
padding: 0; |
height: 205px; |
||||||
} |
} |
||||||
|
|
||||||
.product-wrapper { |
.product_body { |
||||||
|
line-height: normal; |
||||||
|
letter-spacing: 0.5px; |
||||||
|
word-break: break-all; |
||||||
|
word-wrap: break-word; |
||||||
|
width: 100%; |
||||||
|
position: relative; |
||||||
|
margin-bottom: 6px; |
||||||
|
|
||||||
|
.bg_white { |
||||||
background: #fff; |
background: #fff; |
||||||
border-radius: 12px; |
border-radius: 16px; |
||||||
overflow: hidden; |
overflow: hidden; |
||||||
} |
} |
||||||
|
|
||||||
.product-header { |
.product_top { |
||||||
padding: 16px 16px 8px; |
color: #fff; |
||||||
|
border-bottom: #f0ecec 0.01rem solid; |
||||||
|
|
||||||
|
.title_body { |
||||||
|
font-size: 13px; |
||||||
|
width: 100%; |
||||||
|
min-height: 0.5rem; |
||||||
|
background-image: url('../../assets/images/product/banner.png'); |
||||||
|
background-size: cover; |
||||||
|
background-repeat: no-repeat; |
||||||
|
border-radius: 0.36rem 0.36rem 0 0; |
||||||
|
padding: 0.3rem 0 0.3rem 0.36rem; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
|
||||||
|
.title { |
||||||
|
font-size: 15px; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
font-weight: 500; |
||||||
|
position: relative; |
||||||
|
|
||||||
|
.text_content { |
||||||
|
transform: scale(1, 1.05); |
||||||
|
max-width: 270px; |
||||||
} |
} |
||||||
|
|
||||||
.product-header h3 { |
.mark { |
||||||
margin: 0; |
font-size: 12px; |
||||||
font-size: 16px; |
background: #fff; |
||||||
color: #333; |
letter-spacing: 0px; |
||||||
font-weight: 600; |
color: #4f95fd; |
||||||
|
padding: 0px 4px 0px 4px; |
||||||
|
border-radius: 5px 5px 5px 0px; |
||||||
|
font-weight: 700; |
||||||
|
position: absolute; |
||||||
|
top: 1px; |
||||||
|
right: -4px; |
||||||
|
transform: translate(100%, 0%); |
||||||
|
} |
||||||
} |
} |
||||||
|
} |
||||||
|
|
||||||
|
.labels_body { |
||||||
|
padding: 0.25rem 0.36rem 0.25rem 0.36rem; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
|
||||||
.product-item { |
.label { |
||||||
display: flex; |
display: flex; |
||||||
align-items: center; |
align-items: center; |
||||||
padding: 14px 16px; |
|
||||||
border-bottom: 1px solid #f5f5f5; |
img { |
||||||
cursor: pointer; |
width: 0.5rem; |
||||||
|
height: 0.5rem; |
||||||
|
margin-right: 10px; |
||||||
} |
} |
||||||
|
|
||||||
.product-item:last-child { |
span { |
||||||
border-bottom: none; |
flex: 1; |
||||||
|
font-size: 12px; |
||||||
|
color: #777777; |
||||||
|
letter-spacing: 0.1px; |
||||||
|
} |
||||||
|
} |
||||||
} |
} |
||||||
|
|
||||||
.product-item:active { |
.label:nth-child(n):not(:last-child) { |
||||||
background: #f9f9f9; |
margin-bottom: 5px; |
||||||
|
} |
||||||
} |
} |
||||||
|
|
||||||
.product-icon { |
.product_exemption { |
||||||
width: 40px; |
font-size: 12px; |
||||||
height: 40px; |
color: red; |
||||||
margin-right: 12px; |
font-weight: 700; |
||||||
|
margin-top: 11px; |
||||||
|
padding-left: 16px; |
||||||
|
letter-spacing: 0px; |
||||||
} |
} |
||||||
|
|
||||||
.product-icon img { |
.product_main { |
||||||
width: 100%; |
padding: 0.31rem 0rem; |
||||||
height: 100%; |
|
||||||
border-radius: 8px; |
.product_modules { |
||||||
object-fit: cover; |
.base_module { |
||||||
|
background: #fef8ed; |
||||||
|
background-image: url('../../assets/images/product/base.png'); |
||||||
|
background-size: 65px; |
||||||
|
background-repeat: no-repeat; |
||||||
|
background-position: top right; |
||||||
|
padding: 0.36rem; |
||||||
|
border-radius: 0.3rem; |
||||||
|
margin-bottom: 11px; |
||||||
|
letter-spacing: 0; |
||||||
} |
} |
||||||
|
|
||||||
.product-info { |
.more_module { |
||||||
|
border-radius: 0.3rem; |
||||||
|
|
||||||
|
.top_right_bg { |
||||||
|
background-image: url('../../assets/images/product/more.png'); |
||||||
|
background-size: 65px; |
||||||
|
background-repeat: no-repeat; |
||||||
|
background-position: top right; |
||||||
|
padding: 0.36rem; |
||||||
|
border-radius: 0.3rem; |
||||||
|
letter-spacing: 0; |
||||||
|
} |
||||||
|
|
||||||
|
background: #edf4ff; |
||||||
|
background-image: url('../../assets/images/product/productBg.png'); |
||||||
|
background-size: 470px; |
||||||
|
background-repeat: no-repeat; |
||||||
|
background-position: top right; |
||||||
|
|
||||||
|
.tip { |
||||||
|
color: #aaa; |
||||||
|
text-align: right; |
||||||
|
font-size: 12px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.list { |
||||||
|
color: #5b5b5b; |
||||||
|
display: flex; |
||||||
|
line-height: 18px; |
||||||
|
|
||||||
|
.list_label { |
||||||
|
width: 80px; |
||||||
|
font-weight: 700; |
||||||
|
font-size: 14px; |
||||||
|
color: #000; |
||||||
|
} |
||||||
|
|
||||||
|
.list_content { |
||||||
flex: 1; |
flex: 1; |
||||||
|
font-weight: 400; |
||||||
|
font-size: 14px; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
word-break: normal; |
||||||
|
word-wrap: normal; |
||||||
|
|
||||||
|
.value { |
||||||
|
max-width: 168px; |
||||||
} |
} |
||||||
|
|
||||||
.product-title { |
.noBtn { |
||||||
|
max-width: unset !important; |
||||||
|
} |
||||||
|
|
||||||
|
.more_text { |
||||||
|
margin-right: 5px; |
||||||
font-size: 14px; |
font-size: 14px; |
||||||
color: #333; |
font-weight: 400; |
||||||
font-weight: 500; |
} |
||||||
|
|
||||||
|
.more_button { |
||||||
|
font-weight: 400; |
||||||
|
background: #ddeaff; |
||||||
|
color: #4f95fd; |
||||||
|
display: inline-block; |
||||||
|
padding: 0.13rem 0.55rem 0.13rem 0.18rem; |
||||||
|
margin: 2px 0; |
||||||
|
font-size: 13px; |
||||||
|
border-radius: 11px; |
||||||
|
position: relative; |
||||||
|
line-height: initial; |
||||||
} |
} |
||||||
|
|
||||||
.product-subtitle { |
.more_button::after { |
||||||
|
content: ""; |
||||||
|
width: 0.35rem; |
||||||
|
height: 0.35rem; |
||||||
|
background-image: url('../../assets/images/product/arrow.png'); |
||||||
|
background-repeat: no-repeat; |
||||||
|
background-size: contain; |
||||||
|
position: absolute; |
||||||
|
right: 4%; |
||||||
|
top: 50%; |
||||||
|
transform: translate(0, -50%); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.tkk_btn { |
||||||
|
border-radius: 11px; |
||||||
|
border: 1px solid #d4d8dc; |
||||||
font-size: 12px; |
font-size: 12px; |
||||||
color: #999; |
padding: 1px 6px; |
||||||
margin-top: 4px; |
color: #4661f4; |
||||||
|
white-space: nowrap; |
||||||
|
margin-left: 7px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.list:nth-child(1) { |
||||||
|
padding-right: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.list:nth-child(n):not(:last-child) { |
||||||
|
margin-bottom: 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.top_right_bg > .list:nth-child(n):not(:last-child) { |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.top_right_bg > .list { |
||||||
|
flex-direction: column; |
||||||
|
|
||||||
|
.list_content { |
||||||
|
font-size: 14px; |
||||||
|
} |
||||||
|
|
||||||
|
.list_label { |
||||||
|
min-width: unset; |
||||||
|
width: unset; |
||||||
|
line-height: 18px; |
||||||
|
margin-bottom: 7px; |
||||||
|
|
||||||
|
.list_label_span { |
||||||
|
font-weight: 700; |
||||||
|
border-bottom: 1px solid #000; |
||||||
|
} |
||||||
|
} |
||||||
} |
} |
||||||
|
|
||||||
.product-arrow { |
.top_right_bg { |
||||||
color: #ccc; |
.more_button:nth-child(n):not(:last-child) { |
||||||
|
margin-right: 5px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.product_bottom { |
||||||
|
padding-left: 0.3rem; |
||||||
|
|
||||||
|
.bottom_modules { |
||||||
|
width: 100%; |
||||||
|
overflow-x: auto; |
||||||
|
white-space: nowrap; |
||||||
|
|
||||||
|
.img_module:nth-child(n):not(:last-child) { |
||||||
|
margin-right: 8px; |
||||||
|
} |
||||||
|
|
||||||
|
.min_witch { |
||||||
|
width: 28% !important; |
||||||
|
} |
||||||
|
|
||||||
|
.img_module { |
||||||
|
width: 30%; |
||||||
|
height: 50px; |
||||||
|
border-radius: 8px; |
||||||
|
display: inline-block; |
||||||
|
|
||||||
|
img { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.bottom_modules::-webkit-scrollbar { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.questions { |
||||||
|
padding: 0rem 0.36rem 0.31rem 0.36rem; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.hidden_more { |
||||||
|
height: 175px !important; |
||||||
|
} |
||||||
|
|
||||||
|
.noHidden { |
||||||
|
height: unset !important; |
||||||
|
padding-bottom: 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.detaill_body { |
||||||
|
font-size: 18px; |
||||||
|
padding: 10px 16px; |
||||||
|
background-size: 5rem; |
||||||
|
background-repeat: no-repeat; |
||||||
|
background-position: 66% 100%; |
||||||
|
height: 100%; |
||||||
|
|
||||||
|
.detaill_title { |
||||||
|
font-size: 20px; |
||||||
|
font-weight: 600; |
||||||
|
letter-spacing: 1px; |
||||||
|
margin-bottom: 20px; |
||||||
|
position: relative; |
||||||
|
|
||||||
|
&::after { |
||||||
|
content: " "; |
||||||
|
position: absolute; |
||||||
|
bottom: -6px; |
||||||
|
left: 0; |
||||||
|
width: 75%; |
||||||
|
height: 1px; |
||||||
|
background: #d2d2d7; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.detaill_content { |
||||||
|
word-break: break-all; |
||||||
|
line-height: 30px; |
||||||
|
text-indent: 29px; |
||||||
|
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
Loading…
Reference in new issue