detail.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
  5. <div class="w_1200">
  6. <el-col :span="24" class="one">
  7. <el-row :span="24" class="one_1">
  8. <el-col :span="20" class="title">{{ info.name || '暂无标题' }}</el-col>
  9. <el-col :span="4" class="file">
  10. <el-icon>
  11. <Download />
  12. </el-icon>
  13. 附件下载
  14. </el-col>
  15. </el-row>
  16. <el-row :span="24" class="one_2"> {{ getDict(info.sell, 'sell') }} </el-row>
  17. </el-col>
  18. <el-col :span="24" class="two">
  19. <a-descriptions bordered>
  20. <a-descriptions-item label="行业分类">
  21. {{ getDict(info.field, 'field') }}
  22. </a-descriptions-item>
  23. <a-descriptions-item label="成果属性">
  24. {{ getDict(info.attribute, 'attribute') }}
  25. </a-descriptions-item>
  26. <a-descriptions-item label="出让方式">
  27. {{ getDict(info.sell, 'sell') }}
  28. </a-descriptions-item>
  29. <a-descriptions-item label="成熟度">
  30. {{ getDict(info.mature, 'mature') }}
  31. </a-descriptions-item>
  32. <a-descriptions-item label="技术分类">
  33. {{ getDict(info.technology, 'technology') }}
  34. </a-descriptions-item>
  35. <a-descriptions-item label="成果地区">
  36. {{ getArea(info.area) }}
  37. </a-descriptions-item>
  38. <a-descriptions-item label="发布时间">
  39. {{ info.time }}
  40. </a-descriptions-item>
  41. </a-descriptions>
  42. </el-col>
  43. <el-col :span="24" class="pointer">
  44. <div class="money">
  45. 参考价格:<span> {{ info.money || '面议' }} </span>
  46. </div>
  47. <a-button type="primary"> 我要买 </a-button>
  48. </el-col>
  49. <el-col :span="24" class="pointer" v-if="!user && !user._id">
  50. 提醒:您还没有登录,登录成功后再对接
  51. </el-col>
  52. <el-col :span="24" class="thr">
  53. <el-col :span="24" class="thr_1">
  54. <p>单位信息</p>
  55. </el-col>
  56. <el-row :span="24" class="thr_2">
  57. <el-col :span="16" class="left">
  58. <el-col :span="24" class="name">
  59. {{ unit.name || '暂无' }}
  60. </el-col>
  61. <el-col :span="24" class="other">
  62. <span>联系人</span>
  63. {{ unit.contacts || '暂无' }}
  64. </el-col>
  65. </el-col>
  66. <el-col :span="8" class="right">
  67. <a-button type="primary">
  68. <template #icon>
  69. <MessageOutlined />
  70. </template>
  71. 点击在线洽谈
  72. </a-button>
  73. <a-button class="button"> 进入单位 </a-button>
  74. <a-button class="button"> 收藏单位 </a-button>
  75. </el-col>
  76. </el-row>
  77. </el-col>
  78. <a-divider />
  79. <el-col :span="24" class="four">
  80. <el-col :span="24" class="four_1">
  81. <p>成果详情</p>
  82. </el-col>
  83. <el-col :span="24" class="four_2">{{ info.brief || '暂无' }}</el-col>
  84. </el-col>
  85. </div>
  86. </el-col>
  87. </el-row>
  88. </div>
  89. </template>
  90. <script setup>
  91. // 基础
  92. import { MessageOutlined } from '@ant-design/icons-vue'
  93. import { get } from 'lodash-es'
  94. const $checkRes = inject('$checkRes')
  95. // 接口
  96. import { AchievementStore } from '@/store/api/platform/achievement'
  97. import { DictDataStore } from '@/store/api/system/dictData'
  98. const store = AchievementStore()
  99. const dictDataStore = DictDataStore()
  100. import { UserStore } from '@/store/user'
  101. const userStore = UserStore()
  102. const user = computed(() => userStore.user)
  103. // 路由
  104. const route = useRoute()
  105. // 加载中
  106. const loading = ref(false)
  107. const info = ref({})
  108. const unit = ref({ name: '吉林大学', contacts: '陈老师' })
  109. // 字典表
  110. const fieldList = ref([])
  111. const attributeList = ref([])
  112. const matureList = ref([])
  113. const sellList = ref([])
  114. const technologyList = ref([])
  115. // 请求
  116. onMounted(async () => {
  117. loading.value = true
  118. await searchOther()
  119. await search()
  120. loading.value = false
  121. })
  122. const search = async () => {
  123. let id = route.query.id
  124. if (id) {
  125. let res = await store.fetch(id)
  126. if (res.errcode == '0') info.value = res.data
  127. }
  128. }
  129. const searchOther = async () => {
  130. let result
  131. // 成熟度
  132. result = await dictDataStore.query({ code: 'mature', is_use: '0' })
  133. if ($checkRes(result)) matureList.value = result.data
  134. // 出让方式
  135. result = await dictDataStore.query({ code: 'sell', is_use: '0' })
  136. if ($checkRes(result)) sellList.value = result.data
  137. // 技术领域
  138. result = await dictDataStore.query({ code: 'field', is_use: '0' })
  139. if ($checkRes(result)) fieldList.value = result.data
  140. // 属性
  141. result = await dictDataStore.query({ code: 'attribute', is_use: '0' })
  142. if ($checkRes(result)) attributeList.value = result.data
  143. // 技术分类
  144. result = await dictDataStore.query({ code: 'technology', is_use: '0' })
  145. if ($checkRes(result)) technologyList.value = result.data
  146. }
  147. // 字典数据转换
  148. const getDict = (data, model) => {
  149. let res
  150. if (model == 'mature') res = matureList.value.find((f) => f.value == data)
  151. else if (model == 'sell') res = sellList.value.find((f) => f.value == data)
  152. else if (model == 'field') res = fieldList.value.find((f) => f.value == data)
  153. else if (model == 'attribute') res = attributeList.value.find((f) => f.value == data)
  154. else if (model == 'technology') res = technologyList.value.find((f) => f.value == data)
  155. return get(res, 'label')
  156. }
  157. // 地区
  158. const getArea = (data) => {
  159. if (data) return data.join(',')
  160. }
  161. </script>
  162. <style scoped lang="scss">
  163. .main {
  164. .one {
  165. margin: 10px 0 0 0;
  166. background: #f7f7f7;
  167. padding: 24px;
  168. border-top: 6px solid #2374ff;
  169. overflow: hidden;
  170. border-radius: 0 0 5px 5px;
  171. .one_1 {
  172. margin: 0 0 10px 0;
  173. .title {
  174. font-size: 18px;
  175. font-weight: 700;
  176. color: #383b40;
  177. }
  178. .file {
  179. display: flex;
  180. align-items: center;
  181. justify-content: end;
  182. font-family: PingFangSC-Regular;
  183. font-size: 14px;
  184. color: #2374ff;
  185. text-align: right;
  186. }
  187. }
  188. .one_2 {
  189. display: inline-block;
  190. font-size: 12px;
  191. background: rgba(18, 172, 117, 0.05);
  192. color: #12ac75;
  193. padding: 0 15px;
  194. height: 20px;
  195. line-height: 20px;
  196. border-radius: 10px;
  197. margin-bottom: 2px;
  198. }
  199. }
  200. .two {
  201. background: #f9fafb;
  202. border-radius: 2px;
  203. padding: 30px;
  204. margin: 34px 0 20px;
  205. font-family: PingFangSC-Medium;
  206. font-size: 14px;
  207. color: #383b40;
  208. line-height: 14px;
  209. }
  210. .thr {
  211. margin: 0 0 10px 0;
  212. .thr_1 {
  213. width: 100%;
  214. height: 40px;
  215. line-height: 40px;
  216. border-bottom: 2px solid #2374ff;
  217. margin: 20px 0;
  218. background: #f7f7f7;
  219. p {
  220. float: left;
  221. padding: 0 20px;
  222. height: 40px;
  223. border-bottom: 2px solid #2374ff;
  224. color: #fff;
  225. font-size: 18px;
  226. background: #2374ff;
  227. }
  228. }
  229. .thr_2 {
  230. display: flex;
  231. justify-content: space-between;
  232. align-items: center;
  233. background: #fff;
  234. border: 1px solid #edeff2;
  235. box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.03);
  236. border-radius: 2px;
  237. padding: 30px 20px;
  238. .left {
  239. .name {
  240. height: 20px;
  241. font-family: PingFangSC-Semibold;
  242. font-size: 18px;
  243. color: #383b40;
  244. line-height: 20px;
  245. font-weight: 700;
  246. margin-bottom: 8px;
  247. }
  248. .other {
  249. height: 14px;
  250. font-family: PingFangSC-Medium;
  251. font-size: 14px;
  252. color: #383b40;
  253. line-height: 14px;
  254. font-weight: 700;
  255. span {
  256. height: 14px;
  257. font-family: PingFangSC-Regular;
  258. font-size: 14px;
  259. color: #7e8288;
  260. line-height: 14px;
  261. font-weight: 400;
  262. margin-right: 16px;
  263. }
  264. }
  265. }
  266. .right {
  267. display: flex;
  268. justify-content: space-between;
  269. .button {
  270. border-color: #2374ff;
  271. color: #2374ff;
  272. }
  273. }
  274. }
  275. }
  276. .four {
  277. margin: 0 0 10px 0;
  278. .four_1 {
  279. width: 100%;
  280. height: 40px;
  281. line-height: 40px;
  282. border-bottom: 2px solid #2374ff;
  283. margin: 20px 0;
  284. background: #f7f7f7;
  285. p {
  286. float: left;
  287. padding: 0 20px;
  288. height: 40px;
  289. border-bottom: 2px solid #2374ff;
  290. color: #fff;
  291. font-size: 18px;
  292. background: #2374ff;
  293. }
  294. }
  295. }
  296. .pointer {
  297. display: flex;
  298. align-items: center;
  299. justify-content: flex-end;
  300. font-family: PingFangSC-Regular;
  301. font-size: 14px;
  302. color: #7e8288;
  303. margin: 10px 0 0 0;
  304. .money {
  305. margin: 0 10px 0 0;
  306. span {
  307. font-family: PingFangSC-Semibold;
  308. font-size: 20px;
  309. color: #e94643;
  310. line-height: 20px;
  311. }
  312. }
  313. }
  314. }
  315. </style>