course-detail.vue 82 KB

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