course-detail.vue 68 KB

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