courseSection.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  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. if (this.learningOrder == 2 && !this.menuItem.isRebuild && !this.isLive) {
  453. //要按从头到尾顺序学习, 且不是重修课程
  454. if (this.preItem) {
  455. // let rows = await this.studyRecordMenuAllList();
  456. let rows = this.menuAllList;
  457. let newRows = [];
  458. for (let i = 0; i < rows.length; i++) {
  459. let moduleTrue =
  460. rows[i].moduleId == this.menuItem.moduleId ||
  461. rows[i].moduleId == 0;
  462. let chapterTrue =
  463. rows[i].chapterId == this.menuItem.chapterId ||
  464. rows[i].chapterId == 0;
  465. let sectionTrue =
  466. rows[i].sectionId == this.menuItem.sectionId ||
  467. rows[i].sectionId == this.menuItem.menuId;
  468. if (moduleTrue && chapterTrue && sectionTrue) {
  469. break;
  470. } else {
  471. if (rows[i].sectionType != 2) {
  472. newRows.push(rows[i]);
  473. }
  474. }
  475. }
  476. let isAllLearn = newRows.every((item) => {
  477. return item.studyStatus == 1;
  478. });
  479. if (isAllLearn) {
  480. this.playVideo();
  481. } else {
  482. uni.showToast({
  483. icon: "none",
  484. title: "请按顺序学习视频课程",
  485. });
  486. }
  487. } else {
  488. //第一章第一节
  489. this.playVideo();
  490. }
  491. } else {
  492. this.playVideo();
  493. }
  494. setTimeout(() => {
  495. this.clickLock = false;
  496. }, 3000);
  497. },
  498. studyRecordGetChannelBasicInfo(channelId) {
  499. return new Promise((resolve) => {
  500. this.$api
  501. .studyRecordGetChannelBasicInfo({
  502. channelId,
  503. })
  504. .then((res) => {
  505. resolve(res.data.data);
  506. });
  507. });
  508. },
  509. async playVideo() {
  510. if (this.menuItem.sectionType == 1 || this.menuItem.sectionType == 3) {
  511. //1视频 3回放
  512. if (!this.isBuy) {
  513. //非购买
  514. if (!this.menuItem.tryListen) {
  515. //不允许试听
  516. this.clickLock = false;
  517. return;
  518. } else {
  519. this.$store.commit("setPlaySectionId", {
  520. playSectionId: this.newId,
  521. });
  522. this.$store.commit("setPlayVID", {
  523. playVID: this.menuItem.recordingUrl,
  524. });
  525. this.menuItem.courseId = this.courseId;
  526. uni.$emit("getSection", this.menuItem);
  527. return;
  528. }
  529. }
  530. let learnNum = await this.goodsTodayStudySectionNum();
  531. let hasLearn = await this.gradeCheckGoodsStudy();
  532. if (this.sectionMaxNum > 0) {
  533. if (learnNum >= this.sectionMaxNum && !hasLearn) {
  534. uni.showToast({
  535. icon: "none",
  536. title: `每天最多学习${this.sectionMaxNum}节`,
  537. });
  538. this.clickLock = false;
  539. return;
  540. }
  541. }
  542. if (!this.menuItem.recordingUrl) {
  543. uni.showToast({
  544. title: "暂无播放地址数据",
  545. icon: "none",
  546. });
  547. this.clickLock = false;
  548. return;
  549. }
  550. /* if(this.playSectionId==this.newId){
  551. //切换为同一节
  552. return
  553. } */
  554. // 回放
  555. if (this.menuItem.sectionType == 3) {
  556. let moduleId = this.menuItem.moduleId || 0;
  557. let chapterId = this.menuItem.chapterId || 0;
  558. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  559. let uuid = new Date().valueOf() + "";
  560. // buyCourse 是否购买课程:1是 0否,type=vod是回放
  561. let encode = encodeURIComponent(
  562. this.config.hostLive +
  563. "/pages/live/index?token=" +
  564. uni.getStorageSync("token") +
  565. "&userInfo=" +
  566. JSON.stringify(this.userInfo) +
  567. "&channelId=" +
  568. this.menuItem.liveUrl +
  569. "&gradeId=" +
  570. this.gradeId +
  571. "&courseId=" +
  572. this.courseId +
  573. "&goodsId=" +
  574. this.goodsId +
  575. "&orderGoodsId=" +
  576. this.orderGoodsId +
  577. "&sectionId=" +
  578. sectionId +
  579. "&chapterId=" +
  580. chapterId +
  581. "&moduleId=" +
  582. moduleId +
  583. "&buyCourse=1" +
  584. "&ident=" +
  585. uuid +
  586. "&sectionType=3" +
  587. "&vid=" +
  588. this.menuItem.recordingUrl
  589. );
  590. uni.navigateTo({
  591. url: `../../pages/webview/index?url=` + encode,
  592. });
  593. return;
  594. }
  595. if (this.playSectionId > 0) {
  596. //切换视频
  597. let oldSectionId = this.playSectionId;
  598. uni.$emit("changeSection", oldSectionId);
  599. }
  600. // console.log('===设置播放的节IDthis.menuItem,', this.menuItem, this.playId);
  601. //设置播放的节ID
  602. this.$store.commit("setPlaySectionId", { playSectionId: this.newId });
  603. this.$store.commit("setPlayVID", {
  604. playVID: this.menuItem.recordingUrl,
  605. });
  606. this.$store.commit("updatePlayNextId", this.playId);
  607. uni.$emit("levelId", this.levelId);
  608. uni.$emit("getSection", this.menuItem);
  609. uni.$emit("isRebuild", this.isRebuild);
  610. }
  611. if (this.menuItem.sectionType == 2) {
  612. //直播
  613. if (!this.isBuy) {
  614. //非购买
  615. this.clickLock = false;
  616. return;
  617. }
  618. let learnNum = await this.goodsTodayStudySectionNum();
  619. let hasLearn = await this.gradeCheckGoodsStudy();
  620. if (this.sectionMaxNum > 0 && !this.isLive) {
  621. if (learnNum >= this.sectionMaxNum && !hasLearn) {
  622. uni.showToast({
  623. icon: "none",
  624. title: `每天最多学习${this.sectionMaxNum}节`,
  625. });
  626. this.clickLock = false;
  627. return;
  628. }
  629. }
  630. if (!this.menuItem.liveUrl) {
  631. uni.showToast({
  632. title: "暂无直播地址数据",
  633. icon: "error",
  634. });
  635. return;
  636. }
  637. let data = await this.studyRecordGetChannelBasicInfo(
  638. this.menuItem.liveUrl
  639. );
  640. let nowTime = +this.$method.timest();
  641. if (this.menuItem.liveStartTime > nowTime) {
  642. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  643. this.clickLock = false;
  644. uni.showToast({
  645. title: "直播未开始",
  646. icon: "none",
  647. });
  648. return;
  649. }
  650. } else if (
  651. this.menuItem.liveStartTime < nowTime &&
  652. this.menuItem.liveEndTime > nowTime
  653. ) {
  654. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  655. this.clickLock = false;
  656. uni.showToast({
  657. title: "暂无直播",
  658. icon: "none",
  659. });
  660. return;
  661. }
  662. } else if (this.menuItem.liveEndTime < nowTime) {
  663. if (!data) {
  664. uni.showToast({
  665. title: "直播已结束",
  666. icon: "none",
  667. });
  668. return;
  669. }
  670. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  671. this.clickLock = false;
  672. uni.showToast({
  673. title: "直播已结束",
  674. icon: "none",
  675. });
  676. return;
  677. }
  678. }
  679. let moduleId = this.menuItem.moduleId || 0;
  680. let chapterId = this.menuItem.chapterId || 0;
  681. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  682. let uuid = new Date().valueOf() + "";
  683. // buyCourse 是否购买课程:1是 0否
  684. let encode = encodeURIComponent(
  685. this.config.hostLive +
  686. "/pages/live/index?token=" +
  687. uni.getStorageSync("token") +
  688. "&userInfo=" +
  689. JSON.stringify(this.userInfo) +
  690. "&channelId=" +
  691. this.menuItem.liveUrl +
  692. "&gradeId=" +
  693. this.gradeId +
  694. "&courseId=" +
  695. this.courseId +
  696. "&goodsId=" +
  697. this.goodsId +
  698. "&orderGoodsId=" +
  699. this.orderGoodsId +
  700. "&sectionId=" +
  701. sectionId +
  702. "&chapterId=" +
  703. chapterId +
  704. "&moduleId=" +
  705. moduleId +
  706. "&buyCourse=1" +
  707. "&ident=" +
  708. uuid +
  709. "&sectionType=2"
  710. );
  711. uni.navigateTo({
  712. url: `../../pages/webview/index?url=` + encode,
  713. });
  714. return;
  715. }
  716. },
  717. },
  718. computed: {
  719. ...mapGetters([
  720. "playSectionId",
  721. "playChannelId",
  722. "playVID",
  723. "playNextId",
  724. "userInfo",
  725. "liveLast",
  726. "config",
  727. ]),
  728. },
  729. };
  730. </script>
  731. <style scoped lang="scss">
  732. .tagGreen {
  733. width: 80rpx;
  734. height: 28rpx;
  735. background: #34c759;
  736. border-radius: 8rpx;
  737. font-size: 20rpx;
  738. color: #ffffff;
  739. text-align: center;
  740. }
  741. .tagWillPlay {
  742. width: 80rpx;
  743. height: 28rpx;
  744. background: #ebf4ff;
  745. border-radius: 8rpx;
  746. font-size: 20rpx;
  747. color: #007aff;
  748. text-align: center;
  749. }
  750. .tagPlaying {
  751. width: 80rpx;
  752. height: 28rpx;
  753. background: #fff7eb;
  754. border-radius: 8rpx;
  755. font-size: 20rpx;
  756. color: #ff9500;
  757. text-align: center;
  758. }
  759. .tagPlayed {
  760. width: 80rpx;
  761. height: 28rpx;
  762. background: #eeeeee;
  763. border-radius: 8rpx;
  764. font-size: 20rpx;
  765. color: #666666;
  766. text-align: center;
  767. }
  768. .tagRe {
  769. width: 80rpx;
  770. height: 28rpx;
  771. background: #ff3b30;
  772. border-radius: 8rpx;
  773. font-size: 20rpx;
  774. color: #ffffff;
  775. text-align: center;
  776. }
  777. .tryBox {
  778. width: 103rpx;
  779. height: 48rpx;
  780. background: #fff;
  781. border-radius: 24rpx;
  782. color: #3577e8;
  783. font-size: 24rpx;
  784. line-height: 48rpx;
  785. text-align: center;
  786. border: 1rpx solid #3577e8;
  787. }
  788. .icon_up {
  789. width: 24rpx;
  790. height: 24rpx;
  791. }
  792. .t_content3 {
  793. color: #007aff;
  794. }
  795. .t_content2 {
  796. color: #007aff;
  797. }
  798. .t_content1 {
  799. color: #007aff;
  800. }
  801. .t_content {
  802. font-size: 30rpx;
  803. margin-left: 10rpx;
  804. color: #666666;
  805. flex: 1;
  806. }
  807. .tagColor3 {
  808. border: 2rpx solid #ff9500;
  809. color: #ff9500;
  810. }
  811. .tagColor2 {
  812. border: 2rpx solid #ff3b30;
  813. color: #ff3b30;
  814. }
  815. .tagColor1 {
  816. border: 2rpx solid #007aff;
  817. color: #007aff;
  818. }
  819. .color3 {
  820. color: #ff9500;
  821. }
  822. .color2 {
  823. color: #ff3b30;
  824. }
  825. .color1 {
  826. color: #007aff;
  827. }
  828. .tag {
  829. border-radius: 8rpx;
  830. font-size: 20rpx;
  831. padding: 4rpx 10rpx;
  832. }
  833. .exercises {
  834. margin-left: 10rpx;
  835. font-size: 26rpx;
  836. color: #498afe;
  837. > text {
  838. margin-right: 6rpx;
  839. }
  840. }
  841. .learnings {
  842. margin-right: 8rpx;
  843. .learning_icon {
  844. width: 40rpx;
  845. height: 40rpx;
  846. margin-right: 4rpx;
  847. }
  848. }
  849. </style>