detail.vue 43 KB

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