expertDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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. import { ContactApplyStore } from '@/store/api/user/contactApply'
  87. const contactApplyStore = ContactApplyStore()
  88. const store = ExpertStore()
  89. // 收藏
  90. import moment from 'moment'
  91. import { CollectionStore } from '@/store/api/platform/collection'
  92. const collectionStore = CollectionStore()
  93. import { UserStore } from '@/store/user'
  94. const userStore = UserStore()
  95. const user = computed(() => userStore.user)
  96. // 加载中
  97. const loading = ref(false)
  98. // 路由
  99. const route = useRoute()
  100. const tableData = ref([
  101. // { company: '中国科学院固定物理研究所', num: '45' },
  102. // { company: '中国汽车工程学会', num: '30' },
  103. // { company: '清华大学车辆与运载学院', num: '27' },
  104. // { company: '原一汽技术中心技术中心', num: '23' }
  105. ])
  106. const active = ref('1')
  107. const info = ref({})
  108. // 请求
  109. onMounted(async () => {
  110. loading.value = true
  111. await searchOther()
  112. await search()
  113. loading.value = false
  114. })
  115. const search = async () => {
  116. let id = route.query.id
  117. if (id) {
  118. let res = await store.detail(id)
  119. if (res.errcode == '0') info.value = res.data
  120. }
  121. }
  122. const searchOther = async () => {
  123. // let result
  124. // // 成熟度
  125. // result = await dictDataStore.query({ code: 'mature', is_use: '0' })
  126. // if ($checkRes(result)) matureList.value = result.data
  127. // // 出让方式
  128. // result = await dictDataStore.query({ code: 'sell', is_use: '0' })
  129. // if ($checkRes(result)) sellList.value = result.data
  130. // // 技术领域
  131. // result = await dictDataStore.query({ code: 'field', is_use: '0' })
  132. // if ($checkRes(result)) fieldList.value = result.data
  133. // // 属性
  134. // result = await dictDataStore.query({ code: 'attribute', is_use: '0' })
  135. // if ($checkRes(result)) attributeList.value = result.data
  136. // // 技术分类
  137. // result = await dictDataStore.query({ code: 'technology', is_use: '0' })
  138. // if ($checkRes(result)) technologyList.value = result.data
  139. }
  140. const toActive = (item) => {
  141. active.value = item
  142. }
  143. const toChat = () => {
  144. if (user.value.id) {
  145. ElMessageBox.confirm(`您确认要预约对接?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
  146. .then(async () => {
  147. let source_id = route.query.id
  148. let source = 'expert'
  149. let apply_user = user.value.id
  150. const obj = { source_id, source, apply_user }
  151. const res = await contactApplyStore.create(obj)
  152. if (res.errcode == 0) {
  153. ElMessage({ message: '预约对接成功等待消息通知', type: 'success' })
  154. } else {
  155. ElMessageBox.confirm(res.errmsg, '提示', { confirmButtonText: '确定', type: 'warning', showCancelButton: false, center: true })
  156. .then(() => {})
  157. .catch(() => {})
  158. }
  159. })
  160. .catch(() => {})
  161. } else ElMessage({ message: '未登录!', type: 'error' })
  162. }
  163. const toCollect = async () => {
  164. if (user.value.id) {
  165. info.value.is_collection = !info.value.is_collection
  166. let res
  167. let message
  168. const data = {
  169. user: user.value.id,
  170. source: info.value.id,
  171. type: 'expert',
  172. time: moment().format('YYYY-MM-DD')
  173. }
  174. if (info.value.is_collection) {
  175. message = '收藏成功'
  176. res = await collectionStore.create(data)
  177. } else {
  178. message = '取消收藏成功'
  179. res = await collectionStore.cancel(data)
  180. }
  181. if (res.errcode === 0) {
  182. ElMessage({ message, type: 'success' })
  183. await search()
  184. }
  185. } else ElMessage({ message: '未登录!', type: 'error' })
  186. }
  187. </script>
  188. <style scoped lang="scss">
  189. .main {
  190. .one {
  191. background: url(/images/expertBg.png) no-repeat;
  192. background-position: center top;
  193. .info_1 {
  194. padding: 30px 0;
  195. }
  196. .info_2 {
  197. border-radius: 5px;
  198. padding-right: 30px;
  199. padding: 50px;
  200. background: url(/images/userbg.png) no-repeat;
  201. background-position: center top;
  202. .infoName {
  203. display: flex;
  204. align-items: center;
  205. justify-content: center;
  206. .other_1 {
  207. margin: 0 0 0 10px;
  208. width: 20%;
  209. .info_title {
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: center;
  213. .name {
  214. font-size: $global-font-size-22;
  215. font-weight: bold;
  216. }
  217. .collect {
  218. display: flex;
  219. align-items: center;
  220. justify-content: flex-end;
  221. font-size: $global-font-size-20;
  222. width: 45%;
  223. color: #929292;
  224. cursor: default;
  225. span {
  226. margin: 0 0 0 5px;
  227. }
  228. }
  229. .iscollect {
  230. color: #1073ff;
  231. }
  232. }
  233. .brief {
  234. font-size: $global-font-size-18;
  235. color: $global-color-595;
  236. margin: 5px 0 0 0;
  237. span {
  238. margin: 0 5px 0 0;
  239. }
  240. }
  241. }
  242. }
  243. .infoButton {
  244. display: flex;
  245. justify-content: center;
  246. margin: 10px 0 0 0;
  247. .button {
  248. cursor: default;
  249. justify-content: center;
  250. display: flex;
  251. align-items: center;
  252. width: 136px;
  253. height: 44px;
  254. color: #fff;
  255. font-size: $global-font-size-16;
  256. background-image: linear-gradient(90deg, #0455da 0%, #378cff 100%), linear-gradient(#0455da, #0455da);
  257. background-blend-mode: normal, normal;
  258. border-radius: 4px;
  259. }
  260. }
  261. .infoBrief {
  262. background: rgba(194, 209, 225, 0.5);
  263. padding: 20px;
  264. margin: 20px 0;
  265. border-radius: 5px;
  266. font-size: $global-font-size-18;
  267. .Brief_1 {
  268. margin: 10px 0;
  269. span:first-child {
  270. margin: 0 5px 0 0;
  271. }
  272. span:last-child {
  273. color: #dc4900;
  274. margin: 0 5px 0 0;
  275. }
  276. }
  277. .Brief_2 {
  278. margin: 10px 0;
  279. span:first-child {
  280. margin: 0 5px 0 0;
  281. }
  282. span:last-child {
  283. margin: 0 5px 0 0;
  284. }
  285. }
  286. }
  287. .infoOther {
  288. margin: 20px 0;
  289. border-radius: 5px;
  290. padding: 10px;
  291. background: #ffffff;
  292. box-shadow: 0 2px 5px 0 rgba(159, 158, 158, 0.3);
  293. .title {
  294. margin: 10px 0 10px;
  295. padding-left: 10px;
  296. height: 18px;
  297. line-height: 18px;
  298. font-size: 16px;
  299. font-weight: bold;
  300. color: #1073ff;
  301. border-left: 3px solid #1073ff;
  302. }
  303. .content {
  304. padding: 20px;
  305. font-size: $global-font-size-18;
  306. .content_1 {
  307. display: flex;
  308. align-items: center;
  309. .menu {
  310. padding: 10px 20px;
  311. margin: 0 10px 0 0;
  312. color: #666666;
  313. border: 1px solid #bbbbbb;
  314. cursor: default;
  315. }
  316. .menuTrue {
  317. color: $global-color-fff;
  318. background: #1073ff;
  319. border: none;
  320. cursor: default;
  321. }
  322. }
  323. .content_2 {
  324. margin: 10px 0;
  325. .brief {
  326. margin: 10px 0;
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. }
  334. </style>