detail.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576
  1. <template>
  2. <view>
  3. <nav-bar title="课程详情"></nav-bar>
  4. <view class="videoBox">
  5. <!-- <view > -->
  6. <view class="video_box" v-if="!startStatus">
  7. <image
  8. :src="$method.splitImgHost(detail.coverUrl)"
  9. style="width: 100%; height: 450rpx"
  10. ></image>
  11. <image
  12. v-if="false"
  13. class="video_play"
  14. src="/static/play.png"
  15. @click="startVideo"
  16. ></image>
  17. </view>
  18. <view v-else class="video_box" style="width: 100%; height: 450rpx">
  19. <!-- #ifdef MP-WEIXIN -->
  20. <polyv-player
  21. id="playerVideo"
  22. playerId="playerVideo"
  23. height="450rpx"
  24. :vid="vid"
  25. :showSettingBtn="true"
  26. :enablePlayGesture="true"
  27. :playbackRate="playbackRate"
  28. :isAllowSeek="isAllowSeek"
  29. :autoplay="autoplay"
  30. :startTime="startTime"
  31. @statechange="onStateChange"
  32. ></polyv-player>
  33. <!-- #endif -->
  34. <!-- #ifdef H5 -->
  35. <view v-show="vid" id="player"></view>
  36. <!-- #endif -->
  37. </view>
  38. <view class="cou_title">
  39. <view class="title_name">
  40. <!-- <view class="yearTag" v-if="detail.year">{{detail.year}}</view> -->
  41. <view class="titleTag">{{ detail.goodsName }}</view>
  42. </view>
  43. <view
  44. style="
  45. display: flex;
  46. justify-content: space-between;
  47. margin-top: 13rpx;
  48. "
  49. >
  50. <view class="prices">
  51. <!-- <text v-if="detail.standPrice" class="price_word">¥ {{ detail.standPrice }}</text>
  52. <text v-else class="price_word free">免费</text> -->
  53. <view
  54. class="price_word"
  55. v-if="
  56. !detail.specTemplateId || (!detail.maxPrice && !detail.minPrice)
  57. "
  58. >
  59. {{ detail.standPrice === 0 ? "免费" : `¥${detail.standPrice}` }}
  60. </view>
  61. <!-- 范围价格 -->
  62. <view v-else class="price_word">
  63. <view>{{ detail.minPrice }}</view>
  64. <template v-if="detail.minPrice != detail.maxPrice">
  65. <text>-</text>
  66. <view>{{ detail.maxPrice }}</view>
  67. </template>
  68. </view>
  69. <text v-if="detail.linePrice" class="sale"> ¥ </text>
  70. <text v-if="detail.linePrice" class="price_line">
  71. {{ detail.linePrice }}</text
  72. >
  73. </view>
  74. <view class="noteTag">
  75. <text class="blackFont"
  76. >{{ courseList.length }} 课程 {{ detail.classHours || "-" }}</text
  77. >
  78. 学时
  79. </view>
  80. </view>
  81. </view>
  82. <!-- </view> -->
  83. </view>
  84. <view class="contents">
  85. <!-- <u-line color="#D6D6DB" /> -->
  86. <!-- <view style="height: 80rpx;">
  87. <view><u-tabs :list="list" :item-width="itemWidth()" font-size="30" bar-width="24" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
  88. </view> -->
  89. <view class="tabs">
  90. <view
  91. v-for="(item, index) in list"
  92. :key="index"
  93. class="tab_item"
  94. :class="[
  95. list.length == 2 ? 'twoBtn' : list.length == 3 ? 'threeBtn' : '',
  96. { nactive: current == index },
  97. ]"
  98. @click="change(index)"
  99. >{{ item.name }}</view
  100. >
  101. </view>
  102. <view
  103. style="padding: 20rpx; padding-bottom: 100rpx; position: relative"
  104. v-show="current == 0"
  105. >
  106. <view class="content">
  107. <view
  108. v-html="detail.mobileDetailHtml"
  109. style="width: 100%; overflow: hidden"
  110. ></view>
  111. </view>
  112. </view>
  113. <view
  114. style="padding: 20rpx; padding-bottom: 100rpx; position: relative"
  115. v-show="current == 1"
  116. >
  117. <!-- <view v-for="(item, index) in courseItem.courseList" :key="index" > -->
  118. <!-- 视频课 -->
  119. <template v-if="goodsType == 1">
  120. <view v-for="(courseItem, gTindex) in goodsTeacher" :key="gTindex">
  121. <view v-for="(item, index) in courseItem.courseList" :key="index">
  122. <view class="courseItemBox" v-if="item.show && item.show == 1">
  123. <view class="courseItem" @click="openCourse(item)">
  124. <view class="courseName">{{ item.courseName }}</view>
  125. <view>
  126. <image
  127. src="/static/icon/up.png"
  128. class="icon_up"
  129. v-if="item.down"
  130. ></image>
  131. <image
  132. src="/static/icon/down.png"
  133. class="icon_up"
  134. v-if="!item.down"
  135. ></image>
  136. </view>
  137. </view>
  138. <view
  139. v-if="courseItem.teaList && courseItem.teaList.length > 0"
  140. class="teacher_names"
  141. >
  142. <view
  143. v-for="(tea, tindex) in courseItem.teaList"
  144. :key="tindex"
  145. class="names"
  146. :class="[States[gTindex] == tindex ? 'nactive' : '']"
  147. @click.stop="switchTeacher(tea, tindex, gTindex)"
  148. >
  149. <view>{{ tea.aliasName }}</view>
  150. </view>
  151. </view>
  152. <view v-show="!item.down">
  153. <view v-for="(itemM, indexM) in item.menuList" :key="indexM">
  154. <courseModule
  155. :courseId="itemM.courseId"
  156. :needOpen="
  157. isFirstEnter &&
  158. menuIndex[0] === index &&
  159. menuIndex[1] === indexM
  160. ? true
  161. : false
  162. "
  163. v-if="itemM.type == 1"
  164. :menuItem="itemM"
  165. ></courseModule>
  166. <courseChapter
  167. :courseId="itemM.courseId"
  168. :needOpen="
  169. isFirstEnter &&
  170. menuIndex[0] === index &&
  171. menuIndex[1] === indexM
  172. ? true
  173. : false
  174. "
  175. v-if="itemM.type == 2"
  176. :isBuy="false"
  177. :menuItem="itemM"
  178. ></courseChapter>
  179. <courseSection
  180. :courseId="itemM.courseId"
  181. v-if="itemM.type == 3"
  182. :isBuy="false"
  183. :menuItem="itemM"
  184. ></courseSection>
  185. <u-line></u-line>
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </template>
  192. <!-- 直播课 -->
  193. <template v-else>
  194. <view v-for="(item, index) in courseList" :key="index">
  195. <view class="courseItemBox">
  196. <view class="courseItem" @click="openCourse(item)">
  197. <view class="courseName">{{ item.courseName }}</view>
  198. <view>
  199. <image
  200. src="/static/icon/up.png"
  201. class="icon_up"
  202. v-if="item.down"
  203. ></image>
  204. <image
  205. src="/static/icon/down.png"
  206. class="icon_up"
  207. v-if="!item.down"
  208. ></image>
  209. </view>
  210. </view>
  211. <view v-show="!item.down">
  212. <view v-for="(itemM, indexM) in item.menuList" :key="indexM">
  213. <courseModule
  214. :courseId="itemM.courseId"
  215. :needOpen="
  216. isFirstEnter &&
  217. menuIndex[0] === index &&
  218. menuIndex[1] === indexM
  219. ? true
  220. : false
  221. "
  222. v-if="itemM.type == 1"
  223. :menuItem="itemM"
  224. ></courseModule>
  225. <courseChapter
  226. :courseId="itemM.courseId"
  227. :needOpen="
  228. isFirstEnter &&
  229. menuIndex[0] === index &&
  230. menuIndex[1] === indexM
  231. ? true
  232. : false
  233. "
  234. v-if="itemM.type == 2"
  235. :isBuy="false"
  236. :menuItem="itemM"
  237. ></courseChapter>
  238. <courseSection
  239. :courseId="itemM.courseId"
  240. v-if="itemM.type == 3"
  241. :isBuy="false"
  242. :menuItem="itemM"
  243. ></courseSection>
  244. <u-line></u-line>
  245. </view>
  246. </view>
  247. </view>
  248. </view>
  249. </template>
  250. </view>
  251. <view
  252. style="padding: 20rpx; padding-bottom: 100rpx; position: relative"
  253. v-show="current == 2"
  254. >
  255. <!-- <view > -->
  256. <view v-for="(item, index) in freeMenuList" :key="index">
  257. <view class="courseItemBox">
  258. <view class="courseItem">
  259. <view class="courseName">{{ item.freeExamName }}</view>
  260. </view>
  261. </view>
  262. </view>
  263. <!-- </view> -->
  264. </view>
  265. </view>
  266. <view class="bottomBox" v-if="!hideBuyState">
  267. <template v-if="!options.isAct">
  268. <view class="icons">
  269. <view class="icon_item ones">
  270. <image src="/static/index/share.png" class="share"></image>
  271. <button type="default" open-type="share" class="bt_share"></button>
  272. <view class="share_w">分享</view>
  273. </view>
  274. <view class="icon_item">
  275. <image
  276. src="/static/index/shopcar.png"
  277. class="shopcar"
  278. @click="toShopcar()"
  279. ></image>
  280. <view class="share_w">购物车</view>
  281. </view>
  282. </view>
  283. <view style="display: flex; color: #ffffff; align-items: center">
  284. <view class="btn1" @click="addCart()">加购物车</view>
  285. <view class="btn2" @click="buy()">立即购买 </view>
  286. </view>
  287. </template>
  288. <template v-else>
  289. <view
  290. class="btn2"
  291. style="color: #ffffff; position: absolute; right: 24rpx"
  292. @click="drawBuy()"
  293. >立即领取
  294. </view>
  295. </template>
  296. </view>
  297. <!-- 已购买过课程的弹窗 -->
  298. <u-popup v-model="bugCourseModel" mode="center" border-radius="40">
  299. <view class="had_bugCourse">
  300. <image src="/pages3/static/imgs/hadBug.png" class="share"></image>
  301. <view class="tips">
  302. <view class="warns">温馨提示</view>
  303. <view class="words">您<text>已购买过</text>该商品课程</view>
  304. <view class="words">可立即前往学习</view>
  305. </view>
  306. <view class="tip_botton">
  307. <view class="cancel_btn" @click="changeKown()">知道了</view>
  308. <view class="confirm_btn" @click="toStudy()">去学习</view>
  309. </view>
  310. </view>
  311. </u-popup>
  312. <!-- 选择规格弹窗 -->
  313. <u-popup v-model="toggleSkuShow" mode="bottom" border-radius="40">
  314. <view class="popup_box">
  315. <view class="check_head">
  316. <view class="headers">
  317. <view class="grade">选择规格</view>
  318. <u-icon
  319. name="close"
  320. color="#9C9C9C"
  321. size="40"
  322. @click="closePop()"
  323. ></u-icon>
  324. </view>
  325. </view>
  326. <view class="check_con">
  327. <scroll-view scroll-y="true" style="height: 600rpx">
  328. <view
  329. v-for="(item, index) in specList"
  330. :key="index"
  331. class="check_items"
  332. >
  333. <view class="grades">{{ item.name }}</view>
  334. <view
  335. class="grade_names"
  336. v-if="index == 0 && specList.length > 1"
  337. >
  338. <view
  339. class="course_items"
  340. v-for="(child, c_index) in item.specAttrList"
  341. :key="c_index"
  342. :class="{ nactive: selectGoodIndex == c_index }"
  343. @click="selectGoodType(c_index)"
  344. >
  345. {{ child.name }}
  346. </view>
  347. </view>
  348. <view v-if="index == 1 || specList.length == 1" class="check_box">
  349. <u-checkbox-group>
  350. <view
  351. v-for="spec in item.specAttrList"
  352. :key="spec.specAttributeId"
  353. >
  354. <view
  355. class="check_box_item"
  356. v-if="spec.goodsId"
  357. :class="spec.check ? 'selected' : ''"
  358. >
  359. <u-checkbox
  360. @change="checkboxChange"
  361. v-model="spec.check"
  362. :name="spec.specAttributeId"
  363. >
  364. <view class="price_box">
  365. <view class="check_box_item_titme">{{
  366. spec.name
  367. }}</view>
  368. <view class="price">¥{{ spec.standPrice }}</view>
  369. </view>
  370. </u-checkbox>
  371. </view>
  372. </view>
  373. </u-checkbox-group>
  374. </view>
  375. </view>
  376. </scroll-view>
  377. </view>
  378. <view class="confirm_btns">
  379. <view class="allprice">
  380. <view>
  381. 总价:<text>¥</text><text>{{ allPrice }}</text>
  382. </view>
  383. <text>已选择{{ goodsIds.length }}个商品</text>
  384. </view>
  385. <view class="btns">
  386. <view v-if="!goodsIds.length" class="right_now r_disable">{{
  387. isCarOrBuy == 2 ? "立即购买" : "加入购物车"
  388. }}</view>
  389. <view v-else class="right_now" @click="rightNowBuy()"
  390. >{{ isCarOrBuy == 2 ? "立即购买" : "加入购物车" }}
  391. </view>
  392. </view>
  393. </view>
  394. </view>
  395. </u-popup>
  396. </view>
  397. </template>
  398. <script>
  399. import courseModule from "@/components/course/courseModule.vue";
  400. import courseChapter from "@/components/course/courseChapter.vue";
  401. import courseSection from "@/components/course/courseSection.vue";
  402. import { mapGetters, mapMutations } from "vuex";
  403. export default {
  404. components: {
  405. courseModule,
  406. courseChapter,
  407. courseSection,
  408. },
  409. data() {
  410. return {
  411. id: 0,
  412. list: [],
  413. menuIndex: [],
  414. current: 0,
  415. detail: {},
  416. courseList: [],
  417. menuList: [],
  418. freeMenuList: [],
  419. startStatus: false,
  420. playbackRate: [1.0],
  421. isAllowSeek: "no",
  422. vid: "",
  423. autoplay: true,
  424. listenConfigList: [],
  425. listenSecond: 0,
  426. isFirstEnter: true, //是否首次进入
  427. timer: null,
  428. businessData: {},
  429. startTime: 0,
  430. bugCourseModel: false, // 弹窗
  431. hadBuyCourse: {}, // 已购买课程信息
  432. goodsTeacher: [],
  433. teaIndex: 0,
  434. States: { 0: 0 },
  435. goodsType: 1, // 1视频2题库 3补考 4前培 6直播
  436. toggleSkuShow: false,
  437. skuItem: {},
  438. isCarOrBuy: 1, // 1加入购物车 2立即购买
  439. specList: [], // 规格列表
  440. checkedAttrs: [],
  441. selectGoodIndex: 0,
  442. specAttrPriceList: [],
  443. options: {},
  444. };
  445. },
  446. computed: {
  447. ...mapGetters([
  448. "userInfo",
  449. "goodsAuditionConfigIdList",
  450. "playSectionId",
  451. "hideBuyState",
  452. ]),
  453. allPrice() {
  454. if (!this.specList.length) return 0;
  455. let allPrice = this.specList.slice(-1)[0].specAttrList.reduce((a, b) => {
  456. if (b.check) {
  457. return a + b.standPrice;
  458. }
  459. return a;
  460. }, 0);
  461. return this.toFixed(allPrice);
  462. },
  463. goodsIds() {
  464. if (!this.specList.length) return [];
  465. return this.specList
  466. .slice(-1)[0]
  467. .specAttrList.filter((e) => e.check)
  468. .map((e) => e.goodsId);
  469. },
  470. isSingleChoice() {
  471. if (!this.specAttrPriceList.length) {
  472. return false;
  473. }
  474. return this.specAttrPriceList[0].specialGoods;
  475. },
  476. },
  477. onLoad(option) {
  478. if (option.scene) {
  479. // scene 生成二维码扫码进来的
  480. let optObj = {};
  481. let arrs = decodeURIComponent(option.scene).split("&");
  482. for (let i = 0; i < arrs.length; i++) {
  483. optObj[arrs[i].split("=")[0]] = arrs[i].split("=")[1];
  484. }
  485. this.id = optObj.id;
  486. this.goodsType = optObj.goodsType || optObj.gt;
  487. console.log("optObj.sc:", optObj);
  488. uni.setStorageSync("newUser_sc", optObj.sc);
  489. uni.setStorageSync("shareActivityCode", optObj.sac);
  490. if (optObj.sac && this.$method.isLogin()) {
  491. this.editShareActivityCode();
  492. }
  493. } else {
  494. // 小程序正常跳转的
  495. // this.id => goodsId
  496. this.id = option.id;
  497. this.goodsType = option.goodsType || option.gt;
  498. this.options = option;
  499. if (option.sac) {
  500. uni.setStorageSync("shareActivityCode", option.sac);
  501. if (this.$method.isLogin()) {
  502. //已登录
  503. this.editShareActivityCode();
  504. this.getIsBuy(); // 判断是否已经购买过该课程
  505. }
  506. }
  507. }
  508. this.getDetail();
  509. this.goodsCourseList();
  510. this.appCommonGoodsCourseModuleFreeExamList();
  511. // #ifdef MP-WEIXIN
  512. wx.showShareMenu({
  513. withShareTicket: true,
  514. menus: ["shareAppMessage", "shareTimeline"],
  515. });
  516. // #endif
  517. },
  518. onUnload(option) {
  519. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  520. //移除所有的事件监听器
  521. uni.$off();
  522. },
  523. // 分享到朋友圈
  524. onShareTimeline() {
  525. return {
  526. title: this.detail.goodsName,
  527. query: "id=" + this.id,
  528. imageUrl: this.$method.splitImgHost(this.detail.coverUrl),
  529. };
  530. },
  531. // 分享给朋友
  532. onShareAppMessage() {
  533. return {
  534. title: this.detail.goodsName,
  535. path:
  536. `/pages3/course/detail?id=` + this.id + "&goodsType=" + this.goodsType,
  537. imageUrl: this.$method.splitImgHost(this.detail.coverUrl),
  538. };
  539. },
  540. mounted() {
  541. let self = this;
  542. uni.$on("getSection", (item) => {
  543. //播放试听
  544. self.listenSecond = 0;
  545. for (var itemChild of self.listenConfigList) {
  546. if (
  547. self.playSectionId == (itemChild.sectionId || itemChild.menuId) &&
  548. item.courseId == itemChild.courseId
  549. ) {
  550. if (itemChild.auditionMinute > 0) {
  551. // self.listenSecond = itemChild.auditionMinute *60 //试听秒数
  552. self.listenSecond = itemChild.auditionMinute; //试听秒数 auditionMinute调整为秒单位
  553. }
  554. }
  555. }
  556. if (self.listenSecond > 0) {
  557. if (self.timer) {
  558. clearInterval(self.timer);
  559. }
  560. if (item.recordingUrl) {
  561. self.vid = item.recordingUrl;
  562. if (this.player) {
  563. this.player.changeVid(this.vid);
  564. return;
  565. }
  566. //切换视频
  567. // #ifdef H5
  568. this.loadPlayerScript(this.loadPlayer);
  569. // #endif
  570. // #ifdef MP-WEIXIN
  571. this.player = self.selectComponent("#player");
  572. // #endif
  573. } else {
  574. self.$u.toast("地址错误,无法播放");
  575. }
  576. self.startStatus = true;
  577. self.startTime = 0;
  578. } else {
  579. self.$u.toast("试听配置错误");
  580. }
  581. });
  582. this.updateChapterOpen(true);
  583. },
  584. methods: {
  585. ...mapMutations(["updateChapterOpen"]),
  586. itemWidth() {
  587. return 100 / this.list.length + "%";
  588. },
  589. // 修改用户活动邀请码
  590. editShareActivityCode() {
  591. goodsIds;
  592. console.log("修改用户活动邀请码");
  593. this.$http({
  594. url: "/app/user/edit/shareActivityCode",
  595. method: "post",
  596. data: {
  597. shareActivityCode: uni.getStorageSync("shareActivityCode"),
  598. },
  599. }).then((res) => {
  600. if (res.data.code == 200) {
  601. }
  602. });
  603. },
  604. appCommonGoodsCourseModuleFreeExamList() {
  605. // url: '/app/common/goods/course/moduleFreeExamList/'+data,
  606. this.$api.appCommonGoodsCourseModuleFreeExamList(this.id).then((res) => {
  607. if (res.data.data.length) {
  608. this.freeMenuList = res.data.data;
  609. this.list = [
  610. {
  611. name: "课程介绍",
  612. },
  613. {
  614. name: "课程目录",
  615. },
  616. {
  617. name: "赠送",
  618. },
  619. ];
  620. } else {
  621. this.list = [
  622. {
  623. name: "课程介绍",
  624. },
  625. {
  626. name: "课程目录",
  627. },
  628. ];
  629. }
  630. console.log(this.list);
  631. });
  632. },
  633. selectGoodType(index) {
  634. if (index == this.selectGoodIndex) {
  635. return;
  636. }
  637. this.selectGoodIndex = index;
  638. this.changeData();
  639. },
  640. select(val) {
  641. val.check = !val.check;
  642. console.log(val, 6666);
  643. },
  644. checkboxChange(val) {
  645. if (!this.isSingleChoice) return;
  646. this.specList.slice(-1)[0].specAttrList.forEach((ele) => {
  647. if (val.name != ele.specAttributeId) {
  648. ele.check = false;
  649. }
  650. });
  651. },
  652. courseBusiness() {
  653. // url: '/app/common/course/business/'+data,
  654. this.$api.courseBusiness(this.detail.businessId).then((res) => {
  655. this.businessData = res.data.data;
  656. });
  657. },
  658. toFixed(number) {
  659. if (number > 0) {
  660. return number.toFixed(2);
  661. } else {
  662. return "0.00";
  663. }
  664. },
  665. onStateChange(newstate, oldstate) {
  666. if (newstate.detail.newstate == "playing") {
  667. //开始播放
  668. if (this.timer) {
  669. clearInterval(this.timer);
  670. }
  671. this.timer = setInterval(this.timeEvent, 1500); //定时器
  672. }
  673. },
  674. closePlay() {
  675. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  676. this.vid = "";
  677. this.startStatus = false;
  678. },
  679. timeEvent() {
  680. let self = this;
  681. var polyvPlayerContext = this.selectComponent("#playerVideo");
  682. if (polyvPlayerContext != null) {
  683. let PlayCurrentTime = polyvPlayerContext.getCurrentTime();
  684. if (PlayCurrentTime >= this.listenSecond) {
  685. polyvPlayerContext.stop();
  686. polyvPlayerContext.exitFullScreen();
  687. clearInterval(this.timer);
  688. this.timer = null;
  689. uni.showModal({
  690. title: "提示",
  691. content: "试听结束,购买课程可学习全部",
  692. showCancel: false,
  693. success: function (resst) {
  694. self.closePlay();
  695. },
  696. });
  697. }
  698. }
  699. },
  700. openCourse(item) {
  701. item.down = !item.down;
  702. if (!item.down && item.menuList.length == 0) {
  703. this.getMenuList(item);
  704. }
  705. },
  706. addShopCart(goodsIds) {
  707. if (!Array.isArray(goodsIds)) {
  708. goodsIds = [goodsIds];
  709. }
  710. this.$api.addCart({ goodsIds: goodsIds }).then((res) => {
  711. if (res.data.code == 200) {
  712. uni.setStorageSync("updateCart", 1); //提醒刷新购物车
  713. uni.showToast({
  714. title: "添加成功",
  715. });
  716. } else {
  717. this.$u.toast(res.data.msg);
  718. }
  719. });
  720. },
  721. goodsCourseList() {
  722. // url: '/app/common/goods/course/list/'+ data,
  723. this.$api.goodsCourseList(this.id).then((res) => {
  724. if (res.data.code == 200) {
  725. for (let i = 0; i < res.data.rows.length; i++) {
  726. let item = res.data.rows[i];
  727. item.down = true;
  728. item.menuList = [];
  729. }
  730. this.courseList = res.data.rows;
  731. this.getFirstCourse();
  732. // 不同
  733. if (this.goodsType == 1) {
  734. this.getCourseTeacher(res.data.rows);
  735. }
  736. }
  737. });
  738. },
  739. /**
  740. * 获取第一个有模块或者章的课程
  741. */
  742. async getFirstCourse() {
  743. for (let i = 0; i < this.courseList.length; i++) {
  744. let menuIndexOrFalse = await this.getCourseMenus(this.courseList[i]);
  745. if (menuIndexOrFalse !== false) {
  746. this.menuIndex = [i, menuIndexOrFalse];
  747. this.openCourse(this.courseList[i]);
  748. break;
  749. }
  750. }
  751. },
  752. getCourseMenus(item) {
  753. return new Promise((resolve) => {
  754. // url: '/app/common/course/menuList',
  755. this.$api.menuList({ courseId: item.courseId }).then((res) => {
  756. if (res.data.code == 200) {
  757. for (let i = 0; i < res.data.rows.length; i++) {
  758. if (res.data.rows[i].type == 1 || res.data.rows[i].type == 2) {
  759. resolve(i);
  760. break;
  761. }
  762. }
  763. }
  764. });
  765. });
  766. },
  767. getCourseTeacher(rows) {
  768. //获取商品双师资模板
  769. this.$api
  770. .getGoodsCourseTeacher({
  771. goodsId: this.id,
  772. })
  773. .then((res1) => {
  774. // console.log(res1,'res1');
  775. if (res1.data.data && res1.data.data.length > 0) {
  776. //课程老师模板
  777. let teacherTel = res1.data.data;
  778. //商品课程
  779. let courses = rows;
  780. teacherTel.forEach((tea) => {
  781. let dataList = [];
  782. let teacherList = [];
  783. courses.forEach((item) => {
  784. let data = tea.courseList.filter(
  785. (x) => x.courseId == item.courseId
  786. );
  787. if (data && data.length > 0) {
  788. dataList.push(item);
  789. teacherList = tea.courseList;
  790. }
  791. });
  792. let result = {
  793. teaList: teacherList,
  794. courseList: dataList,
  795. };
  796. this.goodsTeacher.push(result);
  797. });
  798. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  799. let courseIds = [];
  800. this.goodsTeacher.forEach((item) => {
  801. item.courseList.forEach((course) => {
  802. courseIds.push(course.courseId);
  803. });
  804. });
  805. if (courseIds.length > 0) {
  806. courses.forEach((item) => {
  807. if (!courseIds.includes(item.courseId)) {
  808. let data = {
  809. teaList: [],
  810. courseList: [],
  811. };
  812. data.courseList.push(item);
  813. this.goodsTeacher.push(data);
  814. }
  815. });
  816. }
  817. this.goodsTeacher.forEach((item) => {
  818. if (item.courseList && item.courseList.length > 0) {
  819. item.courseList[0].show = 1;
  820. }
  821. });
  822. }
  823. } else {
  824. //没有双师资模板
  825. rows.forEach((item) => {
  826. item.show = 1;
  827. let data = {
  828. teaList: [],
  829. courseList: [],
  830. };
  831. data.courseList.push(item);
  832. this.goodsTeacher.push(data);
  833. });
  834. }
  835. });
  836. console.log(this.goodsTeacher, "this.goodsTeacher");
  837. },
  838. //切换老师
  839. switchTeacher(data, tindex, gTindex) {
  840. // console.log(data,'data');
  841. this.States[gTindex] = tindex;
  842. this.teaIndex = tindex;
  843. this.goodsTeacher.forEach((item, index) => {
  844. if (item.teaList && item.teaList.length > 0) {
  845. let list = item.teaList.filter((x) => x.courseId == data.courseId);
  846. if (list && list.length > 0) {
  847. item.courseList.forEach((course, courseIndex) => {
  848. if (course.courseId == data.courseId) {
  849. this.$set(
  850. this.goodsTeacher[index].courseList[courseIndex],
  851. "show",
  852. 1
  853. );
  854. } else {
  855. this.$set(
  856. this.goodsTeacher[index].courseList[courseIndex],
  857. "show",
  858. 0
  859. );
  860. }
  861. });
  862. }
  863. }
  864. });
  865. console.log("切换后的this.goodsTeacher, ", this.goodsTeacher);
  866. },
  867. getMenuList(item) {
  868. let self = this;
  869. this.$api.menuList({ courseId: item.courseId }).then((res) => {
  870. if (res.data.code == 200) {
  871. for (let i = 0; i < res.data.rows.length; i++) {
  872. let item = res.data.rows[i];
  873. item.down = true;
  874. item.id = item.menuId;
  875. item.name = item.menuName;
  876. if (item.type == 3) {
  877. //判断是否试听
  878. item.tryListen = false;
  879. if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
  880. item.tryListen = true;
  881. }
  882. }
  883. }
  884. item.menuList = res.data.rows;
  885. }
  886. });
  887. },
  888. // 获取课程详情
  889. getDetail() {
  890. let self = this;
  891. let sectionIdList = [];
  892. // /app/common/goods/+data
  893. this.$api.commonGoodsDetail(this.id).then((res) => {
  894. if (res.data.code == 200) {
  895. if (res.data.data) {
  896. if (res.data.data.mobileDetailHtml) {
  897. res.data.data.mobileDetailHtml =
  898. res.data.data.mobileDetailHtml.replace(
  899. /<img/gi,
  900. '<img style="max-width:100%;"'
  901. );
  902. }
  903. self.detail = res.data.data;
  904. this.courseBusiness();
  905. if (self.detail.goodsAuditionConfig) {
  906. self.listenConfigList = JSON.parse(
  907. self.detail.goodsAuditionConfig
  908. );
  909. for (var itemChild of self.listenConfigList) {
  910. sectionIdList.push(itemChild.sectionId); //存储试听节ID
  911. }
  912. self.$store.commit("setGoodsAuditionConfigIdList", {
  913. goodsAuditionConfigIdList: sectionIdList,
  914. });
  915. }
  916. }
  917. }
  918. });
  919. },
  920. buy() {
  921. if (this.$method.isGoLogin()) {
  922. return;
  923. }
  924. // 判断有没有规格选择
  925. if (this.detail.specTemplateId) {
  926. this.isCarOrBuy = 2;
  927. this.getSpecDetail();
  928. return;
  929. }
  930. this.$navTo.togo("/pages2/order/confirm_list?id=" + this.id);
  931. },
  932. drawBuy() {
  933. if (!this.$method.isLogin()) {
  934. uni.navigateTo({
  935. url: "/pages4/login/login?isBack=" + true + "&isAct=1",
  936. });
  937. return;
  938. }
  939. this.$api
  940. .drowActGoods({
  941. url: location.href,
  942. goodsList: [this.detail],
  943. sellerName: this.options.sale,
  944. })
  945. .then((res) => {
  946. if (res.data.code == 200) {
  947. // this.$u.toast("领取成功");
  948. uni.showModal({
  949. title: "提示",
  950. content: "领取成功,是否现在去做题?",
  951. cancelText: "取消",
  952. confirmText: "确定",
  953. success: (res) => {
  954. if (res.confirm) {
  955. uni.switchTab({
  956. url: "/pages/questionBank/index",
  957. });
  958. }
  959. },
  960. });
  961. } else {
  962. this.$u.toast(res.data.msg);
  963. }
  964. });
  965. },
  966. addCart() {
  967. if (this.$method.isGoLogin()) {
  968. return;
  969. }
  970. // 判断有没有规格选择
  971. if (this.detail.specTemplateId) {
  972. this.isCarOrBuy = 1;
  973. this.getSpecDetail();
  974. return;
  975. }
  976. this.addShopCart(this.id);
  977. },
  978. getSpecDetail() {
  979. // || 35
  980. this.checkedAttrs = [];
  981. this.$http({
  982. url: `/app/common/spec/${this.detail.specTemplateId}`,
  983. method: "get",
  984. noToken: true,
  985. }).then((res) => {
  986. let data = res.data.data;
  987. console.log(data, "data");
  988. if (data) {
  989. this.toggleSkuShow = true;
  990. this.specAttrPriceList = data.specAttrPriceList;
  991. this.specList = this.changeData(data.specList || []);
  992. } else {
  993. if (this.isCarOrBuy == 1) {
  994. // 加入购物车
  995. this.addShopCart(this.id);
  996. } else {
  997. this.$navTo.togo("/pages2/order/confirm_list?id=" + this.id);
  998. }
  999. this.closePop();
  1000. }
  1001. });
  1002. },
  1003. changeData(data = this.specList) {
  1004. let len = data.length;
  1005. if (!len) return [];
  1006. data[len - 1].specAttrList.forEach((e, i) => {
  1007. e.check = e.check || false;
  1008. let id = e.specAttributeId;
  1009. if (len > 1) {
  1010. id =
  1011. data[0].specAttrList[this.selectGoodIndex].specAttributeId +
  1012. "," +
  1013. id;
  1014. }
  1015. let item = this.specAttrPriceList.find((e) => e.specAttrIds == id);
  1016. if (item) {
  1017. e.standPrice = item.standPrice;
  1018. e.goodsId = item.goodsId;
  1019. } else {
  1020. e.goodsId = null;
  1021. }
  1022. });
  1023. // data.forEach((item, index) => {
  1024. // if (index == len - 1) {
  1025. // item.specAttrList.forEach((e, i) => {
  1026. // e.check = false
  1027. // })
  1028. // }
  1029. // })
  1030. return data;
  1031. },
  1032. change(index) {
  1033. this.current = index;
  1034. },
  1035. toShopcar() {
  1036. uni.navigateTo({
  1037. url: "/pages4/shopping/shoppingCart",
  1038. });
  1039. },
  1040. getIsBuy() {
  1041. this.$http({
  1042. url: "/order/buyGoodsNotExpired",
  1043. method: "get",
  1044. data: { goodsId: this.id },
  1045. }).then((res) => {
  1046. if (res.data.code == 200) {
  1047. if (res.data.data) {
  1048. // 有data返回是已经购买过的课程
  1049. this.hadBuyCourse = res.data.data;
  1050. this.bugCourseModel = true;
  1051. }
  1052. }
  1053. });
  1054. },
  1055. changeKown() {
  1056. this.bugCourseModel = false;
  1057. },
  1058. async toStudy() {
  1059. let item = this.hadBuyCourse;
  1060. if (item.goodsType == 6) {
  1061. // 进入直播课
  1062. this.toLive(item);
  1063. return;
  1064. }
  1065. // /course/goodsRebuildStatus查询用户商品重修状态
  1066. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1067. item.goodsId,
  1068. item.gradeId
  1069. );
  1070. if (rebuildStatus == 0) {
  1071. this.$navTo.togo("/pages2/learn/details", {
  1072. gradeId: item.gradeId,
  1073. goodsId: item.goodsId,
  1074. orderGoodsId: item.orderGoodsId,
  1075. });
  1076. return;
  1077. }
  1078. // /lock/lockStatus
  1079. this.$api
  1080. .lockLockStatus({
  1081. action: "jxjy",
  1082. uuid: this.$method.getUuid(),
  1083. })
  1084. .then((res) => {
  1085. if (res.data.code == 200) {
  1086. //有其他端在操作,不能学习
  1087. uni.showToast({
  1088. icon: "none",
  1089. title: res.data.msg,
  1090. mask: true,
  1091. duration: 3000,
  1092. });
  1093. } else if (res.data.code == 500) {
  1094. //可以学习
  1095. this.$http({
  1096. url: "/course/courseList",
  1097. method: "get",
  1098. data: {
  1099. pageNum: 1,
  1100. pageSize: 1,
  1101. goodsId: item.goodsId,
  1102. gradeId: item.gradeId,
  1103. orderGoodsId: item.orderGoodsId,
  1104. },
  1105. }).then((res) => {
  1106. if (res.data.code == 200) {
  1107. if (res.data.total > 1) {
  1108. // this.$navTo.togo(`/pages2/wd/course?id=${item.goodsId}&gid=${item.gradeId}&orderGoodsId=${item.orderGoodsId}`);
  1109. uni.navigateTo({
  1110. url: `/pages3/polyv/detail?id=''&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  1111. });
  1112. } else if (res.data.total == 1) {
  1113. uni.navigateTo({
  1114. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  1115. });
  1116. } else {
  1117. uni.showToast({
  1118. icon: "none",
  1119. title: "暂无可观看的视频课程",
  1120. });
  1121. }
  1122. }
  1123. });
  1124. }
  1125. });
  1126. },
  1127. toLive(item) {
  1128. this.$api
  1129. .courseCourseList({
  1130. pageNum: 1,
  1131. pageSize: 1,
  1132. goodsId: item.goodsId,
  1133. gradeId: 0,
  1134. orderGoodsId: item.orderGoodsId,
  1135. })
  1136. .then((res) => {
  1137. if (res.data.code == 200) {
  1138. if (res.data.total > 1) {
  1139. // uni.navigateTo({
  1140. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  1141. // })
  1142. uni.navigateTo({
  1143. url:
  1144. "/pages3/live/detail?orderGoodsId=" +
  1145. item.orderGoodsId +
  1146. "&goodsId=" +
  1147. item.goodsId +
  1148. '&gradeId=0&courseId=""',
  1149. });
  1150. } else if (res.data.total == 1) {
  1151. uni.navigateTo({
  1152. url:
  1153. "/pages3/live/detail?orderGoodsId=" +
  1154. item.orderGoodsId +
  1155. "&goodsId=" +
  1156. item.goodsId +
  1157. "&gradeId=0&courseId=" +
  1158. res.data.rows[0].courseId,
  1159. });
  1160. } else {
  1161. uni.showToast({
  1162. icon: "none",
  1163. title: "暂无可观看的直播课程",
  1164. });
  1165. }
  1166. }
  1167. });
  1168. },
  1169. /**
  1170. * @param {Object} goodsId 商品id
  1171. * 查询商品重修状态
  1172. */
  1173. courseGoodsRebuildStatus(goodsId, gradeId) {
  1174. return new Promise((resolve) => {
  1175. this.$http({
  1176. url: "/course/goodsRebuildStatus",
  1177. method: "get",
  1178. data: {
  1179. goodsId: goodsId,
  1180. gradeId: gradeId,
  1181. },
  1182. // noLoading: true,
  1183. // compleLoading: true, // 请求成功是否还要继续显示加载中
  1184. }).then((res) => {
  1185. resolve(res.data.data);
  1186. });
  1187. });
  1188. },
  1189. closePop() {
  1190. this.toggleSkuShow = false;
  1191. this.skuItem = {};
  1192. },
  1193. // 获取规格属性值对应的商品信息
  1194. getGoodsInfos(specAttrIds) {
  1195. this.$http({
  1196. url: "/app/common/attr/goods",
  1197. method: "get",
  1198. data: {
  1199. specTemplateId: this.detail.specTemplateId,
  1200. specAttrIds: specAttrIds.join(","),
  1201. },
  1202. noToken: true,
  1203. }).then((res) => {
  1204. if (res.data.code == 200) {
  1205. this.skuItem = res.data.data || {};
  1206. } else {
  1207. this.skuItem = {};
  1208. this.$u.toast("商品已下架, 请重新选择");
  1209. }
  1210. });
  1211. },
  1212. rightNowBuy() {
  1213. let goodsIds = [...new Set(this.goodsIds)];
  1214. this.$api.checkGoodsStatus({ goodsIds }).then((res) => {
  1215. if (res.data.code == 500) {
  1216. return this.$u.toast(res.data.msg);
  1217. }
  1218. if (this.isCarOrBuy == 1) {
  1219. // 加入购物车
  1220. this.addShopCart(goodsIds);
  1221. } else {
  1222. if (this.isSingleChoice) {
  1223. this.$navTo.togo("/pages2/order/confirm_list?id=" + goodsIds);
  1224. } else {
  1225. let data = [];
  1226. goodsIds.forEach((id) => {
  1227. data.push(this.specAttrPriceList.find((e) => e.goodsId == id));
  1228. });
  1229. this.$store.commit("setShoppingCartList", {
  1230. shoppingCartList: data,
  1231. });
  1232. this.$navTo.togo("/pages2/order/confirm_pay");
  1233. }
  1234. }
  1235. this.closePop();
  1236. });
  1237. },
  1238. loadPlayerScript(callback) {
  1239. if (!window.polyvPlayer) {
  1240. const myScript = document.createElement("script");
  1241. myScript.setAttribute(
  1242. "src",
  1243. "https://player.polyv.net/script/player.js"
  1244. );
  1245. myScript.onload = callback;
  1246. document.body.appendChild(myScript);
  1247. } else {
  1248. callback();
  1249. }
  1250. },
  1251. // 播放视频
  1252. loadPlayer() {
  1253. const polyvPlayer = window.polyvPlayer;
  1254. this.$api.polyvVideoSign(this.vid).then(async (res) => {
  1255. console.log("播放凭证res", res);
  1256. this.player = await polyvPlayer({
  1257. wrap: "#player",
  1258. width: "100%",
  1259. showLine: "off",
  1260. height: 218,
  1261. ban_history_time: "on",
  1262. vid: this.vid,
  1263. forceH5: true,
  1264. autoplay: this.autoplay,
  1265. speed: this.playbackRate,
  1266. teaser_show: 1,
  1267. tail_show: 1,
  1268. hideSwitchPlayer: true,
  1269. ts: res.data.data.ts,
  1270. sign: res.data.data.sign,
  1271. });
  1272. this.polyvPlayerContext = this.player;
  1273. });
  1274. },
  1275. },
  1276. };
  1277. </script>
  1278. <style>
  1279. page {
  1280. background-color: #f2f2f2;
  1281. }
  1282. </style>
  1283. <style lang="scss" scope>
  1284. @import "./index.scss";
  1285. .video_t2 {
  1286. font-size: 24rpx;
  1287. font-family: PingFang SC;
  1288. font-weight: 500;
  1289. color: #666666;
  1290. }
  1291. .video_t1 {
  1292. height: 80rpx;
  1293. color: #333333;
  1294. line-height: 80rpx;
  1295. font-size: 30rpx;
  1296. font-family: PingFang SC;
  1297. font-weight: bold;
  1298. color: #333333;
  1299. overflow: hidden;
  1300. text-overflow: ellipsis;
  1301. white-space: nowrap;
  1302. }
  1303. .video_t1_t {
  1304. display: flex;
  1305. flex-direction: column;
  1306. height: 80rpx;
  1307. color: #333333;
  1308. text-align: center;
  1309. align-items: center;
  1310. border-left: solid 1px #d6d6db;
  1311. }
  1312. .video_play {
  1313. position: absolute;
  1314. width: 95rpx;
  1315. height: 95rpx;
  1316. top: 0;
  1317. left: 0;
  1318. right: 0;
  1319. bottom: 0;
  1320. margin: auto;
  1321. }
  1322. .video_box {
  1323. position: relative;
  1324. }
  1325. .contents {
  1326. width: 100%;
  1327. height: 100%;
  1328. background-color: #ffffff;
  1329. margin-top: 16rpx;
  1330. overflow: hidden;
  1331. }
  1332. .cou_title {
  1333. padding: 24rpx 32rpx 40rpx 32rpx;
  1334. display: flex;
  1335. flex-direction: column;
  1336. justify-content: space-around;
  1337. }
  1338. .prices {
  1339. .price_word {
  1340. display: flex;
  1341. font-size: 44rpx;
  1342. font-weight: 800;
  1343. color: #fc3f3f;
  1344. margin-bottom: 8rpx;
  1345. view::before {
  1346. content: "¥";
  1347. font-size: 26rpx;
  1348. font-weight: bold;
  1349. }
  1350. }
  1351. .sale {
  1352. color: #999999;
  1353. font-size: 28rpx;
  1354. margin-left: 8rpx;
  1355. }
  1356. .price_line {
  1357. color: #999999;
  1358. font-size: 28rpx;
  1359. text-decoration: line-through;
  1360. font-weight: 400;
  1361. }
  1362. .free {
  1363. font-size: 32rpx;
  1364. }
  1365. }
  1366. // tab
  1367. .tabs {
  1368. // width: 100%;
  1369. height: 78rpx;
  1370. display: flex;
  1371. align-items: center;
  1372. justify-content: space-between;
  1373. background-color: #f2f7ff;
  1374. border-radius: 38rpx;
  1375. margin: 24rpx;
  1376. padding: 0rpx 5rpx;
  1377. .tab_item {
  1378. width: 345rpx;
  1379. height: 65rpx;
  1380. line-height: 65rpx;
  1381. font-size: 28rpx;
  1382. font-weight: bold;
  1383. border-radius: 32rpx;
  1384. text-align: center;
  1385. color: #333;
  1386. &.nactive {
  1387. color: #fff;
  1388. background-color: #3577e8;
  1389. }
  1390. &.twoBtn {
  1391. width: 50%;
  1392. }
  1393. &.threeBtn {
  1394. width: 33%;
  1395. }
  1396. }
  1397. // /deep/ .u-tabs {
  1398. // background:none!important;
  1399. // }
  1400. }
  1401. .courseName {
  1402. white-space: nowrap;
  1403. overflow: hidden;
  1404. text-overflow: ellipsis;
  1405. }
  1406. .videoBox {
  1407. background-color: #ffffff;
  1408. width: 100%;
  1409. /* height: 680rpx; */
  1410. z-index: 999;
  1411. }
  1412. .icon_up {
  1413. width: 32rpx;
  1414. height: 32rpx;
  1415. }
  1416. .courseItemBox {
  1417. background: #ffffff;
  1418. border-radius: 16rpx;
  1419. padding: 0 10rpx;
  1420. margin-bottom: 20rpx;
  1421. }
  1422. .courseItem {
  1423. height: 80rpx;
  1424. color: #333333;
  1425. font-size: 32rpx;
  1426. line-height: 80rpx;
  1427. font-weight: bold;
  1428. display: flex;
  1429. justify-content: space-between;
  1430. }
  1431. .content {
  1432. background-color: #ffffff;
  1433. width: 100%;
  1434. }
  1435. .btn2 {
  1436. width: 187rpx;
  1437. height: 79rpx;
  1438. line-height: 79rpx;
  1439. background: #fc3f3f;
  1440. border-radius: 40rpx;
  1441. text-align: center;
  1442. font-size: 24rpx;
  1443. }
  1444. .btn1 {
  1445. width: 187rpx;
  1446. height: 79rpx;
  1447. line-height: 79rpx;
  1448. background: #ffb102;
  1449. border-radius: 40rpx;
  1450. text-align: center;
  1451. margin-right: 11rpx;
  1452. font-size: 24rpx;
  1453. }
  1454. .wk_icon {
  1455. width: 24rpx;
  1456. height: 24rpx;
  1457. margin-right: 12rpx;
  1458. }
  1459. .noteTag,
  1460. .blackFont {
  1461. font-size: 26rpx;
  1462. font-family: PingFang SC;
  1463. font-weight: 400;
  1464. color: #999999;
  1465. align-items: center;
  1466. margin: 0 4rpx;
  1467. line-height: 60rpx;
  1468. }
  1469. .priceTag {
  1470. /* font-size: 30rpx;
  1471. font-family: PingFang SC;
  1472. font-weight: bold;
  1473. color: #FF2D55; */
  1474. width: 60rpx;
  1475. height: 40rpx;
  1476. line-height: 40rpx;
  1477. text-align: center;
  1478. border: 1rpx solid #333;
  1479. }
  1480. .titleTag {
  1481. font-size: 32rpx;
  1482. font-weight: bold;
  1483. color: #333333;
  1484. // margin-left: 8rpx;
  1485. }
  1486. .yearTag {
  1487. width: 80rpx;
  1488. height: 32rpx;
  1489. background: #ebf5ff;
  1490. border: 2rpx solid #007aff;
  1491. border-radius: 16rpx;
  1492. font-size: 24rpx;
  1493. color: #007aff;
  1494. text-align: center;
  1495. line-height: 32rpx;
  1496. }
  1497. .itemBox {
  1498. background: #ffffff;
  1499. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  1500. border-radius: 24rpx;
  1501. width: 100%;
  1502. padding: 20rpx;
  1503. margin-bottom: 20rpx;
  1504. }
  1505. // 老师名字样式
  1506. .teacher_names {
  1507. display: flex;
  1508. padding-bottom: 15rpx;
  1509. border-bottom: 2rpx solid #f0f0f0;
  1510. .names {
  1511. padding: 6rpx 12rpx;
  1512. font-size: 26rpx;
  1513. color: #969696;
  1514. background: #f8f8f8;
  1515. border-radius: 8rpx;
  1516. margin-right: 10rpx;
  1517. &.nactive {
  1518. color: #3f8dfd;
  1519. background: #f2f7ff;
  1520. }
  1521. }
  1522. }
  1523. </style>