detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. <template>
  2. <view>
  3. <view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;top: 0;" id="top">
  4. <view class="video_box" v-if="!startStatus">
  5. <image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
  6. <image v-if="false" 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 :isBuy="true" :menuItem="item"></courseModule></view>
  45. <!--章 -->
  46. <view v-if="item.type == 2"><courseChapter :isBuy="true" :menuItem="item"></courseChapter></view>
  47. <!--节 -->
  48. <view v-if="item.type == 3"><courseSection :isBuy="true" :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 '@/components/course/courseModule.vue';
  105. import courseChapter from '@/components/course/courseChapter.vue';
  106. import courseSection from '@/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. goodsId:0,
  169. goodsData:{}
  170. };
  171. },
  172. onUnload() {},
  173. computed: { ...mapGetters(['userInfo']) },
  174. onLoad(option) {
  175. this.courseId = option.id;
  176. this.goodsId = uni.getStorageSync('courseGoodsId');
  177. this.courseDetail();
  178. this.getMenuList();
  179. this.getGoodsDetail()
  180. },
  181. onShow() {},
  182. mounted() {
  183. eventHub.$on('getSection', item => {
  184. this.vid = item.recordingUrl
  185. this.startStatus = true
  186. });
  187. },
  188. methods: {
  189. getGoodsDetail(){
  190. let self = this
  191. this.$api.goodsDetail(this.goodsId).then(res => {
  192. self.goodsData = res.data.data;
  193. })
  194. },
  195. startVideo() {
  196. this.startStatus = true;
  197. },
  198. getMenuList() {
  199. let self = this;
  200. this.$api.menuList({ courseId: this.courseId }).then(res => {
  201. if (res.data.code == 200) {
  202. for (let i = 0; i < res.data.rows.length; i++) {
  203. let item = res.data.rows[i];
  204. item.down = true;
  205. item.id = item.menuId;
  206. item.name = item.menuName;
  207. }
  208. self.menuList = res.data.rows;
  209. }
  210. });
  211. },
  212. courseDetail() {
  213. let self = this;
  214. this.$api.courseDetail(this.courseId).then(res => {
  215. if (res.data.code == 200) {
  216. self.detail = res.data.data;
  217. }
  218. });
  219. },
  220. open(item) {
  221. item.showChildren = !item.showChildren;
  222. },
  223. change(index) {
  224. this.current = index;
  225. }
  226. }
  227. };
  228. </script>
  229. <style scope>
  230. .chat_box {
  231. display: flex;
  232. padding: 20rpx;
  233. }
  234. .chat3 {
  235. font-size: 30rpx;
  236. font-family: PingFang SC;
  237. font-weight: 500;
  238. color: #666666;
  239. margin-top: 10rpx;
  240. }
  241. .chat2 {
  242. font-size: 20rpx;
  243. font-family: PingFang SC;
  244. font-weight: 500;
  245. color: #999999;
  246. margin-top: 10rpx;
  247. }
  248. .chat1 {
  249. font-size: 24rpx;
  250. font-family: PingFang SC;
  251. font-weight: 500;
  252. color: #333333;
  253. }
  254. .leftPadding {
  255. margin-left: 8rpx;
  256. }
  257. .t2Content {
  258. font-size: 30rpx;
  259. font-family: PingFang SC;
  260. font-weight: bold;
  261. color: #333333;
  262. line-height: 48rpx;
  263. }
  264. .tBox2 {
  265. display: flex;
  266. padding-top: 10rpx;
  267. }
  268. .tBox {
  269. display: flex;
  270. align-items: center;
  271. padding-top: 10rpx;
  272. }
  273. .title {
  274. font-size: 24rpx;
  275. color: #999999;
  276. }
  277. page {
  278. padding-top: 10px;
  279. padding-top: constant(safe-area-inset-top);
  280. padding-top: env(safe-area-inset-top);
  281. }
  282. .inputBottom {
  283. position: fixed;
  284. left: 0;
  285. bottom: 0;
  286. background: #ffffff;
  287. height: 98rpx;
  288. display: flex;
  289. align-items: center;
  290. width: 100%;
  291. }
  292. .noteBox {
  293. width: 100%;
  294. background: #ffffff;
  295. border-radius: 16rpx;
  296. padding: 10rpx;
  297. }
  298. .dateBox {
  299. width: 216rpx;
  300. height: 48rpx;
  301. background: #ffffff;
  302. border-radius: 24rpx;
  303. font-size: 24rpx;
  304. color: #666666;
  305. text-align: center;
  306. line-height: 48rpx;
  307. margin: 20rpx 0;
  308. }
  309. .t_content1 {
  310. color: #007aff;
  311. margin-left: 10rpx;
  312. }
  313. .tag1 {
  314. border: 2rpx solid #007aff;
  315. border-radius: 8rpx;
  316. font-size: 20rpx;
  317. color: #007aff;
  318. padding: 5rpx;
  319. }
  320. .b_title {
  321. color: #333333;
  322. font-size: 30rpx;
  323. font-weight: bold;
  324. }
  325. page {
  326. background: #eaeef1;
  327. }
  328. .menuBox {
  329. width: 100%;
  330. background: #ffffff;
  331. border-radius: 16rpx;
  332. padding: 20rpx;
  333. margin-bottom: 20rpx;
  334. }
  335. .btnspric {
  336. border-top: 1rpx solid #eee;
  337. display: flex;
  338. align-items: center;
  339. justify-content: space-between;
  340. height: 108rpx;
  341. padding-left: 43rpx;
  342. padding-right: 32rpx;
  343. }
  344. .btnspric > .lefprL {
  345. font-size: 36rpx;
  346. color: #0c141f;
  347. font-weight: bold;
  348. }
  349. .btnspric > .lefprR {
  350. padding: 0rpx 24rpx;
  351. height: 60rpx;
  352. line-height: 60rpx;
  353. text-align: center;
  354. color: #fff;
  355. background: #32467b;
  356. border-radius: 24rpx;
  357. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  358. }
  359. .yhj,
  360. .hdyhj {
  361. padding: 24rpx 29rpx 24rpx 34rpx;
  362. }
  363. .yhj {
  364. border-bottom: 16rpx solid #f9f9f9;
  365. }
  366. .yhjtit {
  367. font-size: 30rpx;
  368. color: #0c141f;
  369. font-weight: 500;
  370. margin-bottom: 14rpx;
  371. }
  372. .yhjList {
  373. display: flex;
  374. align-items: center;
  375. justify-content: space-between;
  376. margin-bottom: 14rpx;
  377. }
  378. .yhjList > .yhjLefts {
  379. display: flex;
  380. align-items: center;
  381. }
  382. .yhjLefts > .yhl {
  383. color: #32467b;
  384. font-size: 30rpx;
  385. margin-right: 31rpx;
  386. }
  387. .yhjLefts > .yhbq {
  388. font-size: 24rpx;
  389. color: #ff9500;
  390. border-radius: 18rpx;
  391. background-color: rgba(255, 149, 0, 0.2);
  392. border: 2rpx solid #ff9500;
  393. height: 38rpx;
  394. line-height: 38rpx;
  395. padding: 0rpx 16rpx;
  396. }
  397. .ts {
  398. font-size: 24rpx;
  399. color: #999;
  400. margin: 14rpx 0rpx;
  401. padding-right: 29rpx;
  402. padding-left: 34rpx;
  403. }
  404. .yh {
  405. padding-top: 20rpx;
  406. }
  407. .yh > .yhtitle {
  408. display: flex;
  409. align-items: center;
  410. justify-content: space-between;
  411. padding-right: 29rpx;
  412. padding-left: 34rpx;
  413. }
  414. .priceBxs {
  415. display: flex;
  416. align-items: center;
  417. }
  418. .priceBxs > .pricleft {
  419. border-radius: 24rpx;
  420. border: 1rpx solid #e91313;
  421. background-color: rgba(233, 19, 19, 0.1);
  422. padding: 0rpx 18rpx;
  423. height: 49rpx;
  424. line-height: 49rpx;
  425. text-align: center;
  426. font-size: 30rpx;
  427. font-weight: 500;
  428. color: #e91313;
  429. margin-right: 13rpx;
  430. }
  431. .topBox {
  432. padding: 32rpx 32rpx 24rpx;
  433. border-bottom: 1rpx solid #eeeeee;
  434. }
  435. .topBox > .boldFonstType {
  436. font-weight: 500;
  437. font-size: 30rpx;
  438. margin: 16rpx 0rpx 23rpx;
  439. }
  440. .topBox > .firstTopL {
  441. display: flex;
  442. align-items: center;
  443. }
  444. .topBox > .firstTopL > .imageBs {
  445. width: 331rpx;
  446. height: 160rpx;
  447. border-radius: 6rpx;
  448. overflow: hidden;
  449. margin-right: 8rpx;
  450. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  451. }
  452. .topBox > .firstTopL > .imageBs > image {
  453. width: 100%;
  454. height: 100%;
  455. }
  456. .topBox > .firstTopL > .textBs {
  457. font-size: 30rpx;
  458. font-weight: bold;
  459. color: #0c141f;
  460. }
  461. .content {
  462. padding: 24rpx;
  463. text-align: left;
  464. }
  465. .catalogBox {
  466. display: flex;
  467. align-items: center;
  468. flex-wrap: nowrap;
  469. overflow-x: auto;
  470. padding-left: 38rpx;
  471. max-height: 305rpx;
  472. overflow-y: auto;
  473. transition: all 0.4s;
  474. }
  475. .catalogBox > .catalogA {
  476. min-width: 200rpx;
  477. height: 48rpx;
  478. line-height: 48rpx;
  479. // text-align: center;
  480. border: 2rpx solid transparent;
  481. white-space: nowrap;
  482. text-overflow: ellipsis;
  483. overflow: hidden;
  484. word-break: break-all;
  485. border-radius: 10rpx;
  486. background: rgba(22, 119, 255, 0.05);
  487. padding-left: 19rpx;
  488. box-sizing: border-box;
  489. padding-right: 15rpx;
  490. margin-right: 16rpx;
  491. margin-bottom: 20rpx;
  492. margin-top: 15rpx;
  493. font-size: 24rpx;
  494. color: #666;
  495. }
  496. .catalogBox > .activesq {
  497. border-color: #1677ff;
  498. }
  499. .changeCatalogBox {
  500. display: block;
  501. }
  502. .catalogBox::-webkit-scrollbar {
  503. display: none; /* Chrome Safari */
  504. }
  505. .box {
  506. position: relative;
  507. top: 650rpx;
  508. padding-bottom: 88rpx;
  509. margin: 20rpx;
  510. }
  511. .price_t2 {
  512. font-size: 18rpx;
  513. font-family: PingFang SC;
  514. font-weight: 500;
  515. text-decoration: line-through;
  516. color: #999999;
  517. }
  518. .price_t1 {
  519. font-size: 33rpx;
  520. font-family: PingFang SC;
  521. font-weight: bold;
  522. color: #e91313;
  523. }
  524. .sc_t {
  525. font-size: 22rpx;
  526. color: #000000;
  527. }
  528. .sc {
  529. width: 29rpx;
  530. height: 29rpx;
  531. }
  532. .buy {
  533. width: 138rpx;
  534. height: 48rpx;
  535. line-height: 48rpx;
  536. background: #32467b;
  537. border-radius: 10rpx;
  538. color: #ffffff;
  539. font-size: 28rpx;
  540. text-align: center;
  541. vertical-align: middle;
  542. position: absolute;
  543. right: 30rpx;
  544. }
  545. .video_body {
  546. padding-bottom: 96rpx;
  547. }
  548. .footer_tab {
  549. position: fixed;
  550. bottom: 0;
  551. height: 96rpx;
  552. width: 100%;
  553. background-color: #ffffff;
  554. }
  555. .tj_box {
  556. width: 50%;
  557. display: inline-block;
  558. text-align: center;
  559. margin: 10rpx 0;
  560. }
  561. .teacher_t {
  562. font-size: 24rpx;
  563. font-family: PingFang SC;
  564. font-weight: 400;
  565. color: #666666;
  566. line-height: 36rpx;
  567. margin-left: 15rpx;
  568. }
  569. .teacher_img {
  570. width: 87rpx;
  571. height: 129rpx;
  572. }
  573. .t2 {
  574. font-size: 24rpx;
  575. font-family: PingFang SC;
  576. color: #666666;
  577. line-height: 36rpx;
  578. margin: 15rpx;
  579. }
  580. .r_t2 {
  581. width: 201rpx;
  582. height: 49rpx;
  583. background: rgba(22, 119, 255, 0.05);
  584. border: 1rpx solid #32467b;
  585. border-radius: 16rpx;
  586. color: #666666;
  587. font-size: 23rpx;
  588. text-align: center;
  589. display: flex;
  590. align-items: center;
  591. padding: 5rpx;
  592. }
  593. .scroll_box {
  594. width: 100%;
  595. height: 60rpx;
  596. background: #ffffff;
  597. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  598. white-space: nowrap;
  599. overflow: hidden;
  600. margin: 15rpx 0;
  601. }
  602. .r_sliper {
  603. padding: 0 20rpx;
  604. }
  605. .top_line {
  606. width: 6rpx;
  607. height: 22rpx;
  608. background: #32467b;
  609. margin-right: 10rpx;
  610. }
  611. .video_t2 {
  612. font-size: 24rpx;
  613. font-family: PingFang SC;
  614. font-weight: 500;
  615. color: #666666;
  616. }
  617. .video_t1 {
  618. height: 80rpx;
  619. color: #333333;
  620. line-height: 80rpx;
  621. font-size: 30rpx;
  622. font-family: PingFang SC;
  623. font-weight: bold;
  624. color: #333333;
  625. }
  626. .video_t1_t {
  627. display: flex;
  628. flex-direction: column;
  629. height: 80rpx;
  630. color: #333333;
  631. text-align: center;
  632. align-items: center;
  633. border-left: solid 1px #d6d6db;
  634. }
  635. .video_play {
  636. position: absolute;
  637. width: 95rpx;
  638. height: 95rpx;
  639. top: 0;
  640. left: 0;
  641. right: 0;
  642. bottom: 0;
  643. margin: auto;
  644. }
  645. .video_box {
  646. position: relative;
  647. }
  648. .rotoct {
  649. transform: rotate(90deg);
  650. }
  651. </style>