expertDetail.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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="infoName">
  8. <el-image class="image" :src="userLogo" fit="fill" />
  9. <div class="other_1">
  10. <div class="info_title">
  11. <div class="name">{{ info.name || '暂无' }}</div>
  12. <div class="collect iscollect" @click="toCollect" v-if="info.is_collection">
  13. <el-icon :size="24" color="#1073ff"><StarFilled /></el-icon>
  14. <span>已收藏</span>
  15. </div>
  16. <div class="collect" v-else @click="toCollect">
  17. <el-icon :size="24"><Star /></el-icon>
  18. <span>收藏</span>
  19. </div>
  20. </div>
  21. <div class="brief">
  22. <span>{{ info.title || '暂无' }}</span>
  23. <span v-if="info.area">{{ info.area || '暂无' }}</span>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="infoButton">
  28. <div class="button" @click="toChat">获取联系方式</div>
  29. </div>
  30. <div class="infoBrief">
  31. <div class="Brief_1">
  32. <span>所属产业:</span>
  33. <span>{{ info.industry || '暂无' }}</span>
  34. </div>
  35. <div class="Brief_2" v-if="info.work">
  36. <span>工作单位:</span>
  37. <span>{{ info.work || '暂无' }}</span>
  38. </div>
  39. <div class="Brief_2" v-if="info.direction">
  40. <span>研究方向:</span>
  41. <span>{{ info.direction || '暂无' }}</span>
  42. </div>
  43. </div>
  44. <div class="infoOther">
  45. <div class="title">合作信息</div>
  46. <div class="content">
  47. <el-table :data="tableData" stripe style="width: 100%" :header-cell-style="{ backgroundColor: 'rgba(194, 209, 225, 0.5)', color: '#ffffff', fontSize: '16px', textAlign: 'center' }" :cell-style="{ fontSize: '16px', textAlign: 'center' }" :row-style="{ fontSize: '16px', textAlign: 'center' }">
  48. <el-table-column prop="company" label="合作单位" />
  49. <el-table-column prop="num" label="合作论文数量" />
  50. </el-table>
  51. </div>
  52. </div>
  53. <div class="infoOther">
  54. <div class="title">荣誉&成就</div>
  55. <div class="content">{{ info.title || '暂无' }}</div>
  56. </div>
  57. <div class="infoOther">
  58. <div class="title">科研成果</div>
  59. <div class="content">
  60. <div class="content_1">
  61. <div class="menu" :class="[active == '1' ? 'menuTrue' : '']" @click="toActive('1')">
  62. <span>期刊论文</span>
  63. </div>
  64. <div class="menu" :class="[active == '2' ? 'menuTrue' : '']" @click="toActive('2')">
  65. <span>科技成果</span>
  66. </div>
  67. <div class="menu" :class="[active == '3' ? 'menuTrue' : '']" @click="toActive('3')">
  68. <span>专利</span>
  69. </div>
  70. </div>
  71. <div class="content_2">
  72. <div class="brief">
  73. {{ info.brief || '暂无' }}
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </el-col>
  81. </custom-layout>
  82. </template>
  83. <script setup>
  84. import userLogo from '/images/userLogo.png'
  85. import { ExpertStore } from '@/store/api/user/expert'
  86. const store = ExpertStore()
  87. // 收藏
  88. import moment from 'moment'
  89. import { CollectionStore } from '@/store/api/platform/collection'
  90. const collectionStore = CollectionStore()
  91. import { UserStore } from '@/store/user'
  92. const userStore = UserStore()
  93. const user = computed(() => userStore.user)
  94. // 加载中
  95. const loading = ref(false)
  96. // 路由
  97. const route = useRoute()
  98. const tableData = ref([
  99. // { company: '中国科学院固定物理研究所', num: '45' },
  100. // { company: '中国汽车工程学会', num: '30' },
  101. // { company: '清华大学车辆与运载学院', num: '27' },
  102. // { company: '原一汽技术中心技术中心', num: '23' }
  103. ])
  104. const active = ref('1')
  105. const info = ref({})
  106. // 请求
  107. onMounted(async () => {
  108. loading.value = true
  109. await searchOther()
  110. await search()
  111. loading.value = false
  112. })
  113. const search = async () => {
  114. let id = route.query.id
  115. if (id) {
  116. let res = await store.detail(id)
  117. if (res.errcode == '0') info.value = res.data
  118. }
  119. }
  120. const searchOther = async () => {
  121. // let result
  122. // // 成熟度
  123. // result = await dictDataStore.query({ code: 'mature', is_use: '0' })
  124. // if ($checkRes(result)) matureList.value = result.data
  125. // // 出让方式
  126. // result = await dictDataStore.query({ code: 'sell', is_use: '0' })
  127. // if ($checkRes(result)) sellList.value = result.data
  128. // // 技术领域
  129. // result = await dictDataStore.query({ code: 'field', is_use: '0' })
  130. // if ($checkRes(result)) fieldList.value = result.data
  131. // // 属性
  132. // result = await dictDataStore.query({ code: 'attribute', is_use: '0' })
  133. // if ($checkRes(result)) attributeList.value = result.data
  134. // // 技术分类
  135. // result = await dictDataStore.query({ code: 'technology', is_use: '0' })
  136. // if ($checkRes(result)) technologyList.value = result.data
  137. }
  138. const toActive = (item) => {
  139. active.value = item
  140. }
  141. const toChat = () => {
  142. if (user.value.id) {
  143. ElMessageBox.confirm(`您确认要获取联系方式?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
  144. .then(async () => {
  145. ElMessage({ message: `获取联系方式成功等待消息通知`, type: 'success' })
  146. })
  147. .catch(() => {})
  148. } else ElMessage({ message: '未登录!', type: 'error' })
  149. }
  150. const toCollect = async () => {
  151. if (user.value.id) {
  152. info.value.is_collection = !info.value.is_collection
  153. let res
  154. let message
  155. const data = {
  156. user: user.value.id,
  157. source: info.value.id,
  158. type: 'expert',
  159. time: moment().format('YYYY-MM-DD')
  160. }
  161. if (info.value.is_collection) {
  162. message = '收藏成功'
  163. res = await collectionStore.create(data)
  164. } else {
  165. message = '取消收藏成功'
  166. res = await collectionStore.cancel(data)
  167. }
  168. if (res.errcode === 0) {
  169. ElMessage({ message, type: 'success' })
  170. await search()
  171. }
  172. } else ElMessage({ message: '未登录!', type: 'error' })
  173. }
  174. </script>
  175. <style scoped lang="scss">
  176. .main {
  177. .one {
  178. background: url(/images/expertBg.png) no-repeat;
  179. background-position: center top;
  180. .info_1 {
  181. padding: 30px 0;
  182. }
  183. .info_2 {
  184. border-radius: 5px;
  185. padding-right: 30px;
  186. padding: 50px;
  187. background: url(/images/userbg.png) no-repeat;
  188. background-position: center top;
  189. .infoName {
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. .other_1 {
  194. margin: 0 0 0 10px;
  195. .info_title {
  196. display: flex;
  197. justify-content: space-between;
  198. align-items: center;
  199. .name {
  200. font-size: $global-font-size-22;
  201. font-weight: bold;
  202. }
  203. .collect {
  204. display: flex;
  205. align-items: center;
  206. justify-content: flex-end;
  207. font-size: $global-font-size-20;
  208. width: 45%;
  209. color: #929292;
  210. cursor: default;
  211. span {
  212. margin: 0 0 0 5px;
  213. }
  214. }
  215. .iscollect {
  216. color: #1073ff;
  217. }
  218. }
  219. .brief {
  220. font-size: $global-font-size-18;
  221. color: $global-color-595;
  222. margin: 5px 0 0 0;
  223. span {
  224. margin: 0 5px 0 0;
  225. }
  226. }
  227. }
  228. }
  229. .infoButton {
  230. display: flex;
  231. justify-content: center;
  232. margin: 10px 0 0 0;
  233. .button {
  234. width: 152px;
  235. height: 36px;
  236. background: #3278f4;
  237. border-radius: 18px;
  238. font-size: $global-font-size-14;
  239. font-weight: 500;
  240. color: #ffffff;
  241. text-align: center;
  242. line-height: 36px;
  243. cursor: pointer;
  244. }
  245. }
  246. .infoBrief {
  247. background: rgba(194, 209, 225, 0.5);
  248. padding: 20px;
  249. margin: 20px 0;
  250. border-radius: 5px;
  251. font-size: $global-font-size-18;
  252. .Brief_1 {
  253. margin: 10px 0;
  254. span:first-child {
  255. margin: 0 5px 0 0;
  256. }
  257. span:last-child {
  258. color: #dc4900;
  259. margin: 0 5px 0 0;
  260. }
  261. }
  262. .Brief_2 {
  263. margin: 10px 0;
  264. span:first-child {
  265. margin: 0 5px 0 0;
  266. }
  267. span:last-child {
  268. margin: 0 5px 0 0;
  269. }
  270. }
  271. }
  272. .infoOther {
  273. margin: 20px 0;
  274. border-radius: 5px;
  275. padding: 10px;
  276. background: #ffffff;
  277. box-shadow: 0 2px 5px 0 rgba(159, 158, 158, 0.3);
  278. .title {
  279. margin: 10px 0 10px;
  280. padding-left: 10px;
  281. height: 18px;
  282. line-height: 18px;
  283. font-size: 16px;
  284. font-weight: bold;
  285. color: #1073ff;
  286. border-left: 3px solid #1073ff;
  287. }
  288. .content {
  289. padding: 20px;
  290. font-size: $global-font-size-18;
  291. .content_1 {
  292. display: flex;
  293. align-items: center;
  294. .menu {
  295. padding: 10px 20px;
  296. margin: 0 10px 0 0;
  297. color: #666666;
  298. border: 1px solid #bbbbbb;
  299. cursor: default;
  300. }
  301. .menuTrue {
  302. color: $global-color-fff;
  303. background: #1073ff;
  304. border: none;
  305. cursor: default;
  306. }
  307. }
  308. .content_2 {
  309. margin: 10px 0;
  310. .brief {
  311. margin: 10px 0;
  312. }
  313. }
  314. }
  315. }
  316. }
  317. }
  318. }
  319. </style>