projectDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. <template>
  2. <custom-layout class="main">
  3. <el-col :span="24" class="one">
  4. <div class="w_1300">
  5. <div class="info_1"></div>
  6. <div class="info_2">
  7. <div class="info_left">
  8. <div class="inose_top">
  9. <div class="img">
  10. <el-image class="image" :src="biao_1" fit="fill"></el-image>
  11. </div>
  12. <div class="ba_tile">
  13. 项目来源:
  14. <span class="hui_text textMore">{{ info.source || '暂无' }}</span>
  15. </div>
  16. <div class="ba_tile">
  17. 所属产业:
  18. <span class="hui_text textMore">{{ info.industry || '暂无' }}</span>
  19. </div>
  20. <div class="ba_tile">
  21. 跟踪支持单位:
  22. <span class="hui_text textMore">{{ info.track_unit || '暂无' }}</span>
  23. </div>
  24. <div class="ba_tile">
  25. 项目主体:
  26. <span class="hui_text textMore">{{ info.main || '暂无' }}</span>
  27. </div>
  28. <div class="ba_tile">
  29. 项目进展:
  30. <span class="hui_text textMore">{{ info.progress || '暂无' }}</span>
  31. </div>
  32. </div>
  33. <div class="inose_top">
  34. <div class="img">
  35. <el-image class="image" :src="biao_2" fit="fill"></el-image>
  36. </div>
  37. <div class="other_1">
  38. <div class="name">{{ info.person || '暂无' }}</div>
  39. <div class="button" @click="toChat">预约对接</div>
  40. </div>
  41. </div>
  42. <div class="inose_top">
  43. <div class="img">
  44. <el-image class="image" :src="biao_3" fit="fill"></el-image>
  45. </div>
  46. <div class="wenbe_text">
  47. <span v-if="is_show">{{ info.brief || '暂无' }}</span>
  48. <span v-else>{{ truncateString(info.brief, 100) }}</span>
  49. <span v-if="info.brief && info.brief.length > 100">
  50. <span v-if="!is_show" class="anniu_btn" @click="is_show = true">《点击查看更多》</span>
  51. <span v-else class="anniu_btn" @click="is_show = false">《点击收起更多》</span>
  52. </span>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="info_right">
  57. <div class="right_title">
  58. <div class="type">{{ info.progress || '暂无' }}</div>
  59. <div class="title textOne">项目商业计划书</div>
  60. <div class="collect iscollect" @click="toCollect" v-if="info.is_collection">
  61. <el-icon :size="24" color="#1073ff"><StarFilled /></el-icon>
  62. <span>已收藏</span>
  63. </div>
  64. <div class="collect" v-else @click="toCollect">
  65. <el-icon :size="24"><Star /></el-icon>
  66. <span>收藏</span>
  67. </div>
  68. </div>
  69. <div class="pdf_item" :class="['image' + num]">
  70. <div class="pdf_type textOne">{{ info.industry || '暂无' }}</div>
  71. <div class="title">
  72. <p class="ellipsis-3">{{ info.name || '暂无' }}</p>
  73. </div>
  74. <div class="address">
  75. <el-icon color="#595959"><Location /></el-icon>
  76. <span class="textOne">{{ info.main || '暂无' }}</span>
  77. </div>
  78. <div class="biaoqian textOne">
  79. <span v-if="info.technology">{{ info.technology }}</span>
  80. <span v-if="info.sell">{{ info.sell }}</span>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="info_4" v-if="info.file && info.file.length > 0">
  86. <div class="title">项目附件</div>
  87. <div class="file">
  88. <el-link :href="info.file[0].url" target="_blank">{{ info.file[0].name }}</el-link>
  89. </div>
  90. </div>
  91. <div class="info_3">
  92. <div class="right_1">
  93. <div class="title">
  94. <div class="title_1">成果推荐</div>
  95. <div class="title_2" @click="toMore('0')">更多></div>
  96. </div>
  97. <div class="content_2">
  98. <div class="list" v-for="(item, index) in achievementList" :key="index" @click="toView(item, '0')">
  99. <div class="name">
  100. <el-image class="image" :src="liIcon" fit="fill"></el-image>
  101. <span>{{ item.name || '暂无' }}</span>
  102. </div>
  103. <span>{{ item.source || '暂无' }}</span>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="right_1">
  108. <div class="title">
  109. <div class="title_1">项目推荐</div>
  110. <div class="title_2" @click="toMore('1')">更多></div>
  111. </div>
  112. <div class="content_2">
  113. <div class="list" v-for="(item, index) in projectList" :key="index" @click="toView(item, '1')">
  114. <div class="name">
  115. <el-image class="image" :src="liIcon" fit="fill"></el-image>
  116. <span>{{ item.name || '暂无' }}</span>
  117. </div>
  118. <span>{{ item.source || '暂无' }}</span>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </el-col>
  125. </custom-layout>
  126. </template>
  127. <script setup>
  128. import liIcon from '/images/li-icon.png'
  129. import biao_1 from '/images/biao_1.png'
  130. import biao_2 from '/images/biao_2.png'
  131. import biao_3 from '/images/biao_3.png'
  132. // 接口
  133. import { ProjectStore } from '@/store/api/platform/project'
  134. import { AchievementStore } from '@/store/api/platform/achievement'
  135. import { ContactApplyStore } from '@/store/api/user/contactApply'
  136. const store = ProjectStore()
  137. const achievementStore = AchievementStore()
  138. const contactApplyStore = ContactApplyStore()
  139. import { UserStore } from '@/store/user'
  140. const userStore = UserStore()
  141. const user = computed(() => userStore.user)
  142. // 收藏
  143. import moment from 'moment'
  144. import { CollectionStore } from '@/store/api/platform/collection'
  145. const collectionStore = CollectionStore()
  146. // 加载中
  147. const loading = ref(false)
  148. const is_show = ref(false)
  149. const num = ref(Math.floor(Math.random() * 8))
  150. // 路由
  151. const route = useRoute()
  152. const router = useRouter()
  153. const info = ref({})
  154. const achievementList = ref([])
  155. const projectList = ref([])
  156. // 请求
  157. onMounted(async () => {
  158. loading.value = true
  159. await search()
  160. await searchAchievement()
  161. await searchAchieve()
  162. loading.value = false
  163. })
  164. const search = async () => {
  165. let id = route.query.id
  166. if (id) {
  167. let res = await store.detail(id)
  168. if (res.errcode == '0') info.value = res.data
  169. }
  170. }
  171. const searchAchieve = async () => {
  172. const data = { skip: 0, limit: 3, is_use: '0', status: '1', industry: info.value.industry }
  173. const res = await store.list(data)
  174. if (res.errcode == '0') projectList.value = res.data
  175. }
  176. const searchAchievement = async () => {
  177. const data = { skip: 0, limit: 3, status: '1' }
  178. const res = await achievementStore.query(data)
  179. if (res.errcode == '0') achievementList.value = res.data
  180. }
  181. // 查看
  182. const truncateString = (str, length) => {
  183. if (!str) return '暂无'
  184. if (str.length <= length) {
  185. return str // 如果字符串长度小于等于所需长度,直接返回
  186. } else {
  187. return str.substring(0, length) + '...' // 否则返回前length个字符并加上省略号
  188. }
  189. }
  190. // 查看详情
  191. const toView = (item, type) => {
  192. if (user.value.id) {
  193. if (type == '0') router.push({ path: '/achievement/detail', query: { id: item.id || item._id } })
  194. else if (type == '1')
  195. router.push({ path: '/project/detail', query: { id: item.id || item._id } }).then(() => {
  196. // 重新刷新页面
  197. location.reload()
  198. })
  199. } else ElMessage({ message: '未登录!', type: 'error' })
  200. }
  201. // 查看更多
  202. const toMore = (type) => {
  203. if (type == '0') router.push({ path: '/expert' })
  204. else if (type == '1') router.push({ path: '/project' })
  205. }
  206. const toCollect = async () => {
  207. if (user.value.id) {
  208. info.value.is_collection = !info.value.is_collection
  209. let res
  210. let message
  211. const data = {
  212. user: user.value.id,
  213. source: info.value.id,
  214. type: 'project',
  215. time: moment().format('YYYY-MM-DD')
  216. }
  217. if (info.value.is_collection) {
  218. message = '收藏成功'
  219. res = await collectionStore.create(data)
  220. } else {
  221. message = '取消收藏成功'
  222. res = await collectionStore.cancel(data)
  223. }
  224. if (res.errcode === 0) {
  225. ElMessage({ message, type: 'success' })
  226. await search()
  227. }
  228. } else ElMessage({ message: '未登录!', type: 'error' })
  229. }
  230. const toChat = () => {
  231. if (user.value.id) {
  232. ElMessageBox.confirm(`您确认要预约对接?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
  233. .then(async () => {
  234. let source_id = route.query.id
  235. let source = 'project'
  236. let apply_user = user.value.id
  237. const obj = { source_id, source, apply_user }
  238. const res = await contactApplyStore.create(obj)
  239. $checkRes(res,`预约对接成功等待消息通知`,res.errmsg)
  240. })
  241. .catch(() => {})
  242. } else ElMessage({ message: '未登录!', type: 'error' })
  243. }
  244. </script>
  245. <style scoped lang="scss">
  246. .main {
  247. .one {
  248. padding-bottom: 40px;
  249. background: #f9faff url(/images/bg-gjsxm.jpg) center top no-repeat;
  250. .info_1 {
  251. padding: 30px 0;
  252. }
  253. .info_4 {
  254. padding: 0 50px 30px 50px;
  255. background: #fff;
  256. .title {
  257. color: #000;
  258. display: inline-block;
  259. margin-right: 80px;
  260. padding-bottom: 20px;
  261. font-size: $global-font-size-30;
  262. color: #000000;
  263. border-bottom: 5px solid #378cff;
  264. cursor: pointer;
  265. }
  266. .file {
  267. margin: 20px 0 0 0;
  268. .el-link {
  269. font-size: $global-font-size-20;
  270. }
  271. }
  272. }
  273. .info_2 {
  274. display: flex;
  275. border-radius: 5px;
  276. padding-right: 30px;
  277. padding: 50px;
  278. background: #fff;
  279. .info_left {
  280. width: 390px;
  281. .inose_top {
  282. font-size: $global-font-size-16;
  283. line-height: 30px;
  284. color: #3e3e3e;
  285. margin-bottom: 35px;
  286. .img {
  287. display: flex;
  288. justify-content: center;
  289. align-items: center;
  290. }
  291. .ba_tile {
  292. display: flex;
  293. .hui_text {
  294. color: #8a91b0;
  295. width: 268px;
  296. margin-left: 10px;
  297. }
  298. }
  299. .anniu_btn {
  300. font-size: $global-font-size-16;
  301. color: #2171f6;
  302. cursor: pointer;
  303. }
  304. .other_1 {
  305. display: flex;
  306. align-items: center;
  307. flex-direction: column;
  308. .name {
  309. font-size: $global-font-size-18;
  310. }
  311. .button {
  312. cursor: default;
  313. margin-top: 20px;
  314. justify-content: center;
  315. display: flex;
  316. align-items: center;
  317. width: 136px;
  318. height: 44px;
  319. color: #fff;
  320. font-size: $global-font-size-16;
  321. background-image: linear-gradient(90deg, #0455da 0%, #378cff 100%), linear-gradient(#0455da, #0455da);
  322. background-blend-mode: normal, normal;
  323. border-radius: 4px;
  324. }
  325. }
  326. .wenbe_text {
  327. font-size: $global-font-size-16;
  328. line-height: 26px;
  329. color: #8a91b0;
  330. }
  331. }
  332. }
  333. .info_right {
  334. text-align: center;
  335. min-width: 770px;
  336. margin-left: 35px;
  337. min-height: 417px;
  338. position: relative;
  339. .right_title {
  340. font-size: 20px;
  341. line-height: 45px;
  342. color: #303030;
  343. max-width: 530px;
  344. margin: 0 auto;
  345. .type {
  346. position: absolute;
  347. left: 0;
  348. top: 9px;
  349. width: 83px;
  350. height: 30px;
  351. background-image: linear-gradient(#fff 0%, #fff9e7 100%), linear-gradient(#fff 0%, #fff9e7 100%);
  352. border: 1px solid #ff6600;
  353. font-size: 16px;
  354. line-height: 30px;
  355. color: #ff6600;
  356. text-align: center;
  357. }
  358. .collect {
  359. position: absolute;
  360. right: 0;
  361. top: 0;
  362. display: flex;
  363. align-items: center;
  364. justify-content: flex-end;
  365. font-size: $global-font-size-20;
  366. color: #929292;
  367. cursor: default;
  368. span {
  369. margin: 0 0 0 5px;
  370. }
  371. }
  372. .iscollect {
  373. color: #1073ff;
  374. }
  375. }
  376. .pdf_item {
  377. position: relative;
  378. width: 770px;
  379. height: 464px;
  380. margin: 10px 0 0 0;
  381. .pdf_type {
  382. text-align: left;
  383. font-size: 23px;
  384. line-height: 44px;
  385. color: #414141;
  386. padding-left: 78px;
  387. padding-top: 34px;
  388. }
  389. .title {
  390. padding: 0px 66px 0 88px;
  391. height: 74px;
  392. font-size: 30px;
  393. font-weight: bold;
  394. line-height: 38px;
  395. letter-spacing: 0px;
  396. color: #ffffff;
  397. margin-top: 68px;
  398. .ellipsis-3 {
  399. display: -webkit-box;
  400. -webkit-box-orient: vertical;
  401. overflow: hidden;
  402. -webkit-line-clamp: 3;
  403. }
  404. }
  405. .address {
  406. margin-top: 138px;
  407. padding: 0 65px 0 0;
  408. font-size: 26px;
  409. color: #282828;
  410. display: flex;
  411. align-items: center;
  412. justify-content: flex-end;
  413. }
  414. .biaoqian {
  415. padding: 20px 70px 0 5px;
  416. text-align: right;
  417. overflow: hidden;
  418. span {
  419. padding: 0 5px;
  420. background-color: #f5f8ff;
  421. border-radius: 3px;
  422. border: solid 1px #d2daec;
  423. font-size: $global-font-size-18;
  424. line-height: 26px;
  425. color: #7d8aaa;
  426. margin-right: 2px;
  427. }
  428. }
  429. }
  430. .image0 {
  431. background: url(/images/project/item_1.jpg) no-repeat;
  432. }
  433. .image1 {
  434. background: url(/images/project/item_2.jpg) no-repeat;
  435. }
  436. .image2 {
  437. background: url(/images/project/item_3.jpg) no-repeat;
  438. }
  439. .image3 {
  440. background: url(/images/project/item_4.jpg) no-repeat;
  441. }
  442. .image4 {
  443. background: url(/images/project/item_5.jpg) no-repeat;
  444. }
  445. .image5 {
  446. background: url(/images/project/item_6.jpg) no-repeat;
  447. }
  448. .image6 {
  449. background: url(/images/project/item_7.jpg) no-repeat;
  450. }
  451. .image7 {
  452. background: url(/images/project/item_9.jpg) no-repeat;
  453. }
  454. }
  455. }
  456. .info_3 {
  457. display: flex;
  458. justify-content: space-between;
  459. margin-top: 50px;
  460. .right_1 {
  461. width: 50%;
  462. background-color: #ffffff;
  463. box-shadow: 0px 0px 16px 0px rgba(14, 5, 10, 0.11);
  464. border: solid 1px #e1e6f0;
  465. border-radius: 5px;
  466. .title {
  467. padding: 0 28px 0 24px;
  468. height: 52px;
  469. line-height: 52px;
  470. background-image: linear-gradient(90deg, #2070f6 0%, #629bf5 100%), linear-gradient(#1e6fff, #1e6fff);
  471. background-blend-mode: normal, normal;
  472. color: #fff;
  473. border-top-left-radius: 5px;
  474. border-top-right-radius: 5px;
  475. .title_1 {
  476. float: left;
  477. font-size: $global-font-size-16;
  478. }
  479. .title_2 {
  480. float: right;
  481. font-size: $global-font-size-14;
  482. }
  483. }
  484. .content_2 {
  485. margin: 10px 0;
  486. .list {
  487. display: flex;
  488. align-items: center;
  489. justify-content: space-between;
  490. padding: 10px;
  491. margin: 10px 12px;
  492. padding: 12px 10px;
  493. border-bottom: 1px solid #e1e6f0;
  494. transition: 0.3s ease-in-out;
  495. font-size: $global-font-size-16;
  496. cursor: default;
  497. .name {
  498. display: flex;
  499. align-items: center;
  500. .image {
  501. margin: 6px 5px 0 0;
  502. }
  503. }
  504. }
  505. .list:hover {
  506. box-shadow: 0 0 10px rgb(186, 196, 240); /* 阴影效果 */
  507. }
  508. }
  509. }
  510. .right_1:last-child {
  511. margin-left: 35px !important;
  512. }
  513. }
  514. }
  515. }
  516. </style>