detail.vue 46 KB

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