detail.vue 38 KB

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