This commit is contained in:
851673013@qq.com 2022-07-15 11:03:21 +08:00
parent f2aa5c5e3c
commit cf296916e1
4 changed files with 203 additions and 116 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 使用方式 --> <!-- 使用方式 -->
<div class="usage-mode" v-if="flag"> <div class="usage-mode" v-if="true">
<div class="tltle"> <div class="tltle">
<DetalsTitle <DetalsTitle
:title="dataFrom.title" :title="dataFrom.title"
@ -12,7 +12,6 @@
<div class="left"> <div class="left">
<div class="content-left-title"> <div class="content-left-title">
<span>{{ item.title }}</span> <span>{{ item.title }}</span>
<span>{{ item.titleSon }}</span>
</div> </div>
<div class="content-left-content"> <div class="content-left-content">
<p> <p>
@ -30,10 +29,11 @@
</div> </div>
<div class="right"> <div class="right">
<div @click="technical()">技术文档</div> <div @click="technical()">技术文档</div>
<!-- <div>新手指引</div> --> <div @click="technicalNew()">新手指引</div>
</div> </div>
</div> </div>
<div class="content-right"> <div class="content-right">
<div class="content-right-left">
<div class="content-right-title">{{ item.contact }}</div> <div class="content-right-title">{{ item.contact }}</div>
<div class="content-right-content"> <div class="content-right-content">
<p> <p>
@ -59,22 +59,48 @@
</p> </p>
</div> </div>
</div> </div>
<div class="content-right-right">
<div class="content-right-title">{{ item.contact2 }}</div>
<div class="content-right-content">
<p>
<span>{{ item.facilitator2.name }}</span>
<a-tooltip>
<template #title>{{ item.facilitator2.value }}</template>
<span>{{ item.facilitator2.value }}</span>
</a-tooltip>
</p>
<p>
<span>{{ item.people2.name }}</span>
<a-tooltip>
<template #title>{{ item.people2.value }}</template>
<span>{{ item.people2.value }}</span>
</a-tooltip>
</p>
<p>
<span>{{ item.phone2.name }}</span>
<a-tooltip>
<template #title>{{ item.phone2.value }}</template>
<span>{{ item.phone2.value }}</span>
</a-tooltip>
</p>
</div>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle' import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { message } from 'ant-design-vue'
import { pinyin } from 'pinyin-pro' import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue' import { ref, defineProps, watch } from 'vue'
import { message } from 'ant-design-vue'
let dataFrom = ref({ let dataFrom = ref({
title: '使用方式', title: '使用方式',
englishTitle: 'USAGE', englishTitle: 'USAGE',
content: [ content: [
{ {
title: '技术对接', title: '组件地址',
titleSon: '调用接口',
link: { link: {
name: '服务接口:', name: '服务接口:',
value: '', value: '',
@ -83,16 +109,23 @@
name: '请求方式:', name: '请求方式:',
value: '', value: '',
}, },
contact: '联系厂商', linkValue: '',
facilitator: { name: '服务商:', value: '科大讯飞' }, contact: '归属部门',
people: { name: '联系人:', value: '李四' }, facilitator: { name: '归属部门:', value: '' },
people: { name: '部门联系人:', value: '' },
phone: { phone: {
name: '联系电话:', name: '联系人电话:',
value: '12345678901', value: '',
},
contact2: '服务商',
facilitator2: { name: '服务商:', value: '' },
people2: { name: '服务商联系人:', value: '' },
phone2: {
name: '联系人电话:',
value: '',
}, },
}, },
], ],
link: '',
}) })
// //
const props = defineProps({ const props = defineProps({
@ -105,6 +138,9 @@
item.attrType === '技术文档' || item.attrType === '技术文档' ||
item.attrType === '服务商' || item.attrType === '服务商' ||
item.attrType === '服务商联系人' || item.attrType === '服务商联系人' ||
item.attrType === '使用手册' ||
item.attrType === '服务接口' ||
item.attrType === '样式服务地址' ||
item.attrType === '服务商联系电话' item.attrType === '服务商联系电话'
)[0] )[0]
if (!obj) { if (!obj) {
@ -112,23 +148,22 @@
} else { } else {
// eslint-disable-next-line vue/no-setup-props-destructure // eslint-disable-next-line vue/no-setup-props-destructure
dataFrom.value.content[0].link.value = props.dataList.apiUrl dataFrom.value.content[0].link.value = props.dataList.apiUrl
// eslint-disable-next-line vue/no-setup-props-destructure dataFrom.value.content[0].facilitator.value = props.dataList.deptName
dataFrom.value.content[0].postMethod.value = props.dataList.apiMethodType dataFrom.value.content[0].people.value = props.dataList.deptContacts
dataFrom.value.content[0].phone.value = props.dataList.deptPhone
dataFrom.value.content[0].postMethod.value = val.apiMethodType
console.log('dataList', props.dataList) console.log('dataList', props.dataList)
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
if (item.attrType === '使用方式') { if (item.attrType === '组件地址') {
dataFrom.value.content[0].titleSon = item.attrValue dataFrom.value.content[0].linkValue = item.attrValue || '--'
} else if (item.attrType === '服务商') { } else if (item.attrType === '服务商') {
dataFrom.value.content[0].facilitator.value = item.attrValue || '--' dataFrom.value.content[0].facilitator2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系人') { } else if (item.attrType === '服务商联系人') {
dataFrom.value.content[0].people.value = item.attrValue || '--' dataFrom.value.content[0].people2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系电话') { } else if (item.attrType === '服务商联系电话') {
dataFrom.value.content[0].phone.value = item.attrValue || '--' dataFrom.value.content[0].phone2.value = item.attrValue || '--'
} } else if (item.attrType === '服务接口') {
// } else if (item.attrType === '') { debugger
// dataFrom.value.link = item.attrValue || '--'
// }
else if (item.attrType === '服务接口') {
dataFrom.value.content[0].link.value = item.attrValue || '--' dataFrom.value.content[0].link.value = item.attrValue || '--'
} }
}) })
@ -143,29 +178,32 @@
item.attrType === '技术文档' || item.attrType === '技术文档' ||
item.attrType === '服务商' || item.attrType === '服务商' ||
item.attrType === '服务商联系人' || item.attrType === '服务商联系人' ||
item.attrType === '使用手册' ||
item.attrType === '服务接口' ||
item.attrType === '样式服务地址' ||
item.attrType === '服务商联系电话' item.attrType === '服务商联系电话'
)[0] )[0]
if (!obj) { if (!obj) {
flag.value = false flag.value = false
} else { } else {
dataFrom.value.content[0].link.value = val.apiUrl dataFrom.value.content[0].link.value = val.apiUrl
dataFrom.value.content[0].facilitator.value = val.deptName
dataFrom.value.content[0].people.value = val.deptContacts
dataFrom.value.content[0].phone.value = val.deptPhone
dataFrom.value.content[0].postMethod.value = val.apiMethodType dataFrom.value.content[0].postMethod.value = val.apiMethodType
console.log('dataList', val) console.log('dataList', val)
val.infoList.map((item) => { val.infoList.map((item) => {
if (item.attrType === '使用方式') { if (item.attrType === '组件地址') {
dataFrom.value.content[0].titleSon = item.attrValue dataFrom.value.content[0].linkValue = item.attrValue || '--'
} else if (item.attrType === '服务商') { } else if (item.attrType === '服务商') {
dataFrom.value.content[0].facilitator.value = dataFrom.value.content[0].facilitator2.value =
item.attrValue || '--' item.attrValue || '--'
} else if (item.attrType === '服务商联系人') { } else if (item.attrType === '服务商联系人') {
dataFrom.value.content[0].people.value = item.attrValue || '--' dataFrom.value.content[0].people2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系电话') { } else if (item.attrType === '服务商联系电话') {
dataFrom.value.content[0].phone.value = item.attrValue || '--' dataFrom.value.content[0].phone2.value = item.attrValue || '--'
} } else if (item.attrType === '服务接口') {
// else if (item.attrType === '') { debugger
// dataFrom.value.link = item.attrValue || '--'
// }
else if (item.attrType === '服务接口') {
dataFrom.value.content[0].link.value = item.attrValue || '--' dataFrom.value.content[0].link.value = item.attrValue || '--'
} }
}) })
@ -185,7 +223,6 @@
let obj = props.dataList.infoList.filter( let obj = props.dataList.infoList.filter(
(item) => item.attrType === '技术文档' (item) => item.attrType === '技术文档'
)[0] )[0]
// console.log('dataFrom.value.link', obj.attrValue)
if (obj) { if (obj) {
window.open(window.SITE_CONFIG.frontUrl + obj.attrValue) window.open(window.SITE_CONFIG.frontUrl + obj.attrValue)
} else { } else {
@ -195,6 +232,31 @@
message.error('暂未上传技术文档') message.error('暂未上传技术文档')
} }
} }
function technicalNew() {
//
// const type = pinyin(props.dataList.type, {
// pattern: 'initial',
// }).replace(/\s*/g, '')
// //
// const id = props.dataList.id
// window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank')
let obj = props.dataList.infoList.filter(
(item) => item.attrType === '使用手册'
)[0]
console.log('dataFrom.value.link', obj.attrValue)
if (obj) {
window.open(
window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' +
btoa(encodeURI(obj.attrValue))
)
} else {
message.config({
top: '100px', //
})
message.error('暂未上传使用手册')
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -202,103 +264,128 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding: 80px 0; padding: 0.8rem 0;
.content { .content {
margin-top: 30px; margin-top: 0.3rem;
display: flex; display: flex;
.content-left { .content-left {
height: 150px; height: 1.5rem;
width: 620px; width: 6.2rem;
background: linear-gradient(to right, #7184fc, #94a3fc); background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png')
border-radius: 10px; no-repeat;
margin-right: 60px; background-position: center;
box-shadow: 0px 5px 15px rgba(82, 106, 255, 0.4); background-size: 100% 100%;
border-radius: 0.1rem;
margin-right: 0.6rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 35px; padding: 0 0.35rem;
.left { .left {
.content-left-title { .content-left-title {
font-size: 26px; font-size: 0.26rem;
line-height: 26px; line-height: 0.26rem;
color: #212956; color: #212956;
margin-bottom: 20px; margin-bottom: 0.2rem;
span:first-child { span:first-child {
margin-right: 10px; margin-right: 0.1rem;
} }
} }
.content-left-content { .content-left-content {
width: 420px; width: 4.2rem;
font-size: 20px; font-size: 0.2rem;
color: rgba(33, 41, 86, 0.8); color: rgba(33, 41, 86, 0.8);
line-height: 20px; line-height: 0.2rem;
p { p {
display: -webkit-box;
margin-bottom: 0.1rem;
span:last-of-type {
width: 298px;
display: -webkit-box;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; -webkit-line-clamp: 1;
white-space: nowrap; -webkit-box-orient: vertical;
margin-bottom: 10px;
} }
} }
} }
}
.right { .right {
div { div {
height: 40px; height: 0.4rem;
width: 130px; width: 1.3rem;
background: #ffffff; background: #ffffff;
border-radius: 20px; border-radius: 0.2rem;
color: #526aff; color: #526aff;
font-size: 20px; font-size: 0.2rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
div:first-child { div:first-child {
margin-bottom: 20px; margin-bottom: 0.2rem;
} }
} }
} }
.content-right { .content-right {
height: 150px; height: 1.5rem;
width: 620px; width: 6.2rem;
background: linear-gradient( background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png')
to right, no-repeat;
rgba(113, 132, 252, 0.4), background-position: center;
rgba(148, 163, 252, 0.4) background-size: 100% 100%;
); border-radius: 0.1rem;
border-radius: 10px; box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
box-shadow: 0px 5px 15px rgba(82, 106, 255, 0.4);
display: flex; display: flex;
flex-direction: column; justify-content: space-around;
justify-content: center; align-items: center;
padding: 0 30px; padding: 0 0.3rem;
.content-right-title {
font-size: 26px; .content-right-left {
line-height: 26px; border-right: 0.01rem solid #707fe0;
color: #212956; padding-right: 0.1rem;
margin-bottom: 25px; margin-right: 0.1rem;
} }
.content-right-title {
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.15rem;
}
.content-right-content { .content-right-content {
display: flex; display: flex;
font-size: 18px; font-size: 0.16rem;
color: rgba(33, 41, 86, 0.8); color: rgba(33, 41, 86, 0.8);
line-height: 20px; line-height: 0.2rem;
overflow: hidden; overflow: hidden;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin-bottom: 10px; flex-direction: column;
p { p {
// width: 160px; // width: 1.60rem;
height: 20px; height: 0.2rem;
overflow: hidden; display: -webkit-box;
text-overflow: ellipsis; // overflow: hidden;
margin-bottom: 0.08rem;
white-space: nowrap; white-space: nowrap;
margin-right: 15px; -webkit-line-clamp: 1;
-webkit-box-orient: vertical;
margin-right: 0.15rem;
span { span {
display: inline-block;
max-width: 1.2rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer; cursor: pointer;
} }
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 使用方式 --> <!-- 使用方式 -->
<div class="usage-mode" v-if="flag"> <div class="usage-mode" v-if="true">
<div class="tltle"> <div class="tltle">
<DetalsTitle <DetalsTitle
:title="dataFrom.title" :title="dataFrom.title"

View File

@ -1,6 +1,6 @@
<!--使用方式--> <!--使用方式-->
<template> <template>
<div class="application-deployment-and-security" v-if="flag"> <div class="application-deployment-and-security" v-if="true">
<div class="title"> <div class="title">
<DetalsTitle <DetalsTitle
:title="dataFrom.title" :title="dataFrom.title"

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 使用方式 --> <!-- 使用方式 -->
<div class="usage-mode" v-if="flag"> <div class="usage-mode" v-if="true">
<div class="tltle"> <div class="tltle">
<DetalsTitle <DetalsTitle
:title="dataFrom.title" :title="dataFrom.title"