bank-detail.vue 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887
  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. <!-- 规格选择 -->
  1036. <index-sku-dialog :skuModal.sync="skuModal" :specTemplateId="goodsDetail.specTemplateId" :isCarOrBuy="isCarOrBuy"
  1037. @toShopCart='getAddCar' @togoBuy="toPayment"></index-sku-dialog>
  1038. </div>
  1039. </template>
  1040. <script>
  1041. import Footer from "@/components/footer/index";
  1042. import Header from "@/components/header/index";
  1043. import ToolBar from "@/components/toolbar/index";
  1044. import GoodsItem from "@/components/goodsItem/index";
  1045. import IndexSkuDialog from '@/components/goodsItem/IndexSkuDialog.vue'
  1046. import { mapMutations } from "vuex";
  1047. export default {
  1048. name: "GoodsDetail",
  1049. components: {
  1050. Footer,
  1051. Header,
  1052. ToolBar,
  1053. GoodsItem,
  1054. IndexSkuDialog,
  1055. },
  1056. data() {
  1057. return {
  1058. questionList: [],
  1059. goodsExamConfig: [],
  1060. goodsDetail: {},
  1061. bankList: [],
  1062. goodsId: "",
  1063. checked: false,
  1064. textarea: "",
  1065. questionModalShow: false,
  1066. activeName: "1",
  1067. questionModalData: {
  1068. activeName: "0",
  1069. num: 0, //试做题数
  1070. current: 0,
  1071. },
  1072. judge: ["正确", "错误"],
  1073. ast: [
  1074. "A",
  1075. "B",
  1076. "C",
  1077. "D",
  1078. "E",
  1079. "F",
  1080. "G",
  1081. "H",
  1082. "I",
  1083. "J",
  1084. "K",
  1085. "L",
  1086. "M",
  1087. "N",
  1088. "O",
  1089. "P",
  1090. "Q",
  1091. "R",
  1092. "S",
  1093. "T",
  1094. "U",
  1095. "V",
  1096. "W",
  1097. "X",
  1098. "Y",
  1099. "Z",
  1100. ],
  1101. recommendList: [],
  1102. skuModal: false,
  1103. isCarOrBuy: 1, // 1加入购物车 2立即购买
  1104. };
  1105. },
  1106. computed: {
  1107. compyRecommend: function () {
  1108. return function (array) {
  1109. let ary = [];
  1110. if (array) {
  1111. for (let i = 0; i < array.length; i++) {
  1112. if (i >= 5) {
  1113. break;
  1114. } else {
  1115. ary.push(array[i]);
  1116. }
  1117. }
  1118. }
  1119. return ary;
  1120. };
  1121. },
  1122. },
  1123. mounted() {
  1124. this.goodsId = this.$route.params.goodsId;
  1125. this.getGoodsDetail();
  1126. this.getGoodsBankList();
  1127. },
  1128. methods: {
  1129. ...mapMutations(["setCurrentRouter", "getCartCount"]),
  1130. toGoodsDetail(item) {
  1131. this.$router.push({
  1132. path: "/bank-detail/" + item.goodsId,
  1133. });
  1134. location.reload();
  1135. },
  1136. /**
  1137. * 查看更多
  1138. */
  1139. comeMoreList() {
  1140. this.$router.push({
  1141. path: "/bank-list",
  1142. query: {
  1143. educationId: this.goodsDetail.educationTypeId,
  1144. projectId: this.goodsDetail.projectId,
  1145. businessId: this.goodsDetail.businessId,
  1146. },
  1147. });
  1148. },
  1149. /**
  1150. *
  1151. 获取推荐列表
  1152. */
  1153. getRecommend() {
  1154. this.$request
  1155. .appCommonActivityRecommendList({
  1156. businessId: this.goodsDetail.businessId,
  1157. type: 2,
  1158. })
  1159. .then((res) => {
  1160. if (res.rows.length) {
  1161. this.recommendList = res.rows[0];
  1162. }
  1163. });
  1164. },
  1165. /**
  1166. * @param {Object}
  1167. * 单选点击确认
  1168. */
  1169. radioSelect(question, questionIndex, optionsId) {
  1170. if (this.questionList[questionIndex].ques) return;
  1171. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1172. },
  1173. /**
  1174. * @param {Object}
  1175. * 案例单选点击
  1176. */
  1177. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1178. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1179. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1180. },
  1181. /**
  1182. * 多选点击确认
  1183. */
  1184. checkboxSubmit(question, questionIndex) {
  1185. if (this.questionList[questionIndex].ques) return;
  1186. let arr = [];
  1187. this.questionList[questionIndex].jsonStr.forEach((item) => {
  1188. if (item.checked) {
  1189. arr.push(item.optionsId);
  1190. }
  1191. });
  1192. if (!arr.length) {
  1193. this.$message({
  1194. type: "warning",
  1195. message: "请选择答案",
  1196. });
  1197. return;
  1198. }
  1199. this.$set(this.questionList[questionIndex], "ques", arr);
  1200. },
  1201. /**
  1202. * @param {Object}
  1203. * 案例多选确认
  1204. */
  1205. checkboxSubmitChild(questionIndex, ansIndex) {
  1206. if (this.questionList[questionIndex].ques[ansIndex]) return;
  1207. let arr = [];
  1208. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1209. (item) => {
  1210. if (item.checked) {
  1211. arr.push(item.optionsId);
  1212. }
  1213. }
  1214. );
  1215. if (!arr.length) {
  1216. this.$message({
  1217. type: "warning",
  1218. message: "请选择答案",
  1219. });
  1220. return;
  1221. }
  1222. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1223. },
  1224. /**
  1225. * 判断点击确认
  1226. */
  1227. judgeSelect(question, questionIndex, index) {
  1228. if (question.ques) return;
  1229. this.$set(this.questionList[questionIndex], "ques", index == 0 ? '1' : '0');
  1230. },
  1231. judgeSelectChild(questionIndex, jsonIndex, index) {
  1232. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1233. this.$set(this.questionList[questionIndex].ques, jsonIndex, index == 0 ? '1' : '0');
  1234. },
  1235. /**
  1236. * 上传图片
  1237. */
  1238. uploadImg(e, question, questionIndex) {
  1239. var file = e.target.files[0];
  1240. if (file.size > 2 * 1024 * 1024) {
  1241. this.$message.warn("图片不得大于2000kb");
  1242. return;
  1243. }
  1244. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1245. if (
  1246. type[0] != "jpg" &&
  1247. type[0] != "png" &&
  1248. type[0] != "jpeg" &&
  1249. type[0] != "gif"
  1250. ) {
  1251. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1252. e.target.value = "";
  1253. return;
  1254. }
  1255. this.$upload.upload(file, 0).then((res) => {
  1256. question.ansText.imageList.push(res);
  1257. });
  1258. },
  1259. /**
  1260. * 案例上传图片
  1261. */
  1262. uploadImgChild(e, questionIndex, jsonIndex) {
  1263. var file = e.target.files[0];
  1264. if (file.size > 2 * 1024 * 1024) {
  1265. this.$message.warn("图片不得大于2000kb");
  1266. return;
  1267. }
  1268. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1269. if (
  1270. type[0] != "jpg" &&
  1271. type[0] != "png" &&
  1272. type[0] != "jpeg" &&
  1273. type[0] != "gif"
  1274. ) {
  1275. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1276. e.target.value = "";
  1277. return;
  1278. }
  1279. this.$upload.upload(file, 0).then((res) => {
  1280. this.questionList[questionIndex].jsonStr[
  1281. jsonIndex
  1282. ].ansText.imageList.push(res);
  1283. });
  1284. },
  1285. isOver(item, index) {
  1286. if (this.questionList[index].ques) {
  1287. if (item.type == 4) {
  1288. //案例题
  1289. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1290. if (
  1291. jsonItem.type == 1 ||
  1292. jsonItem.type == 2 ||
  1293. jsonItem.type == 3
  1294. ) {
  1295. if (item.ques[indexs]) {
  1296. return true;
  1297. } else {
  1298. return false;
  1299. }
  1300. } else if (jsonItem.type == 5) {
  1301. if (
  1302. item.ques[indexs] &&
  1303. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1304. ) {
  1305. console.log("chil");
  1306. return true;
  1307. } else {
  1308. return false;
  1309. }
  1310. }
  1311. });
  1312. if (isOver) {
  1313. return true;
  1314. } else {
  1315. return false;
  1316. }
  1317. } else if (item.type == 5) {
  1318. //简答题
  1319. //每一项都相等
  1320. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1321. return true;
  1322. }
  1323. //判断
  1324. } else {
  1325. return false;
  1326. }
  1327. } else {
  1328. return false;
  1329. }
  1330. },
  1331. ansSubmit(question, questionIndex) {
  1332. if (!question.ansText.text && !question.ansText.imageList.length) {
  1333. this.$message({
  1334. type: "warning",
  1335. message: "请输入内容或上传图片",
  1336. });
  1337. return;
  1338. }
  1339. question.ques.imageList = question.ansText.imageList;
  1340. question.ques.text = question.ansText.text;
  1341. console.log(question.ques);
  1342. },
  1343. ansSubmitChild(question, questionIndex, jsonIndex) {
  1344. if (
  1345. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1346. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1347. .length
  1348. ) {
  1349. this.$message({
  1350. type: "warning",
  1351. message: "请输入内容或上传图片",
  1352. });
  1353. return;
  1354. }
  1355. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1356. imageList:
  1357. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1358. .imageList || [],
  1359. text:
  1360. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  1361. "",
  1362. });
  1363. },
  1364. /**
  1365. * 试做
  1366. */
  1367. toDo(item) {
  1368. this.$request
  1369. .goodsQuestionList({
  1370. examId: item.majorId || item.examId,
  1371. })
  1372. .then((res) => {
  1373. this.questionModalData.num = this.isTest(
  1374. item.majorId || item.examId
  1375. ).num;
  1376. res.data.forEach((item, index) => {
  1377. if (typeof item.jsonStr == "string") {
  1378. item.jsonStr = JSON.parse(item.jsonStr);
  1379. if (item.type == 2) {
  1380. //多选
  1381. item.jsonStr.forEach((str) => {
  1382. str.optionsId = "" + str.optionsId;
  1383. });
  1384. let arr = item.answerQuestion.split(",");
  1385. arr.forEach((a, i) => {
  1386. arr[i] = "" + a;
  1387. });
  1388. item.ans = arr;
  1389. item.quesSelect = [];
  1390. item.analysisContent &&
  1391. (item.analysisContent = item.analysisContent.replace(
  1392. /<img/gi,
  1393. '<img style="max-width:100%;"'
  1394. ));
  1395. item.content &&
  1396. (item.content = item.content.replace(
  1397. /<img/gi,
  1398. '<img style="max-width:100%;"'
  1399. ));
  1400. return;
  1401. } else if (item.type == 5) {
  1402. //简答题
  1403. item.ansText = {
  1404. text: "",
  1405. imageList: [],
  1406. };
  1407. item.ques = {
  1408. text: "",
  1409. imageList: [],
  1410. };
  1411. item.analysisContent &&
  1412. (item.analysisContent = item.analysisContent.replace(
  1413. /<img/gi,
  1414. '<img style="max-width:100%;"'
  1415. ));
  1416. item.content &&
  1417. (item.content = item.content.replace(
  1418. /<img/gi,
  1419. '<img style="max-width:100%;"'
  1420. ));
  1421. return;
  1422. } else if (item.type == 4) {
  1423. //案例题
  1424. console.log(item.jsonStr);
  1425. item.ques = [];
  1426. item.tabIndex = "0";
  1427. let ansArr = [];
  1428. item.jsonStr.forEach((json, index) => {
  1429. if (json.type == 1) {
  1430. ansArr[index] = json.answerQuestion;
  1431. json.content &&
  1432. (json.content = json.content.replace(
  1433. /<img/gi,
  1434. '<img style="max-width:100%;"'
  1435. ));
  1436. } else if (json.type == 2) {
  1437. json.optionsList.forEach((str) => {
  1438. str.optionsId = "" + str.optionsId;
  1439. });
  1440. let arr = json.answerQuestion.split(",");
  1441. arr.forEach((a, i) => {
  1442. arr[i] = "" + a;
  1443. });
  1444. ansArr[index] = arr;
  1445. json.content &&
  1446. (json.content = json.content.replace(
  1447. /<img/gi,
  1448. '<img style="max-width:100%;"'
  1449. ));
  1450. } else if (json.type == 3) {
  1451. ansArr[index] = json.answerQuestion;
  1452. json.content &&
  1453. (json.content = json.content.replace(
  1454. /<img/gi,
  1455. '<img style="max-width:100%;"'
  1456. ));
  1457. } else if (json.type == 5) {
  1458. ansArr[index] = {
  1459. text: "",
  1460. imageList: [],
  1461. };
  1462. json.ansText = {
  1463. text: "",
  1464. imageList: [],
  1465. };
  1466. json.ques = {
  1467. text: "",
  1468. imageList: [],
  1469. };
  1470. json.content &&
  1471. (json.content = json.content.replace(
  1472. /<img/gi,
  1473. '<img style="max-width:100%;"'
  1474. ));
  1475. }
  1476. });
  1477. item.ans = ansArr;
  1478. return;
  1479. }
  1480. item.analysisContent &&
  1481. (item.analysisContent = item.analysisContent.replace(
  1482. /<img/gi,
  1483. '<img style="max-width:100%;"'
  1484. ));
  1485. item.content &&
  1486. (item.content = item.content.replace(
  1487. /<img/gi,
  1488. '<img style="max-width:100%;"'
  1489. ));
  1490. item.ques = "";
  1491. item.ans = item.answerQuestion;
  1492. }
  1493. });
  1494. this.questionList = res.data;
  1495. this.questionModalShow = true;
  1496. console.log(this.questionList);
  1497. });
  1498. },
  1499. changeIndex(index) {
  1500. if (index <= this.questionModalData.num - 1) {
  1501. this.questionModalData.current = index;
  1502. } else {
  1503. this.$message({
  1504. type: "warning",
  1505. message: "试做题目已经结束~",
  1506. });
  1507. }
  1508. },
  1509. nextQuestion() {
  1510. if (this.questionModalData.current >= this.questionModalData.num - 1) {
  1511. this.$message({
  1512. type: "warning",
  1513. message: "试做题目已经结束~",
  1514. });
  1515. return;
  1516. } else {
  1517. this.questionModalData.current++;
  1518. }
  1519. },
  1520. prevQuestion() {
  1521. if (this.questionModalData.current == 0) {
  1522. return;
  1523. } else {
  1524. this.questionModalData.current--;
  1525. }
  1526. },
  1527. isRight(item, index) {
  1528. //单选
  1529. if (this.questionList[index].ques) {
  1530. if (item.type == 1) {
  1531. console.log(
  1532. this.questionList[index].ques == this.questionList[index].ans
  1533. );
  1534. return this.questionList[index].ques == this.questionList[index].ans;
  1535. //多选
  1536. } else if (item.type == 2) {
  1537. //每一项都相等
  1538. return this.questionList[index].ans.every((item, i) => {
  1539. return item == this.questionList[index].ques[i];
  1540. });
  1541. //判断
  1542. } else if (item.type == 3) {
  1543. return this.questionList[index].ques == this.questionList[index].ans;
  1544. } else {
  1545. return false;
  1546. }
  1547. } else {
  1548. return false;
  1549. }
  1550. },
  1551. isWrong(item, index) {
  1552. if (this.questionList[index].ques) {
  1553. //单选
  1554. if (item.type == 1) {
  1555. return this.questionList[index].ques != this.questionList[index].ans;
  1556. //多选
  1557. } else if (item.type == 2) {
  1558. //每一项都相等
  1559. return this.questionList[index].ques.some((item, i) => {
  1560. return this.questionList[index].ans.indexOf(item) == -1;
  1561. });
  1562. //判断
  1563. } else if (item.type == 3) {
  1564. return this.questionList[index].ques != this.questionList[index].ans;
  1565. } else {
  1566. return false;
  1567. }
  1568. } else {
  1569. return false;
  1570. }
  1571. },
  1572. isPart(item, index) {
  1573. if (this.questionList[index].ques) {
  1574. if (item.type == 2) {
  1575. let isWrong = this.questionList[index].ques.some((item, i) => {
  1576. return this.questionList[index].ans.indexOf(item) == -1;
  1577. });
  1578. let isRight = this.questionList[index].ans.every((item, i) => {
  1579. return item == this.questionList[index].ques[i];
  1580. });
  1581. if (!isRight && !isWrong) {
  1582. return true;
  1583. }
  1584. }
  1585. } else {
  1586. return false;
  1587. }
  1588. },
  1589. right(bankIndex, ansIndex, option) {
  1590. if (
  1591. this.questionList[bankIndex].ques[ansIndex] &&
  1592. this.questionList[bankIndex].ans[ansIndex]
  1593. ) {
  1594. if (
  1595. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1596. option.optionsId
  1597. ) != -1 ||
  1598. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1599. option.optionsId
  1600. ) != -1
  1601. ) {
  1602. return true;
  1603. } else {
  1604. return false;
  1605. }
  1606. } else {
  1607. return false;
  1608. }
  1609. },
  1610. wrong(bankIndex, ansIndex, option) {
  1611. if (
  1612. this.questionList[bankIndex].ques[ansIndex] &&
  1613. this.questionList[bankIndex].ans[ansIndex]
  1614. ) {
  1615. if (
  1616. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1617. option.optionsId
  1618. ) != -1 &&
  1619. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1620. option.optionsId
  1621. ) == -1
  1622. ) {
  1623. return true;
  1624. } else {
  1625. return false;
  1626. }
  1627. } else {
  1628. return false;
  1629. }
  1630. },
  1631. /**
  1632. * 获取已经回答的题目数
  1633. * hasSpecail (是否包含简答和案例)
  1634. */
  1635. questionOverNum(hasSpecail) {
  1636. let count = 0;
  1637. this.questionList.forEach((item) => {
  1638. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1639. if (item.ques) {
  1640. count++;
  1641. }
  1642. } else if (item.type == 4) {
  1643. //案例题
  1644. if (hasSpecail) {
  1645. let isOver = item.jsonStr.every((jsonItem, index) => {
  1646. if (
  1647. jsonItem.type == 1 ||
  1648. jsonItem.type == 2 ||
  1649. jsonItem.type == 3
  1650. ) {
  1651. if (item.ques[index]) {
  1652. return true;
  1653. } else {
  1654. return false;
  1655. }
  1656. } else if (jsonItem.type == 5) {
  1657. if (
  1658. item.ques[index] &&
  1659. (item.ques[index].text || item.ques[index].imageList.length)
  1660. ) {
  1661. return true;
  1662. } else {
  1663. return false;
  1664. }
  1665. }
  1666. });
  1667. if (isOver) {
  1668. count++;
  1669. }
  1670. }
  1671. } else if (item.type == 5) {
  1672. //简答题
  1673. if (hasSpecail) {
  1674. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1675. count++;
  1676. }
  1677. }
  1678. }
  1679. });
  1680. return count;
  1681. },
  1682. /**
  1683. * 展开模块卷
  1684. */
  1685. moduleExam(Module) {
  1686. if (Module.list.length) {
  1687. Module.showList = !Module.showList;
  1688. return;
  1689. }
  1690. this.$request
  1691. .goodsChapterList({
  1692. moduleExamId: Module.majorId,
  1693. goodsId: this.goodsId,
  1694. })
  1695. .then((res) => {
  1696. res.data.forEach((item) => {
  1697. item.showList = false;
  1698. item.list = [];
  1699. });
  1700. this.$set(Module, "showList", !Module.showList);
  1701. Module.list = res.data;
  1702. });
  1703. },
  1704. /**
  1705. * 展开章卷
  1706. */
  1707. chapterExam(chapter) {
  1708. if (chapter.list.length) {
  1709. chapter.showList = !chapter.showList;
  1710. return;
  1711. }
  1712. this.$request
  1713. .goodsExamList({
  1714. chapterExamId: chapter.chapterExamId || chapter.majorId,
  1715. goodsId: this.goodsId,
  1716. })
  1717. .then((res) => {
  1718. this.$set(chapter, "showList", !chapter.showList);
  1719. chapter.list = res.data;
  1720. });
  1721. },
  1722. buyNow() {
  1723. if (!this.$tools.isLogin()) {
  1724. this.setCurrentRouter(this.$route);
  1725. this.$router.push({
  1726. path: "/login",
  1727. });
  1728. return;
  1729. }
  1730. // 判断有没有规格选择
  1731. if (this.goodsDetail.specTemplateId) {
  1732. this.isCarOrBuy = 2
  1733. this.skuModal = true
  1734. return
  1735. }
  1736. this.toPayment()
  1737. },
  1738. toPayment() {
  1739. let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
  1740. localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
  1741. this.$router.push({
  1742. path: "/payment",
  1743. });
  1744. },
  1745. addCart() {
  1746. if (!this.$tools.isLogin()) {
  1747. this.setCurrentRouter(this.$route);
  1748. this.$router.push({
  1749. path: "/login",
  1750. });
  1751. return;
  1752. }
  1753. // 判断有没有规格选择
  1754. if (this.goodsDetail.specTemplateId) {
  1755. this.isCarOrBuy = 1
  1756. this.skuModal = true
  1757. return
  1758. }
  1759. this.getAddCar()
  1760. },
  1761. getAddCar() {
  1762. this.$request
  1763. .addCart({ goodsId: this.goodsId })
  1764. .then((res) => {
  1765. this.getCartCount();
  1766. this.$message({
  1767. message: "加入购物车成功",
  1768. type: "success",
  1769. });
  1770. })
  1771. .catch((err) => {
  1772. if (err.code == 500) {
  1773. this.$message({
  1774. message: err.msg,
  1775. type: "warning",
  1776. });
  1777. }
  1778. });
  1779. },
  1780. /**
  1781. * 获取商品详情
  1782. */
  1783. getGoodsDetail() {
  1784. this.$request.commonGoodsDetail(this.goodsId).then((res) => {
  1785. this.goodsDetail = res.data;
  1786. this.goodsExamConfig = JSON.parse(res.data.goodsExamConfig);
  1787. this.getRecommend();
  1788. });
  1789. },
  1790. /**
  1791. * 是否是试做
  1792. */
  1793. isTest(id) {
  1794. return this.goodsExamConfig.find((item) => item.examId == id);
  1795. },
  1796. /**
  1797. * 获取课程列表
  1798. */
  1799. getGoodsBankList() {
  1800. this.$request.goodsBankList({ goodsId: this.goodsId }).then((res) => {
  1801. res.data.forEach((item) => {
  1802. if (item.type == 2 || item.type == 1) {
  1803. item.showList = false;
  1804. item.list = [];
  1805. }
  1806. });
  1807. this.bankList = res.data;
  1808. this.showAllCharpter();
  1809. });
  1810. },
  1811. /**
  1812. * 展示第一个章下的节内容
  1813. */
  1814. showAllCharpter() {
  1815. for (let i = 0; i < this.bankList.length; i++) {
  1816. if (this.bankList[i].type == 1) {
  1817. //第一个是模块直接展开,再展开章下面的节
  1818. this.$request
  1819. .goodsChapterList({
  1820. moduleExamId: this.bankList[i].majorId,
  1821. })
  1822. .then((res) => {
  1823. res.data.forEach((re) => {
  1824. re.list = [];
  1825. });
  1826. this.$set(this.bankList[i], "showList", true);
  1827. this.$set(this.bankList[i], "list", res.data);
  1828. this.chapterExam(this.bankList[i].list[0]);
  1829. });
  1830. break;
  1831. } else if (this.bankList[i].type == 2) {
  1832. //第一个章展开下面的节
  1833. this.chapterExam(this.bankList[i]);
  1834. break;
  1835. }
  1836. }
  1837. },
  1838. collect() {
  1839. this.$message({
  1840. message: "试做题目,不支持收藏~",
  1841. type: "warning",
  1842. });
  1843. return;
  1844. },
  1845. examSubmit() {
  1846. this.$confirm("当前为试用做题不可交卷,购买题卷后方可交卷", "提示", {
  1847. confirmButtonText: "继续作答",
  1848. cancelButtonText: "返回详情",
  1849. closeOnClickModal: false,
  1850. closeOnPressEscape: false,
  1851. distinguishCancelAndClose: false,
  1852. showClose: false,
  1853. })
  1854. .then((_) => {})
  1855. .catch((_) => {
  1856. this.questionModalShow = false;
  1857. });
  1858. },
  1859. },
  1860. };
  1861. </script>
  1862. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1863. <style scoped lang="scss">
  1864. .goods-detail {
  1865. .section {
  1866. &__header {
  1867. height: 40px;
  1868. display: flex;
  1869. align-items: center;
  1870. padding: 0 20px;
  1871. }
  1872. &__body {
  1873. .goods-info {
  1874. &__header {
  1875. width: 100%;
  1876. height: 288px;
  1877. background: #f5f7fa;
  1878. border-radius: 10px;
  1879. padding: 20px;
  1880. display: flex;
  1881. .img {
  1882. width: 442px;
  1883. height: 248px;
  1884. border-radius: 10px;
  1885. overflow: hidden;
  1886. img {
  1887. max-width: 100%;
  1888. max-height: 100%;
  1889. width: 100%;
  1890. height: 100%;
  1891. }
  1892. }
  1893. .text {
  1894. flex: 1;
  1895. margin-left: 24px;
  1896. .title {
  1897. font-size: 18px;
  1898. font-family: Microsoft YaHei;
  1899. font-weight: bold;
  1900. color: #333333;
  1901. line-height: 24px;
  1902. }
  1903. .price {
  1904. margin-top: 10px;
  1905. font-size: 24px;
  1906. font-family: Microsoft YaHei;
  1907. font-weight: bold;
  1908. color: #ff2d55;
  1909. line-height: 24px;
  1910. }
  1911. .btns {
  1912. margin-top: 154px;
  1913. display: flex;
  1914. .buynow {
  1915. margin-right: 16px;
  1916. width: 160px;
  1917. height: 40px;
  1918. padding: 0;
  1919. border-radius: 20px;
  1920. text-align: center;
  1921. line-height: 40px;
  1922. }
  1923. .add {
  1924. padding: 0;
  1925. width: 128px;
  1926. height: 40px;
  1927. border-radius: 20px;
  1928. text-align: center;
  1929. line-height: 40px;
  1930. }
  1931. }
  1932. }
  1933. }
  1934. &__body {
  1935. /deep/ .el-tabs__item {
  1936. padding: 0 20px !important;
  1937. height: 80px;
  1938. line-height: 80px;
  1939. font-size: 18px;
  1940. }
  1941. .detail {
  1942. img {
  1943. max-width: 100% !important;
  1944. }
  1945. }
  1946. .label {
  1947. font-size: 18px;
  1948. }
  1949. .view-note {
  1950. width: 40px;
  1951. height: 24px;
  1952. background: #ff3b30;
  1953. border-radius: 4px 4px 0px 4px;
  1954. border: 1px solid #ff3b30;
  1955. text-align: center;
  1956. line-height: 22px;
  1957. color: #fff;
  1958. position: absolute;
  1959. right: -10px;
  1960. top: 5px;
  1961. }
  1962. .goods-img {
  1963. width: 100%;
  1964. }
  1965. .goods-menu {
  1966. margin-top: 15px;
  1967. .left-box {
  1968. width: 948px;
  1969. float: left;
  1970. &__body {
  1971. .item {
  1972. margin-top: 24px;
  1973. padding: 16px;
  1974. background: #f5f7fa;
  1975. border-radius: 10px;
  1976. &__title {
  1977. cursor: pointer;
  1978. font-size: 16px;
  1979. font-family: Microsoft YaHei;
  1980. font-weight: bold;
  1981. color: #333333;
  1982. .note {
  1983. display: inline-block;
  1984. margin-left: 20px;
  1985. width: 40px;
  1986. height: 24px;
  1987. border: 1px solid #ff3b30;
  1988. border-radius: 8px;
  1989. line-height: 22px;
  1990. color: #ff3b30;
  1991. text-align: center;
  1992. }
  1993. }
  1994. &__content {
  1995. margin-top: 12px;
  1996. background: #fff;
  1997. .bank-chapter {
  1998. margin-left: 4px;
  1999. &__item {
  2000. padding-top: 20px;
  2001. padding-bottom: 20px;
  2002. border-bottom: 1px solid #eeeeee;
  2003. font-size: 16px;
  2004. &__text {
  2005. cursor: pointer;
  2006. flex: 1;
  2007. }
  2008. }
  2009. }
  2010. .bank-section {
  2011. margin-left: 40px;
  2012. &__item {
  2013. padding-top: 20px;
  2014. padding-bottom: 20px;
  2015. border-bottom: 1px solid #eeeeee;
  2016. font-size: 16px;
  2017. display: flex;
  2018. &__text {
  2019. flex: 1;
  2020. }
  2021. .btn {
  2022. margin-right: 20px;
  2023. width: 40px;
  2024. height: 24px;
  2025. border: 1px solid #ff3b30;
  2026. border-radius: 8px;
  2027. line-height: 22px;
  2028. color: #ff3b30;
  2029. text-align: center;
  2030. cursor: pointer;
  2031. }
  2032. }
  2033. }
  2034. }
  2035. }
  2036. }
  2037. }
  2038. .right-box {
  2039. width: 255px;
  2040. float: right;
  2041. .title {
  2042. margin-left: 10px;
  2043. font-size: 16px;
  2044. font-family: Microsoft YaHei;
  2045. font-weight: 400;
  2046. color: #333333;
  2047. text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
  2048. position: relative;
  2049. .more {
  2050. font-size: 16px;
  2051. font-family: Microsoft YaHei;
  2052. font-weight: 400;
  2053. color: #999999;
  2054. position: absolute;
  2055. right: 10px;
  2056. top: 0;
  2057. }
  2058. }
  2059. .list {
  2060. .course-item {
  2061. // margin: 110px 9px 0;
  2062. // width: 300px;
  2063. // height: 178px;
  2064. // background: #ffffff;
  2065. // box-shadow: 0px 10px 13px 3px rgba(63, 141, 253, 0.1);
  2066. // border-radius: 10px;
  2067. // position: relative;
  2068. // background: #fff;
  2069. // padding-top: 100px;
  2070. // &__img {
  2071. // width: 280px;
  2072. // height: 178px;
  2073. // background: #ffffff;
  2074. // box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  2075. // border-radius: 10px;
  2076. // position: absolute;
  2077. // left: 10px;
  2078. // top: -78px;
  2079. // background: rgba(122, 136, 246, 1);
  2080. // overflow: hidden;
  2081. // background: no-repeat center center;
  2082. // background-size: 280px 178px;
  2083. // .note {
  2084. // width: 80px;
  2085. // height: 24px;
  2086. // background: #d94404;
  2087. // box-shadow: 0px 1px 1px 0px rgba(248, 78, 5, 0.4);
  2088. // border-radius: 10px 0px 20px 0px;
  2089. // text-align: center;
  2090. // line-height: 24px;
  2091. // color: #fff;
  2092. // }
  2093. // }
  2094. // &__title {
  2095. // margin: 0 8px;
  2096. // font-size: 14px;
  2097. // font-family: Microsoft YaHei;
  2098. // font-weight: 400;
  2099. // color: #333333;
  2100. // line-height: 24px;
  2101. // }
  2102. // &__desc {
  2103. // height: 32px;
  2104. // position: absolute;
  2105. // left: 0;
  2106. // right: 0;
  2107. // bottom: 0;
  2108. // margin-left: 8px;
  2109. // display: flex;
  2110. // justify-content: space-between;
  2111. // .price {
  2112. // font-size: 18px;
  2113. // font-family: Microsoft YaHei;
  2114. // font-weight: bold;
  2115. // color: #ff2d55;
  2116. // line-height: 32px;
  2117. // }
  2118. // .add {
  2119. // display: block;
  2120. // width: 118px;
  2121. // height: 32px;
  2122. // line-height: 30px;
  2123. // background: #f2f4f7;
  2124. // border-radius: 10px 0px 10px 0px;
  2125. // font-size: 16px;
  2126. // color: #3f8dfd;
  2127. // text-align: center;
  2128. // &:hover {
  2129. // background: #3f8dfd;
  2130. // color: #f2f4f7;
  2131. // }
  2132. // }
  2133. // }
  2134. }
  2135. }
  2136. }
  2137. }
  2138. }
  2139. }
  2140. }
  2141. &__footer {
  2142. .recommend {
  2143. padding-top: 40px;
  2144. &__header {
  2145. display: flex;
  2146. align-items: center;
  2147. .title {
  2148. font-size: 24px;
  2149. font-family: YouSheBiaoTiHei;
  2150. font-weight: 400;
  2151. color: #333333;
  2152. text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
  2153. }
  2154. }
  2155. &__body {
  2156. .list {
  2157. width: 100%;
  2158. .recommend-item {
  2159. float: left;
  2160. // margin: 100px 9px 0;
  2161. // width: 300px;
  2162. // height: 178px;
  2163. // background: #ffffff;
  2164. // box-shadow: 0px 10px 13px 3px rgba(63, 141, 253, 0.1);
  2165. // border-radius: 10px;
  2166. // position: relative;
  2167. // background: #fff;
  2168. // padding-top: 100px;
  2169. // &__img {
  2170. // width: 280px;
  2171. // height: 178px;
  2172. // background: #ffffff;
  2173. // box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  2174. // border-radius: 10px;
  2175. // position: absolute;
  2176. // left: 10px;
  2177. // top: -78px;
  2178. // background: rgba(122, 136, 246, 1);
  2179. // overflow: hidden;
  2180. // background: no-repeat center center;
  2181. // background-size: 280px 178px;
  2182. // .note {
  2183. // width: 80px;
  2184. // height: 24px;
  2185. // background: #d94404;
  2186. // box-shadow: 0px 1px 1px 0px rgba(248, 78, 5, 0.4);
  2187. // border-radius: 10px 0px 20px 0px;
  2188. // text-align: center;
  2189. // line-height: 24px;
  2190. // color: #fff;
  2191. // }
  2192. // }
  2193. // &__title {
  2194. // margin: 0 8px;
  2195. // font-size: 14px;
  2196. // font-family: Microsoft YaHei;
  2197. // font-weight: 400;
  2198. // color: #333333;
  2199. // line-height: 24px;
  2200. // }
  2201. // &__desc {
  2202. // height: 32px;
  2203. // position: absolute;
  2204. // left: 0;
  2205. // right: 0;
  2206. // bottom: 0;
  2207. // margin-left: 8px;
  2208. // display: flex;
  2209. // justify-content: space-between;
  2210. // .price {
  2211. // font-size: 18px;
  2212. // font-family: Microsoft YaHei;
  2213. // font-weight: bold;
  2214. // color: #ff2d55;
  2215. // line-height: 32px;
  2216. // }
  2217. // .add {
  2218. // display: block;
  2219. // width: 118px;
  2220. // height: 32px;
  2221. // line-height: 30px;
  2222. // background: #f2f4f7;
  2223. // border-radius: 10px 0px 10px 0px;
  2224. // font-size: 16px;
  2225. // color: #3f8dfd;
  2226. // text-align: center;
  2227. // &:hover {
  2228. // background: #3f8dfd;
  2229. // color: #f2f4f7;
  2230. // }
  2231. // }
  2232. // }
  2233. }
  2234. }
  2235. }
  2236. &__footer {
  2237. overflow: hidden;
  2238. .btn {
  2239. cursor: pointer;
  2240. width: 146px;
  2241. height: 40px;
  2242. background: #e3eaf7;
  2243. border-radius: 8px;
  2244. margin: 20px auto 40px;
  2245. color: #3f8dfd;
  2246. text-align: center;
  2247. line-height: 40px;
  2248. &:hover {
  2249. color: #fff;
  2250. box-shadow: 0px 8px 4px 0px rgba(7, 82, 208, 0.08);
  2251. background: #3f8dfd;
  2252. }
  2253. }
  2254. }
  2255. }
  2256. }
  2257. }
  2258. .question-modal {
  2259. /deep/ .el-dialog__header {
  2260. display: none;
  2261. }
  2262. /deep/ .el-dialog__body {
  2263. padding: 0;
  2264. overflow: unset;
  2265. }
  2266. &__close {
  2267. position: absolute;
  2268. right: 0;
  2269. top: -28px;
  2270. width: 24px;
  2271. height: 24px;
  2272. line-height: 24px;
  2273. text-align: center;
  2274. color: #eee;
  2275. border: 1px solid #eee;
  2276. border-radius: 50%;
  2277. }
  2278. &__content {
  2279. width: 800px;
  2280. height: 530px;
  2281. position: relative;
  2282. box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.04);
  2283. border-radius: 8px;
  2284. .left-box {
  2285. float: left;
  2286. width: 500px;
  2287. border-right: 1px solid #eee;
  2288. &__header {
  2289. height: 40px;
  2290. padding-left: 12px;
  2291. border-bottom: 1px solid #eeeeee;
  2292. display: flex;
  2293. align-items: center;
  2294. .progress {
  2295. width: 200px;
  2296. }
  2297. .text {
  2298. margin-left: 15px;
  2299. font-size: 16px;
  2300. span {
  2301. font-family: Microsoft YaHei;
  2302. font-weight: bold;
  2303. color: #3f8dfd;
  2304. line-height: 24px;
  2305. }
  2306. }
  2307. }
  2308. &__body {
  2309. height: 450px;
  2310. border-bottom: 1px solid #eee;
  2311. .question {
  2312. padding: 12px 0 0 12px;
  2313. display: flex;
  2314. flex-direction: column;
  2315. height: 100%;
  2316. &__title {
  2317. padding-left: 12px;
  2318. font-size: 16px;
  2319. font-family: Microsoft YaHei;
  2320. font-weight: bold;
  2321. color: #333333;
  2322. line-height: 24px;
  2323. }
  2324. &__desc {
  2325. padding-left: 12px;
  2326. margin-top: 20px;
  2327. font-size: 16px;
  2328. font-family: Microsoft YaHei;
  2329. font-weight: 400;
  2330. color: #666666;
  2331. line-height: 24px;
  2332. }
  2333. &__content {
  2334. flex: 1;
  2335. overflow-y: scroll;
  2336. &::-webkit-scrollbar {
  2337. width: 6px;
  2338. }
  2339. &::-webkit-scrollbar-track {
  2340. background-color: #fff;
  2341. -webkit-border-radius: 2em;
  2342. -moz-border-radius: 2em;
  2343. border-radius: 2em;
  2344. }
  2345. &::-webkit-scrollbar-thumb {
  2346. background-color: #eeeeee;
  2347. -webkit-border-radius: 2em;
  2348. -moz-border-radius: 2em;
  2349. border-radius: 2em;
  2350. }
  2351. /deep/ .el-tabs__item {
  2352. padding: 0 20px !important;
  2353. height: 40px;
  2354. line-height: 40px;
  2355. }
  2356. .question__content {
  2357. height: auto;
  2358. overflow: auto;
  2359. }
  2360. .question-list {
  2361. padding: 24px 0 0 24px;
  2362. .checkbox,
  2363. .radio {
  2364. cursor: pointer;
  2365. margin-right: 24px;
  2366. padding: 0 24px;
  2367. display: flex;
  2368. align-items: center;
  2369. margin-top: 2px;
  2370. min-height: 40px;
  2371. padding-top: 10px;
  2372. padding-bottom: 10px;
  2373. background: #f5f9ff;
  2374. border-radius: 8px;
  2375. box-sizing: border-box;
  2376. &.right {
  2377. background: #37c65b;
  2378. }
  2379. &.wrong {
  2380. background: #ff3a30;
  2381. }
  2382. }
  2383. &.textarea {
  2384. margin-right: 12px;
  2385. .upload {
  2386. margin-top: 10px;
  2387. &__imgs {
  2388. margin-right: 10px;
  2389. width: 80px;
  2390. height: 80px;
  2391. background: #ffffff;
  2392. border: 1px solid #eeeeee;
  2393. border-radius: 4px;
  2394. position: relative;
  2395. display: flex;
  2396. float: left;
  2397. align-items: center;
  2398. justify-content: center;
  2399. img {
  2400. max-width: 100%;
  2401. max-height: 100%;
  2402. }
  2403. }
  2404. &__btn {
  2405. margin-right: 10px;
  2406. width: 80px;
  2407. height: 80px;
  2408. background: #ffffff;
  2409. border: 1px solid #eeeeee;
  2410. border-radius: 4px;
  2411. position: relative;
  2412. display: flex;
  2413. float: left;
  2414. align-items: center;
  2415. justify-content: center;
  2416. flex-direction: column;
  2417. .icon {
  2418. font-size: 20px;
  2419. color: #3f8dfd;
  2420. }
  2421. p {
  2422. font-size: 12px;
  2423. font-family: Microsoft YaHei;
  2424. font-weight: 400;
  2425. color: #999999;
  2426. line-height: 24px;
  2427. }
  2428. input {
  2429. position: absolute;
  2430. left: 0;
  2431. top: 0;
  2432. display: block;
  2433. width: 100%;
  2434. height: 100%;
  2435. opacity: 0;
  2436. }
  2437. }
  2438. }
  2439. }
  2440. /deep/ .el-checkbox {
  2441. white-space: pre-wrap;
  2442. }
  2443. }
  2444. .answer-list {
  2445. height: 40px;
  2446. border-top: 1px solid #eee;
  2447. border-bottom: 1px solid #eee;
  2448. margin-top: 24px;
  2449. display: flex;
  2450. align-items: center;
  2451. justify-content: space-between;
  2452. padding: 0 24px;
  2453. &__left {
  2454. font-size: 16px;
  2455. font-family: Microsoft YaHei;
  2456. font-weight: 400;
  2457. color: #333333;
  2458. line-height: 24px;
  2459. }
  2460. &__right {
  2461. font-size: 16px;
  2462. font-family: Microsoft YaHei;
  2463. font-weight: 400;
  2464. color: #333333;
  2465. line-height: 24px;
  2466. }
  2467. }
  2468. .explain-list {
  2469. padding: 12px 24px;
  2470. &__header {
  2471. font-size: 16px;
  2472. font-family: Microsoft YaHei;
  2473. font-weight: bold;
  2474. color: #666666;
  2475. line-height: 24px;
  2476. }
  2477. &__body {
  2478. margin-top: 12px;
  2479. font-size: 16px;
  2480. font-family: Microsoft YaHei;
  2481. font-weight: 400;
  2482. color: #666666;
  2483. line-height: 24px;
  2484. }
  2485. .upload {
  2486. margin-top: 10px;
  2487. &__imgs {
  2488. margin-right: 10px;
  2489. width: 80px;
  2490. height: 80px;
  2491. background: #ffffff;
  2492. border: 1px solid #eeeeee;
  2493. border-radius: 4px;
  2494. position: relative;
  2495. display: flex;
  2496. float: left;
  2497. align-items: center;
  2498. justify-content: center;
  2499. img {
  2500. max-width: 100%;
  2501. max-height: 100%;
  2502. }
  2503. }
  2504. }
  2505. }
  2506. }
  2507. &__btns {
  2508. position: relative;
  2509. height: 32px;
  2510. .submit {
  2511. cursor: pointer;
  2512. margin: 0 auto;
  2513. width: 140px;
  2514. height: 32px;
  2515. background: #3f8dfd;
  2516. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2517. border-radius: 16px;
  2518. text-align: center;
  2519. line-height: 32px;
  2520. color: #fff;
  2521. font-size: 16px;
  2522. }
  2523. .collect {
  2524. cursor: pointer;
  2525. position: absolute;
  2526. right: 0;
  2527. top: 5px;
  2528. font-size: 12px;
  2529. font-family: Microsoft YaHei;
  2530. font-weight: 400;
  2531. color: #3f8dfd;
  2532. line-height: 24px;
  2533. }
  2534. }
  2535. }
  2536. }
  2537. &__footer {
  2538. height: 40px;
  2539. display: flex;
  2540. justify-content: space-around;
  2541. align-items: center;
  2542. .btn {
  2543. cursor: pointer;
  2544. width: 140px;
  2545. height: 32px;
  2546. background: #ffffff;
  2547. border: 1px solid #3f8dfd;
  2548. border-radius: 16px;
  2549. line-height: 32px;
  2550. text-align: center;
  2551. color: #3f8dfd;
  2552. }
  2553. }
  2554. }
  2555. .right-box {
  2556. float: right;
  2557. width: 300px;
  2558. &__header {
  2559. height: 40px;
  2560. line-height: 40px;
  2561. font-size: 16px;
  2562. font-family: Microsoft YaHei;
  2563. font-weight: bold;
  2564. color: #333333;
  2565. text-align: center;
  2566. border-bottom: 1px solid #eeeeee;
  2567. }
  2568. &__body {
  2569. height: 450px;
  2570. border-bottom: 1px solid #eee;
  2571. .card {
  2572. &__note {
  2573. display: flex;
  2574. height: 40px;
  2575. align-items: center;
  2576. border-bottom: 1px solid #eee;
  2577. .item {
  2578. display: flex;
  2579. align-items: center;
  2580. margin-left: 10px;
  2581. .box {
  2582. margin-right: 5px;
  2583. width: 16px;
  2584. height: 16px;
  2585. border-radius: 4px;
  2586. &.white {
  2587. background: #ffffff;
  2588. border: 1px solid #eeeeee;
  2589. }
  2590. &.green {
  2591. background: #37c65b;
  2592. }
  2593. &.red {
  2594. background: #ff3a30;
  2595. }
  2596. &.blue {
  2597. background: #3f8dfd;
  2598. }
  2599. }
  2600. }
  2601. }
  2602. &__content {
  2603. height: 410px;
  2604. overflow-y: scroll;
  2605. &::-webkit-scrollbar {
  2606. width: 6px;
  2607. }
  2608. &::-webkit-scrollbar-track {
  2609. background-color: #fff;
  2610. -webkit-border-radius: 2em;
  2611. -moz-border-radius: 2em;
  2612. border-radius: 2em;
  2613. }
  2614. &::-webkit-scrollbar-thumb {
  2615. background-color: #eeeeee;
  2616. -webkit-border-radius: 2em;
  2617. -moz-border-radius: 2em;
  2618. border-radius: 2em;
  2619. }
  2620. .list {
  2621. display: flex;
  2622. flex-wrap: wrap;
  2623. .item {
  2624. width: 40px;
  2625. height: 40px;
  2626. border-radius: 10px;
  2627. text-align: center;
  2628. line-height: 40px;
  2629. margin-left: 16px;
  2630. margin-top: 16px;
  2631. cursor: pointer;
  2632. &.white {
  2633. line-height: 38px;
  2634. color: #333333;
  2635. background: #ffffff;
  2636. border: 1px solid #eeeeee;
  2637. }
  2638. &.green {
  2639. color: #fff;
  2640. background: #37c65b;
  2641. }
  2642. &.red {
  2643. color: #fff;
  2644. background: #ff3a30;
  2645. }
  2646. &.blue {
  2647. border: 1rpx solid #eeeeee;
  2648. color: #fff;
  2649. background: #3f8dfd;
  2650. }
  2651. &.disabled {
  2652. cursor: not-allowed;
  2653. line-height: 38px;
  2654. color: #eeeeee;
  2655. background: #ffffff;
  2656. border: 1px solid #eeeeee;
  2657. }
  2658. }
  2659. }
  2660. }
  2661. }
  2662. }
  2663. &__footer {
  2664. height: 40px;
  2665. display: flex;
  2666. align-items: center;
  2667. justify-content: center;
  2668. .submit {
  2669. cursor: pointer;
  2670. width: 140px;
  2671. height: 32px;
  2672. background: #3f8dfd;
  2673. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2674. border-radius: 16px;
  2675. line-height: 32px;
  2676. text-align: center;
  2677. color: #fff;
  2678. font-size: 16px;
  2679. }
  2680. }
  2681. }
  2682. }
  2683. }
  2684. .video-modal {
  2685. /deep/ .el-dialog__header {
  2686. display: none;
  2687. }
  2688. /deep/ .el-dialog__body {
  2689. padding: 0;
  2690. overflow: unset;
  2691. }
  2692. &__close {
  2693. position: absolute;
  2694. right: 0;
  2695. top: -28px;
  2696. width: 24px;
  2697. height: 24px;
  2698. line-height: 24px;
  2699. text-align: center;
  2700. color: #eee;
  2701. border: 1px solid #eee;
  2702. border-radius: 50%;
  2703. }
  2704. &__header {
  2705. height: 40px;
  2706. border-bottom: 1px solid #eee;
  2707. line-height: 40px;
  2708. color: #ff3b30;
  2709. padding-left: 24px;
  2710. }
  2711. &__body {
  2712. width: 100%;
  2713. position: relative;
  2714. box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.04);
  2715. border-radius: 8px;
  2716. .video {
  2717. &__title {
  2718. padding-left: 24px;
  2719. height: 40px;
  2720. line-height: 40px;
  2721. font-size: 14px;
  2722. font-family: Microsoft YaHei;
  2723. font-weight: 400;
  2724. color: #333333;
  2725. }
  2726. &__wrap {
  2727. height: 450px;
  2728. video {
  2729. width: 100%;
  2730. height: 100%;
  2731. }
  2732. }
  2733. }
  2734. }
  2735. }
  2736. }
  2737. </style>