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. 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">¥{{ spec.standPrice }}</view>
  356. </view>
  357. </u-checkbox>
  358. </view>
  359. </u-checkbox-group>
  360. </view>
  361. </view>
  362. </scroll-view>
  363. </view>
  364. <view class="confirm_btns">
  365. <view class="allprice">
  366. <view>
  367. 总价:<text>¥</text><text>{{ allPrice }}</text>
  368. </view>
  369. <text>已选择{{ goodsIds.length }}个商品</text>
  370. </view>
  371. <view class="btns">
  372. <view v-if="!goodsIds.length" class="right_now r_disable">{{
  373. isCarOrBuy == 2 ? "立即购买" : "加入购物车"
  374. }}</view>
  375. <view v-else class="right_now" @click="rightNowBuy()"
  376. >{{ isCarOrBuy == 2 ? "立即购买" : "加入购物车" }}
  377. </view>
  378. </view>
  379. </view>
  380. </view>
  381. </u-popup>
  382. </view>
  383. </template>
  384. <script>
  385. import courseModule from "@/components/course/courseModule.vue";
  386. import courseChapter from "@/components/course/courseChapter.vue";
  387. import courseSection from "@/components/course/courseSection.vue";
  388. import { mapGetters, mapMutations } from "vuex";
  389. export default {
  390. components: {
  391. courseModule,
  392. courseChapter,
  393. courseSection,
  394. },
  395. data() {
  396. return {
  397. id: 0,
  398. list: [],
  399. menuIndex: [],
  400. current: 0,
  401. detail: {},
  402. courseList: [],
  403. menuList: [],
  404. freeMenuList: [],
  405. startStatus: false,
  406. playbackRate: [1.0],
  407. isAllowSeek: "no",
  408. vid: "",
  409. autoplay: true,
  410. listenConfigList: [],
  411. listenSecond: 0,
  412. isFirstEnter: true, //是否首次进入
  413. timer: null,
  414. businessData: {},
  415. startTime: 0,
  416. bugCourseModel: false, // 弹窗
  417. hadBuyCourse: {}, // 已购买课程信息
  418. goodsTeacher: [],
  419. teaIndex: 0,
  420. States: { 0: 0 },
  421. goodsType: 1, // 1视频2题库 3补考 4前培 6直播
  422. toggleSkuShow: false,
  423. skuItem: {},
  424. isCarOrBuy: 1, // 1加入购物车 2立即购买
  425. specList: [], // 规格列表
  426. checkedAttrs: [],
  427. selectGoodIndex: 0,
  428. specAttrPriceList: [],
  429. };
  430. },
  431. computed: {
  432. ...mapGetters([
  433. "userInfo",
  434. "goodsAuditionConfigIdList",
  435. "playSectionId",
  436. "hideBuyState",
  437. ]),
  438. allPrice() {
  439. if (!this.specList.length) return 0;
  440. let allPrice = this.specList.slice(-1)[0].specAttrList.reduce((a, b) => {
  441. if (b.check) {
  442. return a + b.standPrice;
  443. }
  444. return a;
  445. }, 0);
  446. return this.toFixed(allPrice);
  447. },
  448. goodsIds() {
  449. if (!this.specList.length) return [];
  450. return this.specList
  451. .slice(-1)[0]
  452. .specAttrList.filter((e) => e.check)
  453. .map((e) => e.goodsId);
  454. },
  455. isSingleChoice() {
  456. if (!this.specAttrPriceList.length) {
  457. return false;
  458. }
  459. return this.specAttrPriceList[0].specialGoods;
  460. },
  461. },
  462. onLoad(option) {
  463. console.log("option:", option);
  464. if (option.scene) {
  465. // scene 生成二维码扫码进来的
  466. let optObj = {};
  467. let arrs = decodeURIComponent(option.scene).split("&");
  468. for (let i = 0; i < arrs.length; i++) {
  469. optObj[arrs[i].split("=")[0]] = arrs[i].split("=")[1];
  470. }
  471. this.id = optObj.id;
  472. this.goodsType = optObj.goodsType || optObj.gt;
  473. console.log("optObj.sc:", optObj);
  474. uni.setStorageSync("newUser_sc", optObj.sc);
  475. uni.setStorageSync("shareActivityCode", optObj.sac);
  476. if (optObj.sac && this.$method.isLogin()) {
  477. this.editShareActivityCode();
  478. }
  479. } else {
  480. // 小程序正常跳转的
  481. // this.id => goodsId
  482. this.id = option.id;
  483. this.goodsType = option.goodsType || option.gt;
  484. if (option.sac) {
  485. uni.setStorageSync("shareActivityCode", option.sac);
  486. if (this.$method.isLogin()) {
  487. //已登录
  488. this.editShareActivityCode();
  489. this.getIsBuy(); // 判断是否已经购买过该课程
  490. }
  491. }
  492. }
  493. this.getDetail();
  494. this.goodsCourseList();
  495. this.appCommonGoodsCourseModuleFreeExamList();
  496. // #ifdef MP-WEIXIN
  497. wx.showShareMenu({
  498. withShareTicket: true,
  499. menus: ["shareAppMessage", "shareTimeline"],
  500. });
  501. // #endif
  502. },
  503. onUnload(option) {
  504. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  505. //移除所有的事件监听器
  506. uni.$off();
  507. },
  508. // 分享到朋友圈
  509. onShareTimeline() {
  510. return {
  511. title: this.detail.goodsName,
  512. query: "id=" + this.id,
  513. imageUrl: this.$method.splitImgHost(this.detail.coverUrl),
  514. };
  515. },
  516. // 分享给朋友
  517. onShareAppMessage() {
  518. return {
  519. title: this.detail.goodsName,
  520. path:
  521. `/pages3/course/detail?id=` + this.id + "&goodsType=" + this.goodsType,
  522. imageUrl: this.$method.splitImgHost(this.detail.coverUrl),
  523. };
  524. },
  525. mounted() {
  526. let self = this;
  527. uni.$on("getSection", (item) => {
  528. //播放试听
  529. self.listenSecond = 0;
  530. for (var itemChild of self.listenConfigList) {
  531. if (
  532. self.playSectionId == (itemChild.sectionId || itemChild.menuId) &&
  533. item.courseId == itemChild.courseId
  534. ) {
  535. if (itemChild.auditionMinute > 0) {
  536. // self.listenSecond = itemChild.auditionMinute *60 //试听秒数
  537. self.listenSecond = itemChild.auditionMinute; //试听秒数 auditionMinute调整为秒单位
  538. }
  539. }
  540. }
  541. if (self.listenSecond > 0) {
  542. if (self.timer) {
  543. clearInterval(self.timer);
  544. }
  545. console.log(4654, self.vid);
  546. self.vid = self.vid || item.recordingUrl;
  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. }
  557. self.startStatus = true;
  558. self.startTime = 0;
  559. } else {
  560. self.$u.toast("试听配置错误");
  561. }
  562. });
  563. this.updateChapterOpen(true);
  564. },
  565. methods: {
  566. ...mapMutations(["updateChapterOpen"]),
  567. itemWidth() {
  568. return 100 / this.list.length + "%";
  569. },
  570. // 修改用户活动邀请码
  571. editShareActivityCode() {
  572. console.log("修改用户活动邀请码");
  573. this.$http({
  574. url: "/app/user/edit/shareActivityCode",
  575. method: "post",
  576. data: {
  577. shareActivityCode: uni.getStorageSync("shareActivityCode"),
  578. },
  579. }).then((res) => {
  580. if (res.data.code == 200) {
  581. }
  582. });
  583. },
  584. appCommonGoodsCourseModuleFreeExamList() {
  585. // url: '/app/common/goods/course/moduleFreeExamList/'+data,
  586. this.$api.appCommonGoodsCourseModuleFreeExamList(this.id).then((res) => {
  587. if (res.data.data.length) {
  588. this.freeMenuList = res.data.data;
  589. this.list = [
  590. {
  591. name: "课程介绍",
  592. },
  593. {
  594. name: "课程目录",
  595. },
  596. {
  597. name: "赠送",
  598. },
  599. ];
  600. } else {
  601. this.list = [
  602. {
  603. name: "课程介绍",
  604. },
  605. {
  606. name: "课程目录",
  607. },
  608. ];
  609. }
  610. console.log(this.list);
  611. });
  612. },
  613. selectGoodType(index) {
  614. if (index == this.selectGoodIndex) {
  615. return;
  616. }
  617. this.selectGoodIndex = index;
  618. this.changeData();
  619. },
  620. select(val) {
  621. val.check = !val.check;
  622. console.log(val, 6666);
  623. },
  624. checkboxChange(val) {
  625. if (!this.isSingleChoice) return;
  626. this.specList.slice(-1)[0].specAttrList.forEach((ele) => {
  627. if (val.name != ele.specAttributeId) {
  628. ele.check = false;
  629. }
  630. });
  631. },
  632. courseBusiness() {
  633. // url: '/app/common/course/business/'+data,
  634. this.$api.courseBusiness(this.detail.businessId).then((res) => {
  635. this.businessData = res.data.data;
  636. });
  637. },
  638. toFixed(number) {
  639. if (number > 0) {
  640. return number.toFixed(2);
  641. } else {
  642. return "0.00";
  643. }
  644. },
  645. onStateChange(newstate, oldstate) {
  646. if (newstate.detail.newstate == "playing") {
  647. //开始播放
  648. if (this.timer) {
  649. clearInterval(this.timer);
  650. }
  651. this.timer = setInterval(this.timeEvent, 1500); //定时器
  652. }
  653. },
  654. closePlay() {
  655. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  656. this.vid = "";
  657. this.startStatus = false;
  658. },
  659. timeEvent() {
  660. let self = this;
  661. var polyvPlayerContext = this.selectComponent("#playerVideo");
  662. if (polyvPlayerContext != null) {
  663. let PlayCurrentTime = polyvPlayerContext.getCurrentTime();
  664. if (PlayCurrentTime >= this.listenSecond) {
  665. polyvPlayerContext.stop();
  666. polyvPlayerContext.exitFullScreen();
  667. clearInterval(this.timer);
  668. this.timer = null;
  669. uni.showModal({
  670. title: "提示",
  671. content: "试听结束,购买课程可学习全部",
  672. showCancel: false,
  673. success: function (resst) {
  674. self.closePlay();
  675. },
  676. });
  677. }
  678. }
  679. },
  680. openCourse(item) {
  681. item.down = !item.down;
  682. if (!item.down && item.menuList.length == 0) {
  683. this.getMenuList(item);
  684. }
  685. },
  686. addShopCart(goodsIds) {
  687. if (!Array.isArray(goodsIds)) {
  688. goodsIds = [goodsIds];
  689. }
  690. this.$api.addCart({ goodsIds: goodsIds }).then((res) => {
  691. if (res.data.code == 200) {
  692. uni.setStorageSync("updateCart", 1); //提醒刷新购物车
  693. uni.showToast({
  694. title: "添加成功",
  695. });
  696. } else {
  697. this.$u.toast(res.data.msg);
  698. }
  699. });
  700. },
  701. goodsCourseList() {
  702. // url: '/app/common/goods/course/list/'+ data,
  703. this.$api.goodsCourseList(this.id).then((res) => {
  704. if (res.data.code == 200) {
  705. for (let i = 0; i < res.data.rows.length; i++) {
  706. let item = res.data.rows[i];
  707. item.down = true;
  708. item.menuList = [];
  709. }
  710. this.courseList = res.data.rows;
  711. this.getFirstCourse();
  712. // 不同
  713. if (this.goodsType == 1) {
  714. this.getCourseTeacher(res.data.rows);
  715. }
  716. }
  717. });
  718. },
  719. /**
  720. * 获取第一个有模块或者章的课程
  721. */
  722. async getFirstCourse() {
  723. for (let i = 0; i < this.courseList.length; i++) {
  724. let menuIndexOrFalse = await this.getCourseMenus(this.courseList[i]);
  725. if (menuIndexOrFalse !== false) {
  726. this.menuIndex = [i, menuIndexOrFalse];
  727. this.openCourse(this.courseList[i]);
  728. break;
  729. }
  730. }
  731. },
  732. getCourseMenus(item) {
  733. return new Promise((resolve) => {
  734. // url: '/app/common/course/menuList',
  735. this.$api.menuList({ courseId: item.courseId }).then((res) => {
  736. if (res.data.code == 200) {
  737. for (let i = 0; i < res.data.rows.length; i++) {
  738. if (res.data.rows[i].type == 1 || res.data.rows[i].type == 2) {
  739. resolve(i);
  740. break;
  741. }
  742. }
  743. }
  744. });
  745. });
  746. },
  747. getCourseTeacher(rows) {
  748. //获取商品双师资模板
  749. this.$api
  750. .getGoodsCourseTeacher({
  751. goodsId: this.id,
  752. })
  753. .then((res1) => {
  754. // console.log(res1,'res1');
  755. if (res1.data.data && res1.data.data.length > 0) {
  756. //课程老师模板
  757. let teacherTel = res1.data.data;
  758. //商品课程
  759. let courses = rows;
  760. teacherTel.forEach((tea) => {
  761. let dataList = [];
  762. let teacherList = [];
  763. courses.forEach((item) => {
  764. let data = tea.courseList.filter(
  765. (x) => x.courseId == item.courseId
  766. );
  767. if (data && data.length > 0) {
  768. dataList.push(item);
  769. teacherList = tea.courseList;
  770. }
  771. });
  772. let result = {
  773. teaList: teacherList,
  774. courseList: dataList,
  775. };
  776. this.goodsTeacher.push(result);
  777. });
  778. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  779. let courseIds = [];
  780. this.goodsTeacher.forEach((item) => {
  781. item.courseList.forEach((course) => {
  782. courseIds.push(course.courseId);
  783. });
  784. });
  785. if (courseIds.length > 0) {
  786. courses.forEach((item) => {
  787. if (!courseIds.includes(item.courseId)) {
  788. let data = {
  789. teaList: [],
  790. courseList: [],
  791. };
  792. data.courseList.push(item);
  793. this.goodsTeacher.push(data);
  794. }
  795. });
  796. }
  797. this.goodsTeacher.forEach((item) => {
  798. if (item.courseList && item.courseList.length > 0) {
  799. item.courseList[0].show = 1;
  800. }
  801. });
  802. }
  803. } else {
  804. //没有双师资模板
  805. rows.forEach((item) => {
  806. item.show = 1;
  807. let data = {
  808. teaList: [],
  809. courseList: [],
  810. };
  811. data.courseList.push(item);
  812. this.goodsTeacher.push(data);
  813. });
  814. }
  815. });
  816. console.log(this.goodsTeacher, "this.goodsTeacher");
  817. },
  818. //切换老师
  819. switchTeacher(data, tindex, gTindex) {
  820. // console.log(data,'data');
  821. this.States[gTindex] = tindex;
  822. this.teaIndex = tindex;
  823. this.goodsTeacher.forEach((item, index) => {
  824. if (item.teaList && item.teaList.length > 0) {
  825. let list = item.teaList.filter((x) => x.courseId == data.courseId);
  826. if (list && list.length > 0) {
  827. item.courseList.forEach((course, courseIndex) => {
  828. if (course.courseId == data.courseId) {
  829. this.$set(
  830. this.goodsTeacher[index].courseList[courseIndex],
  831. "show",
  832. 1
  833. );
  834. } else {
  835. this.$set(
  836. this.goodsTeacher[index].courseList[courseIndex],
  837. "show",
  838. 0
  839. );
  840. }
  841. });
  842. }
  843. }
  844. });
  845. console.log("切换后的this.goodsTeacher, ", this.goodsTeacher);
  846. },
  847. getMenuList(item) {
  848. let self = this;
  849. this.$api.menuList({ courseId: item.courseId }).then((res) => {
  850. if (res.data.code == 200) {
  851. for (let i = 0; i < res.data.rows.length; i++) {
  852. let item = res.data.rows[i];
  853. item.down = true;
  854. item.id = item.menuId;
  855. item.name = item.menuName;
  856. if (item.type == 3) {
  857. //判断是否试听
  858. item.tryListen = false;
  859. if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
  860. item.tryListen = true;
  861. }
  862. }
  863. }
  864. item.menuList = res.data.rows;
  865. }
  866. });
  867. },
  868. // 获取课程详情
  869. getDetail() {
  870. let self = this;
  871. let sectionIdList = [];
  872. // /app/common/goods/+data
  873. this.$api.commonGoodsDetail(this.id).then((res) => {
  874. if (res.data.code == 200) {
  875. if (res.data.data) {
  876. if (res.data.data.mobileDetailHtml) {
  877. res.data.data.mobileDetailHtml =
  878. res.data.data.mobileDetailHtml.replace(
  879. /<img/gi,
  880. '<img style="max-width:100%;"'
  881. );
  882. }
  883. self.detail = res.data.data;
  884. this.courseBusiness();
  885. if (self.detail.goodsAuditionConfig) {
  886. self.listenConfigList = JSON.parse(
  887. self.detail.goodsAuditionConfig
  888. );
  889. for (var itemChild of self.listenConfigList) {
  890. sectionIdList.push(itemChild.sectionId); //存储试听节ID
  891. }
  892. self.$store.commit("setGoodsAuditionConfigIdList", {
  893. goodsAuditionConfigIdList: sectionIdList,
  894. });
  895. }
  896. }
  897. }
  898. });
  899. },
  900. buy() {
  901. if (this.$method.isGoLogin()) {
  902. return;
  903. }
  904. // 判断有没有规格选择
  905. if (this.detail.specTemplateId) {
  906. this.isCarOrBuy = 2;
  907. this.getSpecDetail();
  908. return;
  909. }
  910. this.$navTo.togo("/pages2/order/confirm_list?id=" + this.id);
  911. },
  912. addCart() {
  913. if (this.$method.isGoLogin()) {
  914. return;
  915. }
  916. // 判断有没有规格选择
  917. if (this.detail.specTemplateId) {
  918. this.isCarOrBuy = 1;
  919. this.getSpecDetail();
  920. return;
  921. }
  922. this.addShopCart(this.id);
  923. },
  924. getSpecDetail() {
  925. // || 35
  926. this.checkedAttrs = [];
  927. this.$http({
  928. url: `/app/common/spec/${this.detail.specTemplateId}`,
  929. method: "get",
  930. noToken: true,
  931. }).then((res) => {
  932. let data = res.data.data;
  933. console.log(data, "data");
  934. if (data) {
  935. this.toggleSkuShow = true;
  936. this.specAttrPriceList = data.specAttrPriceList;
  937. this.specList = this.changeData(data.specList || []);
  938. } else {
  939. if (this.isCarOrBuy == 1) {
  940. // 加入购物车
  941. this.addShopCart(this.id);
  942. } else {
  943. this.$navTo.togo("/pages2/order/confirm_list?id=" + this.id);
  944. }
  945. this.closePop();
  946. }
  947. });
  948. },
  949. changeData(data = this.specList) {
  950. let len = data.length;
  951. if (!len) return [];
  952. data[len - 1].specAttrList.forEach((e, i) => {
  953. e.check = e.check || false;
  954. let id = e.specAttributeId;
  955. if (len > 1) {
  956. id =
  957. data[0].specAttrList[this.selectGoodIndex].specAttributeId +
  958. "," +
  959. id;
  960. }
  961. let item = this.specAttrPriceList.find((e) => e.specAttrIds == id);
  962. if (item) {
  963. e.standPrice = item.standPrice;
  964. e.goodsId = item.goodsId;
  965. }
  966. });
  967. // data.forEach((item, index) => {
  968. // if (index == len - 1) {
  969. // item.specAttrList.forEach((e, i) => {
  970. // e.check = false
  971. // })
  972. // }
  973. // })
  974. return data;
  975. },
  976. change(index) {
  977. this.current = index;
  978. },
  979. toShopcar() {
  980. uni.navigateTo({
  981. url: "/pages4/shopping/shoppingCart",
  982. });
  983. },
  984. getIsBuy() {
  985. this.$http({
  986. url: "/order/buyGoodsNotExpired",
  987. method: "get",
  988. data: { goodsId: this.id },
  989. }).then((res) => {
  990. if (res.data.code == 200) {
  991. if (res.data.data) {
  992. // 有data返回是已经购买过的课程
  993. this.hadBuyCourse = res.data.data;
  994. this.bugCourseModel = true;
  995. }
  996. }
  997. });
  998. },
  999. changeKown() {
  1000. this.bugCourseModel = false;
  1001. },
  1002. async toStudy() {
  1003. let item = this.hadBuyCourse;
  1004. if (item.goodsType == 6) {
  1005. // 进入直播课
  1006. this.toLive(item);
  1007. return;
  1008. }
  1009. // /course/goodsRebuildStatus查询用户商品重修状态
  1010. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1011. item.goodsId,
  1012. item.gradeId
  1013. );
  1014. if (rebuildStatus == 0) {
  1015. this.$navTo.togo("/pages2/learn/details", {
  1016. gradeId: item.gradeId,
  1017. goodsId: item.goodsId,
  1018. orderGoodsId: item.orderGoodsId,
  1019. });
  1020. return;
  1021. }
  1022. // /lock/lockStatus
  1023. this.$api
  1024. .lockLockStatus({
  1025. action: "jxjy",
  1026. uuid: this.$method.getUuid(),
  1027. })
  1028. .then((res) => {
  1029. if (res.data.code == 200) {
  1030. //有其他端在操作,不能学习
  1031. uni.showToast({
  1032. icon: "none",
  1033. title: res.data.msg,
  1034. mask: true,
  1035. duration: 3000,
  1036. });
  1037. } else if (res.data.code == 500) {
  1038. //可以学习
  1039. this.$http({
  1040. url: "/course/courseList",
  1041. method: "get",
  1042. data: {
  1043. pageNum: 1,
  1044. pageSize: 1,
  1045. goodsId: item.goodsId,
  1046. gradeId: item.gradeId,
  1047. orderGoodsId: item.orderGoodsId,
  1048. },
  1049. }).then((res) => {
  1050. if (res.data.code == 200) {
  1051. if (res.data.total > 1) {
  1052. // this.$navTo.togo(`/pages2/wd/course?id=${item.goodsId}&gid=${item.gradeId}&orderGoodsId=${item.orderGoodsId}`);
  1053. uni.navigateTo({
  1054. url: `/pages3/polyv/detail?id=''&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  1055. });
  1056. } else if (res.data.total == 1) {
  1057. uni.navigateTo({
  1058. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  1059. });
  1060. } else {
  1061. uni.showToast({
  1062. icon: "none",
  1063. title: "暂无可观看的视频课程",
  1064. });
  1065. }
  1066. }
  1067. });
  1068. }
  1069. });
  1070. },
  1071. toLive(item) {
  1072. this.$api
  1073. .courseCourseList({
  1074. pageNum: 1,
  1075. pageSize: 1,
  1076. goodsId: item.goodsId,
  1077. gradeId: 0,
  1078. orderGoodsId: item.orderGoodsId,
  1079. })
  1080. .then((res) => {
  1081. if (res.data.code == 200) {
  1082. if (res.data.total > 1) {
  1083. // uni.navigateTo({
  1084. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  1085. // })
  1086. uni.navigateTo({
  1087. url:
  1088. "/pages3/live/detail?orderGoodsId=" +
  1089. item.orderGoodsId +
  1090. "&goodsId=" +
  1091. item.goodsId +
  1092. '&gradeId=0&courseId=""',
  1093. });
  1094. } else if (res.data.total == 1) {
  1095. uni.navigateTo({
  1096. url:
  1097. "/pages3/live/detail?orderGoodsId=" +
  1098. item.orderGoodsId +
  1099. "&goodsId=" +
  1100. item.goodsId +
  1101. "&gradeId=0&courseId=" +
  1102. res.data.rows[0].courseId,
  1103. });
  1104. } else {
  1105. uni.showToast({
  1106. icon: "none",
  1107. title: "暂无可观看的直播课程",
  1108. });
  1109. }
  1110. }
  1111. });
  1112. },
  1113. /**
  1114. * @param {Object} goodsId 商品id
  1115. * 查询商品重修状态
  1116. */
  1117. courseGoodsRebuildStatus(goodsId, gradeId) {
  1118. return new Promise((resolve) => {
  1119. this.$http({
  1120. url: "/course/goodsRebuildStatus",
  1121. method: "get",
  1122. data: {
  1123. goodsId: goodsId,
  1124. gradeId: gradeId,
  1125. },
  1126. // noLoading: true,
  1127. // compleLoading: true, // 请求成功是否还要继续显示加载中
  1128. }).then((res) => {
  1129. resolve(res.data.data);
  1130. });
  1131. });
  1132. },
  1133. closePop() {
  1134. this.toggleSkuShow = false;
  1135. this.skuItem = {};
  1136. },
  1137. // 获取规格属性值对应的商品信息
  1138. getGoodsInfos(specAttrIds) {
  1139. this.$http({
  1140. url: "/app/common/attr/goods",
  1141. method: "get",
  1142. data: {
  1143. specTemplateId: this.detail.specTemplateId,
  1144. specAttrIds: specAttrIds.join(","),
  1145. },
  1146. noToken: true,
  1147. }).then((res) => {
  1148. if (res.data.code == 200) {
  1149. this.skuItem = res.data.data || {};
  1150. } else {
  1151. this.skuItem = {};
  1152. this.$u.toast("商品已下架, 请重新选择");
  1153. }
  1154. });
  1155. },
  1156. rightNowBuy() {
  1157. let goodsIds = [...new Set(this.goodsIds)];
  1158. this.$api.checkGoodsStatus({ goodsIds }).then((res) => {
  1159. if (res.data.code == 500) {
  1160. return this.$u.toast(res.data.msg);
  1161. }
  1162. if (this.isCarOrBuy == 1) {
  1163. // 加入购物车
  1164. this.addShopCart(goodsIds);
  1165. } else {
  1166. if (this.isSingleChoice) {
  1167. this.$navTo.togo("/pages2/order/confirm_list?id=" + goodsIds);
  1168. } else {
  1169. let data = [];
  1170. goodsIds.forEach((id) => {
  1171. data.push(this.specAttrPriceList.find((e) => e.goodsId == id));
  1172. });
  1173. this.$store.commit("setShoppingCartList", {
  1174. shoppingCartList: data,
  1175. });
  1176. this.$navTo.togo("/pages2/order/confirm_pay");
  1177. }
  1178. }
  1179. this.closePop();
  1180. });
  1181. },
  1182. loadPlayerScript(callback) {
  1183. if (!window.polyvPlayer) {
  1184. const myScript = document.createElement("script");
  1185. myScript.setAttribute(
  1186. "src",
  1187. "https://player.polyv.net/script/player.js"
  1188. );
  1189. myScript.onload = callback;
  1190. document.body.appendChild(myScript);
  1191. } else {
  1192. callback();
  1193. }
  1194. },
  1195. // 播放视频
  1196. loadPlayer() {
  1197. if (this.player) {
  1198. this.polyvPlayerContext.changeVid(this.vid);
  1199. return;
  1200. }
  1201. const polyvPlayer = window.polyvPlayer;
  1202. this.$api.polyvVideoSign(this.vid).then(async (res) => {
  1203. console.log("播放凭证res", res);
  1204. this.player = await polyvPlayer({
  1205. wrap: "#player",
  1206. width: "100%",
  1207. showLine: "off",
  1208. height: 218,
  1209. ban_history_time: "on",
  1210. vid: this.vid,
  1211. forceH5: true,
  1212. autoplay: this.autoplay,
  1213. speed: this.playbackRate,
  1214. teaser_show: 1,
  1215. tail_show: 1,
  1216. hideSwitchPlayer: true,
  1217. ts: res.data.data.ts,
  1218. sign: res.data.data.sign,
  1219. });
  1220. this.polyvPlayerContext = this.player;
  1221. });
  1222. },
  1223. clears() {
  1224. return new Promise((resolve, reject) => {
  1225. this.vid = "";
  1226. this.player && this.player.destroy();
  1227. resolve();
  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>