courseSection.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  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. if(this.playSectionId == this.newId){
  255. this.$store.commit("updatePlayNextId", playNextId);
  256. }
  257. uni.$off("playNext" + playNextId); //绑定前先移除之前的事件
  258. uni.$once("playNext" + playNextId, async (data) => {
  259. //到时会触发每个节的监听事件,只允许当前节的接收
  260. let self = this;
  261. if (
  262. this.nextMenuItem.recordingUrl &&
  263. this.isRebuild &&
  264. this.newId == this.playSectionId &&
  265. data.fromRebuild
  266. ) {
  267. // fromRebuild 来自重修目录的点击才弹出播放下一节
  268. //重修存在下一节
  269. uni.showModal({
  270. title: "提示",
  271. content: "是否播放下一节",
  272. success: function (res) {
  273. if (res.confirm) {
  274. let nextId =
  275. self.nextMenuItem.sectionId > 0
  276. ? self.nextMenuItem.sectionId
  277. : self.nextMenuItem.menuId;
  278. //设置播放的节ID
  279. self.$store.commit("setPlaySectionId", { playSectionId: nextId });
  280. self.$store.commit("setPlayVID", {
  281. playVID: self.nextMenuItem.recordingUrl,
  282. });
  283. let ids = self.levelId.split("-");
  284. ids[2] = nextId;
  285. uni.$emit("levelId", ids.join("-"));
  286. uni.$emit("getSection", self.nextMenuItem);
  287. self.$emit("playEnd", { isRebuild: self.isRebuild });
  288. } else {
  289. let nextId =
  290. self.nextMenuItem.sectionId > 0
  291. ? self.nextMenuItem.sectionId
  292. : self.nextMenuItem.menuId;
  293. //设置播放的节ID
  294. self.$store.commit("setPlaySectionId", { playSectionId: nextId });
  295. self.$store.commit("setPlayVID", {
  296. playVID: self.nextMenuItem.recordingUrl,
  297. });
  298. let ids = self.levelId.split("-");
  299. ids[2] = nextId;
  300. self.$emit("playEnd", { isRebuild: self.isRebuild });
  301. }
  302. },
  303. });
  304. } else {
  305. this.$emit("playEnd", { isRebuild: this.isRebuild });
  306. }
  307. });
  308. },
  309. methods: {
  310. isLast() {
  311. if (this.liveLast) {
  312. let sectionASame =
  313. this.liveLast.sectionId ==
  314. (this.menuItem.sectionId || this.menuItem.menuId);
  315. let chapterSame =
  316. this.liveLast.chapterId == (this.menuItem.chapterId || 0);
  317. let moduleSame =
  318. this.liveLast.moduleId == (this.menuItem.moduleId || 0);
  319. return sectionASame && chapterSame && moduleSame;
  320. } else {
  321. return false;
  322. }
  323. },
  324. toDoSectionExam() {
  325. if (this.testType == 3) {
  326. this.ModuleExam();
  327. } else {
  328. this.ChapterExam();
  329. }
  330. },
  331. checkTest() {
  332. let data =
  333. this.testType == 3 ? this.moduleSectionExam : this.ChapterSectionExam;
  334. let id =
  335. this.testType == 3 ? this.menuItem.menuId : this.menuItem.sectionId;
  336. if (!data) {
  337. return false;
  338. }
  339. return data.some((e) => e.sectionId == id);
  340. },
  341. ChapterExam() {
  342. this.chapterExams = this.ChapterSectionExam.find(
  343. (e) => e.sectionId == this.menuItem.sectionId
  344. );
  345. let moduleId = this.chapterExams.moduleId || 0;
  346. let chapterId = this.chapterExams.chapterId || 0;
  347. let sectionId = this.chapterExams.sectionId || this.chapterExams.menuId;
  348. uni.navigateTo({
  349. url:
  350. "/pages2/class/questionBank?courseId=" +
  351. this.courseId +
  352. "&gradeId=" +
  353. this.gradeId +
  354. "&isFromVideo=1&id=" +
  355. this.chapterExams.typeId +
  356. "&goodsid=" +
  357. this.goodsId +
  358. "&moduleId=" +
  359. moduleId +
  360. "&chapterId=" +
  361. chapterId +
  362. "&sectionId=" +
  363. sectionId +
  364. "&orderGoodsId=" +
  365. this.orderGoodsId +
  366. "&type=2",
  367. });
  368. },
  369. ModuleExam() {
  370. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  371. this.moduleExams = this.moduleSectionExam.find(
  372. (e) => e.sectionId == sectionId
  373. );
  374. let moduleId = this.moduleExams.moduleId || 0;
  375. let chapterId = this.moduleExams.chapterId || 0;
  376. uni.navigateTo({
  377. url:
  378. "/pages2/class/questionBank?courseId=" +
  379. this.courseId +
  380. "&gradeId=" +
  381. this.gradeId +
  382. "&isFromVideo=1&id=" +
  383. this.moduleExams.typeId +
  384. "&goodsid=" +
  385. this.goodsId +
  386. "&moduleId=" +
  387. moduleId +
  388. "&chapterId=" +
  389. chapterId +
  390. "&sectionId=" +
  391. sectionId +
  392. "&orderGoodsId=" +
  393. this.orderGoodsId +
  394. "&type=2",
  395. });
  396. },
  397. studyRecordMenuAllList() {
  398. return new Promise((resolve) => {
  399. this.$api
  400. .studyRecordMenuAllList({
  401. courseId: this.courseId,
  402. gradeId: this.gradeId,
  403. goodsId: this.goodsId,
  404. })
  405. .then((res) => {
  406. if (res.data.code == 200) {
  407. resolve(res.data.data);
  408. }
  409. });
  410. });
  411. },
  412. gradeCheckGoodsStudy() {
  413. return new Promise((resolve) => {
  414. this.$api
  415. .gradeCheckGoodsStudy({
  416. goodsId: this.goodsId,
  417. gradeId: this.gradeId,
  418. moduleId: this.menuItem.moduleId || 0,
  419. chapterId: this.menuItem.chapterId || 0,
  420. sectionId: this.menuItem.sectionId || this.menuItem.menuId,
  421. })
  422. .then((res) => {
  423. resolve(res.data.data);
  424. });
  425. });
  426. },
  427. goodsTodayStudySectionNum() {
  428. return new Promise((resolve) => {
  429. this.$api
  430. .goodsTodayStudySectionNum({
  431. goodsId: this.goodsId,
  432. gradeId: this.gradeId,
  433. })
  434. .then((res) => {
  435. if (res.data.code == 200) {
  436. resolve(res.data.data);
  437. }
  438. });
  439. });
  440. },
  441. getVideo() {
  442. if (this.clickLock) {
  443. return;
  444. }
  445. if (this.$method.isGoLogin()) {
  446. return;
  447. }
  448. if (this.menuItem.id == this.playSectionId) {
  449. return;
  450. }
  451. this.clickLock = true;
  452. // && !this.menuItem.isRebuild
  453. if (this.learningOrder == 2 && !this.isLive) {
  454. //要按从头到尾顺序学习, 且不是重修课程
  455. if (this.preItem) {
  456. // let rows = await this.studyRecordMenuAllList();
  457. let rows = this.menuAllList;
  458. let newRows = [];
  459. for (let i = 0; i < rows.length; i++) {
  460. let moduleTrue =
  461. rows[i].moduleId == this.menuItem.moduleId ||
  462. rows[i].moduleId == 0;
  463. let chapterTrue =
  464. rows[i].chapterId == this.menuItem.chapterId ||
  465. rows[i].chapterId == 0;
  466. let sectionTrue =
  467. rows[i].sectionId == this.menuItem.sectionId ||
  468. rows[i].sectionId == this.menuItem.menuId;
  469. if (moduleTrue && chapterTrue && sectionTrue) {
  470. break;
  471. } else {
  472. if (rows[i].sectionType != 2) {
  473. newRows.push(rows[i]);
  474. }
  475. }
  476. }
  477. let isAllLearn = newRows.every((item) => {
  478. return item.studyStatus == 1;
  479. });
  480. if (isAllLearn) {
  481. this.playVideo();
  482. } else {
  483. uni.showToast({
  484. icon: "none",
  485. title: "请按顺序学习视频课程",
  486. });
  487. }
  488. } else {
  489. //第一章第一节
  490. this.playVideo();
  491. }
  492. } else {
  493. this.playVideo();
  494. }
  495. setTimeout(() => {
  496. this.clickLock = false;
  497. }, 3000);
  498. },
  499. studyRecordGetChannelBasicInfo(channelId) {
  500. return new Promise((resolve) => {
  501. this.$api
  502. .studyRecordGetChannelBasicInfo({
  503. channelId,
  504. })
  505. .then((res) => {
  506. resolve(res.data.data);
  507. });
  508. });
  509. },
  510. async playVideo() {
  511. if (this.menuItem.sectionType == 1 || this.menuItem.sectionType == 3) {
  512. //1视频 3回放
  513. if (!this.isBuy) {
  514. //非购买
  515. if (!this.menuItem.tryListen) {
  516. //不允许试听
  517. this.clickLock = false;
  518. return;
  519. } else {
  520. this.$store.commit("setPlaySectionId", {
  521. playSectionId: this.newId,
  522. });
  523. this.$store.commit("setPlayVID", {
  524. playVID: this.menuItem.recordingUrl,
  525. });
  526. this.menuItem.courseId = this.courseId;
  527. uni.$emit("getSection", this.menuItem);
  528. return;
  529. }
  530. }
  531. let learnNum = await this.goodsTodayStudySectionNum();
  532. let hasLearn = await this.gradeCheckGoodsStudy();
  533. if (this.sectionMaxNum > 0) {
  534. if (learnNum >= this.sectionMaxNum && !hasLearn) {
  535. uni.showToast({
  536. icon: "none",
  537. title: `每天最多学习${this.sectionMaxNum}节`,
  538. });
  539. this.clickLock = false;
  540. return;
  541. }
  542. }
  543. if (!this.menuItem.recordingUrl) {
  544. uni.showToast({
  545. title: "暂无播放地址数据",
  546. icon: "none",
  547. });
  548. this.clickLock = false;
  549. return;
  550. }
  551. /* if(this.playSectionId==this.newId){
  552. //切换为同一节
  553. return
  554. } */
  555. // 回放
  556. if (this.menuItem.sectionType == 3) {
  557. let moduleId = this.menuItem.moduleId || 0;
  558. let chapterId = this.menuItem.chapterId || 0;
  559. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  560. let uuid = new Date().valueOf() + "";
  561. // buyCourse 是否购买课程:1是 0否,type=vod是回放
  562. let encode = encodeURIComponent(
  563. this.config.hostLive +
  564. "/pages/live/index?token=" +
  565. uni.getStorageSync("token") +
  566. "&userInfo=" +
  567. JSON.stringify(this.userInfo) +
  568. "&channelId=" +
  569. this.menuItem.liveUrl +
  570. "&gradeId=" +
  571. this.gradeId +
  572. "&courseId=" +
  573. this.courseId +
  574. "&goodsId=" +
  575. this.goodsId +
  576. "&orderGoodsId=" +
  577. this.orderGoodsId +
  578. "&sectionId=" +
  579. sectionId +
  580. "&chapterId=" +
  581. chapterId +
  582. "&moduleId=" +
  583. moduleId +
  584. "&buyCourse=1" +
  585. "&ident=" +
  586. uuid +
  587. "&sectionType=3" +
  588. "&vid=" +
  589. this.menuItem.recordingUrl
  590. );
  591. uni.navigateTo({
  592. url: `../../pages/webview/index?url=` + encode,
  593. });
  594. return;
  595. }
  596. if (this.playSectionId > 0) {
  597. //切换视频
  598. let oldSectionId = this.playSectionId;
  599. uni.$emit("changeSection", oldSectionId);
  600. }
  601. // console.log('===设置播放的节IDthis.menuItem,', this.menuItem, this.playId);
  602. //设置播放的节ID
  603. this.$store.commit("setPlaySectionId", { playSectionId: this.newId });
  604. this.$store.commit("setPlayVID", {
  605. playVID: this.menuItem.recordingUrl,
  606. });
  607. this.$store.commit("updatePlayNextId", this.playId);
  608. uni.$emit("levelId", this.levelId);
  609. uni.$emit("getSection", this.menuItem);
  610. uni.$emit("isRebuild", this.isRebuild);
  611. }
  612. if (this.menuItem.sectionType == 2) {
  613. //直播
  614. if (!this.isBuy) {
  615. //非购买
  616. this.clickLock = false;
  617. return;
  618. }
  619. let learnNum = await this.goodsTodayStudySectionNum();
  620. let hasLearn = await this.gradeCheckGoodsStudy();
  621. if (this.sectionMaxNum > 0 && !this.isLive) {
  622. if (learnNum >= this.sectionMaxNum && !hasLearn) {
  623. uni.showToast({
  624. icon: "none",
  625. title: `每天最多学习${this.sectionMaxNum}节`,
  626. });
  627. this.clickLock = false;
  628. return;
  629. }
  630. }
  631. if (!this.menuItem.liveUrl) {
  632. uni.showToast({
  633. title: "暂无直播地址数据",
  634. icon: "error",
  635. });
  636. return;
  637. }
  638. let data = await this.studyRecordGetChannelBasicInfo(
  639. this.menuItem.liveUrl
  640. );
  641. let nowTime = +this.$method.timest();
  642. if (this.menuItem.liveStartTime > nowTime) {
  643. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  644. this.clickLock = false;
  645. uni.showToast({
  646. title: "直播未开始",
  647. icon: "none",
  648. });
  649. return;
  650. }
  651. } else if (
  652. this.menuItem.liveStartTime < nowTime &&
  653. this.menuItem.liveEndTime > nowTime
  654. ) {
  655. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  656. this.clickLock = false;
  657. uni.showToast({
  658. title: "暂无直播",
  659. icon: "none",
  660. });
  661. return;
  662. }
  663. } else if (this.menuItem.liveEndTime < nowTime) {
  664. if (!data) {
  665. uni.showToast({
  666. title: "直播已结束",
  667. icon: "none",
  668. });
  669. return;
  670. }
  671. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  672. this.clickLock = false;
  673. uni.showToast({
  674. title: "直播已结束",
  675. icon: "none",
  676. });
  677. return;
  678. }
  679. }
  680. let moduleId = this.menuItem.moduleId || 0;
  681. let chapterId = this.menuItem.chapterId || 0;
  682. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  683. let uuid = new Date().valueOf() + "";
  684. // buyCourse 是否购买课程:1是 0否
  685. let encode = encodeURIComponent(
  686. this.config.hostLive +
  687. "/pages/live/index?token=" +
  688. uni.getStorageSync("token") +
  689. "&userInfo=" +
  690. JSON.stringify(this.userInfo) +
  691. "&channelId=" +
  692. this.menuItem.liveUrl +
  693. "&gradeId=" +
  694. this.gradeId +
  695. "&courseId=" +
  696. this.courseId +
  697. "&goodsId=" +
  698. this.goodsId +
  699. "&orderGoodsId=" +
  700. this.orderGoodsId +
  701. "&sectionId=" +
  702. sectionId +
  703. "&chapterId=" +
  704. chapterId +
  705. "&moduleId=" +
  706. moduleId +
  707. "&buyCourse=1" +
  708. "&ident=" +
  709. uuid +
  710. "&sectionType=2"
  711. );
  712. uni.navigateTo({
  713. url: `../../pages/webview/index?url=` + encode,
  714. });
  715. return;
  716. }
  717. },
  718. },
  719. computed: {
  720. ...mapGetters([
  721. "playSectionId",
  722. "playChannelId",
  723. "playVID",
  724. "playNextId",
  725. "userInfo",
  726. "liveLast",
  727. "config",
  728. ]),
  729. },
  730. };
  731. </script>
  732. <style scoped lang="scss">
  733. .tagGreen {
  734. width: 80rpx;
  735. height: 28rpx;
  736. background: #34c759;
  737. border-radius: 8rpx;
  738. font-size: 20rpx;
  739. color: #ffffff;
  740. text-align: center;
  741. }
  742. .tagWillPlay {
  743. width: 80rpx;
  744. height: 28rpx;
  745. background: #ebf4ff;
  746. border-radius: 8rpx;
  747. font-size: 20rpx;
  748. color: #007aff;
  749. text-align: center;
  750. }
  751. .tagPlaying {
  752. width: 80rpx;
  753. height: 28rpx;
  754. background: #fff7eb;
  755. border-radius: 8rpx;
  756. font-size: 20rpx;
  757. color: #ff9500;
  758. text-align: center;
  759. }
  760. .tagPlayed {
  761. width: 80rpx;
  762. height: 28rpx;
  763. background: #eeeeee;
  764. border-radius: 8rpx;
  765. font-size: 20rpx;
  766. color: #666666;
  767. text-align: center;
  768. }
  769. .tagRe {
  770. width: 80rpx;
  771. height: 28rpx;
  772. background: #ff3b30;
  773. border-radius: 8rpx;
  774. font-size: 20rpx;
  775. color: #ffffff;
  776. text-align: center;
  777. }
  778. .tryBox {
  779. width: 103rpx;
  780. height: 48rpx;
  781. background: #fff;
  782. border-radius: 24rpx;
  783. color: #3577e8;
  784. font-size: 24rpx;
  785. line-height: 48rpx;
  786. text-align: center;
  787. border: 1rpx solid #3577e8;
  788. }
  789. .icon_up {
  790. width: 24rpx;
  791. height: 24rpx;
  792. }
  793. .t_content3 {
  794. color: #007aff;
  795. }
  796. .t_content2 {
  797. color: #007aff;
  798. }
  799. .t_content1 {
  800. color: #007aff;
  801. }
  802. .t_content {
  803. font-size: 30rpx;
  804. margin-left: 10rpx;
  805. color: #666666;
  806. flex: 1;
  807. }
  808. .tagColor3 {
  809. border: 2rpx solid #ff9500;
  810. color: #ff9500;
  811. }
  812. .tagColor2 {
  813. border: 2rpx solid #ff3b30;
  814. color: #ff3b30;
  815. }
  816. .tagColor1 {
  817. border: 2rpx solid #007aff;
  818. color: #007aff;
  819. }
  820. .color3 {
  821. color: #ff9500;
  822. }
  823. .color2 {
  824. color: #ff3b30;
  825. }
  826. .color1 {
  827. color: #007aff;
  828. }
  829. .tag {
  830. border-radius: 8rpx;
  831. font-size: 20rpx;
  832. padding: 4rpx 10rpx;
  833. }
  834. .exercises {
  835. margin-left: 10rpx;
  836. font-size: 26rpx;
  837. color: #498afe;
  838. > text {
  839. margin-right: 6rpx;
  840. }
  841. }
  842. .learnings {
  843. margin-right: 8rpx;
  844. .learning_icon {
  845. width: 40rpx;
  846. height: 40rpx;
  847. margin-right: 4rpx;
  848. }
  849. }
  850. </style>