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