fix: 融合服务详情-申请使用, 常见问题

This commit is contained in:
guoyue 2022-07-14 10:56:04 +08:00
parent 3d223aaaf3
commit e4280e3874
2 changed files with 216 additions and 156 deletions

View File

@ -52,6 +52,13 @@
<template #icon><shopping-cart-outlined /></template> <template #icon><shopping-cart-outlined /></template>
加入购物车 加入购物车
</a-button> --> </a-button> -->
<!-- 融合服务 存在fuseResourceList -->
<a-button type="primary" @click="handleAKeyApplication()" v-if="dataList.fuseResourceList">
<template #icon>
<form-outlined />
</template>
申请使用
</a-button>
<a-button type="primary" @click="goTOCollection()">收藏</a-button> <a-button type="primary" @click="goTOCollection()">收藏</a-button>
</div> </div>
</div> </div>
@ -59,168 +66,223 @@
</div> </div>
</template> </template>
<script setup> <script setup>
// import { ShoppingCartOutlined } from '@ant-design/icons-vue' // import { ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue' import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter' import { scInsert } from '@/api/personalCenter'
// import { sgcInsert } from '@/api/home' // import { sgcInsert } from '@/api/home'
// import { useRouter } from 'vue-router' // import { useRouter } from 'vue-router'
// import mybus from '@/myplugins/mybus' // import mybus from '@/myplugins/mybus'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
const props = defineProps({ import { useRouter } from 'vue-router'
dataList: { type: Object, default: null }, //
}) const router = useRouter()
// const router = useRouter()
const applicationArea = ref('') const props = defineProps({
// // dataList: { type: Object, default: null },
// const addShoppingCart = () => { })
// console.log('==================>', props.dataList)
// sgcInsert({ console.log('dataList------------>', props.dataList);
// delFlag: '0',
// resourceId: props.dataList.id, // const router = useRouter()
// // userId: userId.value, const applicationArea = ref('')
// }).then((res) => { // //
// console.log(res) // const addShoppingCart = () => {
// message.success('') // console.log('==================>', props.dataList)
// mybus.emit('getSgcNum') // sgcInsert({
// }) // delFlag: '0',
// } // resourceId: props.dataList.id,
// // // // userId: userId.value,
// function toView() { // }).then((res) => {
// // window.open(newpage.href, '_blank') // console.log(res)
// router.push({ // message.success('')
// path: '/apply', // mybus.emit('getSgcNum')
// query: { // })
// name: props.dataList.name, // }
// resourceId: [props.dataList.id], // //
// }, // function toView() {
// }) // // window.open(newpage.href, '_blank')
// } // router.push({
// // path: '/apply',
const goTOCollection = () => { // query: {
console.log('收藏===================》', props.dataList) // name: props.dataList.name,
scInsert([{ resourceId: props.dataList.id }]).then((res) => { // resourceId: [props.dataList.id],
console.log(res) // },
message.success('收藏成功') // })
}) // }
} // --
if (props.dataList.infoList) { const handleAKeyApplication = () => {
applicationArea.value = props.dataList.infoList.filter( let _applyList = [];
(val) => val.attrType === '应用领域' (props.dataList.fuseResourceList || []).map(v => {
)[0].attrValue let resource = v.resource || {}
} let obj = {
watch( arr: [
() => props.dataList, {
(val) => { delFlag: resource.delFlag,
if (val) { description: resource.description,
applicationArea.value = props.dataList.infoList.filter( resourceId: resource.id,
(val) => val.attrType === '应用领域' resourceName: resource.name,
)[0].attrValue time: resource.createDate,
} type: resource.type,
},
],
deptId: resource.deptId,
deptName: resource.deptName,
} }
_applyList.push(obj)
})
localStorage.setItem(
'applyList',
JSON.stringify(_applyList)
) )
router.push({
path: '/apply',
})
}
//
const goTOCollection = () => {
console.log('收藏===================》', props.dataList)
scInsert([{ resourceId: props.dataList.id }]).then((res) => {
console.log(res)
message.success('收藏成功')
})
}
if (props.dataList.infoList) {
applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域'
)[0].attrValue
}
watch(
() => props.dataList,
(val) => {
if (val) {
console.log('props.dataList-----watch------->', val);
applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域'
)[0].attrValue
}
}
)
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.algorithm-top-details { .algorithm-top-details {
height: 6rem; height: 6rem;
padding: 1.8rem 0 0; padding: 1.8rem 0 0;
background: url('~@/assets/detailsAll/sf_top_bg.png') no-repeat; background: url('~@/assets/detailsAll/sf_top_bg.png') no-repeat;
background-size: 100%; background-size: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
.left {
max-width: 7.2rem;
color: #fff;
margin-right: 0.8rem;
.top { .left {
display: flex; max-width: 7.2rem;
align-items: center; color: #fff;
span { margin-right: 0.8rem;
font-size: 0.14rem;
} .top {
.name { display: flex;
// max-width: 3.3rem; align-items: center;
// overflow: hidden;
// text-overflow: ellipsis; span {
// white-space: nowrap; font-size: 0.14rem;
font-size: 0.4rem;
margin-right: 0.2rem;
font-size: 0.4rem;
margin-right: 0.2rem;
max-width: 7rem;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.label-content {
position: relative;
}
.lable-father {
position: absolute;
min-width: 3.5rem;
right: -3.5rem;
top: 0;
}
.label {
padding: 0.01rem 0.1rem;
margin-right: 0.1rem;
border-radius: 0.13rem;
background: rgba(255, 255, 255, 0.4);
}
} }
.main {
margin-top: 0.2rem; .name {
font-size: 0.18rem; // max-width: 3.3rem;
line-height: 0.34rem; // overflow: hidden;
& > div:nth-of-type(1) { // text-overflow: ellipsis;
overflow: hidden; // white-space: nowrap;
text-overflow: ellipsis; font-size: 0.4rem;
white-space: nowrap; margin-right: 0.2rem;
} font-size: 0.4rem;
& > div:nth-of-type(2) { margin-right: 0.2rem;
max-height: 1rem; max-width: 7rem;
overflow: hidden; text-overflow: -o-ellipsis-lastline;
text-overflow: ellipsis; overflow: hidden;
display: -webkit-box; text-overflow: ellipsis;
-webkit-line-clamp: 3; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-line-clamp: 1;
} -webkit-box-orient: vertical;
} }
.bottom {
margin-top: 0.4rem; .label-content {
display: flex; position: relative;
.ant-btn { }
height: 0.5rem;
margin-right: 0.2rem; .lable-father {
background: #ff8b55; position: absolute;
border-radius: 0.06rem; min-width: 3.5rem;
font-size: 0.2rem; right: -3.5rem;
display: flex; top: 0;
justify-content: center; }
align-items: center;
} .label {
.ant-btn:nth-of-type(1) { padding: 0.01rem 0.1rem;
width: 1.8rem; margin-right: 0.1rem;
} border-radius: 0.13rem;
.ant-btn:nth-of-type(2) { background: rgba(255, 255, 255, 0.4);
width: 2.2rem;
}
.ant-btn:nth-of-type(3) {
width: 1.45rem;
background: #fff;
color: #526aff;
}
} }
} }
.right {
width: 5.8rem; .main {
height: 4rem; margin-top: 0.2rem;
background: url('~@/assets/detailsAll/sf_right_bg.png') no-repeat; font-size: 0.18rem;
background-size: 100%; line-height: 0.34rem;
margin-top: -0.4rem;
&>div:nth-of-type(1) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&>div:nth-of-type(2) {
max-height: 1rem;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
}
.bottom {
margin-top: 0.4rem;
display: flex;
.ant-btn {
height: 0.5rem;
margin-right: 0.2rem;
background: #ff8b55;
border-radius: 0.06rem;
font-size: 0.2rem;
display: flex;
justify-content: center;
align-items: center;
}
.ant-btn:nth-of-type(1) {
width: 1.8rem;
}
.ant-btn:nth-of-type(2) {
width: 2.2rem;
}
.ant-btn:nth-of-type(3) {
width: 1.45rem;
background: #fff;
color: #526aff;
}
} }
} }
.right {
width: 5.8rem;
height: 4rem;
background: url('~@/assets/detailsAll/sf_right_bg.png') no-repeat;
background-size: 100%;
margin-top: -0.4rem;
}
}
</style> </style>

View File

@ -187,14 +187,12 @@ const getIntegrationServicesDeatil = (id) => {
let questionValue = fuseAttrList.find(v => v.attrType === '常见问题') || {} let questionValue = fuseAttrList.find(v => v.attrType === '常见问题') || {}
let questionObj = { let questionObj = {
attrType: '常见问题', attrType: '常见问题',
attrValue: JSON.stringify(questionValue.attrValue || []) attrValue: questionValue.attrValue || "[]"
} }
let areaObj = { let areaObj = {
attrType: '应用领域', attrType: '应用领域',
attrValue: detailInfoObj.value.applicationArea attrValue: detailInfoObj.value.applicationArea
} }
console.log('areaObj------------>', areaObj);
combineList.value.map(item => { combineList.value.map(item => {
let arr = (fuseResourceList.filter(v => v.resource && v.resource.type == item.title) || []).map(d => d.resource.name) let arr = (fuseResourceList.filter(v => v.resource && v.resource.type == item.title) || []).map(d => d.resource.name)
item.list = arr; item.list = arr;