detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <template>
  2. <view class="content">
  3. <view class="hflex acenter jbetween top">
  4. <image src="/static/image/index1/logo2.png" class="logo"></image>
  5. <view class="vflex">
  6. <view class="top_title">線上課程,直播,活動,求職,補習,一應俱全</view>
  7. <view class="top_title2">「Day Day U」APP開啟更多功能</view>
  8. </view>
  9. <view class="top_btn hflex acenter jcenter" @click="toIndex">下載</view>
  10. </view>
  11. <view class="video">
  12. <view class="top_label hflex acenter jcenter">會員免費試看此課程,立即下載APP註冊</view>
  13. <video :src="pageData.course_video"></video>
  14. </view>
  15. <view class="box">
  16. <view class="box_title">{{pageData.title}}<span class="title_text">線上課程</span></view>
  17. <view class="hflex acenter">
  18. <image class="avatar" :src="pageData.headimg"></image>
  19. <view class="user_name">{{pageData.name}}</view>
  20. </view>
  21. <view class="info_box">
  22. {{intro}}
  23. <span class="text_blue1" v-if="show" @click="change">{{show_info?'收起':'更多'}}</span>
  24. <!-- <u-parse :content="intro" :class="show_info?'':'info'"></u-parse> -->
  25. </view>
  26. <!-- <view class="info">{{pageData.provider_record}}</view> -->
  27. <view class="hflex acenter ">
  28. <view class="text_style1">{{evaluate.evaluate_avg}}評分</view>
  29. <u-rate count="5" readonly v-model="evaluate.evaluate_avg" active-color="#f7b500"></u-rate>
  30. <image src="/static/image/index1/watch.png" style="margin: 0 1rpx 0 2rpx;width: 32rpx;height: 32rpx;"></image>
  31. <view class="text_style1">{{pageData.sale_num}}觀看</view>
  32. </view>
  33. <view class=" hflex aend" style="padding: 10rpx 0 0;">
  34. <view class="text_blue">HK $ <span class="price">{{pageData.price}}</span></view>
  35. <!-- <view class="price"></view> -->
  36. <view class="text_style1 line">HK ${{ Math.trunc(pageData.original_price)}}</view>
  37. <view class="text_style1" style="font-size: 28rpx;padding-left: 20rpx;"> {{pageData.discount}}%折扣</view>
  38. </view>
  39. <view class="hflex acenter jcenter buy_btn" @click="buy">立即購買</view>
  40. <view class="list">
  41. <view class="title" style="padding: 32rpx 0;">你將學會</view>
  42. <view class="vflex">
  43. <block v-for="(item,index) in pageData.synopsis" :key="index">
  44. <view class="hflex acenter" style="padding: 0 0 24rpx;">
  45. <image src="/static/image/index1/checked.png" class="checked"></image>
  46. <view class="checked_text">{{item}}</view>
  47. </view>
  48. </block>
  49. </view>
  50. </view>
  51. <view class="title" style="padding: 48rpx 0 32rpx;">此課程包括</view>
  52. <view class="hflex acenter fwrap" style="padding: 0 24rpx;">
  53. <block v-for="(item,index) in pageData.include" :key="index">
  54. <view class="text_style2">{{item}}</view>
  55. </block>
  56. </view>
  57. <view class="course_content">
  58. <view class="course_top hflex acenter jbetween">
  59. <view class="course_title">課程內容</view>
  60. <view class="title_right">{{pageData.section_num}}章節·{{pageData.classroom_num}}單元·總長{{pageData.duration}}分鐘</view>
  61. </view>
  62. <view class="course_list">
  63. <block v-for="(item,index) in pageData.section_info" :key="index">
  64. <view class="list_item">
  65. <view class="hflex acenter jbetween">
  66. <view class="item_left">{{item.section_name}}</view>
  67. <view class="hflex acenter" @click="open(index)">
  68. <!-- <view class="item_right">長度·{{item.length}}分鐘</view> -->
  69. <u-icon name="arrow-down" color="#000" size="18" v-if="item.opener"></u-icon>
  70. <u-icon name="arrow-right" color="#000" size="18" v-else></u-icon>
  71. </view>
  72. </view>
  73. <view class="children" v-show="item.opener">
  74. <block v-for="(item2,index2) in item.element_info" :key="index2">
  75. <view class="hflex acenter jbetween" style="padding: 15rpx 0pt 0pt;">
  76. <view class="hflex acenter">
  77. <image src="/static/image/index1/task.png" class="stop" v-if="item2.job_name !== ''"></image>
  78. <image src="/static/image/index1/stop.png" class="stop"></image>
  79. <view class="label">單元{{index2 + 1}}-{{item2.element_name}}</view>
  80. <view class="label" v-if="item2.job_name !== ''">作業1-{{item2.job_name}}</view>
  81. </view>
  82. <view class="item_right">{{item2.time}}分鐘</view>
  83. </view>
  84. </block>
  85. </view>
  86. </view>
  87. </block>
  88. <view class="hflex acenter jcenter" style="padding-top: 32rpx;" v-if="pageData.section_num > 3">
  89. <view class="hflex acenter jcenter list_btn">還有{{pageData.section_num - 3}}章節</view>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="title" style="padding: 48rpx 0 32rpx;">課程要求和說明</view>
  94. <view class="vflex dis">
  95. <u-read-more showHeight="400" :toggle="true" closeText="顯示更多" ref="uReadMore">
  96. <u-parse :content="pageData.detail" @load="load"></u-parse>
  97. </u-read-more>
  98. <!-- <view class="hflex acenter jcenter">
  99. <view class="show_btn hflex acenter jcenter">顯示更多</view>
  100. </view> -->
  101. </view>
  102. <view class="course_content">
  103. <view class="course_top hflex acenter jbetween">
  104. <view class="hflex acenter">
  105. <u-icon name="star-fill" color="#f7b500" size="21"></u-icon>
  106. <view class="score_text">{{evaluate.evaluate_avg}}</view>
  107. <view class="score_text" style="font-size: 24rpx;">課程評分</view>
  108. </view>
  109. </view>
  110. <view class="course_list">
  111. <block v-for="(item,index) in evaluate.evaluate_list" :key="index">
  112. <view class="list_item hflex acenter">
  113. <image :src="item.headimg" class="item_avatar"></image>
  114. <view class="img_right">
  115. <view class="hflex acenter">
  116. <view class="item_name2">{{item.name}}</view>
  117. <u-rate count="5" readonly v-model="item.content" active-color="#f7b500"></u-rate>
  118. </view>
  119. <view class="text_content">{{item.content}}</view>
  120. </view>
  121. </view>
  122. </block>
  123. <view class="hflex acenter jcenter" style="padding-top: 32rpx;">
  124. <view class="hflex acenter jcenter list_btn">{{evaluate.evaluate_num == 0? '暫無評分' : '顯示更多'}}</view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. <view class="bottom vflex acenter jcenter">
  130. <image :src="bottom.img1" class="bottom_img"></image>
  131. </view>
  132. <view class="footer hflex acenter jcenter">
  133. <image :src="bottom.img2" class="bottom_left"></image>
  134. <image :src="bottom.img3" class="bottom_right"></image>
  135. </view>
  136. </view>
  137. </template>
  138. <script>
  139. import $api from '@/static/js/api.js'
  140. var that = ''
  141. export default {
  142. data() {
  143. return {
  144. pageData: {
  145. },
  146. bottom: {
  147. img1: '/static/image/index1/bottom_img1.png',
  148. img2: '/static/image/index1/bottom_img2.png',
  149. img3: '/static/image/index1/bottom_img3.png',
  150. },
  151. evaluate:'',
  152. id: '',
  153. show_info:false,
  154. intro: '',
  155. show: false
  156. }
  157. },
  158. onLoad(options) {
  159. that = this
  160. that.id = options.id
  161. // that.id = '280'
  162. that.getData()
  163. that.getEvaluate()
  164. },
  165. methods: {
  166. getData() {
  167. $api.req({
  168. url: '/api/Online_course/course_detail',
  169. data: {
  170. id: that.id
  171. }
  172. }, function(res) {
  173. if(res.code == 1) {
  174. that.pageData = res.data
  175. if(that.pageData.section_info.length >3) {
  176. that.pageData.section_info = that.pageData.section_info.slice(0,3)
  177. }
  178. for(var i=0;i<that.pageData.section_info.length;i++) {
  179. that.$set(that.pageData.section_info[i],'opener',false)
  180. }
  181. if(that.pageData.introduce.length>45) {
  182. that.intro = that.pageData.introduce.substring(0,45) + '... '
  183. that.show = true
  184. } else {
  185. that.intro = that.pageData.introduce
  186. }
  187. }
  188. })
  189. },
  190. getEvaluate() {
  191. $api.req({
  192. url: '/api/Online_course/evaluate_list',
  193. data: {
  194. page: 1,
  195. page_size: 3,
  196. course_id: that.id
  197. }
  198. }, function(res) {
  199. if(res.code == 1) {
  200. that.evaluate = res.data
  201. if(that.evaluate.evaluate_num > 3) {
  202. that.evaluate.evaluate_list = that.evaluate.evaluate_list.slice(0,3)
  203. }
  204. }
  205. })
  206. },
  207. toIndex() {
  208. $api.jump('/pages/index/index')
  209. },
  210. load() {
  211. this.$refs.uReadMore.init();
  212. },
  213. open(index) {
  214. if(that.pageData.section_info[index].opener) {
  215. that.pageData.section_info[index].opener = false
  216. } else {
  217. that.$set(that.pageData.section_info[index],'opener',true)
  218. }
  219. },
  220. change() {
  221. that.show_info = !that.show_info
  222. if(that.show_info) {
  223. that.intro = that.pageData.introduce
  224. } else {
  225. that.intro = that.pageData.introduce.substring(0,45) + '... '
  226. }
  227. },
  228. buy() {
  229. location.href="https://www.daydayu.com/index.html#/video-pay?id=" + that.id
  230. }
  231. },
  232. }
  233. </script>
  234. <style lang="scss" scoped>
  235. .content::v-deep {
  236. .top {
  237. width: 100%;
  238. height: 120rpx;
  239. background: #FFFFFF;
  240. box-shadow: 0px 6rpx 12rpx 0px rgba(0,0,0,0.16);
  241. box-sizing: border-box;
  242. padding: 20rpx;
  243. .logo {
  244. width: 68rpx;
  245. height: 68rpx;
  246. }
  247. .top_title {
  248. font-size: 26rpx;
  249. font-weight: 500;
  250. color: #333333;
  251. line-height: 30rpx;
  252. }
  253. .top_title2 {
  254. font-size: 26rpx;
  255. font-weight: 400;
  256. color: #999999;
  257. line-height: 30rpx;
  258. padding-top: 4rpx;
  259. }
  260. .top_btn {
  261. width: 114rpx;
  262. height: 46rpx;
  263. background: #231E7F;
  264. border-radius: 36rpx;
  265. font-size: 28rpx;
  266. font-weight: 400;
  267. color: #FFFFFF;
  268. }
  269. }
  270. .video {
  271. width: 100%;
  272. height: 478rpx;
  273. .top_label {
  274. width: 100%;
  275. height: 56rpx;
  276. background: #231E7F;
  277. font-size: 26rpx;
  278. font-weight: 400;
  279. color: #FFFFFF;
  280. line-height: 37rpx;
  281. letter-spacing: 1rpx;
  282. }
  283. uni-video {
  284. width: 100%;
  285. height: 422rpx;
  286. }
  287. }
  288. .box {
  289. box-sizing: border-box;
  290. padding: 0 48rpx;
  291. width: 100%;
  292. .box_title {
  293. font-size: 32rpx;
  294. font-weight: 600;
  295. color: #333333;
  296. padding: 36rpx 0 32rpx;
  297. line-height: 45rpx;
  298. }
  299. .title_text {
  300. // width: 120rpx;
  301. height: 36rpx;
  302. padding: 0 20rpx;
  303. background: #55C3B9;
  304. border-radius: 24rpx 0px 24rpx 0px;
  305. font-size: 20rpx;
  306. font-weight: 500;
  307. color: #FFFFFF;
  308. line-height: 36rpx;
  309. text-align: center;
  310. float: right;
  311. margin-top: 10rpx;
  312. }
  313. .avatar {
  314. width: 78rpx;
  315. height: 78rpx;
  316. margin: 0 12rpx 0 0;
  317. border-radius: 50%;
  318. }
  319. .user_name {
  320. font-size: 34rpx;
  321. font-weight: 600;
  322. color: #333333;
  323. line-height: 48rpx;
  324. }
  325. .info_box {
  326. width: 100%;
  327. // height: 50rpx;
  328. font-size: 28rpx;
  329. font-weight: 400;
  330. color: #666666;
  331. line-height: 40rpx;
  332. margin: 20rpx 0 16rpx;
  333. }
  334. .info {
  335. text-overflow: ellipsis;
  336. overflow: hidden;
  337. display: -webkit-box;
  338. -webkit-box-orient: vertical;
  339. box-orient: vertical;
  340. line-clamp: 2;
  341. -webkit-line-clamp: 2;
  342. }
  343. .text_style1 {
  344. font-size: 24rpx;
  345. font-weight: 400;
  346. color: #999999;
  347. // line-height: 33rpx;
  348. }
  349. .line {
  350. font-size: 28rpx;
  351. padding-left: 20rpx;
  352. text-decoration: line-through;
  353. }
  354. .text_blue {
  355. font-size: 36rpx;
  356. font-weight: 600;
  357. color: #5581FB;
  358. // line-height: 50rpx;
  359. }
  360. .text_blue1 {
  361. font-size: 28rpx;
  362. font-weight: 400;
  363. color: #5581FB;
  364. line-height: 40rpx;
  365. }
  366. .price {
  367. font-size: 56rpx;
  368. color: #5581FB;
  369. font-weight: 600;
  370. line-height: 50rpx;
  371. }
  372. .buy_btn {
  373. width: 246rpx;
  374. height: 68rpx;
  375. background: #5581FB;
  376. border-radius: 40rpx;
  377. margin: 25rpx auto 72rpx;
  378. font-size: 28rpx;
  379. font-weight: 400;
  380. color: #FFFFFF;
  381. line-height: 28rpx;
  382. letter-spacing: 1rpx;
  383. }
  384. .title {
  385. font-size: 32rpx;
  386. font-weight: 600;
  387. color: #FFFFFF;
  388. line-height: 36rpx;
  389. text-align: center;
  390. background: linear-gradient(180deg, #4AC1FD 0%, #B259FA 100%);
  391. -webkit-background-clip: text;
  392. -webkit-text-fill-color: transparent;
  393. }
  394. .dis {
  395. .u-icon--right {
  396. display: none;
  397. }
  398. }
  399. .list {
  400. width: 644rpx;
  401. border-radius: 16rpx;
  402. border: 2rpx solid #5581FB;
  403. box-sizing: border-box;
  404. padding: 0 24rpx;
  405. .checked {
  406. padding-right: 8rpx;
  407. width: 29rpx;
  408. height: 24rpx;
  409. }
  410. .checked_text {
  411. font-size: 28rpx;
  412. font-weight: 400;
  413. color: #666666;
  414. line-height: 28rpx;
  415. }
  416. }
  417. .text_style2 {
  418. width: 45%;
  419. padding-left: 22rpx;
  420. font-size: 28rpx;
  421. font-weight: 400;
  422. color: #666666;
  423. line-height: 28rpx;
  424. padding-bottom: 26rpx;
  425. position: relative;
  426. }
  427. .text_style2::before {
  428. content: "";
  429. position: absolute;
  430. left: 0;
  431. top: 8rpx;
  432. width: 12rpx;
  433. height: 12rpx;
  434. border: 2rpx solid #9E6DFB;
  435. border-radius: 50%;
  436. }
  437. .show_btn {
  438. width: 181rpx;
  439. height: 48rpx;
  440. border-radius: 8rpx;
  441. border: 2rpx solid #5581FB;
  442. font-size: 28rpx;
  443. font-weight: 400;
  444. color: #5581FB;
  445. line-height: 40rpx;
  446. margin: 0 0 48rpx;
  447. }
  448. .course_content {
  449. position: relative;
  450. .course_top {
  451. width: 100%;
  452. height: 120rpx;
  453. background: #5581FB;
  454. border-radius: 16px;
  455. box-sizing: border-box;
  456. padding: 20rpx 48rpx;
  457. // position: absolute;
  458. // left: 0;
  459. // bottom: 466rpx;
  460. .course_title {
  461. font-size: 32rpx;
  462. font-weight: 600;
  463. color: #FFFFFF;
  464. line-height: 36rpx;
  465. }
  466. .title_right {
  467. font-size: 20rpx;
  468. font-weight: 400;
  469. color: #FFFFFF;
  470. line-height: 28rpx;
  471. }
  472. .score_text {
  473. font-size: 36rpx;
  474. font-weight: 600;
  475. color: #FFFFFF;
  476. line-height: 50rpx;
  477. }
  478. }
  479. .course_list {
  480. width: 100%;
  481. background: #F5F8FF;
  482. border-radius: 16rpx;
  483. box-sizing: border-box;
  484. padding: 44rpx;
  485. .list_item {
  486. width: 100%;
  487. box-sizing: border-box;
  488. padding: 31rpx 0;
  489. border-bottom: 1rpx solid #9476FB;
  490. .item_left {
  491. font-size: 28rpx;
  492. font-weight: 600;
  493. color: #341D70;
  494. line-height: 40rpx;
  495. }
  496. .item_right {
  497. font-size: 20rpx;
  498. font-weight: 400;
  499. color: #666666;
  500. line-height: 28rpx;
  501. }
  502. .label {
  503. font-size: 26rpx;
  504. font-weight: 400;
  505. color: #333333;
  506. line-height: 37rpx;
  507. }
  508. .stop {
  509. width: 24rpx;
  510. height: 24rpx;
  511. margin-right: 12rpx;
  512. }
  513. .item_avatar {
  514. width: 80rpx;
  515. height: 80rpx;
  516. border-radius: 50%;
  517. }
  518. .img_right {
  519. margin: 0 0 0 20rpx;
  520. .item_name2 {
  521. font-size: 28rpx;
  522. font-weight: 600;
  523. color: #333333;
  524. line-height: 40rpx;
  525. padding-right: 60rpx;
  526. }
  527. .item_content {
  528. font-size: 26rpx;
  529. font-weight: 400;
  530. color: #666666;
  531. line-height: 37rpx;
  532. }
  533. }
  534. }
  535. .list_item:nth-last-child(1) {
  536. border: none;
  537. }
  538. }
  539. .list_btn {
  540. width: 222rpx;
  541. height: 48rpx;
  542. background: #5581FB;
  543. border-radius: 8rpx;
  544. font-size: 28rpx;
  545. font-weight: 400;
  546. color: #FFFFFF;
  547. line-height: 40rpx;
  548. }
  549. }
  550. }
  551. .bottom {
  552. width: 100%;
  553. padding: 40rpx 0 0;
  554. .bottom_img {
  555. width: 316rpx;
  556. height: 368rpx;
  557. margin-bottom: 48rpx;
  558. }
  559. }
  560. .footer {
  561. width: 100%;
  562. height: 262rpx;
  563. background: url('@/static/image/index1/footer_bg.png') no-repeat;
  564. background-size: 100%;
  565. .bottom_left {
  566. width: 216rpx;
  567. height: 64rpx;
  568. margin-right: 56rpx;
  569. }
  570. .bottom_right {
  571. width: 216rpx;
  572. height: 64rpx;
  573. }
  574. }
  575. .u-read-more__toggle__text {
  576. width: 181rpx;
  577. height: 48rpx;
  578. border-radius: 8rpx;
  579. border: 2rpx solid #5581FB;
  580. font-size: 28rpx;
  581. font-weight: 400;
  582. color: #5581FB;
  583. line-height: 40rpx;
  584. margin: 48rpx 0 48rpx;
  585. display: flex;
  586. justify-content: center;
  587. }
  588. .u-text {
  589. justify-content: center !important;
  590. }
  591. }
  592. </style>