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>
加入购物车
</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>
</div>
</div>
@ -59,74 +66,115 @@
</div>
</template>
<script setup>
// import { ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter'
// import { sgcInsert } from '@/api/home'
// import { useRouter } from 'vue-router'
// import mybus from '@/myplugins/mybus'
import { message } from 'ant-design-vue'
const props = defineProps({
// import { ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter'
// import { sgcInsert } from '@/api/home'
// import { useRouter } from 'vue-router'
// import mybus from '@/myplugins/mybus'
import { message } from 'ant-design-vue'
import { useRouter } from 'vue-router'
//
const router = useRouter()
const props = defineProps({
dataList: { type: Object, default: null },
})
console.log('dataList------------>', props.dataList);
// const router = useRouter()
const applicationArea = ref('')
// //
// const addShoppingCart = () => {
// console.log('==================>', props.dataList)
// sgcInsert({
// delFlag: '0',
// resourceId: props.dataList.id,
// // userId: userId.value,
// }).then((res) => {
// console.log(res)
// message.success('')
// mybus.emit('getSgcNum')
// })
// }
// //
// function toView() {
// // window.open(newpage.href, '_blank')
// router.push({
// path: '/apply',
// query: {
// name: props.dataList.name,
// resourceId: [props.dataList.id],
// },
// })
// }
// --
const handleAKeyApplication = () => {
let _applyList = [];
(props.dataList.fuseResourceList || []).map(v => {
let resource = v.resource || {}
let obj = {
arr: [
{
delFlag: resource.delFlag,
description: resource.description,
resourceId: resource.id,
resourceName: resource.name,
time: resource.createDate,
type: resource.type,
},
],
deptId: resource.deptId,
deptName: resource.deptName,
}
_applyList.push(obj)
})
// const router = useRouter()
const applicationArea = ref('')
// //
// const addShoppingCart = () => {
// console.log('==================>', props.dataList)
// sgcInsert({
// delFlag: '0',
// resourceId: props.dataList.id,
// // userId: userId.value,
// }).then((res) => {
// console.log(res)
// message.success('')
// mybus.emit('getSgcNum')
// })
// }
// //
// function toView() {
// // window.open(newpage.href, '_blank')
// router.push({
// path: '/apply',
// query: {
// name: props.dataList.name,
// resourceId: [props.dataList.id],
// },
// })
// }
//
const goTOCollection = () => {
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) {
}
if (props.dataList.infoList) {
applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域'
)[0].attrValue
}
watch(
}
watch(
() => props.dataList,
(val) => {
if (val) {
console.log('props.dataList-----watch------->', val);
applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域'
)[0].attrValue
}
}
)
)
</script>
<style lang="less" scoped>
.algorithm-top-details {
.algorithm-top-details {
height: 6rem;
padding: 1.8rem 0 0;
background: url('~@/assets/detailsAll/sf_top_bg.png') no-repeat;
background-size: 100%;
display: flex;
justify-content: center;
.left {
max-width: 7.2rem;
color: #fff;
@ -135,9 +183,11 @@
.top {
display: flex;
align-items: center;
span {
font-size: 0.14rem;
}
.name {
// max-width: 3.3rem;
// overflow: hidden;
@ -155,15 +205,18 @@
-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;
@ -171,16 +224,19 @@
background: rgba(255, 255, 255, 0.4);
}
}
.main {
margin-top: 0.2rem;
font-size: 0.18rem;
line-height: 0.34rem;
& > div:nth-of-type(1) {
&>div:nth-of-type(1) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
& > div:nth-of-type(2) {
&>div:nth-of-type(2) {
max-height: 1rem;
overflow: hidden;
text-overflow: ellipsis;
@ -189,9 +245,11 @@
-webkit-box-orient: vertical;
}
}
.bottom {
margin-top: 0.4rem;
display: flex;
.ant-btn {
height: 0.5rem;
margin-right: 0.2rem;
@ -202,12 +260,15 @@
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;
@ -215,6 +276,7 @@
}
}
}
.right {
width: 5.8rem;
height: 4rem;
@ -222,5 +284,5 @@
background-size: 100%;
margin-top: -0.4rem;
}
}
}
</style>

View File

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