detail.vue 45 KB

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