吉光研途前端代码仓库
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.

725 lines
19 KiB

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