courseSection.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858
  1. <template>
  2. <view
  3. style="display: flex; justify-content: space-between; align-items: center"
  4. @click="getVideo"
  5. >
  6. <view
  7. style="
  8. display: flex;
  9. justify-content: space-between;
  10. align-items: center;
  11. margin: 20rpx 0;
  12. width: 100%;
  13. "
  14. >
  15. <view style="display: flex; align-items: center; flex: 1">
  16. <view class="tag tagColor1" v-if="menuItem.sectionType == 1">视频</view>
  17. <view class="tag tagColor2" v-if="menuItem.sectionType == 2">直播</view>
  18. <view class="tag tagColor3" v-if="menuItem.sectionType == 3">回放</view>
  19. <view class="t_content">
  20. <view
  21. v-if="menuItem.sectionType == 1"
  22. :class="
  23. playSectionId == newId && playNextId == playId ? 'color1' : ''
  24. "
  25. >{{ menuItem.name || "" }}</view
  26. >
  27. <view
  28. v-if="menuItem.sectionType == 2"
  29. :class="
  30. playSectionId == newId && playNextId == playId ? 'color2' : ''
  31. "
  32. >{{ menuItem.name || "" }}</view
  33. >
  34. <view
  35. v-if="menuItem.sectionType == 3"
  36. :class="
  37. playSectionId == newId && playNextId == playId ? 'color3' : ''
  38. "
  39. >{{ menuItem.name || "" }}</view
  40. >
  41. <view
  42. style="font-size: 20rpx; color: #ff3b30"
  43. v-if="menuItem.sectionType == 2 && menuItem.liveStartTime"
  44. >
  45. <view v-if="menuItem.liveStartTime > nowTime || !isBuy">
  46. <text>{{
  47. $method.timestampToTime(menuItem.liveStartTime, (isDay = false))
  48. }}</text
  49. >-
  50. <text>{{
  51. $method.timestampToTime(menuItem.liveEndTime, (isDay = false))
  52. }}</text>
  53. </view>
  54. <template v-if="isLast()">
  55. <view v-if="liveLast.watchStatus == 'live'">
  56. <text>直播中</text>
  57. </view>
  58. <view v-if="liveLast.watchStatus == 'end'">
  59. <text>当前直播回放视频请稍后再查看</text>
  60. </view>
  61. </template>
  62. <!-- <view v-if="menuItem.liveStartTime<=nowTime&&menuItem.liveEndTime>nowTime">
  63. <text>直播中</text>
  64. </view>
  65. <view v-if="menuItem.liveEndTime<nowTime">
  66. <text>回放</text>
  67. </view> -->
  68. </view>
  69. <view
  70. style="font-size: 20rpx; color: #ff3b30"
  71. v-if="menuItem.sectionType == 3"
  72. >
  73. <view v-if="!menuItem.recordingUrl">
  74. <text>当前直播回放视频请稍后再查看</text>
  75. </view>
  76. <view v-else> 回放中 </view>
  77. </view>
  78. </view>
  79. <view v-if="menuItem.sectionType == null">{{
  80. menuItem.name || ""
  81. }}</view>
  82. <!-- 学习中 -->
  83. <view
  84. v-if="playSectionId == newId && playNextId == playId"
  85. class="learnings"
  86. >
  87. <image
  88. src="/pages3/static/imgs/learning_icon.gif"
  89. class="learning_icon"
  90. ></image>
  91. </view>
  92. </view>
  93. <view
  94. style="font-size: 20rpx; color: #ff3b30"
  95. v-if="menuItem.liveStartTime && menuItem.sectionType != 3 && isBuy"
  96. >
  97. <template v-if="!isLast() && !isLive">
  98. <view class="tagWillPlay" v-if="menuItem.liveStartTime > nowTime">
  99. <text>待开播</text>
  100. </view>
  101. <view
  102. class="tagPlaying"
  103. v-if="
  104. menuItem.liveStartTime <= nowTime &&
  105. menuItem.liveEndTime > nowTime
  106. "
  107. >
  108. <text>直播中</text>
  109. </view>
  110. <view class="tagPlayed" v-if="menuItem.liveEndTime < nowTime">
  111. <text>已结束</text>
  112. </view>
  113. </template>
  114. </view>
  115. <!-- 直播课程没有学习状态 -->
  116. <template v-if="!isLive">
  117. <view v-if="isRebuild || menuItem.rebuild > 0" class="tagRe"
  118. >待重修</view
  119. >
  120. <view v-else>
  121. <view v-if="menuItem.learning == 1" class="tagGreen">已学完</view>
  122. </view>
  123. </template>
  124. <view
  125. v-if="checkTest()"
  126. class="exercises"
  127. @click.stop="toDoSectionExam()"
  128. >
  129. <text class="exe_w">习题</text>
  130. <u-icon name="arrow-right" color="#498AFE" size="28"></u-icon>
  131. </view>
  132. </view>
  133. <view v-if="menuItem.tryListen && !isBuy" class="tryBox"> 试看 </view>
  134. </view>
  135. </template>
  136. <script>
  137. import { mapGetters } from "vuex";
  138. export default {
  139. name: "courseSection",
  140. props: {
  141. isLive: false, //是否是直播课
  142. orderGoodsId: {
  143. default: 0,
  144. },
  145. preItem: {
  146. default: undefined,
  147. },
  148. learningOrder: {
  149. //是否设置学习顺序 1 章节顺序 0不设置 2从头学到尾顺序
  150. type: Number,
  151. default: 0,
  152. },
  153. courseId: {
  154. type: Number,
  155. default: 0,
  156. },
  157. goodsId: {
  158. type: Number,
  159. default: 0,
  160. },
  161. menuItem: {
  162. type: Object,
  163. default: {},
  164. },
  165. isBuy: {
  166. type: Boolean,
  167. default: false,
  168. },
  169. levelId: {
  170. type: String,
  171. default: "",
  172. },
  173. isRebuild: {
  174. type: Boolean,
  175. default: false,
  176. },
  177. gradeId: {
  178. type: Number,
  179. default: 0,
  180. },
  181. nextMenuItem: {
  182. type: Object,
  183. default: () => {
  184. return {};
  185. },
  186. },
  187. sectionMaxNum: {
  188. default: undefined,
  189. },
  190. // 章->所有节试卷列表
  191. ChapterSectionExam: {
  192. type: Array,
  193. default: () => [],
  194. },
  195. // 区分是模块试卷还是章试卷,3是模块试卷
  196. testType: {
  197. type: Number,
  198. default: 0,
  199. },
  200. menuAllList: {
  201. // 课程所有子目录结构列表
  202. type: Array,
  203. default: () => [],
  204. },
  205. },
  206. watch: {
  207. menuItem(val) {
  208. console.log(val, "val");
  209. },
  210. },
  211. data() {
  212. return {
  213. nowTime: 0,
  214. newId: 0,
  215. playId: "",
  216. clickLock: false, //点击锁,防止连续点击多次
  217. moduleSectionExam: [], // 模块下的所有节试卷列表
  218. chapterExams: {},
  219. moduleExams: {},
  220. // newMenuAllList: [],
  221. };
  222. },
  223. onLoad() {},
  224. created() {
  225. if (this.testType == 3) {
  226. // 模块下的所有节试卷列表
  227. this.$api
  228. .reSectionExamList({
  229. chapterId: 0,
  230. courseId: this.courseId,
  231. gradeId: this.gradeId,
  232. })
  233. .then((res) => {
  234. if (res.data.code == 200) {
  235. this.moduleSectionExam = res.data.data || [];
  236. }
  237. });
  238. }
  239. },
  240. mounted() {
  241. // console.log('节的播放---menuItem', this.menuItem, 'playSectionId:', this.playSectionId, 'isBuy:', this.isBuy)
  242. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  243. this.newId =
  244. this.menuItem.sectionId > 0
  245. ? this.menuItem.sectionId
  246. : this.menuItem.menuId;
  247. let moduleId = this.menuItem.moduleId || 0;
  248. let chapterId = this.menuItem.chapterId || 0;
  249. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  250. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}${
  251. this.isRebuild ? "isRebuild" : ""
  252. }`;
  253. this.playId = playNextId;
  254. // console.log('playNextId:', this.playNextId, 'playId:', this.playId);
  255. uni.$off("playNext" + playNextId); //绑定前先移除之前的事件
  256. uni.$once("playNext" + playNextId, async (data) => {
  257. //到时会触发每个节的监听事件,只允许当前节的接收
  258. let self = this;
  259. if (
  260. this.nextMenuItem.recordingUrl &&
  261. this.isRebuild &&
  262. this.newId == this.playSectionId &&
  263. data.fromRebuild
  264. ) {
  265. // fromRebuild 来自重修目录的点击才弹出播放下一节
  266. //重修存在下一节
  267. uni.showModal({
  268. title: "提示",
  269. content: "是否播放下一节",
  270. success: function (res) {
  271. if (res.confirm) {
  272. let nextId =
  273. self.nextMenuItem.sectionId > 0
  274. ? self.nextMenuItem.sectionId
  275. : self.nextMenuItem.menuId;
  276. //设置播放的节ID
  277. self.$store.commit("setPlaySectionId", { playSectionId: nextId });
  278. self.$store.commit("setPlayVID", {
  279. playVID: self.nextMenuItem.recordingUrl,
  280. });
  281. let ids = self.levelId.split("-");
  282. ids[2] = nextId;
  283. uni.$emit("levelId", ids.join("-"));
  284. uni.$emit("getSection", self.nextMenuItem);
  285. self.$emit("playEnd", { isRebuild: self.isRebuild });
  286. } else {
  287. let nextId =
  288. self.nextMenuItem.sectionId > 0
  289. ? self.nextMenuItem.sectionId
  290. : self.nextMenuItem.menuId;
  291. //设置播放的节ID
  292. self.$store.commit("setPlaySectionId", { playSectionId: nextId });
  293. self.$store.commit("setPlayVID", {
  294. playVID: self.nextMenuItem.recordingUrl,
  295. });
  296. let ids = self.levelId.split("-");
  297. ids[2] = nextId;
  298. self.$emit("playEnd", { isRebuild: self.isRebuild });
  299. }
  300. },
  301. });
  302. } else {
  303. this.$emit("playEnd", { isRebuild: this.isRebuild });
  304. }
  305. });
  306. },
  307. methods: {
  308. isLast() {
  309. if (this.liveLast) {
  310. let sectionASame =
  311. this.liveLast.sectionId ==
  312. (this.menuItem.sectionId || this.menuItem.menuId);
  313. let chapterSame =
  314. this.liveLast.chapterId == (this.menuItem.chapterId || 0);
  315. let moduleSame =
  316. this.liveLast.moduleId == (this.menuItem.moduleId || 0);
  317. return sectionASame && chapterSame && moduleSame;
  318. } else {
  319. return false;
  320. }
  321. },
  322. toDoSectionExam() {
  323. if (this.testType == 3) {
  324. this.ModuleExam();
  325. } else {
  326. this.ChapterExam();
  327. }
  328. },
  329. checkTest() {
  330. let data =
  331. this.testType == 3 ? this.moduleSectionExam : this.ChapterSectionExam;
  332. let id =
  333. this.testType == 3 ? this.menuItem.menuId : this.menuItem.sectionId;
  334. if (!data) {
  335. return false;
  336. }
  337. return data.some((e) => e.sectionId == id);
  338. },
  339. ChapterExam() {
  340. this.chapterExams = this.ChapterSectionExam.find(
  341. (e) => e.sectionId == this.menuItem.sectionId
  342. );
  343. let moduleId = this.chapterExams.moduleId || 0;
  344. let chapterId = this.chapterExams.chapterId || 0;
  345. let sectionId = this.chapterExams.sectionId || this.chapterExams.menuId;
  346. uni.navigateTo({
  347. url:
  348. "/pages2/class/questionBank?courseId=" +
  349. this.courseId +
  350. "&gradeId=" +
  351. this.gradeId +
  352. "&isFromVideo=1&id=" +
  353. this.chapterExams.typeId +
  354. "&goodsid=" +
  355. this.goodsId +
  356. "&moduleId=" +
  357. moduleId +
  358. "&chapterId=" +
  359. chapterId +
  360. "&sectionId=" +
  361. sectionId +
  362. "&orderGoodsId=" +
  363. this.orderGoodsId +
  364. "&type=2",
  365. });
  366. },
  367. ModuleExam() {
  368. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  369. this.moduleExams = this.moduleSectionExam.find(
  370. (e) => e.sectionId == sectionId
  371. );
  372. let moduleId = this.moduleExams.moduleId || 0;
  373. let chapterId = this.moduleExams.chapterId || 0;
  374. uni.navigateTo({
  375. url:
  376. "/pages2/class/questionBank?courseId=" +
  377. this.courseId +
  378. "&gradeId=" +
  379. this.gradeId +
  380. "&isFromVideo=1&id=" +
  381. this.moduleExams.typeId +
  382. "&goodsid=" +
  383. this.goodsId +
  384. "&moduleId=" +
  385. moduleId +
  386. "&chapterId=" +
  387. chapterId +
  388. "&sectionId=" +
  389. sectionId +
  390. "&orderGoodsId=" +
  391. this.orderGoodsId +
  392. "&type=2",
  393. });
  394. },
  395. studyRecordMenuAllList() {
  396. return new Promise((resolve) => {
  397. this.$api
  398. .studyRecordMenuAllList({
  399. courseId: this.courseId,
  400. gradeId: this.gradeId,
  401. goodsId: this.goodsId,
  402. })
  403. .then((res) => {
  404. if (res.data.code == 200) {
  405. resolve(res.data.data);
  406. }
  407. });
  408. });
  409. },
  410. gradeCheckGoodsStudy() {
  411. return new Promise((resolve) => {
  412. this.$api
  413. .gradeCheckGoodsStudy({
  414. goodsId: this.goodsId,
  415. gradeId: this.gradeId,
  416. moduleId: this.menuItem.moduleId || 0,
  417. chapterId: this.menuItem.chapterId || 0,
  418. sectionId: this.menuItem.sectionId || this.menuItem.menuId,
  419. })
  420. .then((res) => {
  421. resolve(res.data.data);
  422. });
  423. });
  424. },
  425. goodsTodayStudySectionNum() {
  426. return new Promise((resolve) => {
  427. this.$api
  428. .goodsTodayStudySectionNum({
  429. goodsId: this.goodsId,
  430. gradeId: this.gradeId,
  431. })
  432. .then((res) => {
  433. if (res.data.code == 200) {
  434. resolve(res.data.data);
  435. }
  436. });
  437. });
  438. },
  439. getVideo() {
  440. if (this.clickLock) {
  441. return;
  442. }
  443. if (this.$method.isGoLogin()) {
  444. return;
  445. }
  446. if(this.menuItem.id==this.playSectionId){
  447. return
  448. }
  449. this.clickLock = true;
  450. if (this.learningOrder == 2 && !this.menuItem.isRebuild && !this.isLive) {
  451. //要按从头到尾顺序学习, 且不是重修课程
  452. if (this.preItem) {
  453. // let rows = await this.studyRecordMenuAllList();
  454. let rows = this.menuAllList;
  455. let newRows = [];
  456. for (let i = 0; i < rows.length; i++) {
  457. let moduleTrue =
  458. rows[i].moduleId == this.menuItem.moduleId ||
  459. rows[i].moduleId == 0;
  460. let chapterTrue =
  461. rows[i].chapterId == this.menuItem.chapterId ||
  462. rows[i].chapterId == 0;
  463. let sectionTrue =
  464. rows[i].sectionId == this.menuItem.sectionId ||
  465. rows[i].sectionId == this.menuItem.menuId;
  466. if (moduleTrue && chapterTrue && sectionTrue) {
  467. break;
  468. } else {
  469. if (rows[i].sectionType != 2) {
  470. newRows.push(rows[i]);
  471. }
  472. }
  473. }
  474. let isAllLearn = newRows.every((item) => {
  475. return item.studyStatus == 1;
  476. });
  477. if (isAllLearn) {
  478. this.playVideo();
  479. } else {
  480. uni.showToast({
  481. icon: "none",
  482. title: "请按顺序学习视频课程",
  483. });
  484. }
  485. } else {
  486. //第一章第一节
  487. this.playVideo();
  488. }
  489. } else {
  490. this.playVideo();
  491. }
  492. setTimeout(() => {
  493. this.clickLock = false;
  494. }, 3000);
  495. },
  496. studyRecordGetChannelBasicInfo(channelId) {
  497. return new Promise((resolve) => {
  498. this.$api
  499. .studyRecordGetChannelBasicInfo({
  500. channelId,
  501. })
  502. .then((res) => {
  503. resolve(res.data.data);
  504. });
  505. });
  506. },
  507. async playVideo() {
  508. if (this.menuItem.sectionType == 1 || this.menuItem.sectionType == 3) {
  509. //1视频 3回放
  510. if (!this.isBuy) {
  511. //非购买
  512. if (!this.menuItem.tryListen) {
  513. //不允许试听
  514. this.clickLock = false;
  515. return;
  516. } else {
  517. this.$store.commit("setPlaySectionId", {
  518. playSectionId: this.newId,
  519. });
  520. this.$store.commit("setPlayVID", {
  521. playVID: this.menuItem.recordingUrl,
  522. });
  523. this.menuItem.courseId = this.courseId;
  524. uni.$emit("getSection", this.menuItem);
  525. return;
  526. }
  527. }
  528. let learnNum = await this.goodsTodayStudySectionNum();
  529. let hasLearn = await this.gradeCheckGoodsStudy();
  530. if (this.sectionMaxNum > 0) {
  531. if (learnNum >= this.sectionMaxNum && !hasLearn) {
  532. uni.showToast({
  533. icon: "none",
  534. title: `每天最多学习${this.sectionMaxNum}节`,
  535. });
  536. this.clickLock = false;
  537. return;
  538. }
  539. }
  540. if (!this.menuItem.recordingUrl) {
  541. uni.showToast({
  542. title: "暂无播放地址数据",
  543. icon: "none",
  544. });
  545. this.clickLock = false;
  546. return;
  547. }
  548. /* if(this.playSectionId==this.newId){
  549. //切换为同一节
  550. return
  551. } */
  552. // 回放
  553. if (this.menuItem.sectionType == 3) {
  554. let moduleId = this.menuItem.moduleId || 0;
  555. let chapterId = this.menuItem.chapterId || 0;
  556. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  557. let uuid = new Date().valueOf() + "";
  558. // buyCourse 是否购买课程:1是 0否,type=vod是回放
  559. let encode = encodeURIComponent(
  560. this.config.hostLive +
  561. "/pages/live/index?token=" +
  562. uni.getStorageSync("token") +
  563. "&userInfo=" +
  564. JSON.stringify(this.userInfo) +
  565. "&channelId=" +
  566. this.menuItem.liveUrl +
  567. "&gradeId=" +
  568. this.gradeId +
  569. "&courseId=" +
  570. this.courseId +
  571. "&goodsId=" +
  572. this.goodsId +
  573. "&orderGoodsId=" +
  574. this.orderGoodsId +
  575. "&sectionId=" +
  576. sectionId +
  577. "&chapterId=" +
  578. chapterId +
  579. "&moduleId=" +
  580. moduleId +
  581. "&buyCourse=1" +
  582. "&ident=" +
  583. uuid +
  584. "&sectionType=3" +
  585. "&vid=" +
  586. this.menuItem.recordingUrl
  587. );
  588. uni.navigateTo({
  589. url: `../../pages/webview/index?url=` + encode,
  590. });
  591. return;
  592. }
  593. if (this.playSectionId > 0) {
  594. //切换视频
  595. let oldSectionId = this.playSectionId;
  596. uni.$emit("changeSection", oldSectionId);
  597. }
  598. // console.log('===设置播放的节IDthis.menuItem,', this.menuItem, this.playId);
  599. //设置播放的节ID
  600. this.$store.commit("setPlaySectionId", { playSectionId: this.newId });
  601. this.$store.commit("setPlayVID", {
  602. playVID: this.menuItem.recordingUrl,
  603. });
  604. this.$store.commit("updatePlayNextId", this.playId);
  605. uni.$emit("levelId", this.levelId);
  606. uni.$emit("getSection", this.menuItem);
  607. uni.$emit("isRebuild", this.isRebuild);
  608. }
  609. if (this.menuItem.sectionType == 2) {
  610. //直播
  611. if (!this.isBuy) {
  612. //非购买
  613. this.clickLock = false;
  614. return;
  615. }
  616. let learnNum = await this.goodsTodayStudySectionNum();
  617. let hasLearn = await this.gradeCheckGoodsStudy();
  618. if (this.sectionMaxNum > 0 && !this.isLive) {
  619. if (learnNum >= this.sectionMaxNum && !hasLearn) {
  620. uni.showToast({
  621. icon: "none",
  622. title: `每天最多学习${this.sectionMaxNum}节`,
  623. });
  624. this.clickLock = false;
  625. return;
  626. }
  627. }
  628. if (!this.menuItem.liveUrl) {
  629. uni.showToast({
  630. title: "暂无直播地址数据",
  631. icon: "error",
  632. });
  633. return;
  634. }
  635. let data = await this.studyRecordGetChannelBasicInfo(
  636. this.menuItem.liveUrl
  637. );
  638. let nowTime = +this.$method.timest();
  639. if (this.menuItem.liveStartTime > nowTime) {
  640. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  641. this.clickLock = false;
  642. uni.showToast({
  643. title: "直播未开始",
  644. icon: "none",
  645. });
  646. return;
  647. }
  648. } else if (
  649. this.menuItem.liveStartTime < nowTime &&
  650. this.menuItem.liveEndTime > nowTime
  651. ) {
  652. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  653. this.clickLock = false;
  654. uni.showToast({
  655. title: "暂无直播",
  656. icon: "none",
  657. });
  658. return;
  659. }
  660. } else if (this.menuItem.liveEndTime < nowTime) {
  661. if (!data) {
  662. uni.showToast({
  663. title: "直播已结束",
  664. icon: "none",
  665. });
  666. return;
  667. }
  668. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  669. this.clickLock = false;
  670. uni.showToast({
  671. title: "直播已结束",
  672. icon: "none",
  673. });
  674. return;
  675. }
  676. }
  677. let moduleId = this.menuItem.moduleId || 0;
  678. let chapterId = this.menuItem.chapterId || 0;
  679. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  680. let uuid = new Date().valueOf() + "";
  681. // buyCourse 是否购买课程:1是 0否
  682. let encode = encodeURIComponent(
  683. this.config.hostLive +
  684. "/pages/live/index?token=" +
  685. uni.getStorageSync("token") +
  686. "&userInfo=" +
  687. JSON.stringify(this.userInfo) +
  688. "&channelId=" +
  689. this.menuItem.liveUrl +
  690. "&gradeId=" +
  691. this.gradeId +
  692. "&courseId=" +
  693. this.courseId +
  694. "&goodsId=" +
  695. this.goodsId +
  696. "&orderGoodsId=" +
  697. this.orderGoodsId +
  698. "&sectionId=" +
  699. sectionId +
  700. "&chapterId=" +
  701. chapterId +
  702. "&moduleId=" +
  703. moduleId +
  704. "&buyCourse=1" +
  705. "&ident=" +
  706. uuid +
  707. "&sectionType=2"
  708. );
  709. uni.navigateTo({
  710. url: `../../pages/webview/index?url=` + encode,
  711. });
  712. return;
  713. }
  714. },
  715. },
  716. computed: {
  717. ...mapGetters([
  718. "playSectionId",
  719. "playChannelId",
  720. "playVID",
  721. "playNextId",
  722. "userInfo",
  723. "liveLast",
  724. "config",
  725. ]),
  726. },
  727. };
  728. </script>
  729. <style scoped lang="scss">
  730. .tagGreen {
  731. width: 80rpx;
  732. height: 28rpx;
  733. background: #34c759;
  734. border-radius: 8rpx;
  735. font-size: 20rpx;
  736. color: #ffffff;
  737. text-align: center;
  738. }
  739. .tagWillPlay {
  740. width: 80rpx;
  741. height: 28rpx;
  742. background: #ebf4ff;
  743. border-radius: 8rpx;
  744. font-size: 20rpx;
  745. color: #007aff;
  746. text-align: center;
  747. }
  748. .tagPlaying {
  749. width: 80rpx;
  750. height: 28rpx;
  751. background: #fff7eb;
  752. border-radius: 8rpx;
  753. font-size: 20rpx;
  754. color: #ff9500;
  755. text-align: center;
  756. }
  757. .tagPlayed {
  758. width: 80rpx;
  759. height: 28rpx;
  760. background: #eeeeee;
  761. border-radius: 8rpx;
  762. font-size: 20rpx;
  763. color: #666666;
  764. text-align: center;
  765. }
  766. .tagRe {
  767. width: 80rpx;
  768. height: 28rpx;
  769. background: #ff3b30;
  770. border-radius: 8rpx;
  771. font-size: 20rpx;
  772. color: #ffffff;
  773. text-align: center;
  774. }
  775. .tryBox {
  776. width: 103rpx;
  777. height: 48rpx;
  778. background: #fff;
  779. border-radius: 24rpx;
  780. color: #3577e8;
  781. font-size: 24rpx;
  782. line-height: 48rpx;
  783. text-align: center;
  784. border: 1rpx solid #3577e8;
  785. }
  786. .icon_up {
  787. width: 24rpx;
  788. height: 24rpx;
  789. }
  790. .t_content3 {
  791. color: #007aff;
  792. }
  793. .t_content2 {
  794. color: #007aff;
  795. }
  796. .t_content1 {
  797. color: #007aff;
  798. }
  799. .t_content {
  800. font-size: 30rpx;
  801. margin-left: 10rpx;
  802. color: #666666;
  803. flex: 1;
  804. }
  805. .tagColor3 {
  806. border: 2rpx solid #ff9500;
  807. color: #ff9500;
  808. }
  809. .tagColor2 {
  810. border: 2rpx solid #ff3b30;
  811. color: #ff3b30;
  812. }
  813. .tagColor1 {
  814. border: 2rpx solid #007aff;
  815. color: #007aff;
  816. }
  817. .color3 {
  818. color: #ff9500;
  819. }
  820. .color2 {
  821. color: #ff3b30;
  822. }
  823. .color1 {
  824. color: #007aff;
  825. }
  826. .tag {
  827. border-radius: 8rpx;
  828. font-size: 20rpx;
  829. padding: 4rpx 10rpx;
  830. }
  831. .exercises {
  832. margin-left: 10rpx;
  833. font-size: 26rpx;
  834. color: #498afe;
  835. > text {
  836. margin-right: 6rpx;
  837. }
  838. }
  839. .learnings {
  840. margin-right: 8rpx;
  841. .learning_icon {
  842. width: 40rpx;
  843. height: 40rpx;
  844. margin-right: 4rpx;
  845. }
  846. }
  847. </style>