detail.vue 46 KB

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