bank-detail.vue 93 KB

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