live-detail.vue 83 KB

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