course-detail.vue 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404
  1. <template>
  2. <div class="goods-detail">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="section__header">
  7. <div class="container">
  8. <el-breadcrumb separator="/">
  9. <el-breadcrumb-item :to="{ path: '/index' }"
  10. >首页</el-breadcrumb-item
  11. >
  12. <el-breadcrumb-item>商品详情</el-breadcrumb-item>
  13. </el-breadcrumb>
  14. </div>
  15. </div>
  16. <div class="section__body">
  17. <div class="container">
  18. <div class="goods-info">
  19. <div class="goods-info__header">
  20. <div class="img">
  21. <img
  22. :src="$tools.splitImgHost(goodsDetail.coverUrl, true)"
  23. alt=""
  24. />
  25. </div>
  26. <div class="text">
  27. <div class="title">
  28. {{ goodsDetail.goodsName }}
  29. </div>
  30. <div class="desc">
  31. {{ courseList.length }} 课程
  32. {{ goodsDetail.classHours }}学时
  33. </div>
  34. <div class="price">
  35. ${{ goodsDetail.standPrice | toFixed }}
  36. </div>
  37. <div class="btns">
  38. <div class="buynow" @click="buyNow()">立即购买</div>
  39. <div class="add" @click="addCart()">加入购物车</div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="goods-info__body">
  44. <el-tabs v-model="activeName">
  45. <el-tab-pane label="课程详情" name="1">
  46. <div class="detail" v-html="goodsDetail.pcDetailHtml"></div>
  47. </el-tab-pane>
  48. <el-tab-pane label="章节目录" name="2">
  49. <div slot="label" style="position: relative">
  50. <span class="label">章节目录</span>
  51. <span v-if="listenConfigList.length" class="view-note"
  52. >试看</span
  53. >
  54. </div>
  55. <div class="goods-menu clearfix">
  56. <div class="left-box">
  57. <div class="left-box__body">
  58. <div
  59. class="course-list-item"
  60. v-for="(course, index) in courseList"
  61. :key="index"
  62. >
  63. <div
  64. class="course-list-item__title"
  65. @click="openCourse(course)"
  66. >
  67. <i
  68. :class="{
  69. 'el-icon-caret-right': !course.showList,
  70. 'el-icon-caret-bottom': course.showList,
  71. }"
  72. ></i>
  73. {{ course.courseName }}
  74. </div>
  75. <template v-if="course.showList">
  76. <div
  77. class="item"
  78. v-for="(item, index) in course.list"
  79. :key="index"
  80. >
  81. <template v-if="item.type == 1">
  82. <div
  83. class="item__title"
  84. @click="openModule(item)"
  85. >
  86. <i
  87. :class="{
  88. 'el-icon-caret-right': !item.showList,
  89. 'el-icon-caret-bottom': item.showList,
  90. }"
  91. ></i>
  92. {{ item.name }}
  93. </div>
  94. <div class="item__content">
  95. <div
  96. class="bank-chapter"
  97. v-if="item.showList"
  98. >
  99. <div
  100. class="bank-chapter__item"
  101. v-for="(
  102. chapter, chapterIndex
  103. ) in item.list"
  104. :key="chapterIndex"
  105. >
  106. <div
  107. class="bank-chapter__item__text"
  108. @click="openChapter(chapter)"
  109. >
  110. <i
  111. :class="{
  112. 'el-icon-caret-right':
  113. !chapter.showList,
  114. 'el-icon-caret-bottom':
  115. chapter.showList,
  116. }"
  117. ></i
  118. >{{ chapter.name }}
  119. </div>
  120. <div
  121. class="bank-section"
  122. v-if="chapter.showList"
  123. >
  124. <div
  125. class="bank-section__item"
  126. v-for="(
  127. section, sectionIndex
  128. ) in chapter.list"
  129. :key="sectionIndex"
  130. >
  131. <div
  132. class="bank-section__item__text"
  133. >
  134. {{ section.name }}
  135. </div>
  136. <div
  137. v-if="section.tryListen"
  138. @click="
  139. toDo(section, item.courseId)
  140. "
  141. class="btn"
  142. >
  143. 试看
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </template>
  151. <template v-if="item.type == 2">
  152. <div class="item__content">
  153. <div class="bank-chapter">
  154. <div class="bank-chapter__item">
  155. <div
  156. class="bank-chapter__item__text"
  157. @click="openChapter(item)"
  158. >
  159. <i
  160. :class="{
  161. 'el-icon-caret-right':
  162. !item.showList,
  163. 'el-icon-caret-bottom':
  164. item.showList,
  165. }"
  166. ></i
  167. >{{ item.name }}
  168. </div>
  169. <div
  170. class="bank-section"
  171. v-if="item.showList"
  172. >
  173. <div
  174. class="bank-section__item"
  175. v-for="(
  176. section, sectionIndex
  177. ) in item.list"
  178. :key="sectionIndex"
  179. >
  180. <div
  181. class="bank-section__item__text"
  182. >
  183. {{ section.name }}
  184. </div>
  185. <div
  186. v-if="section.tryListen"
  187. @click="
  188. toDo(section, item.courseId)
  189. "
  190. class="btn"
  191. >
  192. 试看
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </template>
  200. <template v-if="item.type == 3">
  201. <div class="item__content">
  202. <div class="bank-section">
  203. <div class="bank-section__item">
  204. <div class="bank-section__item__text">
  205. {{ item.name }}
  206. </div>
  207. <div
  208. v-if="item.tryListen"
  209. @click="toDo(item, item.courseId)"
  210. class="btn"
  211. >
  212. 试看
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </template>
  218. </div>
  219. </template>
  220. </div>
  221. </div>
  222. </div>
  223. <div class="right-box">
  224. <div class="title">
  225. 推荐题库
  226. <span class="more">更多></span>
  227. </div>
  228. <ul class="list">
  229. <li
  230. class="course-item"
  231. v-for="(item, index) in 5"
  232. :key="index"
  233. @click="goodsDetail()"
  234. >
  235. <div class="course-item__img">
  236. <div class="note">2022</div>
  237. </div>
  238. <div class="course-item__title">
  239. 2022年二建建设工程法规及相关知识(黄金基础班)
  240. </div>
  241. <div class="course-item__desc">
  242. <div class="price">¥100</div>
  243. <a class="add">加购物车</a>
  244. </div>
  245. </li>
  246. </ul>
  247. </div>
  248. </div>
  249. </el-tab-pane>
  250. <el-tab-pane label="学员须知" name="3">
  251. {{ goodsDetail.buyNote }}
  252. </el-tab-pane>
  253. </el-tabs>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. <div
  259. class="section__footer"
  260. v-if="recommendList.goodsList && recommendList.goodsList.length"
  261. >
  262. <div class="recommend">
  263. <div class="recommend__header">
  264. <div class="title">相关推荐</div>
  265. </div>
  266. <div class="recommend__body">
  267. <ul class="list clearfix">
  268. <li
  269. class="recommend-item"
  270. v-for="(itemy, index) in compyRecommend(
  271. recommendList.goodsList
  272. )"
  273. :key="index"
  274. >
  275. <div
  276. class="recommend-item__img"
  277. :style="`background-image:url(${$tools.splitImgHost(
  278. itemy.coverUrl,
  279. true
  280. )})`"
  281. @click="toGoodsDetail(itemy)"
  282. >
  283. <div class="note" v-if="itemy.year">{{ itemy.year }}</div>
  284. </div>
  285. <div class="recommend-item__title">
  286. {{ itemy.goodsName }}
  287. </div>
  288. <div class="recommend-item__desc">
  289. <div class="price">¥{{ itemy.standPrice }}</div>
  290. <a class="add" @click="addCart(true, itemy.goodsId)"
  291. >加购物车</a
  292. >
  293. </div>
  294. </li>
  295. </ul>
  296. </div>
  297. <div class="recommend__footer">
  298. <div class="btn" @click="comeMoreList">查看更多</div>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. </section>
  304. <el-dialog
  305. width="800px"
  306. class="video-modal"
  307. :visible.sync="videoModalShow"
  308. :close-on-click-modal="false"
  309. :close-on-press-escape="false"
  310. :show-close="false"
  311. >
  312. <div class="video-modal__content">
  313. <a class="video-modal__close" @click="videoModalShow = false">X</a>
  314. <div class="video-modal__header">课程试看</div>
  315. <div class="video-modal__body">
  316. <div class="video">
  317. <div class="video__title">1、这是课程的第一节试看标题</div>
  318. <div class="video__wrap">
  319. <div v-show="vid" id="player"></div>
  320. <div v-show="vidzb" id="playerzb"></div>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. </el-dialog>
  326. <el-dialog
  327. width="800px"
  328. class="select-class"
  329. :visible.sync="selectClassModal"
  330. >
  331. <div class="select-class__content">
  332. <div
  333. class="selection"
  334. v-if="
  335. goodsDetail.templateType == 'class' && goodsDetail.goodsType == 1
  336. "
  337. >
  338. <el-select
  339. class="select"
  340. v-model="gradeId"
  341. placeholder="请选择班级"
  342. size="small"
  343. @click.native="selectClick(goodsDetail, 'class')"
  344. >
  345. <el-option
  346. v-for="item in gradeList"
  347. :key="item.gradeId"
  348. :label="
  349. item.classEndTime
  350. ? `${item.className} 有效期至:${$tools.timestampToTime(
  351. item.classEndTime
  352. )},本班还剩${$tools.GetRTime(
  353. item.classEndTime
  354. )}天将结束学习`
  355. : `${item.className}`
  356. "
  357. :value="item.gradeId"
  358. >
  359. </el-option>
  360. </el-select>
  361. </div>
  362. <div
  363. class="selection"
  364. v-if="
  365. goodsDetail.templateType == 'apply' && goodsDetail.goodsType == 1
  366. "
  367. >
  368. <el-select
  369. v-model="educationId"
  370. placeholder="请选择考期"
  371. size="small"
  372. @click.native="selectClick(goodsDetail, 'exam')"
  373. >
  374. <el-option
  375. v-for="item in examineList"
  376. :key="item.educationId"
  377. :label="item.examineName"
  378. :value="item.educationId"
  379. >
  380. </el-option>
  381. </el-select>
  382. <el-cascader
  383. size="small"
  384. :props="props"
  385. ref="cascader"
  386. :options="provinceList"
  387. v-model="examArea"
  388. @change="areaChange(goodsDetail)"
  389. clearable
  390. placeholder="请选择报考地区"
  391. ></el-cascader>
  392. </div>
  393. </div>
  394. <div slot="footer" class="dialog-footer">
  395. <el-button type="primary" @click="pay">确 定</el-button>
  396. </div>
  397. </el-dialog>
  398. <ToolBar></ToolBar>
  399. <Footer></Footer>
  400. </div>
  401. </template>
  402. <script>
  403. import Footer from "@/components/footer/index";
  404. import Header from "@/components/header/index";
  405. import ToolBar from "@/components/toolbar/index";
  406. import { mapMutations } from "vuex";
  407. export default {
  408. name: "GoodsDetail",
  409. components: {
  410. Footer,
  411. Header,
  412. ToolBar,
  413. },
  414. data() {
  415. return {
  416. questionList: [],
  417. goodsExamConfig: [],
  418. goodsDetail: {
  419. standPrice: 0,
  420. },
  421. courseList: [],
  422. goodsId: "",
  423. checked: false,
  424. textarea: "",
  425. selectClassModal: false,
  426. videoModalShow: false,
  427. activeName: "1",
  428. questionModalData: {
  429. activeName: "0",
  430. num: 0, //试做题数
  431. current: 0,
  432. },
  433. judge: ["错误", "正确"],
  434. ast: ["A", "B", "C", "D", "E", "F", "G"],
  435. goodsAuditionConfigIdList: [], //试听列表
  436. listenConfigList: [],
  437. vid: "",
  438. vidzb: "",
  439. player: "",
  440. playerzb: "",
  441. activeId: "", //当前选中ID
  442. vodPlayerJs: "https://player.polyv.net/script/player.js",
  443. playerJs:
  444. "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
  445. uidzb: "egsxlptzdq",
  446. gradeList: [],
  447. gradeId: "",
  448. examineList: [],
  449. examArea: [],
  450. educationId: "",
  451. props: {
  452. lazy: true,
  453. lazyLoad: this.lazyLoad,
  454. },
  455. applyAreas: [],
  456. provinceList: [],
  457. sectionItem: {},
  458. playCourseId: 0,
  459. recommendList: {}, //推荐课程
  460. };
  461. },
  462. mounted() {
  463. this.goodsId = this.$route.params.goodsId;
  464. this.getGoodsDetail();
  465. this.goodsCourseList();
  466. if (this.$tools.isLogin()) {
  467. this.getProvinceList();
  468. }
  469. },
  470. computed: {
  471. compyRecommend: function () {
  472. return function (array) {
  473. let ary = [];
  474. for (let i = 0; i < array.length; i++) {
  475. if (i >= 4) {
  476. break;
  477. } else {
  478. ary.push(array[i]);
  479. }
  480. }
  481. return ary;
  482. };
  483. },
  484. },
  485. methods: {
  486. ...mapMutations(["setCheckGoodsList", "setCurrentRouter", "getCartCount"]),
  487. toGoodsDetail(item) {
  488. this.$router.push({
  489. path: "/course-detail/" + item.goodsId,
  490. });
  491. location.reload();
  492. },
  493. /**
  494. * 查看更多
  495. */
  496. comeMoreList() {
  497. this.$router.push({
  498. path: "/course-list",
  499. query: {
  500. educationId: this.goodsDetail.educationTypeId,
  501. projectId: this.goodsDetail.projectId,
  502. businessId: this.goodsDetail.businessId,
  503. },
  504. });
  505. },
  506. /**
  507. * 点击课程大目录
  508. */
  509. openCourse(course) {
  510. course.showList = !course.showList;
  511. if (!course.list.length) {
  512. this.getMenuList(course);
  513. }
  514. },
  515. /**
  516. *
  517. 获取推荐列表
  518. */
  519. getRecommend() {
  520. this.$request
  521. .appCommonActivityRecommendList({
  522. businessId: this.goodsDetail.businessId,
  523. type: 1,
  524. })
  525. .then((res) => {
  526. if (res.rows.length) {
  527. this.recommendList = res.rows[0];
  528. }
  529. });
  530. },
  531. /**
  532. * 获取模块列表
  533. */
  534. getMenuList(item) {
  535. this.$request.menuList({ courseId: item.courseId }).then((res) => {
  536. for (let i = 0; i < res.rows.length; i++) {
  537. let item = res.rows[i];
  538. item.showList = false;
  539. item.id = item.menuId;
  540. item.name = item.menuName;
  541. if (item.type == 3) {
  542. //判断是否试听
  543. item.tryListen = false;
  544. if (this.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
  545. item.tryListen = true;
  546. }
  547. } else {
  548. item.list = [];
  549. }
  550. }
  551. item.list = res.rows;
  552. });
  553. },
  554. /**
  555. * @param {Object}
  556. * 单选点击确认
  557. */
  558. radioSelect(question, questionIndex, optionsId) {
  559. if (this.questionList[questionIndex].ques) return;
  560. this.$set(this.questionList[questionIndex], "ques", optionsId);
  561. },
  562. /**
  563. * @param {Object}
  564. * 案例单选点击
  565. */
  566. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  567. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  568. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  569. },
  570. /**
  571. * 多选点击确认
  572. */
  573. checkboxSubmit(question, questionIndex) {
  574. if (this.questionList[questionIndex].ques) return;
  575. let arr = [];
  576. this.questionList[questionIndex].jsonStr.forEach((item) => {
  577. if (item.checked) {
  578. arr.push(item.optionsId);
  579. }
  580. });
  581. if (!arr.length) {
  582. this.$message({
  583. type: "warning",
  584. message: "请选择答案",
  585. });
  586. return;
  587. }
  588. this.$set(this.questionList[questionIndex], "ques", arr);
  589. },
  590. /**
  591. * @param {Object}
  592. * 案例多选确认
  593. */
  594. checkboxSubmitChild(questionIndex, ansIndex) {
  595. if (this.questionList[questionIndex].ques[ansIndex]) return;
  596. let arr = [];
  597. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  598. (item) => {
  599. if (item.checked) {
  600. arr.push(item.optionsId);
  601. }
  602. }
  603. );
  604. if (!arr.length) {
  605. this.$message({
  606. type: "warning",
  607. message: "请选择答案",
  608. });
  609. return;
  610. }
  611. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  612. },
  613. /**
  614. * 判断点击确认
  615. */
  616. judgeSelect(question, questionIndex, index) {
  617. if (question.ques) return;
  618. this.$set(this.questionList[questionIndex], "ques", index + "");
  619. },
  620. judgeSelectChild(questionIndex, jsonIndex, index) {
  621. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  622. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  623. this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
  624. },
  625. /**
  626. * 上传图片
  627. */
  628. uploadImg(e, question, questionIndex) {
  629. var file = e.target.files[0];
  630. if (file.size > 2 * 1024 * 1024) {
  631. this.$message.warn("图片不得大于2000kb");
  632. return;
  633. }
  634. var type = e.target.value.toLowerCase().split(".").splice(-1);
  635. if (
  636. type[0] != "jpg" &&
  637. type[0] != "png" &&
  638. type[0] != "jpeg" &&
  639. type[0] != "gif"
  640. ) {
  641. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  642. e.target.value = "";
  643. return;
  644. }
  645. this.$upload.upload(file, 0).then((res) => {
  646. question.ansText.imageList.push(res);
  647. });
  648. },
  649. /**
  650. * 案例上传图片
  651. */
  652. uploadImgChild(e, questionIndex, jsonIndex) {
  653. var file = e.target.files[0];
  654. if (file.size > 2 * 1024 * 1024) {
  655. this.$message.warn("图片不得大于2000kb");
  656. return;
  657. }
  658. var type = e.target.value.toLowerCase().split(".").splice(-1);
  659. if (
  660. type[0] != "jpg" &&
  661. type[0] != "png" &&
  662. type[0] != "jpeg" &&
  663. type[0] != "gif"
  664. ) {
  665. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  666. e.target.value = "";
  667. return;
  668. }
  669. this.$upload.upload(file, 0).then((res) => {
  670. this.questionList[questionIndex].jsonStr[
  671. jsonIndex
  672. ].ansText.imageList.push(res);
  673. });
  674. },
  675. isOver(item, index) {
  676. if (this.questionList[index].ques) {
  677. if (item.type == 4) {
  678. //案例题
  679. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  680. if (
  681. jsonItem.type == 1 ||
  682. jsonItem.type == 2 ||
  683. jsonItem.type == 3
  684. ) {
  685. if (item.ques[indexs]) {
  686. return true;
  687. } else {
  688. return false;
  689. }
  690. } else if (jsonItem.type == 5) {
  691. if (
  692. item.ques[indexs] &&
  693. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  694. ) {
  695. console.log("chil");
  696. return true;
  697. } else {
  698. return false;
  699. }
  700. }
  701. });
  702. if (isOver) {
  703. return true;
  704. } else {
  705. return false;
  706. }
  707. } else if (item.type == 5) {
  708. //简答题
  709. //每一项都相等
  710. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  711. return true;
  712. }
  713. //判断
  714. } else {
  715. return false;
  716. }
  717. } else {
  718. return false;
  719. }
  720. },
  721. ansSubmit(question, questionIndex) {
  722. if (!question.ansText.text && !question.ansText.imageList.length) {
  723. this.$message({
  724. type: "warning",
  725. message: "请输入内容或上传图片",
  726. });
  727. return;
  728. }
  729. question.ques.imageList = question.ansText.imageList;
  730. question.ques.text = question.ansText.text;
  731. console.log(question.ques);
  732. },
  733. ansSubmitChild(question, questionIndex, jsonIndex) {
  734. if (
  735. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  736. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  737. .length
  738. ) {
  739. this.$message({
  740. type: "warning",
  741. message: "请输入内容或上传图片",
  742. });
  743. return;
  744. }
  745. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  746. imageList:
  747. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  748. .imageList || [],
  749. text:
  750. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  751. "",
  752. });
  753. },
  754. /**
  755. * 试看
  756. */
  757. toDo(section, courseId) {
  758. this.videoModalShow = true;
  759. this.playCourseId = courseId;
  760. console.log(this.playCourseId, "playCourseId");
  761. this.initVideo(section);
  762. },
  763. async initVideo(option) {
  764. await this.clears();
  765. console.log(option);
  766. this.sectionItem = option;
  767. if (option.sectionType === 2) {
  768. this.vidzb = option.liveUrl;
  769. this.loadPlayerScriptzb(this.loadPlayerzb);
  770. } else {
  771. this.vid = option.recordingUrl;
  772. this.loadPlayerScript(this.loadPlayer);
  773. }
  774. },
  775. loadPlayerzb() {
  776. const polyvLivePlayer = window.polyvLivePlayer;
  777. this.playerzb = polyvLivePlayer({
  778. wrap: "#playerzb",
  779. width: 800,
  780. height: 450,
  781. uid: this.uidzb,
  782. vid: this.vidzb,
  783. });
  784. },
  785. loadPlayer() {
  786. var self = this;
  787. const polyvPlayer = window.polyvPlayer;
  788. let auditionMinute = this.listenConfigList.find((item) => {
  789. if (
  790. item.sectionId ==
  791. (this.sectionItem.sectionId || this.sectionItem.menuId) &&
  792. item.courseId == this.playCourseId
  793. ) {
  794. return true;
  795. }
  796. }).auditionMinute;
  797. self.$request.obtainpolyvvideosign(self.vid).then((res) => {
  798. self.player = polyvPlayer({
  799. wrap: "#player",
  800. width: 800,
  801. height: 450,
  802. vid: self.vid,
  803. start: 0,
  804. end: auditionMinute,
  805. teaser_show: 0,
  806. ts: res.data.ts,
  807. sign: res.data.sign,
  808. playsafe: function (vid, next) {
  809. next();
  810. },
  811. });
  812. });
  813. },
  814. /**
  815. * @param {String} 直播预览
  816. */
  817. loadPlayerScriptzb(callback) {
  818. if (!window.polyvLivePlayer) {
  819. const myScript = document.createElement("script");
  820. myScript.setAttribute("src", this.playerJs);
  821. myScript.onload = callback;
  822. document.body.appendChild(myScript);
  823. } else {
  824. callback();
  825. }
  826. },
  827. loadPlayerScript(callback) {
  828. if (!window.polyvPlayer) {
  829. const myScript = document.createElement("script");
  830. myScript.setAttribute("src", this.vodPlayerJs);
  831. myScript.onload = callback;
  832. document.body.appendChild(myScript);
  833. } else {
  834. callback();
  835. }
  836. },
  837. /**
  838. * @param {String} 关闭视频窗口-销毁实例
  839. */
  840. clears() {
  841. return new Promise((resolve, reject) => {
  842. this.vid = "";
  843. this.vidzb = "";
  844. if (this.player) {
  845. this.player.destroy();
  846. }
  847. if (this.playerzb) {
  848. this.playerzb.destroy();
  849. }
  850. resolve();
  851. });
  852. },
  853. changeIndex(index) {
  854. if (index <= this.questionModalData.num - 1) {
  855. this.questionModalData.current = index;
  856. } else {
  857. this.$message({
  858. type: "warning",
  859. message: "试做题目已经结束~",
  860. });
  861. }
  862. },
  863. nextQuestion() {
  864. if (this.questionModalData.current >= this.questionModalData.num - 1) {
  865. this.$message({
  866. type: "warning",
  867. message: "试做题目已经结束~",
  868. });
  869. return;
  870. } else {
  871. this.questionModalData.current++;
  872. }
  873. },
  874. prevQuestion() {
  875. if (this.questionModalData.current == 0) {
  876. return;
  877. } else {
  878. this.questionModalData.current--;
  879. }
  880. },
  881. isRight(item, index) {
  882. //单选
  883. if (this.questionList[index].ques) {
  884. if (item.type == 1) {
  885. console.log(
  886. this.questionList[index].ques == this.questionList[index].ans
  887. );
  888. return this.questionList[index].ques == this.questionList[index].ans;
  889. //多选
  890. } else if (item.type == 2) {
  891. //每一项都相等
  892. return this.questionList[index].ans.every((item, i) => {
  893. return item == this.questionList[index].ques[i];
  894. });
  895. //判断
  896. } else if (item.type == 3) {
  897. return this.questionList[index].ques == this.questionList[index].ans;
  898. } else {
  899. return false;
  900. }
  901. } else {
  902. return false;
  903. }
  904. },
  905. isWrong(item, index) {
  906. if (this.questionList[index].ques) {
  907. //单选
  908. if (item.type == 1) {
  909. return this.questionList[index].ques != this.questionList[index].ans;
  910. //多选
  911. } else if (item.type == 2) {
  912. //每一项都相等
  913. return this.questionList[index].ans.some((item, i) => {
  914. return item != this.questionList[index].ques[i];
  915. });
  916. //判断
  917. } else if (item.type == 3) {
  918. return this.questionList[index].ques != this.questionList[index].ans;
  919. } else {
  920. return false;
  921. }
  922. } else {
  923. return false;
  924. }
  925. },
  926. right(bankIndex, ansIndex, option) {
  927. if (
  928. this.questionList[bankIndex].ques[ansIndex] &&
  929. this.questionList[bankIndex].ans[ansIndex]
  930. ) {
  931. if (
  932. this.questionList[bankIndex].ques[ansIndex].indexOf(
  933. option.optionsId
  934. ) != -1 ||
  935. this.questionList[bankIndex].ans[ansIndex].indexOf(
  936. option.optionsId
  937. ) != -1
  938. ) {
  939. return true;
  940. } else {
  941. return false;
  942. }
  943. } else {
  944. return false;
  945. }
  946. },
  947. wrong(bankIndex, ansIndex, option) {
  948. if (
  949. this.questionList[bankIndex].ques[ansIndex] &&
  950. this.questionList[bankIndex].ans[ansIndex]
  951. ) {
  952. if (
  953. this.questionList[bankIndex].ques[ansIndex].indexOf(
  954. option.optionsId
  955. ) != -1 &&
  956. this.questionList[bankIndex].ans[ansIndex].indexOf(
  957. option.optionsId
  958. ) == -1
  959. ) {
  960. return true;
  961. } else {
  962. return false;
  963. }
  964. } else {
  965. return false;
  966. }
  967. },
  968. /**
  969. * 获取已经回答的题目数
  970. * hasSpecail (是否包含简答和案例)
  971. */
  972. questionOverNum(hasSpecail) {
  973. let count = 0;
  974. this.questionList.forEach((item) => {
  975. if (item.type == 1 || item.type == 2 || item.type == 3) {
  976. if (item.ques) {
  977. count++;
  978. }
  979. } else if (item.type == 4) {
  980. //案例题
  981. if (hasSpecail) {
  982. let isOver = item.jsonStr.every((jsonItem, index) => {
  983. if (
  984. jsonItem.type == 1 ||
  985. jsonItem.type == 2 ||
  986. jsonItem.type == 3
  987. ) {
  988. if (item.ques[index]) {
  989. return true;
  990. } else {
  991. return false;
  992. }
  993. } else if (jsonItem.type == 5) {
  994. if (
  995. item.ques[index] &&
  996. (item.ques[index].text || item.ques[index].imageList.length)
  997. ) {
  998. return true;
  999. } else {
  1000. return false;
  1001. }
  1002. }
  1003. });
  1004. if (isOver) {
  1005. count++;
  1006. console.log(item, 444);
  1007. }
  1008. }
  1009. } else if (item.type == 5) {
  1010. //简答题
  1011. if (hasSpecail) {
  1012. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1013. console.log(5, item);
  1014. count++;
  1015. }
  1016. }
  1017. }
  1018. });
  1019. return count;
  1020. },
  1021. /**
  1022. * 展开模块卷
  1023. */
  1024. openModule(Module) {
  1025. Module.showList = !Module.showList;
  1026. if (!Module.list.length) {
  1027. this.getChapterList(Module);
  1028. }
  1029. },
  1030. getChapterList(Module) {
  1031. this.$request.chapterList(Module.id).then((res) => {
  1032. for (let i = 0; i < res.data.length; i++) {
  1033. let item = res.data[i];
  1034. item.id = item.chapterId;
  1035. item.showList = false;
  1036. item.list = [];
  1037. item.menuType = 2;
  1038. }
  1039. Module.list = res.data;
  1040. });
  1041. },
  1042. /**
  1043. * 展开章卷
  1044. */
  1045. openChapter(chapter) {
  1046. chapter.showList = !chapter.showList;
  1047. if (!chapter.list.length) {
  1048. this.getSectionList(chapter);
  1049. }
  1050. },
  1051. lazyLoad(node, resolve) {
  1052. const { level } = node;
  1053. console.log(node);
  1054. if (level == 0) {
  1055. } else if (level == 1) {
  1056. this.$request.getCityList({ parentId: node.value }).then((res) => {
  1057. const nodes = res.rows.map((item) => ({
  1058. value: item.areaId,
  1059. label: `${item.areaName}`,
  1060. leaf: level >= 1,
  1061. }));
  1062. resolve(nodes);
  1063. });
  1064. }
  1065. },
  1066. getSectionList(chapter) {
  1067. this.$request.sectionList(chapter.id).then((res) => {
  1068. for (let i = 0; i < res.data.length; i++) {
  1069. let item = res.data[i];
  1070. item.id = item.sectionId;
  1071. item.menuType = 3;
  1072. //判断是否试听
  1073. item.tryListen = false;
  1074. if (this.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
  1075. item.tryListen = true;
  1076. }
  1077. }
  1078. chapter.list = res.data;
  1079. });
  1080. },
  1081. selectClick(goodsDetail, type) {
  1082. if (type == "class") {
  1083. //选择班级
  1084. if (!this.gradeList.length) {
  1085. this.$request
  1086. .goodsGradeList({ goodsId: goodsDetail.goodsId })
  1087. .then((res) => {
  1088. this.gradeList = res.rows;
  1089. if (this.gradeList.length == 0) {
  1090. let item = {
  1091. className: "系统分班",
  1092. gradeId: 0,
  1093. };
  1094. this.gradeList.push(item);
  1095. }
  1096. });
  1097. }
  1098. } else if (type == "apply") {
  1099. //选择考试地点
  1100. } else if (type == "exam") {
  1101. //选择考期
  1102. this.$request
  1103. .getExamineList({ projectId: goodsDetail.projectId })
  1104. .then((res) => {
  1105. this.examineList = res.rows;
  1106. });
  1107. }
  1108. },
  1109. /**
  1110. * 获取所有省份
  1111. */
  1112. getProvinceList() {
  1113. this.$request.getProvinceList().then((res) => {
  1114. this.provinceList = res.rows.map((item) => ({
  1115. value: item.areaId,
  1116. label: `${item.areaName}`,
  1117. leaf: false,
  1118. }));
  1119. });
  1120. },
  1121. areaChange() {
  1122. let node = this.$refs["cascader"].getCheckedNodes()[0]; //选中的根节点
  1123. console.log(node);
  1124. this.applyAreas = {
  1125. areaName: node.parent.label,
  1126. areaId: node.parent.value,
  1127. cityId: node.value,
  1128. cityName: node.label,
  1129. };
  1130. },
  1131. buyNow() {
  1132. if (this.$tools.isLogin()) {
  1133. if (this.goodsDetail.templateType) {
  1134. this.selectClassModal = true;
  1135. } else {
  1136. let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
  1137. selectGoodsList.forEach((item) => {
  1138. if (item.goodsType == 1) {
  1139. if (item.templateType == "class") {
  1140. let goodsInputData = {
  1141. type: "class",
  1142. gradeId: this.gradeId,
  1143. gradeJson: JSON.stringify(
  1144. this.gradeList.find(
  1145. (grade) => grade.gradeId == this.gradeId
  1146. )
  1147. ),
  1148. };
  1149. item.goodsInputData = goodsInputData;
  1150. }
  1151. if (item.templateType == "apply") {
  1152. let goodsInputData = {
  1153. type: "apply",
  1154. applyAreasJson: JSON.stringify(this.applyAreas),
  1155. examDateJson: JSON.stringify(
  1156. this.examineList.find(
  1157. (exam) => exam.educationId == this.educationId
  1158. )
  1159. ),
  1160. };
  1161. item.goodsInputData = goodsInputData;
  1162. }
  1163. }
  1164. });
  1165. this.setCheckGoodsList(selectGoodsList);
  1166. this.$router.push({
  1167. path: "/payment",
  1168. });
  1169. }
  1170. } else {
  1171. this.setCurrentRouter(this.$route);
  1172. this.$router.push({
  1173. path: "/login",
  1174. });
  1175. }
  1176. },
  1177. pay() {
  1178. if (
  1179. this.goodsDetail.templateType == "class" &&
  1180. this.goodsDetail.goodsType == 1
  1181. ) {
  1182. if (!this.gradeId && this.gradeId !== 0) {
  1183. this.$message({
  1184. message: "请选择班级",
  1185. type: "warning",
  1186. });
  1187. return;
  1188. }
  1189. }
  1190. if (
  1191. this.goodsDetail.templateType == "apply" &&
  1192. this.goodsDetail.goodsType == 1
  1193. ) {
  1194. // if (!item.applyAreas.areaName) {
  1195. // uni.showModal({
  1196. // title: '提示',
  1197. // content: '请选择报考地区',
  1198. // showCancel: false
  1199. // });
  1200. // return false;
  1201. // }
  1202. if (!this.educationId) {
  1203. this.$message({
  1204. message: "请选择考期",
  1205. type: "warning",
  1206. });
  1207. return false;
  1208. }
  1209. }
  1210. let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
  1211. selectGoodsList.forEach((item) => {
  1212. if (item.goodsType == 1) {
  1213. if (item.templateType == "class") {
  1214. let goodsInputData = {
  1215. type: "class",
  1216. gradeId: this.gradeId,
  1217. gradeJson: JSON.stringify(
  1218. this.gradeList.find((grade) => grade.gradeId == this.gradeId)
  1219. ),
  1220. };
  1221. item.goodsInputData = goodsInputData;
  1222. }
  1223. if (item.templateType == "apply") {
  1224. let goodsInputData = {
  1225. type: "apply",
  1226. applyAreasJson: JSON.stringify(this.applyAreas),
  1227. examDateJson: JSON.stringify(
  1228. this.examineList.find(
  1229. (exam) => exam.educationId == this.educationId
  1230. )
  1231. ),
  1232. };
  1233. item.goodsInputData = goodsInputData;
  1234. }
  1235. }
  1236. });
  1237. this.setCheckGoodsList(selectGoodsList);
  1238. this.$router.push({
  1239. path: "/payment",
  1240. });
  1241. },
  1242. addCart(status, goodsId) {
  1243. if (!this.$tools.isLogin()) {
  1244. this.setCurrentRouter(this.$route);
  1245. this.$router.push({
  1246. path: "/login",
  1247. });
  1248. return;
  1249. }
  1250. this.$request
  1251. .addCart({ goodsId: status ? goodsId : this.goodsId })
  1252. .then((res) => {
  1253. this.getCartCount();
  1254. this.$message({
  1255. message: "加入购物车成功",
  1256. type: "success",
  1257. });
  1258. })
  1259. .catch((err) => {
  1260. if (err.code == 500) {
  1261. this.$message({
  1262. message: err.msg,
  1263. type: "warning",
  1264. });
  1265. }
  1266. });
  1267. },
  1268. /**
  1269. * 获取商品详情
  1270. */
  1271. getGoodsDetail() {
  1272. this.$request.commonGoodsDetail(this.goodsId).then((res) => {
  1273. if (res.data.pcDetailHtml) {
  1274. res.data.pcDetailHtml = res.data.pcDetailHtml.replace(
  1275. /<img/gi,
  1276. '<img style="max-width:100%;height:100%;display:block;margin:0px auto;"'
  1277. );
  1278. }
  1279. this.goodsDetail = res.data;
  1280. this.goodsExamConfig = JSON.parse(res.data.goodsExamConfig);
  1281. // this.courseBusiness();
  1282. if (this.goodsDetail.goodsAuditionConfig) {
  1283. this.listenConfigList = JSON.parse(
  1284. this.goodsDetail.goodsAuditionConfig
  1285. );
  1286. for (var itemChild of this.listenConfigList) {
  1287. this.goodsAuditionConfigIdList.push(itemChild.sectionId); //存储试听节ID
  1288. }
  1289. console.log(
  1290. this.goodsAuditionConfigIdList,
  1291. "this.goodsAuditionConfigIdList"
  1292. );
  1293. }
  1294. this.getRecommend();
  1295. });
  1296. },
  1297. /**
  1298. * 是否是试做
  1299. */
  1300. isTest(id) {
  1301. return this.goodsExamConfig.find((item) => item.examId == id);
  1302. },
  1303. /**
  1304. * 获取课程章节列表
  1305. */
  1306. goodsCourseList() {
  1307. this.$request.goodsCourseList(this.goodsId).then((res) => {
  1308. res.rows.forEach((item) => {
  1309. item.showList = false;
  1310. item.list = [];
  1311. });
  1312. this.courseList = res.rows;
  1313. });
  1314. },
  1315. collect() {
  1316. this.$message({
  1317. message: "试做题目,不支持收藏~",
  1318. type: "warning",
  1319. });
  1320. return;
  1321. },
  1322. examSubmit() {
  1323. this.$confirm("当前为试用做题不可交卷,购买题卷后方可交卷", "提示", {
  1324. confirmButtonText: "继续作答",
  1325. cancelButtonText: "返回详情",
  1326. closeOnClickModal: false,
  1327. closeOnPressEscape: false,
  1328. distinguishCancelAndClose: false,
  1329. showClose: false,
  1330. })
  1331. .then((_) => {})
  1332. .catch((_) => {
  1333. this.questionModalShow = false;
  1334. });
  1335. },
  1336. },
  1337. };
  1338. </script>
  1339. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1340. <style scoped lang="scss">
  1341. .goods-detail {
  1342. .section {
  1343. &__header {
  1344. height: 40px;
  1345. display: flex;
  1346. align-items: center;
  1347. padding: 0 20px;
  1348. }
  1349. &__body {
  1350. .goods-info {
  1351. &__header {
  1352. width: 100%;
  1353. height: 288px;
  1354. background: #f5f7fa;
  1355. border-radius: 10px;
  1356. padding: 20px;
  1357. display: flex;
  1358. .img {
  1359. width: 442px;
  1360. height: 248px;
  1361. border-radius: 10px;
  1362. overflow: hidden;
  1363. img {
  1364. max-width: 100%;
  1365. max-height: 100%;
  1366. width: 100%;
  1367. height: 100%;
  1368. }
  1369. }
  1370. .text {
  1371. flex: 1;
  1372. margin-left: 24px;
  1373. .title {
  1374. font-size: 18px;
  1375. font-family: Microsoft YaHei;
  1376. font-weight: bold;
  1377. color: #333333;
  1378. line-height: 24px;
  1379. }
  1380. .desc {
  1381. padding: 1px 5px;
  1382. display: inline-block;
  1383. border: 1px solid #333333;
  1384. border-radius: 4px;
  1385. font-size: 12px;
  1386. font-family: Microsoft YaHei;
  1387. font-weight: 400;
  1388. color: #333333;
  1389. }
  1390. .price {
  1391. margin-top: 10px;
  1392. font-size: 24px;
  1393. font-family: Microsoft YaHei;
  1394. font-weight: bold;
  1395. color: #ff2d55;
  1396. line-height: 24px;
  1397. }
  1398. .btns {
  1399. margin-top: 124px;
  1400. display: flex;
  1401. .buynow {
  1402. cursor: pointer;
  1403. margin-right: 16px;
  1404. width: 160px;
  1405. height: 40px;
  1406. background: #3f8dfd;
  1407. border-radius: 20px;
  1408. text-align: center;
  1409. line-height: 40px;
  1410. color: #fff;
  1411. }
  1412. .add {
  1413. cursor: pointer;
  1414. width: 128px;
  1415. height: 40px;
  1416. background: #ffffff;
  1417. border: 1px solid #3f8dfd;
  1418. border-radius: 20px;
  1419. text-align: center;
  1420. line-height: 40px;
  1421. color: #3f8dfd;
  1422. }
  1423. }
  1424. }
  1425. }
  1426. &__body {
  1427. /deep/ .el-tabs__item {
  1428. padding: 0 20px !important;
  1429. height: 80px;
  1430. line-height: 80px;
  1431. font-size: 18px;
  1432. }
  1433. .label {
  1434. font-size: 18px;
  1435. }
  1436. .view-note {
  1437. width: 40px;
  1438. height: 24px;
  1439. background: #ff3b30;
  1440. border-radius: 4px 4px 0px 4px;
  1441. border: 1px solid #ff3b30;
  1442. text-align: center;
  1443. line-height: 22px;
  1444. color: #fff;
  1445. position: absolute;
  1446. right: -10px;
  1447. top: 5px;
  1448. }
  1449. .detail {
  1450. img {
  1451. max-width: 100% !important;
  1452. }
  1453. }
  1454. .goods-img {
  1455. width: 100%;
  1456. }
  1457. .goods-menu {
  1458. margin-top: 15px;
  1459. .left-box {
  1460. width: 948px;
  1461. float: left;
  1462. &__body {
  1463. .course-list-item {
  1464. margin-top: 24px;
  1465. padding: 16px;
  1466. background: #f5f7fa;
  1467. border-radius: 10px;
  1468. &__title {
  1469. font-size: 18px;
  1470. color: #333;
  1471. font-weight: bold;
  1472. cursor: pointer;
  1473. }
  1474. .item {
  1475. overflow: hidden;
  1476. background: #fff;
  1477. margin-top: 12px;
  1478. &__title {
  1479. padding: 10px 0;
  1480. cursor: pointer;
  1481. font-size: 16px;
  1482. font-family: Microsoft YaHei;
  1483. font-weight: bold;
  1484. color: #333333;
  1485. .note {
  1486. display: inline-block;
  1487. margin-left: 20px;
  1488. width: 40px;
  1489. height: 24px;
  1490. border: 1px solid #ff3b30;
  1491. border-radius: 8px;
  1492. line-height: 22px;
  1493. color: #ff3b30;
  1494. text-align: center;
  1495. }
  1496. }
  1497. &__content {
  1498. background: #fff;
  1499. .bank-chapter {
  1500. margin-left: 4px;
  1501. &__item {
  1502. padding-top: 20px;
  1503. padding-bottom: 20px;
  1504. border-bottom: 1px solid #eeeeee;
  1505. font-size: 16px;
  1506. &__text {
  1507. cursor: pointer;
  1508. flex: 1;
  1509. }
  1510. }
  1511. }
  1512. .bank-section {
  1513. margin-left: 40px;
  1514. &__item {
  1515. padding-top: 20px;
  1516. padding-bottom: 20px;
  1517. border-bottom: 1px solid #eeeeee;
  1518. font-size: 16px;
  1519. display: flex;
  1520. &__text {
  1521. flex: 1;
  1522. }
  1523. .btn {
  1524. margin-right: 20px;
  1525. width: 40px;
  1526. height: 24px;
  1527. border: 1px solid #ff3b30;
  1528. border-radius: 8px;
  1529. line-height: 22px;
  1530. color: #ff3b30;
  1531. text-align: center;
  1532. cursor: pointer;
  1533. }
  1534. }
  1535. }
  1536. }
  1537. }
  1538. }
  1539. }
  1540. }
  1541. .right-box {
  1542. width: 323px;
  1543. float: right;
  1544. .title {
  1545. margin-left: 10px;
  1546. font-size: 16px;
  1547. font-family: Microsoft YaHei;
  1548. font-weight: 400;
  1549. color: #333333;
  1550. text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
  1551. position: relative;
  1552. .more {
  1553. font-size: 16px;
  1554. font-family: Microsoft YaHei;
  1555. font-weight: 400;
  1556. color: #999999;
  1557. position: absolute;
  1558. right: 10px;
  1559. top: 0;
  1560. }
  1561. }
  1562. .list {
  1563. .course-item {
  1564. margin: 110px 9px 0;
  1565. width: 300px;
  1566. height: 178px;
  1567. background: #ffffff;
  1568. box-shadow: 0px 10px 13px 3px rgba(63, 141, 253, 0.1);
  1569. border-radius: 10px;
  1570. position: relative;
  1571. background: #fff;
  1572. padding-top: 100px;
  1573. &__img {
  1574. width: 280px;
  1575. height: 178px;
  1576. background: #ffffff;
  1577. box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  1578. border-radius: 10px;
  1579. position: absolute;
  1580. left: 10px;
  1581. top: -78px;
  1582. background: rgba(122, 136, 246, 1);
  1583. overflow: hidden;
  1584. .note {
  1585. width: 80px;
  1586. height: 24px;
  1587. background: #d94404;
  1588. box-shadow: 0px 1px 1px 0px rgba(248, 78, 5, 0.4);
  1589. border-radius: 10px 0px 20px 0px;
  1590. text-align: center;
  1591. line-height: 24px;
  1592. color: #fff;
  1593. }
  1594. }
  1595. &__title {
  1596. margin: 0 8px;
  1597. font-size: 14px;
  1598. font-family: Microsoft YaHei;
  1599. font-weight: 400;
  1600. color: #333333;
  1601. line-height: 24px;
  1602. }
  1603. &__desc {
  1604. height: 32px;
  1605. position: absolute;
  1606. left: 0;
  1607. right: 0;
  1608. bottom: 0;
  1609. margin-left: 8px;
  1610. display: flex;
  1611. justify-content: space-between;
  1612. .price {
  1613. font-size: 18px;
  1614. font-family: Microsoft YaHei;
  1615. font-weight: bold;
  1616. color: #ff2d55;
  1617. line-height: 32px;
  1618. }
  1619. .add {
  1620. display: block;
  1621. width: 118px;
  1622. height: 32px;
  1623. line-height: 30px;
  1624. background: #f2f4f7;
  1625. border-radius: 10px 0px 10px 0px;
  1626. font-size: 16px;
  1627. color: #3f8dfd;
  1628. text-align: center;
  1629. &:hover {
  1630. background: #3f8dfd;
  1631. color: #f2f4f7;
  1632. }
  1633. }
  1634. }
  1635. }
  1636. }
  1637. }
  1638. }
  1639. }
  1640. }
  1641. }
  1642. &__footer {
  1643. .recommend {
  1644. padding-top: 40px;
  1645. &__header {
  1646. display: flex;
  1647. align-items: center;
  1648. .title {
  1649. font-size: 24px;
  1650. font-family: YouSheBiaoTiHei;
  1651. font-weight: 400;
  1652. color: #333333;
  1653. text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
  1654. }
  1655. }
  1656. &__body {
  1657. .list {
  1658. width: 100%;
  1659. .recommend-item {
  1660. float: left;
  1661. margin: 100px 9px 0;
  1662. width: 300px;
  1663. height: 178px;
  1664. background: #ffffff;
  1665. box-shadow: 0px 10px 13px 3px rgba(63, 141, 253, 0.1);
  1666. border-radius: 10px;
  1667. position: relative;
  1668. background: #fff;
  1669. padding-top: 100px;
  1670. &__img {
  1671. width: 280px;
  1672. height: 178px;
  1673. background: #ffffff;
  1674. box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  1675. border-radius: 10px;
  1676. position: absolute;
  1677. left: 10px;
  1678. top: -78px;
  1679. background: rgba(122, 136, 246, 1);
  1680. overflow: hidden;
  1681. background: no-repeat center center;
  1682. background-size: 280px 178px;
  1683. .note {
  1684. width: 80px;
  1685. height: 24px;
  1686. background: #d94404;
  1687. box-shadow: 0px 1px 1px 0px rgba(248, 78, 5, 0.4);
  1688. border-radius: 10px 0px 20px 0px;
  1689. text-align: center;
  1690. line-height: 24px;
  1691. color: #fff;
  1692. }
  1693. }
  1694. &__title {
  1695. margin: 0 8px;
  1696. font-size: 14px;
  1697. font-family: Microsoft YaHei;
  1698. font-weight: 400;
  1699. color: #333333;
  1700. line-height: 24px;
  1701. }
  1702. &__desc {
  1703. height: 32px;
  1704. position: absolute;
  1705. left: 0;
  1706. right: 0;
  1707. bottom: 0;
  1708. margin-left: 8px;
  1709. display: flex;
  1710. justify-content: space-between;
  1711. .price {
  1712. font-size: 18px;
  1713. font-family: Microsoft YaHei;
  1714. font-weight: bold;
  1715. color: #ff2d55;
  1716. line-height: 32px;
  1717. }
  1718. .add {
  1719. display: block;
  1720. width: 118px;
  1721. height: 32px;
  1722. line-height: 30px;
  1723. background: #f2f4f7;
  1724. border-radius: 10px 0px 10px 0px;
  1725. font-size: 16px;
  1726. color: #3f8dfd;
  1727. text-align: center;
  1728. &:hover {
  1729. background: #3f8dfd;
  1730. color: #f2f4f7;
  1731. }
  1732. }
  1733. }
  1734. }
  1735. }
  1736. }
  1737. &__footer {
  1738. overflow: hidden;
  1739. .btn {
  1740. cursor: pointer;
  1741. width: 146px;
  1742. height: 40px;
  1743. background: #e3eaf7;
  1744. border-radius: 8px;
  1745. margin: 20px auto 40px;
  1746. color: #3f8dfd;
  1747. text-align: center;
  1748. line-height: 40px;
  1749. &:hover {
  1750. color: #fff;
  1751. box-shadow: 0px 8px 4px 0px rgba(7, 82, 208, 0.08);
  1752. background: #3f8dfd;
  1753. }
  1754. }
  1755. }
  1756. }
  1757. }
  1758. }
  1759. .question-modal {
  1760. /deep/ .el-dialog__header {
  1761. display: none;
  1762. }
  1763. /deep/ .el-dialog__body {
  1764. padding: 0;
  1765. overflow: unset;
  1766. }
  1767. &__close {
  1768. position: absolute;
  1769. right: 0;
  1770. top: -28px;
  1771. width: 24px;
  1772. height: 24px;
  1773. line-height: 24px;
  1774. text-align: center;
  1775. color: #eee;
  1776. border: 1px solid #eee;
  1777. border-radius: 50%;
  1778. }
  1779. &__content {
  1780. width: 800px;
  1781. height: 530px;
  1782. position: relative;
  1783. box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.04);
  1784. border-radius: 8px;
  1785. .left-box {
  1786. float: left;
  1787. width: 500px;
  1788. border-right: 1px solid #eee;
  1789. &__header {
  1790. height: 40px;
  1791. padding-left: 12px;
  1792. border-bottom: 1px solid #eeeeee;
  1793. display: flex;
  1794. align-items: center;
  1795. .progress {
  1796. width: 200px;
  1797. }
  1798. .text {
  1799. margin-left: 15px;
  1800. font-size: 16px;
  1801. span {
  1802. font-family: Microsoft YaHei;
  1803. font-weight: bold;
  1804. color: #3f8dfd;
  1805. line-height: 24px;
  1806. }
  1807. }
  1808. }
  1809. &__body {
  1810. height: 450px;
  1811. border-bottom: 1px solid #eee;
  1812. .question {
  1813. padding: 12px 0 0 12px;
  1814. display: flex;
  1815. flex-direction: column;
  1816. height: 100%;
  1817. &__title {
  1818. padding-left: 12px;
  1819. font-size: 16px;
  1820. font-family: Microsoft YaHei;
  1821. font-weight: bold;
  1822. color: #333333;
  1823. line-height: 24px;
  1824. }
  1825. &__desc {
  1826. padding-left: 12px;
  1827. margin-top: 20px;
  1828. font-size: 16px;
  1829. font-family: Microsoft YaHei;
  1830. font-weight: 400;
  1831. color: #666666;
  1832. line-height: 24px;
  1833. }
  1834. &__content {
  1835. flex: 1;
  1836. overflow-y: scroll;
  1837. &::-webkit-scrollbar {
  1838. width: 6px;
  1839. }
  1840. &::-webkit-scrollbar-track {
  1841. background-color: #fff;
  1842. -webkit-border-radius: 2em;
  1843. -moz-border-radius: 2em;
  1844. border-radius: 2em;
  1845. }
  1846. &::-webkit-scrollbar-thumb {
  1847. background-color: #eeeeee;
  1848. -webkit-border-radius: 2em;
  1849. -moz-border-radius: 2em;
  1850. border-radius: 2em;
  1851. }
  1852. /deep/ .el-tabs__item {
  1853. padding: 0 20px !important;
  1854. height: 40px;
  1855. line-height: 40px;
  1856. }
  1857. .question__content {
  1858. height: auto;
  1859. overflow: auto;
  1860. }
  1861. .question-list {
  1862. padding: 24px 0 0 24px;
  1863. .checkbox,
  1864. .radio {
  1865. cursor: pointer;
  1866. margin-right: 24px;
  1867. padding: 0 24px;
  1868. display: flex;
  1869. align-items: center;
  1870. margin-top: 2px;
  1871. min-height: 40px;
  1872. padding-top: 10px;
  1873. padding-bottom: 10px;
  1874. background: #f5f9ff;
  1875. border-radius: 8px;
  1876. box-sizing: border-box;
  1877. &.right {
  1878. background: #37c65b;
  1879. }
  1880. &.wrong {
  1881. background: #ff3a30;
  1882. }
  1883. }
  1884. &.textarea {
  1885. margin-right: 12px;
  1886. .upload {
  1887. margin-top: 10px;
  1888. &__imgs {
  1889. margin-right: 10px;
  1890. width: 80px;
  1891. height: 80px;
  1892. background: #ffffff;
  1893. border: 1px solid #eeeeee;
  1894. border-radius: 4px;
  1895. position: relative;
  1896. display: flex;
  1897. float: left;
  1898. align-items: center;
  1899. justify-content: center;
  1900. img {
  1901. max-width: 100%;
  1902. max-height: 100%;
  1903. }
  1904. }
  1905. &__btn {
  1906. margin-right: 10px;
  1907. width: 80px;
  1908. height: 80px;
  1909. background: #ffffff;
  1910. border: 1px solid #eeeeee;
  1911. border-radius: 4px;
  1912. position: relative;
  1913. display: flex;
  1914. float: left;
  1915. align-items: center;
  1916. justify-content: center;
  1917. flex-direction: column;
  1918. .icon {
  1919. font-size: 20px;
  1920. color: #3f8dfd;
  1921. }
  1922. p {
  1923. font-size: 12px;
  1924. font-family: Microsoft YaHei;
  1925. font-weight: 400;
  1926. color: #999999;
  1927. line-height: 24px;
  1928. }
  1929. input {
  1930. position: absolute;
  1931. left: 0;
  1932. top: 0;
  1933. display: block;
  1934. width: 100%;
  1935. height: 100%;
  1936. opacity: 0;
  1937. }
  1938. }
  1939. }
  1940. }
  1941. /deep/ .el-checkbox {
  1942. white-space: pre-wrap;
  1943. }
  1944. }
  1945. .answer-list {
  1946. height: 40px;
  1947. border-top: 1px solid #eee;
  1948. border-bottom: 1px solid #eee;
  1949. margin-top: 24px;
  1950. display: flex;
  1951. align-items: center;
  1952. justify-content: space-between;
  1953. padding: 0 24px;
  1954. &__left {
  1955. font-size: 16px;
  1956. font-family: Microsoft YaHei;
  1957. font-weight: 400;
  1958. color: #333333;
  1959. line-height: 24px;
  1960. }
  1961. &__right {
  1962. font-size: 16px;
  1963. font-family: Microsoft YaHei;
  1964. font-weight: 400;
  1965. color: #333333;
  1966. line-height: 24px;
  1967. }
  1968. }
  1969. .explain-list {
  1970. padding: 12px 24px;
  1971. &__header {
  1972. font-size: 16px;
  1973. font-family: Microsoft YaHei;
  1974. font-weight: bold;
  1975. color: #666666;
  1976. line-height: 24px;
  1977. }
  1978. &__body {
  1979. margin-top: 12px;
  1980. font-size: 16px;
  1981. font-family: Microsoft YaHei;
  1982. font-weight: 400;
  1983. color: #666666;
  1984. line-height: 24px;
  1985. }
  1986. .upload {
  1987. margin-top: 10px;
  1988. &__imgs {
  1989. margin-right: 10px;
  1990. width: 80px;
  1991. height: 80px;
  1992. background: #ffffff;
  1993. border: 1px solid #eeeeee;
  1994. border-radius: 4px;
  1995. position: relative;
  1996. display: flex;
  1997. float: left;
  1998. align-items: center;
  1999. justify-content: center;
  2000. img {
  2001. max-width: 100%;
  2002. max-height: 100%;
  2003. }
  2004. }
  2005. }
  2006. }
  2007. }
  2008. &__btns {
  2009. position: relative;
  2010. height: 32px;
  2011. .submit {
  2012. cursor: pointer;
  2013. margin: 0 auto;
  2014. width: 140px;
  2015. height: 32px;
  2016. background: #3f8dfd;
  2017. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2018. border-radius: 16px;
  2019. text-align: center;
  2020. line-height: 32px;
  2021. color: #fff;
  2022. font-size: 16px;
  2023. }
  2024. .collect {
  2025. cursor: pointer;
  2026. position: absolute;
  2027. right: 0;
  2028. top: 5px;
  2029. font-size: 12px;
  2030. font-family: Microsoft YaHei;
  2031. font-weight: 400;
  2032. color: #3f8dfd;
  2033. line-height: 24px;
  2034. }
  2035. }
  2036. }
  2037. }
  2038. &__footer {
  2039. height: 40px;
  2040. display: flex;
  2041. justify-content: space-around;
  2042. align-items: center;
  2043. .btn {
  2044. cursor: pointer;
  2045. width: 140px;
  2046. height: 32px;
  2047. background: #ffffff;
  2048. border: 1px solid #3f8dfd;
  2049. border-radius: 16px;
  2050. line-height: 32px;
  2051. text-align: center;
  2052. color: #3f8dfd;
  2053. }
  2054. }
  2055. }
  2056. .right-box {
  2057. float: right;
  2058. width: 300px;
  2059. &__header {
  2060. height: 40px;
  2061. line-height: 40px;
  2062. font-size: 16px;
  2063. font-family: Microsoft YaHei;
  2064. font-weight: bold;
  2065. color: #333333;
  2066. text-align: center;
  2067. border-bottom: 1px solid #eeeeee;
  2068. }
  2069. &__body {
  2070. height: 450px;
  2071. border-bottom: 1px solid #eee;
  2072. .card {
  2073. &__note {
  2074. display: flex;
  2075. height: 40px;
  2076. align-items: center;
  2077. border-bottom: 1px solid #eee;
  2078. .item {
  2079. display: flex;
  2080. align-items: center;
  2081. margin-left: 10px;
  2082. .box {
  2083. margin-right: 5px;
  2084. width: 16px;
  2085. height: 16px;
  2086. border-radius: 4px;
  2087. &.white {
  2088. background: #ffffff;
  2089. border: 1px solid #eeeeee;
  2090. }
  2091. &.green {
  2092. background: #37c65b;
  2093. }
  2094. &.red {
  2095. background: #ff3a30;
  2096. }
  2097. &.blue {
  2098. background: #3f8dfd;
  2099. }
  2100. }
  2101. }
  2102. }
  2103. &__content {
  2104. height: 410px;
  2105. overflow-y: scroll;
  2106. &::-webkit-scrollbar {
  2107. width: 6px;
  2108. }
  2109. &::-webkit-scrollbar-track {
  2110. background-color: #fff;
  2111. -webkit-border-radius: 2em;
  2112. -moz-border-radius: 2em;
  2113. border-radius: 2em;
  2114. }
  2115. &::-webkit-scrollbar-thumb {
  2116. background-color: #eeeeee;
  2117. -webkit-border-radius: 2em;
  2118. -moz-border-radius: 2em;
  2119. border-radius: 2em;
  2120. }
  2121. .list {
  2122. display: flex;
  2123. flex-wrap: wrap;
  2124. .item {
  2125. width: 40px;
  2126. height: 40px;
  2127. border-radius: 10px;
  2128. text-align: center;
  2129. line-height: 40px;
  2130. margin-left: 16px;
  2131. margin-top: 16px;
  2132. cursor: pointer;
  2133. &.white {
  2134. line-height: 38px;
  2135. color: #333333;
  2136. background: #ffffff;
  2137. border: 1px solid #eeeeee;
  2138. }
  2139. &.green {
  2140. color: #fff;
  2141. background: #37c65b;
  2142. }
  2143. &.red {
  2144. color: #fff;
  2145. background: #ff3a30;
  2146. }
  2147. &.blue {
  2148. border: 1rpx solid #eeeeee;
  2149. color: #fff;
  2150. background: #3f8dfd;
  2151. }
  2152. &.disabled {
  2153. cursor: not-allowed;
  2154. line-height: 38px;
  2155. color: #eeeeee;
  2156. background: #ffffff;
  2157. border: 1px solid #eeeeee;
  2158. }
  2159. }
  2160. }
  2161. }
  2162. }
  2163. }
  2164. &__footer {
  2165. height: 40px;
  2166. display: flex;
  2167. align-items: center;
  2168. justify-content: center;
  2169. .submit {
  2170. cursor: pointer;
  2171. width: 140px;
  2172. height: 32px;
  2173. background: #3f8dfd;
  2174. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2175. border-radius: 16px;
  2176. line-height: 32px;
  2177. text-align: center;
  2178. color: #fff;
  2179. font-size: 16px;
  2180. }
  2181. }
  2182. }
  2183. }
  2184. }
  2185. .video-modal {
  2186. /deep/ .el-dialog__header {
  2187. display: none;
  2188. }
  2189. /deep/ .el-dialog__body {
  2190. padding: 0;
  2191. overflow: unset;
  2192. }
  2193. &__close {
  2194. position: absolute;
  2195. right: 0;
  2196. top: -28px;
  2197. width: 24px;
  2198. height: 24px;
  2199. line-height: 24px;
  2200. text-align: center;
  2201. color: #eee;
  2202. border: 1px solid #eee;
  2203. border-radius: 50%;
  2204. }
  2205. &__header {
  2206. height: 40px;
  2207. border-bottom: 1px solid #eee;
  2208. line-height: 40px;
  2209. color: #ff3b30;
  2210. padding-left: 24px;
  2211. }
  2212. &__body {
  2213. width: 100%;
  2214. position: relative;
  2215. box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.04);
  2216. border-radius: 8px;
  2217. .video {
  2218. &__title {
  2219. padding-left: 24px;
  2220. height: 40px;
  2221. line-height: 40px;
  2222. font-size: 14px;
  2223. font-family: Microsoft YaHei;
  2224. font-weight: 400;
  2225. color: #333333;
  2226. }
  2227. &__wrap {
  2228. height: 450px;
  2229. video {
  2230. width: 100%;
  2231. height: 100%;
  2232. }
  2233. }
  2234. }
  2235. }
  2236. }
  2237. .select-class {
  2238. &__content {
  2239. .selection {
  2240. .el-select {
  2241. width: 100%;
  2242. }
  2243. }
  2244. }
  2245. }
  2246. }
  2247. </style>