detail.vue 46 KB

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