detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <template>
  2. <view>
  3. <view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;" id="top">
  4. <view class="video_box" v-if="!startStatus">
  5. <image src="https://cdn.uviewui.com/uview/swiper/3.jpg" style="width: 100%;height: 460rpx;"></image>
  6. <image class="video_play" src="/static/play.png" @click="startVideo"></image>
  7. </view>
  8. <view v-else class="video_box" style="width: 100%;height: 460rpx;">
  9. <polyv-player
  10. id="playerVideo"
  11. playerId="playerVideo"
  12. height="460rpx"
  13. :vid="vid"
  14. :showSettingBtn="true"
  15. :enablePlayGesture="true"
  16. ></polyv-player>
  17. </view>
  18. <view>
  19. <u-row>
  20. <u-col span="10">
  21. <view class="video_t1">{{ detail.courseName }}</view>
  22. </u-col>
  23. <u-col span="2">
  24. <view class="video_t1_t">
  25. <image src="/static/icon/jy_icon.png" style="width: 40rpx;height: 40rpx;"></image>
  26. 讲义
  27. </view>
  28. </u-col>
  29. </u-row>
  30. </view>
  31. <u-line color="#D6D6DB" />
  32. <view>
  33. <view style="width: 240px;margin: 0 auto;">
  34. <u-tabs :list="list" item-width="150" font-size="24" bar-width="80" :current="current" @change="change" active-color="#007AFF"></u-tabs>
  35. </view>
  36. </view>
  37. <u-line color="#D6D6DB" />
  38. </view>
  39. <view class="box">
  40. <!--目录 -->
  41. <view v-show="current == 0">
  42. <view class="menuBox" v-for="(item, index) in menuList">
  43. <!--模块 -->
  44. <view v-if="item.type == 1"><courseModule :menuItem="item"></courseModule></view>
  45. <!--章 -->
  46. <view v-if="item.type == 2"><courseChapter :menuItem="item"></courseChapter></view>
  47. <!--节 -->
  48. <view v-if="item.type == 3"><courseSection :menuItem="item"></courseSection></view>
  49. </view>
  50. </view>
  51. <!--笔记 -->
  52. <view v-show="current == 1">
  53. <view class="inputBottom">
  54. <view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
  55. <view style="width: 73%;height: 88rpx;margin-bottom: 15rpx;">
  56. <u-input height="78" fixed="true" :placeholder="placeholder" type="textarea" :custom-style="inputStyle" v-model="value" />
  57. </view>
  58. <view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;">提交</view>
  59. </view>
  60. <view v-for="(item, index) in menuList">
  61. <view class="dateBox">2021年10月30日</view>
  62. <view class="noteBox">
  63. <view class="tBox">
  64. <image src="/static/icon/note1.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
  65. <view class="title leftPadding">施工承发包模式-施工合同与物资采购合同</view>
  66. </view>
  67. <view class="tBox2">
  68. <view class="title" style="width: 39rpx;height: 39rpx;margin:0 29rpx;">00:20</view>
  69. <view class="t2Content leftPadding">这是一段用户记录的笔记本文,当内容过长时 需要换行,完整显示文字内容。</view>
  70. </view>
  71. <view class="tBox">
  72. <image src="/static/icon/note2.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
  73. <view class="title leftPadding">施工承发包模式-施工合同与物资采购合同</view>
  74. </view>
  75. <view style="margin-left: 97rpx;" class="t2Content leftPadding">这是一段用户记录的笔记本文,当内容过长时 需要换行,完整显示文字内容。</view>
  76. </view>
  77. </view>
  78. </view>
  79. <!--答疑 -->
  80. <view v-show="current == 2">
  81. <view class="inputBottom">
  82. <view style="width: 73%;height: 88rpx;margin-bottom: 15rpx;margin-left: 10% ;">
  83. <u-input height="78" fixed="true" placeholder="您可以在这里输入答疑内容" type="textarea" :custom-style="inputStyle" v-model="value" />
  84. </view>
  85. <view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;">提交</view>
  86. </view>
  87. <view v-for="(item, index) in menuList" style="background-color: #FFFFFF;">
  88. <view class="chat_box">
  89. <view><image src="https://file-dev.xyyxt.net/oss/images/avatar/20210623/1624414559368_44562477.png" style="width: 64rpx;height: 64rpx;"></image></view>
  90. <view style="margin-left: 15rpx;">
  91. <view class="chat1">倪虹洁</view>
  92. <view class="chat2">2021/10/31 09:36:23</view>
  93. <view class="chat3">老师的课讲得太棒了!</view>
  94. </view>
  95. </view>
  96. <u-line color="#D6D6DB" />
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import eventHub from '@/common/eventHub.js';
  104. import courseModule from '@/pages2/components/course/courseModule.vue';
  105. import courseChapter from '@/pages2/components/course/courseChapter.vue';
  106. import courseSection from '@/pages2/components/course/courseSection.vue';
  107. import { mapGetters } from 'vuex';
  108. export default {
  109. components: {
  110. courseModule,
  111. courseChapter,
  112. courseSection
  113. },
  114. data() {
  115. return {
  116. startStatus: false,
  117. detail: {},
  118. courseId: 0,
  119. placeholder: '您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记',
  120. inputStyle: {
  121. background: 'rgba(244, 244, 244, 0.98)',
  122. borderRadius: '24rpx',
  123. padding: '8rpx',
  124. marginBottom: '10rpx'
  125. },
  126. playbackRate: [0.5, 0.8, 1.0],
  127. list: [
  128. {
  129. name: '目录'
  130. },
  131. {
  132. name: '笔记'
  133. },
  134. {
  135. name: '答疑'
  136. }
  137. ],
  138. menuList: [
  139. {
  140. list: [
  141. {
  142. showChildren: false,
  143. children: [1, 2, 3]
  144. },
  145. {
  146. showChildren: false,
  147. children: [1]
  148. },
  149. {
  150. showChildren: false,
  151. children: [1, 2]
  152. }
  153. ],
  154. type: 1
  155. },
  156. {
  157. type: 2,
  158. showChildren: false,
  159. list: [{}, {}, {}]
  160. },
  161. {
  162. type: 3,
  163. list: [{}, {}]
  164. }
  165. ],
  166. current: 0,
  167. vid:'',
  168. };
  169. },
  170. onUnload() {},
  171. computed: { ...mapGetters(['userInfo']) },
  172. onLoad(option) {
  173. this.courseId = option.id;
  174. this.courseDetail();
  175. this.getMenuList();
  176. },
  177. onShow() {},
  178. mounted() {
  179. eventHub.$on('getSection', item => {
  180. this.vid = item
  181. this.startStatus = true
  182. });
  183. },
  184. methods: {
  185. startVideo() {
  186. this.startStatus = true;
  187. },
  188. getMenuList() {
  189. let self = this;
  190. this.$api.menuList({ courseId: this.courseId }).then(res => {
  191. if (res.data.code == 200) {
  192. for (let i = 0; i < res.data.rows.length; i++) {
  193. let item = res.data.rows[i];
  194. item.down = true;
  195. item.id = item.menuId;
  196. item.name = item.menuName;
  197. }
  198. self.menuList = res.data.rows;
  199. }
  200. });
  201. },
  202. courseDetail() {
  203. let self = this;
  204. this.$api.courseDetail(this.courseId).then(res => {
  205. if (res.data.code == 200) {
  206. self.detail = res.data.data;
  207. }
  208. });
  209. },
  210. open(item) {
  211. item.showChildren = !item.showChildren;
  212. },
  213. change(index) {
  214. this.current = index;
  215. }
  216. }
  217. };
  218. </script>
  219. <style scope>
  220. .chat_box {
  221. display: flex;
  222. padding: 20rpx;
  223. }
  224. .chat3 {
  225. font-size: 30rpx;
  226. font-family: PingFang SC;
  227. font-weight: 500;
  228. color: #666666;
  229. margin-top: 10rpx;
  230. }
  231. .chat2 {
  232. font-size: 20rpx;
  233. font-family: PingFang SC;
  234. font-weight: 500;
  235. color: #999999;
  236. margin-top: 10rpx;
  237. }
  238. .chat1 {
  239. font-size: 24rpx;
  240. font-family: PingFang SC;
  241. font-weight: 500;
  242. color: #333333;
  243. }
  244. .leftPadding {
  245. margin-left: 8rpx;
  246. }
  247. .t2Content {
  248. font-size: 30rpx;
  249. font-family: PingFang SC;
  250. font-weight: bold;
  251. color: #333333;
  252. line-height: 48rpx;
  253. }
  254. .tBox2 {
  255. display: flex;
  256. padding-top: 10rpx;
  257. }
  258. .tBox {
  259. display: flex;
  260. align-items: center;
  261. padding-top: 10rpx;
  262. }
  263. .title {
  264. font-size: 24rpx;
  265. color: #999999;
  266. }
  267. page {
  268. padding-top: 10px;
  269. padding-top: constant(safe-area-inset-top);
  270. padding-top: env(safe-area-inset-top);
  271. }
  272. .inputBottom {
  273. position: fixed;
  274. left: 0;
  275. bottom: 0;
  276. background: #ffffff;
  277. height: 98rpx;
  278. display: flex;
  279. align-items: center;
  280. width: 100%;
  281. }
  282. .noteBox {
  283. width: 100%;
  284. background: #ffffff;
  285. border-radius: 16rpx;
  286. padding: 10rpx;
  287. }
  288. .dateBox {
  289. width: 216rpx;
  290. height: 48rpx;
  291. background: #ffffff;
  292. border-radius: 24rpx;
  293. font-size: 24rpx;
  294. color: #666666;
  295. text-align: center;
  296. line-height: 48rpx;
  297. margin: 20rpx 0;
  298. }
  299. .t_content1 {
  300. color: #007aff;
  301. margin-left: 10rpx;
  302. }
  303. .tag1 {
  304. border: 2rpx solid #007aff;
  305. border-radius: 8rpx;
  306. font-size: 20rpx;
  307. color: #007aff;
  308. padding: 5rpx;
  309. }
  310. .b_title {
  311. color: #333333;
  312. font-size: 30rpx;
  313. font-weight: bold;
  314. }
  315. page {
  316. background: #eaeef1;
  317. }
  318. .menuBox {
  319. width: 100%;
  320. background: #ffffff;
  321. border-radius: 16rpx;
  322. padding: 20rpx;
  323. margin-bottom: 20rpx;
  324. }
  325. .btnspric {
  326. border-top: 1rpx solid #eee;
  327. display: flex;
  328. align-items: center;
  329. justify-content: space-between;
  330. height: 108rpx;
  331. padding-left: 43rpx;
  332. padding-right: 32rpx;
  333. }
  334. .btnspric > .lefprL {
  335. font-size: 36rpx;
  336. color: #0c141f;
  337. font-weight: bold;
  338. }
  339. .btnspric > .lefprR {
  340. padding: 0rpx 24rpx;
  341. height: 60rpx;
  342. line-height: 60rpx;
  343. text-align: center;
  344. color: #fff;
  345. background: #32467b;
  346. border-radius: 24rpx;
  347. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  348. }
  349. .yhj,
  350. .hdyhj {
  351. padding: 24rpx 29rpx 24rpx 34rpx;
  352. }
  353. .yhj {
  354. border-bottom: 16rpx solid #f9f9f9;
  355. }
  356. .yhjtit {
  357. font-size: 30rpx;
  358. color: #0c141f;
  359. font-weight: 500;
  360. margin-bottom: 14rpx;
  361. }
  362. .yhjList {
  363. display: flex;
  364. align-items: center;
  365. justify-content: space-between;
  366. margin-bottom: 14rpx;
  367. }
  368. .yhjList > .yhjLefts {
  369. display: flex;
  370. align-items: center;
  371. }
  372. .yhjLefts > .yhl {
  373. color: #32467b;
  374. font-size: 30rpx;
  375. margin-right: 31rpx;
  376. }
  377. .yhjLefts > .yhbq {
  378. font-size: 24rpx;
  379. color: #ff9500;
  380. border-radius: 18rpx;
  381. background-color: rgba(255, 149, 0, 0.2);
  382. border: 2rpx solid #ff9500;
  383. height: 38rpx;
  384. line-height: 38rpx;
  385. padding: 0rpx 16rpx;
  386. }
  387. .ts {
  388. font-size: 24rpx;
  389. color: #999;
  390. margin: 14rpx 0rpx;
  391. padding-right: 29rpx;
  392. padding-left: 34rpx;
  393. }
  394. .yh {
  395. padding-top: 20rpx;
  396. }
  397. .yh > .yhtitle {
  398. display: flex;
  399. align-items: center;
  400. justify-content: space-between;
  401. padding-right: 29rpx;
  402. padding-left: 34rpx;
  403. }
  404. .priceBxs {
  405. display: flex;
  406. align-items: center;
  407. }
  408. .priceBxs > .pricleft {
  409. border-radius: 24rpx;
  410. border: 1rpx solid #e91313;
  411. background-color: rgba(233, 19, 19, 0.1);
  412. padding: 0rpx 18rpx;
  413. height: 49rpx;
  414. line-height: 49rpx;
  415. text-align: center;
  416. font-size: 30rpx;
  417. font-weight: 500;
  418. color: #e91313;
  419. margin-right: 13rpx;
  420. }
  421. .topBox {
  422. padding: 32rpx 32rpx 24rpx;
  423. border-bottom: 1rpx solid #eeeeee;
  424. }
  425. .topBox > .boldFonstType {
  426. font-weight: 500;
  427. font-size: 30rpx;
  428. margin: 16rpx 0rpx 23rpx;
  429. }
  430. .topBox > .firstTopL {
  431. display: flex;
  432. align-items: center;
  433. }
  434. .topBox > .firstTopL > .imageBs {
  435. width: 331rpx;
  436. height: 160rpx;
  437. border-radius: 6rpx;
  438. overflow: hidden;
  439. margin-right: 8rpx;
  440. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  441. }
  442. .topBox > .firstTopL > .imageBs > image {
  443. width: 100%;
  444. height: 100%;
  445. }
  446. .topBox > .firstTopL > .textBs {
  447. font-size: 30rpx;
  448. font-weight: bold;
  449. color: #0c141f;
  450. }
  451. .content {
  452. padding: 24rpx;
  453. text-align: left;
  454. }
  455. .catalogBox {
  456. display: flex;
  457. align-items: center;
  458. flex-wrap: nowrap;
  459. overflow-x: auto;
  460. padding-left: 38rpx;
  461. max-height: 305rpx;
  462. overflow-y: auto;
  463. transition: all 0.4s;
  464. }
  465. .catalogBox > .catalogA {
  466. min-width: 200rpx;
  467. height: 48rpx;
  468. line-height: 48rpx;
  469. // text-align: center;
  470. border: 2rpx solid transparent;
  471. white-space: nowrap;
  472. text-overflow: ellipsis;
  473. overflow: hidden;
  474. word-break: break-all;
  475. border-radius: 10rpx;
  476. background: rgba(22, 119, 255, 0.05);
  477. padding-left: 19rpx;
  478. box-sizing: border-box;
  479. padding-right: 15rpx;
  480. margin-right: 16rpx;
  481. margin-bottom: 20rpx;
  482. margin-top: 15rpx;
  483. font-size: 24rpx;
  484. color: #666;
  485. }
  486. .catalogBox > .activesq {
  487. border-color: #1677ff;
  488. }
  489. .changeCatalogBox {
  490. display: block;
  491. }
  492. .catalogBox::-webkit-scrollbar {
  493. display: none; /* Chrome Safari */
  494. }
  495. .box {
  496. position: relative;
  497. top: 650rpx;
  498. padding-bottom: 88rpx;
  499. margin: 20rpx;
  500. }
  501. .price_t2 {
  502. font-size: 18rpx;
  503. font-family: PingFang SC;
  504. font-weight: 500;
  505. text-decoration: line-through;
  506. color: #999999;
  507. }
  508. .price_t1 {
  509. font-size: 33rpx;
  510. font-family: PingFang SC;
  511. font-weight: bold;
  512. color: #e91313;
  513. }
  514. .sc_t {
  515. font-size: 22rpx;
  516. color: #000000;
  517. }
  518. .sc {
  519. width: 29rpx;
  520. height: 29rpx;
  521. }
  522. .buy {
  523. width: 138rpx;
  524. height: 48rpx;
  525. line-height: 48rpx;
  526. background: #32467b;
  527. border-radius: 10rpx;
  528. color: #ffffff;
  529. font-size: 28rpx;
  530. text-align: center;
  531. vertical-align: middle;
  532. position: absolute;
  533. right: 30rpx;
  534. }
  535. .video_body {
  536. padding-bottom: 96rpx;
  537. }
  538. .footer_tab {
  539. position: fixed;
  540. bottom: 0;
  541. height: 96rpx;
  542. width: 100%;
  543. background-color: #ffffff;
  544. }
  545. .tj_box {
  546. width: 50%;
  547. display: inline-block;
  548. text-align: center;
  549. margin: 10rpx 0;
  550. }
  551. .teacher_t {
  552. font-size: 24rpx;
  553. font-family: PingFang SC;
  554. font-weight: 400;
  555. color: #666666;
  556. line-height: 36rpx;
  557. margin-left: 15rpx;
  558. }
  559. .teacher_img {
  560. width: 87rpx;
  561. height: 129rpx;
  562. }
  563. .t2 {
  564. font-size: 24rpx;
  565. font-family: PingFang SC;
  566. color: #666666;
  567. line-height: 36rpx;
  568. margin: 15rpx;
  569. }
  570. .r_t2 {
  571. width: 201rpx;
  572. height: 49rpx;
  573. background: rgba(22, 119, 255, 0.05);
  574. border: 1rpx solid #32467b;
  575. border-radius: 16rpx;
  576. color: #666666;
  577. font-size: 23rpx;
  578. text-align: center;
  579. display: flex;
  580. align-items: center;
  581. padding: 5rpx;
  582. }
  583. .scroll_box {
  584. width: 100%;
  585. height: 60rpx;
  586. background: #ffffff;
  587. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  588. white-space: nowrap;
  589. overflow: hidden;
  590. margin: 15rpx 0;
  591. }
  592. .r_sliper {
  593. padding: 0 20rpx;
  594. }
  595. .top_line {
  596. width: 6rpx;
  597. height: 22rpx;
  598. background: #32467b;
  599. margin-right: 10rpx;
  600. }
  601. .video_t2 {
  602. font-size: 24rpx;
  603. font-family: PingFang SC;
  604. font-weight: 500;
  605. color: #666666;
  606. }
  607. .video_t1 {
  608. height: 80rpx;
  609. color: #333333;
  610. line-height: 80rpx;
  611. font-size: 30rpx;
  612. font-family: PingFang SC;
  613. font-weight: bold;
  614. color: #333333;
  615. }
  616. .video_t1_t {
  617. display: flex;
  618. flex-direction: column;
  619. height: 80rpx;
  620. color: #333333;
  621. text-align: center;
  622. align-items: center;
  623. border-left: solid 1px #d6d6db;
  624. }
  625. .video_play {
  626. position: absolute;
  627. width: 95rpx;
  628. height: 95rpx;
  629. top: 0;
  630. left: 0;
  631. right: 0;
  632. bottom: 0;
  633. margin: auto;
  634. }
  635. .video_box {
  636. position: relative;
  637. }
  638. .rotoct {
  639. transform: rotate(90deg);
  640. }
  641. </style>