detail.vue 41 KB

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