detail.vue 41 KB

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