courseSection.vue 24 KB

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