courseSection.vue 24 KB

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