detail.vue 43 KB

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