吉光研途前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

617 lines
15 KiB

  1. <template>
  2. <view class="page__view">
  3. <!-- 导航栏 -->
  4. <navbar :title="details.title" leftClick @leftClick="$utils.navigateBack" bgColor="#4883F9" color="#FFFFFF" />
  5. <!-- 轮播图 -->
  6. <view class="swiper">
  7. <uv-swiper :list="bannerList" keyName="image" :autoplay="bannerList.length > 1" :indicator="bannerList.length > 1" indicatorMode="dot" indicatorActiveColor="#4883F9" indicatorInactiveColor="#FFFFFF" height="424rpx"></uv-swiper>
  8. </view>
  9. <!-- 发表全流程辅导 -->
  10. <view class="section">
  11. <view class="section-header">发表全流程辅导</view>
  12. <view class="section-content paragraph process">
  13. <view class="paragraph">
  14. <uv-parse :content="details.process"></uv-parse>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 可发表方向 -->
  19. <view class="section">
  20. <view class="section-header">
  21. <view class="section-header-line"></view>
  22. <view>可发表方向</view>
  23. </view>
  24. <view class="section-content direction">
  25. <view class="table">
  26. <view class="table-row" v-for="row in details.educationTargetList" :key="row.id">
  27. <view class="table-cell">{{ row.title }}</view>
  28. <view class="table-cell">{{ row.description }}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <!-- 师资介绍 -->
  34. <view class="section">
  35. <view class="section-header">
  36. <view class="section-header-line"></view>
  37. <view>师资介绍</view>
  38. </view>
  39. <view class="section-content teachers">
  40. <view class="card" v-for="item in details.educationTeacherList" :key="item.id">
  41. <view class="info">
  42. <view class="title">
  43. <view class="name">{{ item.title }}</view>
  44. <view class="label">
  45. <view class="label-text">{{ item.career }}</view>
  46. <view class="label-line"></view>
  47. </view>
  48. </view>
  49. <view class="tag">
  50. <image class="tag-icon" src="@/static/image/icon-degree.png" mode="widthFix"></image>
  51. <vie>{{ item.qualification }}</vie>
  52. </view>
  53. <view class="desc">
  54. <view>专业经历</view>
  55. <view>{{ item.experience }}</view>
  56. </view>
  57. </view>
  58. <view class="pic">
  59. <image class="img" :src="item.image" mode="aspectFill"></image>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 课程安排 -->
  65. <view class="section">
  66. <view class="section-header">
  67. <view class="section-header-line"></view>
  68. <view>课程安排</view>
  69. </view>
  70. <view class="section-content">
  71. <view class="table">
  72. <view class="table-row" v-for="row in details.educationCourseList" :key="row.id">
  73. <view class="table-cell">{{ row.title }}</view>
  74. <view class="table-cell">{{ row.description }}</view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- 适用人群 -->
  80. <view class="section">
  81. <view class="section-header">
  82. <view class="section-header-line"></view>
  83. <view>适用人群</view>
  84. </view>
  85. <view class="section-content target-audience">
  86. <view class="paragraph">
  87. <uv-parse :content="details.suit"></uv-parse>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 期刊推荐 -->
  92. <view class="section">
  93. <view class="section-header">
  94. <view class="section-header-line"></view>
  95. <view>期刊推荐</view>
  96. </view>
  97. <view class="section-content journal">
  98. <view class="box" v-for="item in details.educationPeriodicalList" :key="item.id">
  99. <view class="card">
  100. <view class="top">
  101. <view class="pic">
  102. <image class="img" :src="item.image" mode="aspectFill"></image>
  103. </view>
  104. <view class="info">
  105. <view class="name">{{ item.title }}</view>
  106. <view class="desc">{{ item.shortTitle }}</view>
  107. </view>
  108. </view>
  109. <view class="main">
  110. {{ item.description }}
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <!-- 附加材料 -->
  117. <view class="section">
  118. <view class="section-header">
  119. <view class="section-header-line"></view>
  120. <view>附加材料</view>
  121. </view>
  122. <view class="section-content attachment">
  123. <view class="flex file" v-for="item in details.educationDocumentList" :key="item.id">
  124. <view class="file-info">
  125. <template v-if="item.type == 'pdf'">
  126. <image class="file-icon" src="@/static/image/icon-pdf.png" mode="widthFix"></image>
  127. </template>
  128. <template v-else>
  129. <image class="file-icon" src="@/static/image/icon-word.png" mode="widthFix"></image>
  130. </template>
  131. <view class="file-detail">
  132. <view class="title">{{ item.title }}</view>
  133. <view class="desc">{{ `${getFileType(item.document)} ${item.size || '-'}MB` }}</view>
  134. </view>
  135. </view>
  136. <button class="btn" @click="downloadFile(item.document)">下载</button>
  137. </view>
  138. </view>
  139. </view>
  140. <view class="flex bottom">
  141. <view class="flex btns">
  142. <button class="btn" @click="jumpToPoster">保存海报</button>
  143. <button class="btn btn-share" open-type="share">分享文章</button>
  144. </view>
  145. </view>
  146. </view>
  147. </template>
  148. <script>
  149. export default {
  150. data() {
  151. return {
  152. details: {},
  153. }
  154. },
  155. onLoad({ thesisId }) {
  156. this.getData(thesisId)
  157. },
  158. onShareAppMessage(res) {
  159. return {
  160. title: this.posterData.paperDesc,
  161. imageUrl: this.posterData.paperImage,
  162. path: this.posterData.path,
  163. }
  164. },
  165. computed: {
  166. bannerList() {
  167. const { image } = this.details || {}
  168. return (image || '').split(',').map(url => ({ image: url }))
  169. },
  170. posterData() {
  171. const { id, title, paperDesc, paperImage } = this.details || {}
  172. return {
  173. paperDesc: paperDesc || title,
  174. paperImage: paperImage || this.bannerList?.[0]?.image || '',
  175. path: `pages_order/thesis/index?thesisId=${id}`
  176. }
  177. },
  178. },
  179. methods: {
  180. async getData(thesisId) {
  181. try {
  182. this.details = await this.$fetch('queryThesisById', { thesisId })
  183. } catch (err) {
  184. }
  185. },
  186. getFileType(fileName) {
  187. const pdfReg = /(.pdf)$/g
  188. // const officeReg = /(doc|docx|ppt|pptx|xls|xlsx)$/g
  189. return pdfReg.test(fileName) ? 'pdf' : ''
  190. },
  191. downloadFile(url) {
  192. console.log('downloadFile', url)
  193. uni.downloadFile({
  194. url, // 文件地址
  195. success: (downloadRes) => {
  196. console.log('downloadRes', downloadRes)
  197. if (downloadRes.statusCode === 200) {
  198. uni.openDocument({
  199. showMenu: true,
  200. filePath: downloadRes.tempFilePath,
  201. success: () => console.log('打开成功')
  202. });
  203. } else {
  204. uni.showToast({ title: '下载失败', icon: 'none' });
  205. }
  206. },
  207. fail: (err) => {
  208. uni.showToast({ title: '网络异常', icon: 'none' });
  209. }
  210. });
  211. },
  212. jumpToPoster() {
  213. uni.setStorageSync('posterData', this.posterData)
  214. uni.navigateTo({
  215. url: `/pages_order/poster/index`
  216. })
  217. },
  218. },
  219. }
  220. </script>
  221. <style scoped lang="scss">
  222. .page__view {
  223. background: #FFFFFF;
  224. padding-bottom: calc(62rpx + 110rpx + env(safe-area-inset-bottom));
  225. }
  226. .swiper {
  227. margin: 20rpx 18rpx 32rpx 18rpx;
  228. border-radius: 25rpx;
  229. overflow: hidden;
  230. /deep/ .uv-swiper-indicator__wrapper__dot {
  231. width: 15rpx;
  232. height: 15rpx;
  233. }
  234. /deep/ .uv-swiper-indicator__wrapper__dot--active {
  235. width: 15rpx;
  236. }
  237. }
  238. .section {
  239. width: 100%;
  240. padding: 0 18rpx;
  241. box-sizing: border-box;
  242. & + & {
  243. margin-top: 40rpx;
  244. }
  245. &-header {
  246. display: flex;
  247. align-items: center;
  248. justify-content: flex-start;
  249. column-gap: 15rpx;
  250. padding-left: 18rpx;
  251. font-size: 32rpx;
  252. font-weight: 700;
  253. color: #000000;
  254. &-line {
  255. width: 11rpx;
  256. height: 45rpx;
  257. border-radius: 6rpx;
  258. background-image: linear-gradient(#FFFFFF, #4883F9);
  259. }
  260. }
  261. &-content {
  262. margin-top: 37rpx;
  263. .paragraph {
  264. width: 100%;
  265. padding: 22rpx;
  266. box-sizing: border-box;
  267. white-space: pre-line;
  268. font-size: 28rpx;
  269. color: #000000;
  270. background: #F8F8F8;
  271. border-radius: 15rpx;
  272. }
  273. .table {
  274. width: 100%;
  275. border-radius: 15rpx;
  276. overflow: hidden;
  277. &-row {
  278. display: grid;
  279. grid-template-columns: 218rpx auto;
  280. background: #EEEEEE;
  281. &:nth-child(2n) {
  282. background: #DEDEDE;
  283. }
  284. }
  285. &-cell {
  286. display: inline-flex;
  287. flex-direction: column;
  288. align-items: flex-start;
  289. justify-content: center;
  290. padding: 17rpx;
  291. box-sizing: border-box;
  292. font-family: PingFang SC;
  293. font-weight: 400;
  294. font-size: 28rpx;
  295. color: #080808;
  296. &:first-child {
  297. border-right: 1rpx solid #E5E5E5;
  298. }
  299. }
  300. }
  301. &.process {
  302. margin-top: 24rpx;
  303. .difficulty {
  304. justify-content: flex-start;
  305. }
  306. }
  307. &.teachers {
  308. .card {
  309. display: flex;
  310. align-items: center;
  311. column-gap: 12rpx;
  312. background: #ffffff;
  313. border-radius: 15rpx;
  314. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  315. .info {
  316. flex: 1;
  317. padding: 19rpx 0 28rpx 17rpx;
  318. .title {
  319. display: flex;
  320. align-items: center;
  321. padding-left: 11rpx;
  322. color: #000000;
  323. .name {
  324. font-size: 32rpx;
  325. font-weight: 700;
  326. }
  327. .label {
  328. margin-left: 12rpx;
  329. position: relative;
  330. height: 30rpx;
  331. &-line {
  332. margin: 24rpx 0 0 25rpx;
  333. width: 195rpx;
  334. height: 4rpx;
  335. background-image: linear-gradient(#4883F9, #FFFFFF);
  336. border-radius: 2rpx;
  337. }
  338. &-text {
  339. position: absolute;
  340. top: 0;
  341. left: 0;
  342. font-size: 22rpx;
  343. font-weight: 400;
  344. }
  345. }
  346. }
  347. .tag {
  348. margin: 5rpx 0 18rpx 0;
  349. display: inline-flex;
  350. align-items: center;
  351. padding: 5rpx 43rpx 5rpx 16rpx;
  352. column-gap: 16rpx;
  353. font-size: 28rpx;
  354. color: #FFFFFF;
  355. background: rgba(72,131,249,0.58);
  356. border-radius: 30rpx 0rpx 30rpx 0rpx;
  357. &-icon {
  358. width: 38rpx;
  359. height: auto;
  360. }
  361. }
  362. .desc {
  363. padding: 12rpx 15rpx;
  364. font-size: 28rpx;
  365. font-weight: 500;
  366. color: #000000;
  367. background: #f8f8f8;
  368. border-radius: 16rpx;
  369. }
  370. }
  371. .pic {
  372. margin: 48rpx 9rpx 48rpx 0;
  373. width: 253rpx;
  374. height: 345rpx;
  375. border-radius: 127rpx;
  376. overflow: hidden;
  377. .img {
  378. width: 100%;
  379. height: 100%;
  380. }
  381. }
  382. &:nth-child(2n) {
  383. flex-direction: row-reverse;
  384. .info {
  385. padding: 19rpx 17rpx 28rpx 0;
  386. }
  387. .pic {
  388. margin: 48rpx 0 48rpx 9rpx;
  389. }
  390. }
  391. }
  392. .card + .card {
  393. margin-top: 24rpx;
  394. }
  395. }
  396. &.journal {
  397. .box {
  398. padding-top: 73rpx;
  399. .card {
  400. padding: 29rpx 12rpx 19rpx 12rpx;
  401. background: #f6f6f6;
  402. border-radius: 15rpx;
  403. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  404. .top {
  405. position: relative;
  406. .pic {
  407. position: absolute;
  408. left: 42rpx;
  409. bottom: 0;
  410. width: 213rpx;
  411. height: 285rpx;
  412. .img {
  413. width: 100%;
  414. height: 100%;
  415. }
  416. }
  417. .info {
  418. height: 181rpx;
  419. padding: 0 14rpx 0 266rpx;
  420. .name {
  421. padding-left: 6rpx;
  422. font-size: 32rpx;
  423. font-weight: 700;
  424. color: #000000;
  425. }
  426. .desc {
  427. margin-top: 24rpx;
  428. font-size: 28rpx;
  429. font-weight: 700;
  430. color: #707070;
  431. overflow: hidden;
  432. text-overflow: ellipsis;
  433. display:-webkit-box; //作为弹性伸缩盒子模型显示。
  434. -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
  435. -webkit-line-clamp:3; //显示的行
  436. }
  437. }
  438. }
  439. .main {
  440. margin-top: 18rpx;
  441. padding: 14rpx;
  442. font-size: 28rpx;
  443. color: #000000;
  444. background: #ebebeb;
  445. border-radius: 30rpx 0rpx 30rpx 0rpx;
  446. }
  447. }
  448. &:nth-child(2n) {
  449. .card {
  450. .top {
  451. .info {
  452. padding: 0 258rpx 0 14rpx;
  453. }
  454. .pic {
  455. left: unset;
  456. right: 29rpx;
  457. }
  458. }
  459. }
  460. }
  461. }
  462. .box + .box {
  463. margin-top: 28rpx;
  464. }
  465. }
  466. &.attachment {
  467. .file {
  468. justify-content: space-between;
  469. padding: 32rpx 15rpx 32rpx 26rpx;
  470. background: #f8f8f8;
  471. border-radius: 15rpx;
  472. &-info {
  473. display: flex;
  474. align-items: flex-end;
  475. }
  476. &-icon {
  477. width: 64rpx;
  478. height: auto;
  479. }
  480. &-detail {
  481. margin-left: 14rpx;
  482. .title {
  483. font-size: 30rpx;
  484. color: #000000;
  485. }
  486. .desc {
  487. font-size: 28rpx;
  488. color: #999999;
  489. }
  490. }
  491. .btn {
  492. padding: 7rpx 30rpx;
  493. font-size: 28rpx;
  494. color: #FFFFFF;
  495. background: #4883f9;
  496. border-radius: 27rpx;
  497. }
  498. }
  499. .file + .file {
  500. margin-top: 21rpx;
  501. }
  502. }
  503. }
  504. }
  505. .bottom {
  506. position: fixed;
  507. left: 0;
  508. bottom: 0;
  509. width: 100vw;
  510. height: 110rpx;
  511. padding-bottom: env(safe-area-inset-bottom);
  512. background: #FFFFFF;
  513. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  514. .btns {
  515. column-gap: 34rpx;
  516. }
  517. .btn {
  518. padding: 20rpx 90rpx;
  519. font-size: 28rpx;
  520. color: #FFFFFF;
  521. background: #4883F9;
  522. border-radius: 42rpx;
  523. &-share {
  524. background: #FFD019;
  525. }
  526. }
  527. }
  528. </style>