detail.vue 46 KB

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