detail.vue 46 KB

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