detail.vue 46 KB

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