detail.vue 43 KB

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