detail.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563
  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="!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. isAct: undefined, //活动 区分是否隐藏身份证注册
  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. console.log("option:", option);
  479. if (option.scene) {
  480. // scene 生成二维码扫码进来的
  481. let optObj = {};
  482. let arrs = decodeURIComponent(option.scene).split("&");
  483. for (let i = 0; i < arrs.length; i++) {
  484. optObj[arrs[i].split("=")[0]] = arrs[i].split("=")[1];
  485. }
  486. this.id = optObj.id;
  487. this.goodsType = optObj.goodsType || optObj.gt;
  488. console.log("optObj.sc:", optObj);
  489. uni.setStorageSync("newUser_sc", optObj.sc);
  490. uni.setStorageSync("shareActivityCode", optObj.sac);
  491. if (optObj.sac && this.$method.isLogin()) {
  492. this.editShareActivityCode();
  493. }
  494. } else {
  495. // 小程序正常跳转的
  496. // this.id => goodsId
  497. this.id = option.id;
  498. this.goodsType = option.goodsType || option.gt;
  499. this.isAct = option.isAct;
  500. if (option.sac) {
  501. uni.setStorageSync("shareActivityCode", option.sac);
  502. if (this.$method.isLogin()) {
  503. //已登录
  504. this.editShareActivityCode();
  505. this.getIsBuy(); // 判断是否已经购买过该课程
  506. }
  507. }
  508. }
  509. this.getDetail();
  510. this.goodsCourseList();
  511. this.appCommonGoodsCourseModuleFreeExamList();
  512. // #ifdef MP-WEIXIN
  513. wx.showShareMenu({
  514. withShareTicket: true,
  515. menus: ["shareAppMessage", "shareTimeline"],
  516. });
  517. // #endif
  518. },
  519. onUnload(option) {
  520. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  521. //移除所有的事件监听器
  522. uni.$off();
  523. },
  524. // 分享到朋友圈
  525. onShareTimeline() {
  526. return {
  527. title: this.detail.goodsName,
  528. query: "id=" + this.id,
  529. imageUrl: this.$method.splitImgHost(this.detail.coverUrl),
  530. };
  531. },
  532. // 分享给朋友
  533. onShareAppMessage() {
  534. return {
  535. title: this.detail.goodsName,
  536. path:
  537. `/pages3/course/detail?id=` + this.id + "&goodsType=" + this.goodsType,
  538. imageUrl: this.$method.splitImgHost(this.detail.coverUrl),
  539. };
  540. },
  541. mounted() {
  542. let self = this;
  543. uni.$on("getSection", (item) => {
  544. //播放试听
  545. self.listenSecond = 0;
  546. for (var itemChild of self.listenConfigList) {
  547. if (
  548. self.playSectionId == (itemChild.sectionId || itemChild.menuId) &&
  549. item.courseId == itemChild.courseId
  550. ) {
  551. if (itemChild.auditionMinute > 0) {
  552. // self.listenSecond = itemChild.auditionMinute *60 //试听秒数
  553. self.listenSecond = itemChild.auditionMinute; //试听秒数 auditionMinute调整为秒单位
  554. }
  555. }
  556. }
  557. if (self.listenSecond > 0) {
  558. if (self.timer) {
  559. clearInterval(self.timer);
  560. }
  561. if (item.recordingUrl) {
  562. self.vid = item.recordingUrl;
  563. if (this.player) {
  564. this.player.changeVid(this.vid);
  565. return;
  566. }
  567. //切换视频
  568. // #ifdef H5
  569. this.loadPlayerScript(this.loadPlayer);
  570. // #endif
  571. // #ifdef MP-WEIXIN
  572. this.player = self.selectComponent("#player");
  573. // #endif
  574. } else {
  575. self.$u.toast("地址错误,无法播放");
  576. }
  577. self.startStatus = true;
  578. self.startTime = 0;
  579. } else {
  580. self.$u.toast("试听配置错误");
  581. }
  582. });
  583. this.updateChapterOpen(true);
  584. },
  585. methods: {
  586. ...mapMutations(["updateChapterOpen"]),
  587. itemWidth() {
  588. return 100 / this.list.length + "%";
  589. },
  590. // 修改用户活动邀请码
  591. editShareActivityCode() {
  592. goodsIds;
  593. console.log("修改用户活动邀请码");
  594. this.$http({
  595. url: "/app/user/edit/shareActivityCode",
  596. method: "post",
  597. data: {
  598. shareActivityCode: uni.getStorageSync("shareActivityCode"),
  599. },
  600. }).then((res) => {
  601. if (res.data.code == 200) {
  602. }
  603. });
  604. },
  605. appCommonGoodsCourseModuleFreeExamList() {
  606. // url: '/app/common/goods/course/moduleFreeExamList/'+data,
  607. this.$api.appCommonGoodsCourseModuleFreeExamList(this.id).then((res) => {
  608. if (res.data.data.length) {
  609. this.freeMenuList = res.data.data;
  610. this.list = [
  611. {
  612. name: "课程介绍",
  613. },
  614. {
  615. name: "课程目录",
  616. },
  617. {
  618. name: "赠送",
  619. },
  620. ];
  621. } else {
  622. this.list = [
  623. {
  624. name: "课程介绍",
  625. },
  626. {
  627. name: "课程目录",
  628. },
  629. ];
  630. }
  631. console.log(this.list);
  632. });
  633. },
  634. selectGoodType(index) {
  635. if (index == this.selectGoodIndex) {
  636. return;
  637. }
  638. this.selectGoodIndex = index;
  639. this.changeData();
  640. },
  641. select(val) {
  642. val.check = !val.check;
  643. console.log(val, 6666);
  644. },
  645. checkboxChange(val) {
  646. if (!this.isSingleChoice) return;
  647. this.specList.slice(-1)[0].specAttrList.forEach((ele) => {
  648. if (val.name != ele.specAttributeId) {
  649. ele.check = false;
  650. }
  651. });
  652. },
  653. courseBusiness() {
  654. // url: '/app/common/course/business/'+data,
  655. this.$api.courseBusiness(this.detail.businessId).then((res) => {
  656. this.businessData = res.data.data;
  657. });
  658. },
  659. toFixed(number) {
  660. if (number > 0) {
  661. return number.toFixed(2);
  662. } else {
  663. return "0.00";
  664. }
  665. },
  666. onStateChange(newstate, oldstate) {
  667. if (newstate.detail.newstate == "playing") {
  668. //开始播放
  669. if (this.timer) {
  670. clearInterval(this.timer);
  671. }
  672. this.timer = setInterval(this.timeEvent, 1500); //定时器
  673. }
  674. },
  675. closePlay() {
  676. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  677. this.vid = "";
  678. this.startStatus = false;
  679. },
  680. timeEvent() {
  681. let self = this;
  682. var polyvPlayerContext = this.selectComponent("#playerVideo");
  683. if (polyvPlayerContext != null) {
  684. let PlayCurrentTime = polyvPlayerContext.getCurrentTime();
  685. if (PlayCurrentTime >= this.listenSecond) {
  686. polyvPlayerContext.stop();
  687. polyvPlayerContext.exitFullScreen();
  688. clearInterval(this.timer);
  689. this.timer = null;
  690. uni.showModal({
  691. title: "提示",
  692. content: "试听结束,购买课程可学习全部",
  693. showCancel: false,
  694. success: function (resst) {
  695. self.closePlay();
  696. },
  697. });
  698. }
  699. }
  700. },
  701. openCourse(item) {
  702. item.down = !item.down;
  703. if (!item.down && item.menuList.length == 0) {
  704. this.getMenuList(item);
  705. }
  706. },
  707. addShopCart(goodsIds) {
  708. if (!Array.isArray(goodsIds)) {
  709. goodsIds = [goodsIds];
  710. }
  711. this.$api.addCart({ goodsIds: goodsIds }).then((res) => {
  712. if (res.data.code == 200) {
  713. uni.setStorageSync("updateCart", 1); //提醒刷新购物车
  714. uni.showToast({
  715. title: "添加成功",
  716. });
  717. } else {
  718. this.$u.toast(res.data.msg);
  719. }
  720. });
  721. },
  722. goodsCourseList() {
  723. // url: '/app/common/goods/course/list/'+ data,
  724. this.$api.goodsCourseList(this.id).then((res) => {
  725. if (res.data.code == 200) {
  726. for (let i = 0; i < res.data.rows.length; i++) {
  727. let item = res.data.rows[i];
  728. item.down = true;
  729. item.menuList = [];
  730. }
  731. this.courseList = res.data.rows;
  732. this.getFirstCourse();
  733. // 不同
  734. if (this.goodsType == 1) {
  735. this.getCourseTeacher(res.data.rows);
  736. }
  737. }
  738. });
  739. },
  740. /**
  741. * 获取第一个有模块或者章的课程
  742. */
  743. async getFirstCourse() {
  744. for (let i = 0; i < this.courseList.length; i++) {
  745. let menuIndexOrFalse = await this.getCourseMenus(this.courseList[i]);
  746. if (menuIndexOrFalse !== false) {
  747. this.menuIndex = [i, menuIndexOrFalse];
  748. this.openCourse(this.courseList[i]);
  749. break;
  750. }
  751. }
  752. },
  753. getCourseMenus(item) {
  754. return new Promise((resolve) => {
  755. // url: '/app/common/course/menuList',
  756. this.$api.menuList({ courseId: item.courseId }).then((res) => {
  757. if (res.data.code == 200) {
  758. for (let i = 0; i < res.data.rows.length; i++) {
  759. if (res.data.rows[i].type == 1 || res.data.rows[i].type == 2) {
  760. resolve(i);
  761. break;
  762. }
  763. }
  764. }
  765. });
  766. });
  767. },
  768. getCourseTeacher(rows) {
  769. //获取商品双师资模板
  770. this.$api
  771. .getGoodsCourseTeacher({
  772. goodsId: this.id,
  773. })
  774. .then((res1) => {
  775. // console.log(res1,'res1');
  776. if (res1.data.data && res1.data.data.length > 0) {
  777. //课程老师模板
  778. let teacherTel = res1.data.data;
  779. //商品课程
  780. let courses = rows;
  781. teacherTel.forEach((tea) => {
  782. let dataList = [];
  783. let teacherList = [];
  784. courses.forEach((item) => {
  785. let data = tea.courseList.filter(
  786. (x) => x.courseId == item.courseId
  787. );
  788. if (data && data.length > 0) {
  789. dataList.push(item);
  790. teacherList = tea.courseList;
  791. }
  792. });
  793. let result = {
  794. teaList: teacherList,
  795. courseList: dataList,
  796. };
  797. this.goodsTeacher.push(result);
  798. });
  799. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  800. let courseIds = [];
  801. this.goodsTeacher.forEach((item) => {
  802. item.courseList.forEach((course) => {
  803. courseIds.push(course.courseId);
  804. });
  805. });
  806. if (courseIds.length > 0) {
  807. courses.forEach((item) => {
  808. if (!courseIds.includes(item.courseId)) {
  809. let data = {
  810. teaList: [],
  811. courseList: [],
  812. };
  813. data.courseList.push(item);
  814. this.goodsTeacher.push(data);
  815. }
  816. });
  817. }
  818. this.goodsTeacher.forEach((item) => {
  819. if (item.courseList && item.courseList.length > 0) {
  820. item.courseList[0].show = 1;
  821. }
  822. });
  823. }
  824. } else {
  825. //没有双师资模板
  826. rows.forEach((item) => {
  827. item.show = 1;
  828. let data = {
  829. teaList: [],
  830. courseList: [],
  831. };
  832. data.courseList.push(item);
  833. this.goodsTeacher.push(data);
  834. });
  835. }
  836. });
  837. console.log(this.goodsTeacher, "this.goodsTeacher");
  838. },
  839. //切换老师
  840. switchTeacher(data, tindex, gTindex) {
  841. // console.log(data,'data');
  842. this.States[gTindex] = tindex;
  843. this.teaIndex = tindex;
  844. this.goodsTeacher.forEach((item, index) => {
  845. if (item.teaList && item.teaList.length > 0) {
  846. let list = item.teaList.filter((x) => x.courseId == data.courseId);
  847. if (list && list.length > 0) {
  848. item.courseList.forEach((course, courseIndex) => {
  849. if (course.courseId == data.courseId) {
  850. this.$set(
  851. this.goodsTeacher[index].courseList[courseIndex],
  852. "show",
  853. 1
  854. );
  855. } else {
  856. this.$set(
  857. this.goodsTeacher[index].courseList[courseIndex],
  858. "show",
  859. 0
  860. );
  861. }
  862. });
  863. }
  864. }
  865. });
  866. console.log("切换后的this.goodsTeacher, ", this.goodsTeacher);
  867. },
  868. getMenuList(item) {
  869. let self = this;
  870. this.$api.menuList({ courseId: item.courseId }).then((res) => {
  871. if (res.data.code == 200) {
  872. for (let i = 0; i < res.data.rows.length; i++) {
  873. let item = res.data.rows[i];
  874. item.down = true;
  875. item.id = item.menuId;
  876. item.name = item.menuName;
  877. if (item.type == 3) {
  878. //判断是否试听
  879. item.tryListen = false;
  880. if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
  881. item.tryListen = true;
  882. }
  883. }
  884. }
  885. item.menuList = res.data.rows;
  886. }
  887. });
  888. },
  889. // 获取课程详情
  890. getDetail() {
  891. let self = this;
  892. let sectionIdList = [];
  893. // /app/common/goods/+data
  894. this.$api.commonGoodsDetail(this.id).then((res) => {
  895. if (res.data.code == 200) {
  896. if (res.data.data) {
  897. if (res.data.data.mobileDetailHtml) {
  898. res.data.data.mobileDetailHtml =
  899. res.data.data.mobileDetailHtml.replace(
  900. /<img/gi,
  901. '<img style="max-width:100%;"'
  902. );
  903. }
  904. self.detail = res.data.data;
  905. this.courseBusiness();
  906. if (self.detail.goodsAuditionConfig) {
  907. self.listenConfigList = JSON.parse(
  908. self.detail.goodsAuditionConfig
  909. );
  910. for (var itemChild of self.listenConfigList) {
  911. sectionIdList.push(itemChild.sectionId); //存储试听节ID
  912. }
  913. self.$store.commit("setGoodsAuditionConfigIdList", {
  914. goodsAuditionConfigIdList: sectionIdList,
  915. });
  916. }
  917. }
  918. }
  919. });
  920. },
  921. buy() {
  922. if (this.$method.isGoLogin()) {
  923. return;
  924. }
  925. // 判断有没有规格选择
  926. if (this.detail.specTemplateId) {
  927. this.isCarOrBuy = 2;
  928. this.getSpecDetail();
  929. return;
  930. }
  931. this.$navTo.togo("/pages2/order/confirm_list?id=" + this.id);
  932. },
  933. drawBuy() {
  934. if (!this.$method.isLogin()) {
  935. uni.navigateTo({
  936. url: "/pages4/login/login?isBack=" + true + "&isAct=" + this.isAct,
  937. });
  938. return;
  939. }
  940. this.$api
  941. .drowActGoods({
  942. url: location.href,
  943. goodsList: [this.detail],
  944. })
  945. .then((res) => {
  946. if (res.data.code == 200) {
  947. this.$u.toast("领取成功");
  948. } else {
  949. this.$u.toast(res.data.msg);
  950. }
  951. });
  952. },
  953. addCart() {
  954. if (this.$method.isGoLogin()) {
  955. return;
  956. }
  957. // 判断有没有规格选择
  958. if (this.detail.specTemplateId) {
  959. this.isCarOrBuy = 1;
  960. this.getSpecDetail();
  961. return;
  962. }
  963. this.addShopCart(this.id);
  964. },
  965. getSpecDetail() {
  966. // || 35
  967. this.checkedAttrs = [];
  968. this.$http({
  969. url: `/app/common/spec/${this.detail.specTemplateId}`,
  970. method: "get",
  971. noToken: true,
  972. }).then((res) => {
  973. let data = res.data.data;
  974. console.log(data, "data");
  975. if (data) {
  976. this.toggleSkuShow = true;
  977. this.specAttrPriceList = data.specAttrPriceList;
  978. this.specList = this.changeData(data.specList || []);
  979. } else {
  980. if (this.isCarOrBuy == 1) {
  981. // 加入购物车
  982. this.addShopCart(this.id);
  983. } else {
  984. this.$navTo.togo("/pages2/order/confirm_list?id=" + this.id);
  985. }
  986. this.closePop();
  987. }
  988. });
  989. },
  990. changeData(data = this.specList) {
  991. let len = data.length;
  992. if (!len) return [];
  993. data[len - 1].specAttrList.forEach((e, i) => {
  994. e.check = e.check || false;
  995. let id = e.specAttributeId;
  996. if (len > 1) {
  997. id =
  998. data[0].specAttrList[this.selectGoodIndex].specAttributeId +
  999. "," +
  1000. id;
  1001. }
  1002. let item = this.specAttrPriceList.find((e) => e.specAttrIds == id);
  1003. if (item) {
  1004. e.standPrice = item.standPrice;
  1005. e.goodsId = item.goodsId;
  1006. } else {
  1007. e.goodsId = null;
  1008. }
  1009. });
  1010. // data.forEach((item, index) => {
  1011. // if (index == len - 1) {
  1012. // item.specAttrList.forEach((e, i) => {
  1013. // e.check = false
  1014. // })
  1015. // }
  1016. // })
  1017. return data;
  1018. },
  1019. change(index) {
  1020. this.current = index;
  1021. },
  1022. toShopcar() {
  1023. uni.navigateTo({
  1024. url: "/pages4/shopping/shoppingCart",
  1025. });
  1026. },
  1027. getIsBuy() {
  1028. this.$http({
  1029. url: "/order/buyGoodsNotExpired",
  1030. method: "get",
  1031. data: { goodsId: this.id },
  1032. }).then((res) => {
  1033. if (res.data.code == 200) {
  1034. if (res.data.data) {
  1035. // 有data返回是已经购买过的课程
  1036. this.hadBuyCourse = res.data.data;
  1037. this.bugCourseModel = true;
  1038. }
  1039. }
  1040. });
  1041. },
  1042. changeKown() {
  1043. this.bugCourseModel = false;
  1044. },
  1045. async toStudy() {
  1046. let item = this.hadBuyCourse;
  1047. if (item.goodsType == 6) {
  1048. // 进入直播课
  1049. this.toLive(item);
  1050. return;
  1051. }
  1052. // /course/goodsRebuildStatus查询用户商品重修状态
  1053. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1054. item.goodsId,
  1055. item.gradeId
  1056. );
  1057. if (rebuildStatus == 0) {
  1058. this.$navTo.togo("/pages2/learn/details", {
  1059. gradeId: item.gradeId,
  1060. goodsId: item.goodsId,
  1061. orderGoodsId: item.orderGoodsId,
  1062. });
  1063. return;
  1064. }
  1065. // /lock/lockStatus
  1066. this.$api
  1067. .lockLockStatus({
  1068. action: "jxjy",
  1069. uuid: this.$method.getUuid(),
  1070. })
  1071. .then((res) => {
  1072. if (res.data.code == 200) {
  1073. //有其他端在操作,不能学习
  1074. uni.showToast({
  1075. icon: "none",
  1076. title: res.data.msg,
  1077. mask: true,
  1078. duration: 3000,
  1079. });
  1080. } else if (res.data.code == 500) {
  1081. //可以学习
  1082. this.$http({
  1083. url: "/course/courseList",
  1084. method: "get",
  1085. data: {
  1086. pageNum: 1,
  1087. pageSize: 1,
  1088. goodsId: item.goodsId,
  1089. gradeId: item.gradeId,
  1090. orderGoodsId: item.orderGoodsId,
  1091. },
  1092. }).then((res) => {
  1093. if (res.data.code == 200) {
  1094. if (res.data.total > 1) {
  1095. // this.$navTo.togo(`/pages2/wd/course?id=${item.goodsId}&gid=${item.gradeId}&orderGoodsId=${item.orderGoodsId}`);
  1096. uni.navigateTo({
  1097. url: `/pages3/polyv/detail?id=''&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  1098. });
  1099. } else if (res.data.total == 1) {
  1100. uni.navigateTo({
  1101. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  1102. });
  1103. } else {
  1104. uni.showToast({
  1105. icon: "none",
  1106. title: "暂无可观看的视频课程",
  1107. });
  1108. }
  1109. }
  1110. });
  1111. }
  1112. });
  1113. },
  1114. toLive(item) {
  1115. this.$api
  1116. .courseCourseList({
  1117. pageNum: 1,
  1118. pageSize: 1,
  1119. goodsId: item.goodsId,
  1120. gradeId: 0,
  1121. orderGoodsId: item.orderGoodsId,
  1122. })
  1123. .then((res) => {
  1124. if (res.data.code == 200) {
  1125. if (res.data.total > 1) {
  1126. // uni.navigateTo({
  1127. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  1128. // })
  1129. uni.navigateTo({
  1130. url:
  1131. "/pages3/live/detail?orderGoodsId=" +
  1132. item.orderGoodsId +
  1133. "&goodsId=" +
  1134. item.goodsId +
  1135. '&gradeId=0&courseId=""',
  1136. });
  1137. } else if (res.data.total == 1) {
  1138. uni.navigateTo({
  1139. url:
  1140. "/pages3/live/detail?orderGoodsId=" +
  1141. item.orderGoodsId +
  1142. "&goodsId=" +
  1143. item.goodsId +
  1144. "&gradeId=0&courseId=" +
  1145. res.data.rows[0].courseId,
  1146. });
  1147. } else {
  1148. uni.showToast({
  1149. icon: "none",
  1150. title: "暂无可观看的直播课程",
  1151. });
  1152. }
  1153. }
  1154. });
  1155. },
  1156. /**
  1157. * @param {Object} goodsId 商品id
  1158. * 查询商品重修状态
  1159. */
  1160. courseGoodsRebuildStatus(goodsId, gradeId) {
  1161. return new Promise((resolve) => {
  1162. this.$http({
  1163. url: "/course/goodsRebuildStatus",
  1164. method: "get",
  1165. data: {
  1166. goodsId: goodsId,
  1167. gradeId: gradeId,
  1168. },
  1169. // noLoading: true,
  1170. // compleLoading: true, // 请求成功是否还要继续显示加载中
  1171. }).then((res) => {
  1172. resolve(res.data.data);
  1173. });
  1174. });
  1175. },
  1176. closePop() {
  1177. this.toggleSkuShow = false;
  1178. this.skuItem = {};
  1179. },
  1180. // 获取规格属性值对应的商品信息
  1181. getGoodsInfos(specAttrIds) {
  1182. this.$http({
  1183. url: "/app/common/attr/goods",
  1184. method: "get",
  1185. data: {
  1186. specTemplateId: this.detail.specTemplateId,
  1187. specAttrIds: specAttrIds.join(","),
  1188. },
  1189. noToken: true,
  1190. }).then((res) => {
  1191. if (res.data.code == 200) {
  1192. this.skuItem = res.data.data || {};
  1193. } else {
  1194. this.skuItem = {};
  1195. this.$u.toast("商品已下架, 请重新选择");
  1196. }
  1197. });
  1198. },
  1199. rightNowBuy() {
  1200. let goodsIds = [...new Set(this.goodsIds)];
  1201. this.$api.checkGoodsStatus({ goodsIds }).then((res) => {
  1202. if (res.data.code == 500) {
  1203. return this.$u.toast(res.data.msg);
  1204. }
  1205. if (this.isCarOrBuy == 1) {
  1206. // 加入购物车
  1207. this.addShopCart(goodsIds);
  1208. } else {
  1209. if (this.isSingleChoice) {
  1210. this.$navTo.togo("/pages2/order/confirm_list?id=" + goodsIds);
  1211. } else {
  1212. let data = [];
  1213. goodsIds.forEach((id) => {
  1214. data.push(this.specAttrPriceList.find((e) => e.goodsId == id));
  1215. });
  1216. this.$store.commit("setShoppingCartList", {
  1217. shoppingCartList: data,
  1218. });
  1219. this.$navTo.togo("/pages2/order/confirm_pay");
  1220. }
  1221. }
  1222. this.closePop();
  1223. });
  1224. },
  1225. loadPlayerScript(callback) {
  1226. if (!window.polyvPlayer) {
  1227. const myScript = document.createElement("script");
  1228. myScript.setAttribute(
  1229. "src",
  1230. "https://player.polyv.net/script/player.js"
  1231. );
  1232. myScript.onload = callback;
  1233. document.body.appendChild(myScript);
  1234. } else {
  1235. callback();
  1236. }
  1237. },
  1238. // 播放视频
  1239. loadPlayer() {
  1240. const polyvPlayer = window.polyvPlayer;
  1241. this.$api.polyvVideoSign(this.vid).then(async (res) => {
  1242. console.log("播放凭证res", res);
  1243. this.player = await polyvPlayer({
  1244. wrap: "#player",
  1245. width: "100%",
  1246. showLine: "off",
  1247. height: 218,
  1248. ban_history_time: "on",
  1249. vid: this.vid,
  1250. forceH5: true,
  1251. autoplay: this.autoplay,
  1252. speed: this.playbackRate,
  1253. teaser_show: 1,
  1254. tail_show: 1,
  1255. hideSwitchPlayer: true,
  1256. ts: res.data.data.ts,
  1257. sign: res.data.data.sign,
  1258. });
  1259. this.polyvPlayerContext = this.player;
  1260. });
  1261. },
  1262. },
  1263. };
  1264. </script>
  1265. <style>
  1266. page {
  1267. background-color: #f2f2f2;
  1268. }
  1269. </style>
  1270. <style lang="scss" scope>
  1271. @import "./index.scss";
  1272. .video_t2 {
  1273. font-size: 24rpx;
  1274. font-family: PingFang SC;
  1275. font-weight: 500;
  1276. color: #666666;
  1277. }
  1278. .video_t1 {
  1279. height: 80rpx;
  1280. color: #333333;
  1281. line-height: 80rpx;
  1282. font-size: 30rpx;
  1283. font-family: PingFang SC;
  1284. font-weight: bold;
  1285. color: #333333;
  1286. overflow: hidden;
  1287. text-overflow: ellipsis;
  1288. white-space: nowrap;
  1289. }
  1290. .video_t1_t {
  1291. display: flex;
  1292. flex-direction: column;
  1293. height: 80rpx;
  1294. color: #333333;
  1295. text-align: center;
  1296. align-items: center;
  1297. border-left: solid 1px #d6d6db;
  1298. }
  1299. .video_play {
  1300. position: absolute;
  1301. width: 95rpx;
  1302. height: 95rpx;
  1303. top: 0;
  1304. left: 0;
  1305. right: 0;
  1306. bottom: 0;
  1307. margin: auto;
  1308. }
  1309. .video_box {
  1310. position: relative;
  1311. }
  1312. .contents {
  1313. width: 100%;
  1314. height: 100%;
  1315. background-color: #ffffff;
  1316. margin-top: 16rpx;
  1317. overflow: hidden;
  1318. }
  1319. .cou_title {
  1320. padding: 24rpx 32rpx 40rpx 32rpx;
  1321. display: flex;
  1322. flex-direction: column;
  1323. justify-content: space-around;
  1324. }
  1325. .prices {
  1326. .price_word {
  1327. display: flex;
  1328. font-size: 44rpx;
  1329. font-weight: 800;
  1330. color: #fc3f3f;
  1331. margin-bottom: 8rpx;
  1332. view::before {
  1333. content: "¥";
  1334. font-size: 26rpx;
  1335. font-weight: bold;
  1336. }
  1337. }
  1338. .sale {
  1339. color: #999999;
  1340. font-size: 28rpx;
  1341. margin-left: 8rpx;
  1342. }
  1343. .price_line {
  1344. color: #999999;
  1345. font-size: 28rpx;
  1346. text-decoration: line-through;
  1347. font-weight: 400;
  1348. }
  1349. .free {
  1350. font-size: 32rpx;
  1351. }
  1352. }
  1353. // tab
  1354. .tabs {
  1355. // width: 100%;
  1356. height: 78rpx;
  1357. display: flex;
  1358. align-items: center;
  1359. justify-content: space-between;
  1360. background-color: #f2f7ff;
  1361. border-radius: 38rpx;
  1362. margin: 24rpx;
  1363. padding: 0rpx 5rpx;
  1364. .tab_item {
  1365. width: 345rpx;
  1366. height: 65rpx;
  1367. line-height: 65rpx;
  1368. font-size: 28rpx;
  1369. font-weight: bold;
  1370. border-radius: 32rpx;
  1371. text-align: center;
  1372. color: #333;
  1373. &.nactive {
  1374. color: #fff;
  1375. background-color: #3577e8;
  1376. }
  1377. &.twoBtn {
  1378. width: 50%;
  1379. }
  1380. &.threeBtn {
  1381. width: 33%;
  1382. }
  1383. }
  1384. // /deep/ .u-tabs {
  1385. // background:none!important;
  1386. // }
  1387. }
  1388. .courseName {
  1389. white-space: nowrap;
  1390. overflow: hidden;
  1391. text-overflow: ellipsis;
  1392. }
  1393. .videoBox {
  1394. background-color: #ffffff;
  1395. width: 100%;
  1396. /* height: 680rpx; */
  1397. z-index: 999;
  1398. }
  1399. .icon_up {
  1400. width: 32rpx;
  1401. height: 32rpx;
  1402. }
  1403. .courseItemBox {
  1404. background: #ffffff;
  1405. border-radius: 16rpx;
  1406. padding: 0 10rpx;
  1407. margin-bottom: 20rpx;
  1408. }
  1409. .courseItem {
  1410. height: 80rpx;
  1411. color: #333333;
  1412. font-size: 32rpx;
  1413. line-height: 80rpx;
  1414. font-weight: bold;
  1415. display: flex;
  1416. justify-content: space-between;
  1417. }
  1418. .content {
  1419. background-color: #ffffff;
  1420. width: 100%;
  1421. }
  1422. .btn2 {
  1423. width: 187rpx;
  1424. height: 79rpx;
  1425. line-height: 79rpx;
  1426. background: #fc3f3f;
  1427. border-radius: 40rpx;
  1428. text-align: center;
  1429. font-size: 24rpx;
  1430. }
  1431. .btn1 {
  1432. width: 187rpx;
  1433. height: 79rpx;
  1434. line-height: 79rpx;
  1435. background: #ffb102;
  1436. border-radius: 40rpx;
  1437. text-align: center;
  1438. margin-right: 11rpx;
  1439. font-size: 24rpx;
  1440. }
  1441. .wk_icon {
  1442. width: 24rpx;
  1443. height: 24rpx;
  1444. margin-right: 12rpx;
  1445. }
  1446. .noteTag,
  1447. .blackFont {
  1448. font-size: 26rpx;
  1449. font-family: PingFang SC;
  1450. font-weight: 400;
  1451. color: #999999;
  1452. align-items: center;
  1453. margin: 0 4rpx;
  1454. line-height: 60rpx;
  1455. }
  1456. .priceTag {
  1457. /* font-size: 30rpx;
  1458. font-family: PingFang SC;
  1459. font-weight: bold;
  1460. color: #FF2D55; */
  1461. width: 60rpx;
  1462. height: 40rpx;
  1463. line-height: 40rpx;
  1464. text-align: center;
  1465. border: 1rpx solid #333;
  1466. }
  1467. .titleTag {
  1468. font-size: 32rpx;
  1469. font-weight: bold;
  1470. color: #333333;
  1471. // margin-left: 8rpx;
  1472. }
  1473. .yearTag {
  1474. width: 80rpx;
  1475. height: 32rpx;
  1476. background: #ebf5ff;
  1477. border: 2rpx solid #007aff;
  1478. border-radius: 16rpx;
  1479. font-size: 24rpx;
  1480. color: #007aff;
  1481. text-align: center;
  1482. line-height: 32rpx;
  1483. }
  1484. .itemBox {
  1485. background: #ffffff;
  1486. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  1487. border-radius: 24rpx;
  1488. width: 100%;
  1489. padding: 20rpx;
  1490. margin-bottom: 20rpx;
  1491. }
  1492. // 老师名字样式
  1493. .teacher_names {
  1494. display: flex;
  1495. padding-bottom: 15rpx;
  1496. border-bottom: 2rpx solid #f0f0f0;
  1497. .names {
  1498. padding: 6rpx 12rpx;
  1499. font-size: 26rpx;
  1500. color: #969696;
  1501. background: #f8f8f8;
  1502. border-radius: 8rpx;
  1503. margin-right: 10rpx;
  1504. &.nactive {
  1505. color: #3f8dfd;
  1506. background: #f2f7ff;
  1507. }
  1508. }
  1509. }
  1510. </style>