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

607 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.details.title,
  161. imageUrl: this.bannerList?.[0]?.image || '',
  162. path: `/pages_order/thesis/index?thesisId=${this.details.id}`
  163. }
  164. },
  165. computed: {
  166. bannerList() {
  167. const { image } = this.details || {}
  168. return (image || '').split(',').map(url => ({ image: url }))
  169. }
  170. },
  171. methods: {
  172. async getData(thesisId) {
  173. try {
  174. this.details = await this.$fetch('queryThesisById', { thesisId })
  175. } catch (err) {
  176. }
  177. },
  178. getFileType(fileName) {
  179. const pdfReg = /(.pdf)$/g
  180. // const officeReg = /(doc|docx|ppt|pptx|xls|xlsx)$/g
  181. return pdfReg.test(fileName) ? 'pdf' : ''
  182. },
  183. downloadFile(url) {
  184. console.log('downloadFile', url)
  185. uni.downloadFile({
  186. url, // 文件地址
  187. success: (downloadRes) => {
  188. console.log('downloadRes', downloadRes)
  189. if (downloadRes.statusCode === 200) {
  190. uni.openDocument({
  191. showMenu: true,
  192. filePath: downloadRes.tempFilePath,
  193. success: () => console.log('打开成功')
  194. });
  195. } else {
  196. uni.showToast({ title: '下载失败', icon: 'none' });
  197. }
  198. },
  199. fail: (err) => {
  200. uni.showToast({ title: '网络异常', icon: 'none' });
  201. }
  202. });
  203. },
  204. jumpToPoster() {
  205. uni.navigateTo({
  206. url: `/pages_order/thesis/poster?thesisId=${this.details.id}`
  207. })
  208. },
  209. },
  210. }
  211. </script>
  212. <style scoped lang="scss">
  213. .page__view {
  214. padding-bottom: 62rpx;
  215. background: #FFFFFF;
  216. padding-bottom: calc(62rpx + 110rpx + env(safe-area-inset-bottom));
  217. }
  218. .swiper {
  219. margin: 20rpx 18rpx 32rpx 18rpx;
  220. border-radius: 25rpx;
  221. overflow: hidden;
  222. /deep/ .uv-swiper-indicator__wrapper__dot {
  223. width: 15rpx;
  224. height: 15rpx;
  225. }
  226. /deep/ .uv-swiper-indicator__wrapper__dot--active {
  227. width: 15rpx;
  228. }
  229. }
  230. .section {
  231. width: 100%;
  232. padding: 0 18rpx;
  233. box-sizing: border-box;
  234. & + & {
  235. margin-top: 40rpx;
  236. }
  237. &-header {
  238. display: flex;
  239. align-items: center;
  240. justify-content: flex-start;
  241. column-gap: 15rpx;
  242. padding-left: 18rpx;
  243. font-size: 32rpx;
  244. font-weight: 700;
  245. color: #000000;
  246. &-line {
  247. width: 11rpx;
  248. height: 45rpx;
  249. border-radius: 6rpx;
  250. background-image: linear-gradient(#FFFFFF, #4883F9);
  251. }
  252. }
  253. &-content {
  254. margin-top: 37rpx;
  255. .paragraph {
  256. width: 100%;
  257. padding: 22rpx;
  258. box-sizing: border-box;
  259. white-space: pre-line;
  260. font-size: 28rpx;
  261. color: #000000;
  262. background: #F8F8F8;
  263. border-radius: 15rpx;
  264. }
  265. .table {
  266. width: 100%;
  267. border-radius: 15rpx;
  268. overflow: hidden;
  269. &-row {
  270. display: grid;
  271. grid-template-columns: 218rpx auto;
  272. background: #EEEEEE;
  273. &:nth-child(2n) {
  274. background: #DEDEDE;
  275. }
  276. }
  277. &-cell {
  278. display: inline-flex;
  279. flex-direction: column;
  280. align-items: flex-start;
  281. justify-content: center;
  282. padding: 17rpx;
  283. box-sizing: border-box;
  284. font-family: PingFang SC;
  285. font-weight: 400;
  286. font-size: 28rpx;
  287. color: #080808;
  288. &:first-child {
  289. border-right: 1rpx solid #E5E5E5;
  290. }
  291. }
  292. }
  293. &.process {
  294. margin-top: 24rpx;
  295. .difficulty {
  296. justify-content: flex-start;
  297. }
  298. }
  299. &.teachers {
  300. .card {
  301. display: flex;
  302. align-items: center;
  303. column-gap: 12rpx;
  304. background: #ffffff;
  305. border-radius: 15rpx;
  306. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  307. .info {
  308. flex: 1;
  309. padding: 19rpx 0 28rpx 17rpx;
  310. .title {
  311. display: flex;
  312. align-items: center;
  313. padding-left: 11rpx;
  314. color: #000000;
  315. .name {
  316. font-size: 32rpx;
  317. font-weight: 700;
  318. }
  319. .label {
  320. margin-left: 12rpx;
  321. position: relative;
  322. height: 30rpx;
  323. &-line {
  324. margin: 24rpx 0 0 25rpx;
  325. width: 195rpx;
  326. height: 4rpx;
  327. background-image: linear-gradient(#4883F9, #FFFFFF);
  328. border-radius: 2rpx;
  329. }
  330. &-text {
  331. position: absolute;
  332. top: 0;
  333. left: 0;
  334. font-size: 22rpx;
  335. font-weight: 400;
  336. }
  337. }
  338. }
  339. .tag {
  340. margin: 5rpx 0 18rpx 0;
  341. display: inline-flex;
  342. align-items: center;
  343. padding: 5rpx 43rpx 5rpx 16rpx;
  344. column-gap: 16rpx;
  345. font-size: 28rpx;
  346. color: #FFFFFF;
  347. background: rgba(72,131,249,0.58);
  348. border-radius: 30rpx 0rpx 30rpx 0rpx;
  349. &-icon {
  350. width: 38rpx;
  351. height: auto;
  352. }
  353. }
  354. .desc {
  355. padding: 12rpx 15rpx;
  356. font-size: 28rpx;
  357. font-weight: 500;
  358. color: #000000;
  359. background: #f8f8f8;
  360. border-radius: 16rpx;
  361. }
  362. }
  363. .pic {
  364. margin: 48rpx 9rpx 48rpx 0;
  365. width: 253rpx;
  366. height: 345rpx;
  367. border-radius: 127rpx;
  368. overflow: hidden;
  369. .img {
  370. width: 100%;
  371. height: 100%;
  372. }
  373. }
  374. &:nth-child(2n) {
  375. flex-direction: row-reverse;
  376. .info {
  377. padding: 19rpx 17rpx 28rpx 0;
  378. }
  379. .pic {
  380. margin: 48rpx 0 48rpx 9rpx;
  381. }
  382. }
  383. }
  384. .card + .card {
  385. margin-top: 24rpx;
  386. }
  387. }
  388. &.journal {
  389. .box {
  390. padding-top: 73rpx;
  391. .card {
  392. padding: 29rpx 12rpx 19rpx 12rpx;
  393. background: #f6f6f6;
  394. border-radius: 15rpx;
  395. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  396. .top {
  397. position: relative;
  398. .pic {
  399. position: absolute;
  400. left: 42rpx;
  401. bottom: 0;
  402. width: 213rpx;
  403. height: 285rpx;
  404. .img {
  405. width: 100%;
  406. height: 100%;
  407. }
  408. }
  409. .info {
  410. height: 181rpx;
  411. padding: 0 14rpx 0 266rpx;
  412. .name {
  413. padding-left: 6rpx;
  414. font-size: 32rpx;
  415. font-weight: 700;
  416. color: #000000;
  417. }
  418. .desc {
  419. margin-top: 24rpx;
  420. font-size: 28rpx;
  421. font-weight: 700;
  422. color: #707070;
  423. overflow: hidden;
  424. text-overflow: ellipsis;
  425. display:-webkit-box; //作为弹性伸缩盒子模型显示。
  426. -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
  427. -webkit-line-clamp:3; //显示的行
  428. }
  429. }
  430. }
  431. .main {
  432. margin-top: 18rpx;
  433. padding: 14rpx;
  434. font-size: 28rpx;
  435. color: #000000;
  436. background: #ebebeb;
  437. border-radius: 30rpx 0rpx 30rpx 0rpx;
  438. }
  439. }
  440. &:nth-child(2n) {
  441. .card {
  442. .top {
  443. .info {
  444. padding: 0 258rpx 0 14rpx;
  445. }
  446. .pic {
  447. left: unset;
  448. right: 29rpx;
  449. }
  450. }
  451. }
  452. }
  453. }
  454. .box + .box {
  455. margin-top: 28rpx;
  456. }
  457. }
  458. &.attachment {
  459. .file {
  460. justify-content: space-between;
  461. padding: 32rpx 15rpx 32rpx 26rpx;
  462. background: #f8f8f8;
  463. border-radius: 15rpx;
  464. &-info {
  465. display: flex;
  466. align-items: flex-end;
  467. }
  468. &-icon {
  469. width: 64rpx;
  470. height: auto;
  471. }
  472. &-detail {
  473. margin-left: 14rpx;
  474. .title {
  475. font-size: 30rpx;
  476. color: #000000;
  477. }
  478. .desc {
  479. font-size: 28rpx;
  480. color: #999999;
  481. }
  482. }
  483. .btn {
  484. padding: 7rpx 30rpx;
  485. font-size: 28rpx;
  486. color: #FFFFFF;
  487. background: #4883f9;
  488. border-radius: 27rpx;
  489. }
  490. }
  491. .file + .file {
  492. margin-top: 21rpx;
  493. }
  494. }
  495. }
  496. }
  497. .bottom {
  498. position: fixed;
  499. left: 0;
  500. bottom: 0;
  501. width: 100vw;
  502. height: 110rpx;
  503. padding-bottom: env(safe-area-inset-bottom);
  504. background: #FFFFFF;
  505. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  506. .btns {
  507. column-gap: 34rpx;
  508. }
  509. .btn {
  510. padding: 20rpx 90rpx;
  511. font-size: 28rpx;
  512. color: #FFFFFF;
  513. background: #4883F9;
  514. border-radius: 42rpx;
  515. &-share {
  516. background: #FFD019;
  517. }
  518. }
  519. }
  520. </style>