achievementDetail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <custom-layout class="main">
  3. <el-col :span="24" class="one">
  4. <div class="w_1300">
  5. <div class="info_1">
  6. <h3 class="name">{{ info.name || '暂无' }}</h3>
  7. <div class="collect iscollect" @click="toCollect" v-if="info.is_collection">
  8. <el-icon :size="24" color="#1073ff"><StarFilled /></el-icon>
  9. <span>已收藏</span>
  10. </div>
  11. <div class="collect" v-else @click="toCollect">
  12. <el-icon :size="24"><Star /></el-icon>
  13. <span>收藏</span>
  14. </div>
  15. <div class="other_1">
  16. <div class="value">
  17. <el-image class="image" :src="icon1" fit="fill" />
  18. <span class="span">{{ info.time || '暂无' }}</span>
  19. </div>
  20. <div class="value">
  21. <el-image class="image" :src="icon2" fit="fill" />
  22. <span class="span">{{ info.num || '0' }}</span>
  23. </div>
  24. </div>
  25. <div class="other_2">
  26. <div class="value">
  27. <el-image class="image" :src="icon4" fit="fill" />
  28. <span class="span">技术领域:{{ info.field || '暂无' }}</span>
  29. </div>
  30. <div class="value">
  31. <el-image class="image" :src="icon5" fit="fill" />
  32. <span class="span">项目来源:{{ info.source || '暂无' }}</span>
  33. </div>
  34. <div class="value">
  35. <el-image class="image" :src="icon9" fit="fill" />
  36. <span class="span">负责人:{{ info.person || '暂无' }}</span>
  37. </div>
  38. <div class="value">
  39. <el-image class="image" :src="icon6" fit="fill" />
  40. <span class="span">联系电话:{{ info.tel || '暂无' }}</span>
  41. </div>
  42. <div class="value">
  43. <el-image class="image" :src="icon7" fit="fill" />
  44. <span class="span">专利情况:{{ info.patent || '暂无' }}</span>
  45. </div>
  46. <div class="value">
  47. <el-image class="image" :src="icon8" fit="fill" />
  48. <span class="span">技术标签:{{ info.label || '暂无' }}</span>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="info_2">
  53. <div class="title">成果简介</div>
  54. <div class="content">
  55. <div class="tit">
  56. <el-image class="image" :src="icon3" fit="fill" />
  57. <span>成果简介</span>
  58. </div>
  59. <div class="brief">{{ info.brief || '暂无' }}</div>
  60. </div>
  61. </div>
  62. <div class="info_2" v-if="info.file && info.file.length > 0">
  63. <div class="title">成果附件</div>
  64. <div class="file">
  65. <el-link :href="info.file[0].url" target="_blank">{{ info.file[0].name }}</el-link>
  66. </div>
  67. </div>
  68. <div class="info_3">
  69. <div class="title">相关成果推荐</div>
  70. <div class="content">
  71. <div class="list" v-for="(item, index) in list" :key="index" @click="toView(item)">
  72. <div class="list_1">
  73. <el-image class="image" :src="file[index]" fit="fill" />
  74. <div class="box">
  75. <p class="name textMore">{{ item.name || '暂无' }}</p>
  76. </div>
  77. <div class="list_2">
  78. <div class="other">
  79. <el-image class="image" :src="one" fit="fill" />
  80. <div class="text">{{ item.field || '暂无' }}</div>
  81. </div>
  82. <div class="other">
  83. <el-image class="image" :src="two" fit="fill" />
  84. <div class="text">{{ item.person || '暂无' }}</div>
  85. </div>
  86. <div class="other">
  87. <el-image class="image" :src="thr" fit="fill" />
  88. <div class="text">{{ item.source || '暂无' }}</div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </el-col>
  97. </custom-layout>
  98. </template>
  99. <script setup>
  100. import bg_1 from '/images/achievement/tec_bg_1.png'
  101. import bg_2 from '/images/achievement/tec_bg_2.png'
  102. import bg_3 from '/images/achievement/tec_bg_3.png'
  103. import bg_4 from '/images/achievement/tec_bg_4.png'
  104. import one from '/images/achievement/bg-cgyx-list-icon1.png'
  105. import two from '/images/achievement/bg-cgyx-list-icon2.png'
  106. import thr from '/images/achievement/bg-cgyx-list-icon3.png'
  107. import icon1 from '/images/achievement/cg-detail-icon1.png'
  108. import icon2 from '/images/achievement/cg-detail-icon2.png'
  109. import icon3 from '/images/achievement/bg-cg_detail-cgjj1.png'
  110. import icon4 from '/images/achievement/cg-detail-icon4.png'
  111. import icon5 from '/images/achievement/cg-detail-icon5.png'
  112. import icon6 from '/images/achievement/cg-detail-icon6.png'
  113. import icon7 from '/images/achievement/cg-detail-icon7.png'
  114. import icon8 from '/images/achievement/cg-detail-icon8.png'
  115. import icon9 from '/images/achievement/cg-detail-icon9.png'
  116. // 接口
  117. import { AchievementStore } from '@/store/api/platform/achievement'
  118. const store = AchievementStore()
  119. import { UserStore } from '@/store/user'
  120. const userStore = UserStore()
  121. const user = computed(() => userStore.user)
  122. // 加载中
  123. const loading = ref(false)
  124. // 路由
  125. const route = useRoute()
  126. const router = useRouter()
  127. const info = ref({})
  128. const file = ref([bg_1, bg_2, bg_3, bg_4])
  129. const list = ref([])
  130. // 请求
  131. onMounted(async () => {
  132. loading.value = true
  133. await search()
  134. await searchAchieve()
  135. loading.value = false
  136. })
  137. const search = async () => {
  138. let id = route.query.id
  139. if (id) {
  140. let res = await store.detail(id)
  141. if (res.errcode == '0') info.value = res.data
  142. }
  143. }
  144. const searchAchieve = async () => {
  145. const data = {
  146. skip: 0,
  147. limit: 4,
  148. is_use: '0',
  149. status: '1',
  150. field: info.value.field
  151. }
  152. const res = await store.list(data)
  153. if (res.errcode == '0') list.value = res.data
  154. }
  155. // 查看详情
  156. const toView = async (item) => {
  157. router.push({ path: '/achievement/detail', query: { id: item.id || item._id } }).then(() => {
  158. // 重新刷新页面
  159. location.reload()
  160. })
  161. }
  162. const toCollect = async () => {
  163. if (user.value.id) {
  164. info.value.is_collection = !info.value.is_collection
  165. } else ElMessage({ message: '未登录!', type: 'error' })
  166. }
  167. </script>
  168. <style scoped lang="scss">
  169. .main {
  170. .one {
  171. background: url(/images/bg-cg_detail-infor.png) no-repeat top right;
  172. .info_1 {
  173. padding: 100px 80px 0 80px;
  174. .name {
  175. font-size: $global-font-size-36;
  176. width: 70%;
  177. font-weight: bold;
  178. }
  179. .collect {
  180. display: flex;
  181. align-items: center;
  182. width: 35%;
  183. font-size: $global-font-size-20;
  184. color: #929292;
  185. cursor: default;
  186. span {
  187. margin: 0 0 0 5px;
  188. }
  189. }
  190. .iscollect {
  191. color: #1073ff;
  192. }
  193. .other_1 {
  194. width: 430px;
  195. margin-top: 40px !important;
  196. display: flex;
  197. align-items: center;
  198. justify-content: space-between;
  199. .value {
  200. display: flex;
  201. align-items: center;
  202. .span {
  203. margin: 0 0 0 10px;
  204. font-size: 18px;
  205. line-height: 36px;
  206. color: #18284d;
  207. }
  208. }
  209. }
  210. .other_2 {
  211. width: 430px;
  212. .value {
  213. display: flex;
  214. align-items: center;
  215. margin: 5px 0 0 0;
  216. .span {
  217. margin: 0 0 0 10px;
  218. font-size: 18px;
  219. line-height: 36px;
  220. color: #18284d;
  221. }
  222. }
  223. }
  224. }
  225. .info_2 {
  226. padding: 0 80px;
  227. margin-top: 70px !important;
  228. .title {
  229. color: #000;
  230. display: inline-block;
  231. margin-right: 80px;
  232. padding-bottom: 20px;
  233. font-size: $global-font-size-30;
  234. color: #000000;
  235. border-bottom: 5px solid #378cff;
  236. cursor: pointer;
  237. }
  238. .file {
  239. margin: 20px 0 0 0;
  240. .el-link {
  241. font-size: $global-font-size-20;
  242. }
  243. }
  244. .content {
  245. padding: 20px;
  246. margin-top: 25px !important;
  247. width: 100%;
  248. background-image: linear-gradient(90deg, #3dbef2 0, #5b3bff 100%), linear-gradient(#5b3bff, #5b3bff);
  249. background-blend-mode: normal, normal;
  250. .tit {
  251. span {
  252. font-size: 20px !important;
  253. margin-left: 15px !important;
  254. color: #fff;
  255. }
  256. }
  257. .brief {
  258. line-height: 28px;
  259. color: #fff;
  260. font-size: 16px;
  261. margin-top: 20px !important;
  262. }
  263. }
  264. }
  265. .info_3 {
  266. padding: 80px !important;
  267. background: #fff;
  268. .title {
  269. color: #000;
  270. display: inline-block;
  271. margin-right: 80px;
  272. padding-bottom: 20px;
  273. font-size: $global-font-size-30;
  274. color: #000000;
  275. border-bottom: 5px solid #378cff;
  276. cursor: pointer;
  277. }
  278. .content {
  279. margin: 10px 0;
  280. display: flex;
  281. flex-wrap: wrap;
  282. align-items: center;
  283. .list {
  284. margin-right: 10px;
  285. margin-bottom: 15px;
  286. padding-top: 3px;
  287. width: 277px;
  288. height: 325px;
  289. background-color: #fff;
  290. box-shadow: 0 2px 5px 0 rgba(159, 158, 158, 0.3);
  291. .list_1 {
  292. position: relative;
  293. .image {
  294. height: 100%;
  295. width: 100%;
  296. }
  297. .box {
  298. display: flex !important;
  299. align-items: center;
  300. position: absolute;
  301. top: 40px;
  302. left: 0;
  303. padding: 15px 10px;
  304. width: 100%;
  305. height: 70px;
  306. background-color: rgba(0, 25, 79, 0.5);
  307. font-size: $global-font-size-18;
  308. line-height: 24px;
  309. color: #fff;
  310. }
  311. }
  312. .list_2 {
  313. margin: 10px 13px 0;
  314. .other {
  315. display: flex;
  316. align-items: center;
  317. margin: 0 0 5px 0;
  318. .image {
  319. width: 25px;
  320. height: 25px;
  321. margin: 0 5px 0 0;
  322. }
  323. .text {
  324. font-size: $global-font-size-16;
  325. line-height: 32px;
  326. color: #404040;
  327. }
  328. }
  329. }
  330. }
  331. .list:nth-child(4n) {
  332. margin-right: 0;
  333. }
  334. .list:hover {
  335. box-shadow: 0 2px 5px 0 rgba(159, 158, 158, 0.8);
  336. }
  337. }
  338. }
  339. }
  340. }
  341. </style>