index.vue 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380
  1. <template>
  2. <div class="home">
  3. <header class="header">
  4. <div class="header__header">
  5. <div class="container">
  6. <div class="text-list" v-if="!userInfo">
  7. <a @click="go('/login', { state: 1 })">登录</a>
  8. <a @click="go('/login', { state: 2 })">注册</a>
  9. </div>
  10. <div class="icon-list" v-else>
  11. <!-- <a @click="go('/person-center/my-message')">
  12. <i class="el-icon-message-solid icon"></i>
  13. </a> -->
  14. <el-tooltip
  15. placement="bottom-end"
  16. v-model="msgShow"
  17. :hide-after="0"
  18. manual
  19. popper-class="tooltipStyle"
  20. >
  21. <el-badge
  22. :is-dot="msgCount > 0 ? true : false"
  23. class="item"
  24. style="vertical-align: baseline"
  25. >
  26. <el-button
  27. style="font-size: 20px; padding: 0px"
  28. icon="el-icon-message-solid"
  29. type="text"
  30. @click="go('/person-center/my-message')"
  31. ></el-button>
  32. </el-badge>
  33. <div slot="content" class="dis_plays">
  34. <p style="max-width: 247px">{{ msgData.text }}</p>
  35. <div class="toolbth" @click="newGoToStudy">立即学习</div>
  36. <i
  37. style="font-size: 18px;cursor:pointer;"
  38. class="el-icon-close"
  39. @click="clearMsg"
  40. ></i>
  41. </div>
  42. </el-tooltip>
  43. <el-dropdown @command="handleCommand">
  44. <span class="el-dropdown-link">
  45. <i
  46. class="el-icon-user-solid"
  47. style="
  48. font-size: 20px;
  49. color: #3f8dfd;
  50. cursor: pointer;
  51. margin-left: 20px;
  52. "
  53. @click="go('/person-center/my-course')"
  54. ></i>
  55. </span>
  56. <el-dropdown-menu slot="dropdown">
  57. <el-dropdown-item command="1">我的课程</el-dropdown-item>
  58. <el-dropdown-item command="2">我的题库</el-dropdown-item>
  59. <el-dropdown-item command="3">个人中心</el-dropdown-item>
  60. <el-dropdown-item command="4">退出登录</el-dropdown-item>
  61. </el-dropdown-menu>
  62. </el-dropdown>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="header__body">
  67. <div class="container clearfix">
  68. <a class="logo">
  69. <img
  70. v-if="header.companyLogo"
  71. :src="$tools.splitImgHost(header.companyLogo)"
  72. alt=""
  73. />
  74. <h1 v-else></h1>
  75. </a>
  76. <div class="search">
  77. <div class="search__select">
  78. <select v-model="type">
  79. <option value="1">课程</option>
  80. <option value="2">题库</option>
  81. <option value="6">直播</option>
  82. </select>
  83. </div>
  84. <div class="search__input">
  85. <input
  86. v-model="searchKey"
  87. type="text"
  88. autocomplete="new-password"
  89. />
  90. </div>
  91. <el-button type="primary" @click="search" class="search__btn"
  92. >搜索</el-button
  93. >
  94. </div>
  95. <div
  96. class="contact"
  97. v-show="false"
  98. v-if="header.serviceTel.status == 1"
  99. >
  100. <div class="contact__phone">{{ header.serviceTel.tel }}</div>
  101. <div class="contact__time">
  102. {{ header.serviceTel.time }}
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </header>
  108. <section class="section">
  109. <div class="container">
  110. <div class="tabs">
  111. <template v-for="(item, index) in showNav(header.Nav)">
  112. <a v-if="item.name === '首页'" :key="index" class="tab active"
  113. >首页</a
  114. >
  115. <a
  116. v-if="item.name === '走进祥粤'"
  117. :key="index"
  118. class="tab"
  119. @click="go('/about')"
  120. >走进祥粤</a
  121. >
  122. <a
  123. v-if="item.name === '课程'"
  124. :key="index"
  125. class="tab"
  126. @click="go('/course-list')"
  127. >课程</a
  128. >
  129. <a
  130. v-if="item.name === '题库'"
  131. :key="index"
  132. class="tab"
  133. @click="go('/bank-list')"
  134. >题库</a
  135. >
  136. <a
  137. v-if="item.name === '直播'"
  138. :key="index"
  139. class="tab"
  140. @click="go('/live-list')"
  141. >直播</a
  142. >
  143. </template>
  144. </div>
  145. </div>
  146. <div class="swiper-wrap" :style="{ background: color }">
  147. <div class="container">
  148. <div class="left-box">
  149. <div class="left-box__header">课程导航</div>
  150. <div class="left-box__body">
  151. <div class="bg"></div>
  152. <div class="slide-list">
  153. <div
  154. class="slide-list__item"
  155. v-for="(type, typeItem) in typeList"
  156. :key="'type' + typeItem"
  157. >
  158. <div class="title" @click="goCourse(type)">
  159. {{ type.educationName }}
  160. </div>
  161. <ul class="nav">
  162. <li
  163. v-for="(slideItem, slideIndex) in slideList[typeItem]"
  164. :key="'item' + slideIndex"
  165. @click="goCourse(slideItem)"
  166. >
  167. <div class="text">
  168. <!-- {{ slideItem.projectName }}-{{ slideItem.businessName }} -->
  169. {{ slideItem.aliasName }}
  170. </div>
  171. </li>
  172. </ul>
  173. </div>
  174. </div>
  175. <ul class="list">
  176. <li v-for="(item, index) in typeList" :key="index">
  177. <div class="text">
  178. <div class="text__title" @click="goCourse(item)">
  179. {{ item.educationName }}
  180. </div>
  181. <div class="text__desc">
  182. <a
  183. @click="goCourse(aItem)"
  184. class="item"
  185. v-for="(aItem, aIndex) in item.list"
  186. :key="'aItem' + aIndex"
  187. >
  188. <!-- {{ aItem.projectName }}-{{ aItem.businessName }} -->
  189. {{ aItem.aliasName }}
  190. </a>
  191. </div>
  192. </div>
  193. </li>
  194. </ul>
  195. </div>
  196. </div>
  197. <div class="swiper">
  198. <swiper
  199. v-if="bannerList.length > 0"
  200. ref="mySwiper"
  201. @slideChangeTransitionStart="slideChangeTransitionStart($event)"
  202. class=""
  203. v-bind:options="swiperOptions"
  204. >
  205. <swiper-slide
  206. v-for="(item, index) in bannerList"
  207. v-bind:key="index"
  208. @click.native="swiperJump(item)"
  209. >
  210. <img
  211. :src="$tools.splitImgHost(item.adverUrl, true, 1272)"
  212. alt=""
  213. />
  214. </swiper-slide>
  215. <div class="swiper-pagination" slot="pagination"></div>
  216. <!-- <div class="swiper-button-prev" slot="button-prev"></div>
  217. <div class="swiper-button-next" slot="button-next"></div> -->
  218. </swiper>
  219. </div>
  220. <div class="right-box">
  221. <div class="bg"></div>
  222. <div class="no-login" v-if="!userInfo">
  223. <template v-if="loginType == 1">
  224. <el-form :model="loginForm" ref="loginForm" :rules="loginRules">
  225. <div class="input">
  226. <el-form-item prop="account">
  227. <el-input
  228. autocomplete="new-password"
  229. v-model="loginForm.account"
  230. @keyup.enter.native="login"
  231. placeholder="请输入手机号或身份证号"
  232. ></el-input>
  233. </el-form-item>
  234. </div>
  235. <div class="input">
  236. <el-form-item prop="pwd">
  237. <el-input
  238. autocomplete="new-password"
  239. type="password"
  240. v-model="loginForm.pwd"
  241. placeholder="请输入密码"
  242. @keyup.enter.native="login"
  243. ></el-input>
  244. </el-form-item>
  245. </div>
  246. <el-button
  247. type="primary"
  248. class="submit"
  249. @click="login()"
  250. :loading="isLogin"
  251. >登录</el-button
  252. >
  253. <div class="bottom-text">
  254. <a class="text" @click="loginType = 2">手机验证码登录</a>
  255. <a class="text" @click="go('/login?state=2')">注册</a>
  256. </div>
  257. <div class="dis_flex">
  258. <div class="dis_flex_wxloginImg">
  259. <img src="@/assets/wx.png" alt="" @click="wxLoginFunc" />
  260. </div>
  261. </div>
  262. </el-form>
  263. </template>
  264. <template v-if="loginType == 2">
  265. <el-form
  266. :model="loginSmsForm"
  267. ref="loginSmsForm"
  268. :rules="loginSmsRules"
  269. >
  270. <div class="input">
  271. <el-form-item prop="tel">
  272. <el-input
  273. autocomplete="new-password"
  274. v-model="loginSmsForm.tel"
  275. placeholder="请输入手机号"
  276. ></el-input>
  277. </el-form-item>
  278. </div>
  279. <div class="input">
  280. <el-form-item prop="code">
  281. <el-input
  282. autocomplete="new-password"
  283. v-model="loginSmsForm.code"
  284. placeholder="请输入验证码"
  285. >
  286. <span slot="suffix" @click="getLoginSms" class="btn">{{
  287. countDown == 0
  288. ? "获取验证码"
  289. : `${countDown}秒重新获取`
  290. }}</span>
  291. </el-input>
  292. </el-form-item>
  293. </div>
  294. <el-button
  295. type="primary"
  296. class="submit"
  297. :loading="isloginSms"
  298. @click="loginSms()"
  299. >登录</el-button
  300. >
  301. <div class="bottom-text">
  302. <a class="text" @click="loginType = 1">账号密码登录</a>
  303. <a class="text" @click="go('/login?state=2')">注册</a>
  304. </div>
  305. <div class="dis_flex">
  306. <div class="dis_flex_wxloginImg">
  307. <img src="@/assets/wx.png" alt="" @click="wxLoginFunc" />
  308. </div>
  309. </div>
  310. </el-form>
  311. </template>
  312. </div>
  313. <div class="has-login" v-else>
  314. <div class="userinfo">
  315. <img src="@/assets/ava.png" class="avatar" alt="" />
  316. <div class="nickname">{{ userInfo && userInfo.realname }}</div>
  317. </div>
  318. <div class="type-list">
  319. <div
  320. class="type-list__item"
  321. @click="go('/person-center/my-course')"
  322. >
  323. <img src="@/assets/kc.png" alt="" />
  324. <div class="text">课程</div>
  325. </div>
  326. <div
  327. class="type-list__item"
  328. @click="go('/person-center/my-bank')"
  329. >
  330. <img src="@/assets/tk.png" alt="" />
  331. <div class="text">题库</div>
  332. </div>
  333. <div
  334. class="type-list__item"
  335. @click="go('/person-center/my-order')"
  336. >
  337. <img src="@/assets/dd.png" alt="" />
  338. <div class="text">订单</div>
  339. </div>
  340. </div>
  341. <div class="history">
  342. <div class="btn">上次播放</div>
  343. <div class="title" @click="goLast">
  344. {{ recordList.goodsName }}
  345. </div>
  346. <div class="progress">
  347. <span
  348. >已学{{
  349. toFixed(
  350. (recordList.videoCurrentTime /
  351. recordList.durationTime) *
  352. 100
  353. )
  354. }}%</span
  355. >
  356. <span>{{ recordList.date }}</span>
  357. </div>
  358. </div>
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. </section>
  364. <section class="course">
  365. <div class="container">
  366. <div class="course__header">
  367. <div class="lefts">
  368. <div class="title">推荐课程</div>
  369. <div class="tabs">
  370. <div
  371. v-for="(item, index) in courseName"
  372. :key="index"
  373. class="tab"
  374. :class="couIndex === index ? 'active' : ''"
  375. @click="changeCou(item.recommendId, index)"
  376. >
  377. {{ item.name }}
  378. </div>
  379. </div>
  380. </div>
  381. <div class="course__footer">
  382. <div class="btn" @click="go('/course-list')">查看更多</div>
  383. </div>
  384. </div>
  385. <!-- <div class="tabs">
  386. <div
  387. v-for="(item, index) in goodsList1"
  388. :key="index"
  389. class="tab"
  390. :class="active1 === index ? 'active' : ''"
  391. @click="active1 = index"
  392. >
  393. {{ item.name }}
  394. </div>
  395. </div>
  396. <div class="course__body">
  397. <p
  398. v-if="
  399. !goodsList1[active1] ||
  400. !goodsList1[active1].goodsList ||
  401. goodsList1[active1].goodsList.length === 0
  402. "
  403. class="text_align"
  404. >
  405. 该培训项目无推荐课程
  406. </p>
  407. <ul v-else class="list clearfix">
  408. <template v-for="(item, index) in goodsList1[active1].goodsList">
  409. <li class="course-item" :key="index" v-if="index < 15">
  410. <GoodsItem :item="item"></GoodsItem>
  411. </li>
  412. </template>
  413. </ul>
  414. </div> -->
  415. <div class="course__body">
  416. <p
  417. v-if="
  418. !goodsList1.length
  419. "
  420. class="text_align"
  421. >
  422. 该培训项目无推荐课程
  423. </p>
  424. <ul v-else class="list clearfix">
  425. <template v-for="(item, index) in goodsList1">
  426. <li class="course-item" :key="index">
  427. <GoodsItem :item="item"></GoodsItem>
  428. </li>
  429. </template>
  430. </ul>
  431. </div>
  432. <div class="pagination">
  433. <el-pagination
  434. @current-change="currentChangeCou"
  435. background
  436. layout="prev, pager, next"
  437. :total="paramList[0].total"
  438. :current-page.sync="paramList[0].currentPage"
  439. :page-size="paramList[0].pageSize"
  440. >
  441. </el-pagination>
  442. </div>
  443. <!-- <div class="course__footer">
  444. <div class="btn" @click="go('/course-list')">查看更多</div>
  445. </div> -->
  446. </div>
  447. </section>
  448. <section class="bank">
  449. <div class="container">
  450. <div class="bank__header">
  451. <div class="lefts">
  452. <div class="title">推荐题库</div>
  453. <div class="tabs">
  454. <div
  455. v-for="(item, index) in bankName"
  456. :key="index"
  457. class="tab"
  458. :class="bankIndex === index ? 'active' : ''"
  459. @click="changebank(item.recommendId, index)"
  460. >
  461. {{ item.name }}
  462. </div>
  463. </div>
  464. </div>
  465. <div class="bank__footer">
  466. <div class="btn" @click="go('/bank-list')">查看更多</div>
  467. </div>
  468. </div>
  469. <!-- <div class="tabs">
  470. <div
  471. v-for="(item, index) in goodsList2"
  472. :key="index"
  473. class="tab"
  474. :class="active2 === index ? 'active' : ''"
  475. @click="active2 = index"
  476. >
  477. {{ item.name }}
  478. </div>
  479. </div>
  480. <div class="bank__body">
  481. <p
  482. v-if="
  483. !goodsList2[active2] ||
  484. !goodsList2[active2].goodsList ||
  485. goodsList2[active2].goodsList.length === 0
  486. "
  487. class="text_align"
  488. >
  489. 该培训项目无推荐题库
  490. </p>
  491. <ul v-else class="list clearfix">
  492. <template v-for="(item, index) in goodsList2[active2].goodsList">
  493. <li
  494. class="bank-item"
  495. v-if="index < 15"
  496. :key="index"
  497. @click="goodsDetail(item, 2)"
  498. >
  499. <GoodsItem :item="item"></GoodsItem>
  500. </li>
  501. </template>
  502. </ul>
  503. </div> -->
  504. <div class="bank__body">
  505. <p
  506. v-if="
  507. !goodsList2.length
  508. "
  509. class="text_align"
  510. >
  511. 该培训项目无推荐题库
  512. </p>
  513. <ul v-else class="list clearfix">
  514. <template v-for="(item, index) in goodsList2">
  515. <!-- @click="goodsDetail(item, 2)" -->
  516. <li
  517. class="bank-item"
  518. :key="index"
  519. >
  520. <GoodsItem :item="item"></GoodsItem>
  521. </li>
  522. </template>
  523. </ul>
  524. </div>
  525. <div class="pagination">
  526. <el-pagination
  527. @current-change="currentChangeBank"
  528. background
  529. layout="prev, pager, next"
  530. :total="paramList[1].total"
  531. :current-page.sync="paramList[1].currentPage"
  532. :page-size="paramList[1].pageSize"
  533. >
  534. </el-pagination>
  535. </div>
  536. </div>
  537. </section>
  538. <el-dialog
  539. :visible.sync="bindShow"
  540. width="348px"
  541. center
  542. :close-on-click-modal="false"
  543. :close-on-press-escape="false"
  544. class="bind"
  545. >
  546. <a class="bind__close" @click="bindNext">X</a>
  547. <div class="bind__header">关联学员身份</div>
  548. <div class="bind__body">
  549. <el-form
  550. class="bind-form"
  551. ref="bindForm"
  552. :model="bindForm"
  553. :rules="bindForm"
  554. >
  555. <el-form-item prop="realname"
  556. ><el-input placeholder="真实姓名" v-model="bindForm.realname">
  557. </el-input
  558. ></el-form-item>
  559. <el-form-item prop="idCard">
  560. <el-input placeholder="身份证号码" v-model="bindForm.idCard" maxlength="18">
  561. </el-input
  562. ></el-form-item>
  563. <el-button
  564. class="submit"
  565. type="primary"
  566. :loading="isBind"
  567. round
  568. @click="bind()"
  569. >确定</el-button
  570. >
  571. <div class="bind-next" @click="bindNext">下次再关联</div>
  572. </el-form>
  573. </div>
  574. </el-dialog>
  575. <ToolBar></ToolBar>
  576. <Footer></Footer>
  577. <wx-login ref="wxLogin" @wxLoginBack="wxLoginBack"></wx-login>
  578. <RebuildModal
  579. ref="rebuildModal"
  580. @rebuildSubmit="rebuildSubmit($event)"
  581. ></RebuildModal>
  582. </div>
  583. </template>
  584. <script>
  585. import RebuildModal from "@/components/rebuildModal";
  586. import wxLogin from "@/components/wxLogin/index";
  587. import Footer from "@/components/footer/index";
  588. import ToolBar from "@/components/toolbar/index";
  589. import GoodsItem from "@/components/goodsItem/index";
  590. import { swiper, swiperSlide } from "vue-awesome-swiper";
  591. import { mapGetters, mapMutations } from "vuex";
  592. import "swiper/swiper-bundle.css";
  593. export default {
  594. name: "Home",
  595. components: {
  596. swiper,
  597. swiperSlide,
  598. Footer,
  599. GoodsItem,
  600. ToolBar,
  601. wxLogin,
  602. RebuildModal,
  603. },
  604. computed: {
  605. ...mapGetters(["userInfo", "token", "header", "msgCount"]),
  606. showNav: function () {
  607. return function (list) {
  608. var newList = [];
  609. if (list) {
  610. newList = list.filter((item) => {
  611. return item.status === 1;
  612. });
  613. }
  614. return newList;
  615. };
  616. },
  617. },
  618. data() {
  619. return {
  620. msgShow: false,
  621. msgData: {},
  622. showBox: false,
  623. indexToken: "",
  624. indexUserAccount: "",
  625. colors: [],
  626. color: "",
  627. countDown: 0,
  628. countDownTimer: null,
  629. loginRules: {
  630. account: [
  631. { required: true, trigger: "blur", message: "请输入手机号/身份证号" },
  632. ],
  633. pwd: [{ required: true, trigger: "blur", message: "请输入密码" }],
  634. },
  635. loginSmsRules: {
  636. code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
  637. tel: [{ required: true, trigger: "blur", message: "请输入手机号" }],
  638. },
  639. bindRules: {
  640. code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
  641. tel: [{ required: true, trigger: "blur", message: "请输入手机号" }],
  642. pwd: [{ required: true, trigger: "blur", message: "请输入密码" }],
  643. read: [{ required: true, trigger: "blur", message: "请勾选服务协议" }],
  644. },
  645. bindShow: false,
  646. loginType: 2,
  647. loginForm: {},
  648. loginSmsForm: {},
  649. bindForm: {},
  650. isLogin: false,
  651. isLoginSms: false,
  652. isBind: false,
  653. getLoginCodeLock: false,
  654. isloginSms: false,
  655. swiperOptions: {
  656. loop: true,
  657. observer: true,
  658. observeParents: true,
  659. speed: 300,
  660. autoplayDisableOnInteraction: false,
  661. autoplayStopOnLast: false,
  662. autoplay: {
  663. delay: 1000,
  664. disableOnInteraction: false,
  665. },
  666. // 显示分页
  667. pagination: {
  668. el: ".swiper-pagination",
  669. clickable: true, //允许分页点击跳转
  670. },
  671. // 设置点击箭头
  672. navigation: {
  673. nextEl: ".swiper-button-next",
  674. prevEl: ".swiper-button-prev",
  675. },
  676. },
  677. bannerList: [],
  678. goodsList1: [{}], //推荐课程列表
  679. goodsList2: [{}], //推荐题库列表
  680. typeList: [],
  681. slideList: [],
  682. active1: 0, //推荐课程index
  683. active2: 0, //推荐题库index
  684. searchKey: "",
  685. type: "1",
  686. recordList: {},
  687. params: {
  688. pageNum: 1,
  689. pageSize: 10,
  690. },
  691. paramList: [
  692. {
  693. pageNum: 1,
  694. pageSize: 15,
  695. total: 0,
  696. },
  697. {
  698. pageNum: 1,
  699. pageSize: 15,
  700. total: 0,
  701. }
  702. ],
  703. total1: 0,
  704. total2: 0,
  705. courseName: [],
  706. bankName: [],
  707. couIndex: 0,
  708. bankIndex: 0,
  709. courseId: '',
  710. bankId: '',
  711. };
  712. },
  713. created() {
  714. this.goodsList1 = []
  715. this.goodsList2 = []
  716. this.courseLists()
  717. },
  718. mounted() {
  719. if (this.userInfo) {
  720. this.getRecord();
  721. this.getmsg();
  722. this.getMsgCount();
  723. }
  724. // this.getActivityList();
  725. // this.color = this.colors[0];
  726. this.advertisingList();
  727. this.educationTypeList();
  728. },
  729. watch: {
  730. userInfo(val) {
  731. if (val) {
  732. this.getRecord();
  733. this.getmsg();
  734. this.getMsgCount();
  735. }
  736. },
  737. },
  738. methods: {
  739. //课程
  740. courseLists() {
  741. this.$request.appCommonActivityRecommendList({ platform: 2, status: 1 }).then(async (res) => {
  742. // return
  743. if (res.code == 200) {
  744. let list = res.rows || []
  745. //课程
  746. this.courseName = list.filter(x => x.type == 1).sort((a,b) => a.sort - b.sort).map(x => {
  747. return {
  748. name: x.name,
  749. recommendId: x.recommendId
  750. }
  751. });
  752. console.log('couIndex', this.couIndex, this.courseName)
  753. //题库
  754. this.bankName = list.filter(x => x.type == 2).sort((a,b) => a.sort - b.sort).map(x => {
  755. return {
  756. name: x.name,
  757. recommendId: x.recommendId
  758. }
  759. });
  760. if (this.courseName.length) {
  761. this.courseId = this.courseName[0].recommendId
  762. let list1 = await this.getGoodsList(this.courseName[0].recommendId, 0)
  763. this.goodsList1.push(...list1)
  764. }
  765. if (this.bankName.length) {
  766. this.bankId = this.bankName[0].recommendId
  767. let list2 = await this.getGoodsList(this.bankName[0].recommendId, 1)
  768. this.goodsList2.push(...list2)
  769. }
  770. }
  771. });
  772. },
  773. getGoodsList(recommendId, num) {
  774. return new Promise((resolve, reject) => {
  775. this.$axios({
  776. url: `/app/common/activity/recommend/goodsList`,
  777. method: 'get',
  778. params: {
  779. pageNum: this.paramList[num].pageNum,
  780. pageSize: this.paramList[num].pageSize,
  781. recommendId: recommendId
  782. },
  783. noToken: true
  784. }).then((res) => {
  785. if (res.code == 200) {
  786. this.paramList[num].total = res.total
  787. resolve(res.rows)
  788. }
  789. })
  790. })
  791. },
  792. async currentChangeCou(val) {
  793. console.log('vallll', val)
  794. this.paramList[0].pageNum = val
  795. this.goodsList1 = []
  796. let list1 = await this.getGoodsList(this.courseId, 0)
  797. this.goodsList1.push(...list1)
  798. },
  799. async changeCou(recommendId, index) {
  800. this.couIndex = index
  801. this.courseId = recommendId
  802. this.paramList[0].pageNum = 1
  803. this.paramList[0].currentPage = 1
  804. this.goodsList1 = []
  805. let list1 = await this.getGoodsList(recommendId, 0)
  806. this.goodsList1.push(...list1)
  807. },
  808. async currentChangeBank(val) {
  809. console.log('val--', val)
  810. this.paramList[1].pageNum = val
  811. this.goodsList2 = []
  812. let list2 = await this.getGoodsList(this.bankId, 1)
  813. this.goodsList2.push(...list2)
  814. },
  815. async changebank(recommendId, index) {
  816. this.bankIndex = index
  817. this.bankId = recommendId
  818. this.paramList[1].pageNum = 1
  819. this.paramList[1].currentPage = 1
  820. this.goodsList2 = []
  821. let list2 = await this.getGoodsList(recommendId, 1)
  822. this.goodsList2.push(...list2)
  823. },
  824. /**
  825. * 关闭消息
  826. */
  827. clearMsg() {
  828. let ary = {
  829. userId: this.msgData.userId,
  830. msgId: this.msgData.id,
  831. updateTime: new Date(new Date().toLocaleDateString()).getTime(),
  832. };
  833. localStorage.setItem("msg", JSON.stringify(ary));
  834. this.msgShow = false;
  835. },
  836. rebuildSubmit(item) {
  837. this.$router.push({
  838. path: `/my-course-detail/${item.goodsId}`,
  839. query: {
  840. gradeId: item.gradeId,
  841. orderGoodsId: item.orderGoodsId,
  842. rebuild: 1,
  843. },
  844. });
  845. },
  846. getGoodsData() {
  847. return new Promise((resolve, reject) => {
  848. this.$request.goodsDetail(this.msgData.goodsId).then((res) => {
  849. resolve(res.data);
  850. });
  851. });
  852. },
  853. /**
  854. * 前往学习
  855. */
  856. async newGoToStudy() {
  857. let item = await this.getGoodsData();
  858. if (item.goodsType == 1) {
  859. this.sysTime = this.$tools.timest();
  860. item.orderGoodsId = this.msgData.orderGoodsId;
  861. this.canJump(item).then((res) => {
  862. this.clearMsg();
  863. this.$router.push({
  864. path: `/my-course-detail/${item.goodsId}`,
  865. query: {
  866. gradeId: item.gradeId,
  867. orderGoodsId: item.orderGoodsId,
  868. courseId: res.rows[0].courseId || "",
  869. },
  870. });
  871. });
  872. // arsty = '立刻学习';
  873. //题库
  874. } else if (item.goodsType == 2) {
  875. this.clearMsg();
  876. this.$router.push({
  877. path: "/person-center/my-bank/bank-detail/" + item.goodsId,
  878. query: {
  879. orderGoodsId: item.orderGoodsId,
  880. },
  881. });
  882. }
  883. },
  884. canJump(item) {
  885. return new Promise((resolve) => {
  886. this.$request
  887. .orderInfo({
  888. orderGoodsId: item.orderGoodsId,
  889. })
  890. .then(async (res) => {
  891. let items = res.data;
  892. let currentTime = this.$tools.timest();
  893. if (items.interfaceAccountId > 0) {
  894. //学习账号已开通
  895. if (items.learnStatus == 1) {
  896. //跳转第三方h5
  897. const confirmText = [
  898. "您的学习账号已经开通,请按照步骤操作,进行学习。",
  899. "1.点击【跳转学习网址】按钮",
  900. "2.打开学习网址后,选择【个人用户】进行登录",
  901. "(1)账号:您个人的身份证号码",
  902. "(2)密码:身份证号码,再加111111",
  903. ];
  904. const newDatas = [];
  905. const h = this.$createElement;
  906. for (const i in confirmText) {
  907. newDatas.push(h("p", null, confirmText[i]));
  908. }
  909. this.$confirm(h("div", null, newDatas), "温馨提示", {
  910. confirmButtonText: "跳转学习网址",
  911. cancelButtonText: "关闭",
  912. closeOnClickModal: false,
  913. closeOnPressEscape: false,
  914. distinguishCancelAndClose: false,
  915. showClose: false,
  916. })
  917. .then((_) => {
  918. window.open("http://admin.zhujianpeixun.com/", "_blank");
  919. })
  920. .catch((_) => {});
  921. return;
  922. } else {
  923. this.$message({
  924. type: "warning",
  925. message:
  926. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  927. });
  928. return;
  929. }
  930. }
  931. // //内部系统
  932. // if (items.interfacePushId > 0 && items.officialStatus != 1) {
  933. // this.$message({
  934. // type: "warning",
  935. // message:
  936. // "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
  937. // });
  938. // return;
  939. // }
  940. if (items.goodsType !== 6) {
  941. if (
  942. this.sysTime <= items.serviceStartTime ||
  943. this.sysTime >= items.serviceEndTime
  944. ) {
  945. this.$message({
  946. type: "warning",
  947. message: "不在学习服务期,不能进入学习",
  948. });
  949. return;
  950. }
  951. if (
  952. (items.classStartTime &&
  953. this.sysTime <= items.classStartTime) ||
  954. (items.classEndTime && this.sysTime >= items.classEndTime)
  955. ) {
  956. this.$message({
  957. type: "warning",
  958. message: "不在班级有效期,不能进入学习",
  959. });
  960. return;
  961. }
  962. if (items.learningStatus == 2) {
  963. this.$message({
  964. type: "warning",
  965. message: "开放学习时间待定,不能进入学习",
  966. });
  967. return;
  968. }
  969. if (items.classStatus == 0) {
  970. this.$message({
  971. type: "warning",
  972. message: "尚未开班,不能进入学习",
  973. });
  974. return;
  975. }
  976. if (
  977. items.learningStatus == 3 &&
  978. this.sysTime < items.learningTimeStart
  979. ) {
  980. this.$message({
  981. type: "warning",
  982. message: "不在开放学习时间,不能进入学习",
  983. });
  984. return;
  985. }
  986. let rebuildStatus = await this.courseGoodsRebuildStatus(
  987. items.goodsId,
  988. items.gradeId
  989. );
  990. if (rebuildStatus == 0) {
  991. this.$refs.rebuildModal.showModal(items);
  992. return;
  993. }
  994. }
  995. // if (item.educationName == "继续教育") {
  996. this.$request
  997. .lockLockStatus({
  998. action: "jxjy",
  999. })
  1000. .then((res) => {
  1001. //有其他端在操作,不能学习
  1002. this.$message({
  1003. type: "warning",
  1004. message: res.msg,
  1005. });
  1006. })
  1007. .catch((err) => {
  1008. //可以学习
  1009. this.$request
  1010. .courseCourseList({
  1011. pageNum: 1,
  1012. pageSize: 1,
  1013. goodsId: items.goodsId,
  1014. gradeId: items.gradeId,
  1015. })
  1016. .then((res) => {
  1017. if (res.rows.length) {
  1018. resolve(res);
  1019. } else {
  1020. this.$message({
  1021. type: "warning",
  1022. message: "课程内暂无可以学习的科目",
  1023. });
  1024. }
  1025. });
  1026. });
  1027. // } else {
  1028. // this.$request
  1029. // .courseCourseList({
  1030. // pageNum: 1,
  1031. // pageSize: 1,
  1032. // goodsId: items.goodsId,
  1033. // gradeId: items.gradeId,
  1034. // })
  1035. // .then((res) => {
  1036. // if (res.rows.length) {
  1037. // resolve(res);
  1038. // } else {
  1039. // this.$message({
  1040. // type: "warning",
  1041. // message: "课程内暂无可以学习的科目",
  1042. // });
  1043. // }
  1044. // });
  1045. // }
  1046. });
  1047. });
  1048. },
  1049. /**
  1050. * @param {Object} goodsId 商品id
  1051. * 查询商品重修状态
  1052. */
  1053. courseGoodsRebuildStatus(goodsId, gradeId) {
  1054. return new Promise((resolve) => {
  1055. this.$request
  1056. .courseGoodsRebuildStatus({
  1057. goodsId: goodsId,
  1058. gradeId: gradeId,
  1059. })
  1060. .then((res) => {
  1061. resolve(res.data);
  1062. });
  1063. });
  1064. },
  1065. /**
  1066. * 微信登入
  1067. */
  1068. wxLoginFunc() {
  1069. this.$refs.wxLogin.openBoxs();
  1070. },
  1071. /**
  1072. * 微信登入—返回数据
  1073. */
  1074. wxLoginBack(res) {
  1075. localStorage.setItem("user_account", res.data.user_account);
  1076. localStorage.setItem("token", res.data.token);
  1077. if (res.data.full_info) {
  1078. this.getInfo();
  1079. } else {
  1080. this.indexUserAccount = res.data.user_account;
  1081. this.indexToken = res.data.token;
  1082. this.isLogin = false;
  1083. // 弹窗
  1084. this.bindShow = true;
  1085. }
  1086. },
  1087. goLast() {
  1088. if (this.recordList.goodsType == 6) {
  1089. this.go("/my-live-detail/" + this.recordList.goodsId, {
  1090. gradeId: this.recordList.gradeId,
  1091. orderGoodsId: this.recordList.orderGoodsId,
  1092. courseId: this.recordList.courseId,
  1093. });
  1094. } else if (this.recordList.goodsType == 1) {
  1095. this.go("/my-course-detail/" + this.recordList.goodsId, {
  1096. gradeId: this.recordList.gradeId,
  1097. orderGoodsId: this.recordList.orderGoodsId,
  1098. courseId: this.recordList.courseId,
  1099. });
  1100. }
  1101. },
  1102. swiperJump(swiper) {
  1103. if (swiper.jumpType == 1) {
  1104. //无跳转
  1105. return;
  1106. } else if (swiper.jumpType == 2) {
  1107. //url
  1108. window.open(swiper.jumpUrl, "_blank");
  1109. } else if (swiper.jumpType == 3) {
  1110. //内部接口
  1111. this.$router.push({
  1112. path: swiper.jumpUrl,
  1113. });
  1114. }
  1115. },
  1116. handleCommand(command) {
  1117. switch (command) {
  1118. case "1":
  1119. this.go("/person-center/my-course");
  1120. break;
  1121. case "2":
  1122. this.go("/person-center/my-bank");
  1123. break;
  1124. case "3":
  1125. this.go("/person-center/my-info");
  1126. break;
  1127. case "4":
  1128. this.$tools.exit();
  1129. break;
  1130. default:
  1131. break;
  1132. }
  1133. },
  1134. toFixed(num) {
  1135. if (num) {
  1136. let str = String(num).indexOf(".");
  1137. if (str != -1) {
  1138. return +num.toFixed(2);
  1139. } else {
  1140. return num;
  1141. }
  1142. } else {
  1143. return 0;
  1144. }
  1145. },
  1146. ...mapMutations(["setUserInfo", "getMsgCount"]),
  1147. /**
  1148. * 播放记录
  1149. */
  1150. getRecord() {
  1151. this.$request
  1152. .studRrecordListUserRecord({
  1153. pageNum: 1,
  1154. pageSize: 1,
  1155. })
  1156. .then((res) => {
  1157. if (res.rows.length) {
  1158. this.recordList = res.rows[0];
  1159. }
  1160. });
  1161. },
  1162. search() {
  1163. if (!this.searchKey.trim()) {
  1164. this.$message({
  1165. type: "warning",
  1166. duration: 2000,
  1167. message: "请输入搜索内容",
  1168. });
  1169. return;
  1170. }
  1171. let type = this.type;
  1172. //根据类型跳转题库或者列表页面
  1173. if (type == "1") {
  1174. this.$router.push({
  1175. path: "/course-list",
  1176. query: {
  1177. searchKey: this.searchKey,
  1178. },
  1179. });
  1180. } else if (type == "6") {
  1181. this.$router.push({
  1182. path: "/live-list",
  1183. query: {
  1184. searchKey: this.searchKey,
  1185. },
  1186. });
  1187. } else {
  1188. this.$router.push({
  1189. path: "/bank-list",
  1190. query: {
  1191. searchKey: this.searchKey,
  1192. },
  1193. });
  1194. }
  1195. },
  1196. /**
  1197. * 查看商品详情
  1198. */
  1199. goodsDetail(item, type) {
  1200. if (type === 1) {
  1201. this.$router.push({
  1202. path: "/course-detail/" + item.goodsId,
  1203. });
  1204. }
  1205. if (type === 2) {
  1206. this.$router.push({
  1207. path: "/bank-detail/" + item.goodsId,
  1208. });
  1209. }
  1210. },
  1211. educationTypeList() {
  1212. this.$request.educationTypeList().then((res) => {
  1213. this.typeList = res.rows.slice(0, 5);
  1214. this.typeList.forEach((typeItem, index) => {
  1215. this.businessList(typeItem.id, index);
  1216. });
  1217. });
  1218. },
  1219. businessList(educationId, index) {
  1220. this.$request
  1221. .businessList({ educationId })
  1222. .then((res) => {
  1223. let rows = res.rows.filter((item) => item.aliasName)
  1224. this.$set(this.slideList, index, rows);
  1225. if (rows.length >= 2) {
  1226. let newRows = rows.slice(0, 2);
  1227. let length = 0;
  1228. newRows.forEach((row) => {
  1229. let str = row.projectName + "-" + row.businessName;
  1230. length = length + str.length;
  1231. });
  1232. if (length >= 17) {
  1233. this.$set(this.typeList[index], "list", rows.slice(0, 1));
  1234. } else {
  1235. this.$set(this.typeList[index], "list", rows.slice(0, 2));
  1236. }
  1237. } else {
  1238. this.$set(this.typeList[index], "list", rows);
  1239. }
  1240. console.log('this.typeList:',this.slideList, this.typeList)
  1241. })
  1242. .catch((err) => {
  1243. console.log(err, "err");
  1244. });
  1245. },
  1246. /**
  1247. * 加入购物车
  1248. */
  1249. addCart(item) {
  1250. this.$request
  1251. .addCart({ goodsId: item.goodsId })
  1252. .then((res) => {
  1253. if (res) {
  1254. this.getCartCount();
  1255. this.$message({
  1256. message: "加入购物车成功",
  1257. type: "success",
  1258. });
  1259. }
  1260. })
  1261. .catch((err) => {
  1262. if (err.code == 500) {
  1263. this.$message({
  1264. message: err.msg,
  1265. type: "warning",
  1266. });
  1267. }
  1268. });
  1269. },
  1270. /**
  1271. * 获取推荐商品
  1272. */
  1273. getActivityList() {
  1274. this.$request
  1275. .appCommonActivityRecommendList({ platform: 2, status: 1 })
  1276. .then((res) => {
  1277. let goodsList1 = []; //推荐视频商品
  1278. let goodsList2 = []; //推荐题库商品
  1279. res.rows.forEach((item) => {
  1280. if (item.type === 1) {
  1281. goodsList1.push(item);
  1282. }
  1283. if (item.type === 2) {
  1284. goodsList2.push(item);
  1285. }
  1286. });
  1287. this.goodsList1 = goodsList1.sort((a, b) => a.sort - b.sort);
  1288. this.goodsList2 = goodsList2.sort((a, b) => a.sort - b.sort);
  1289. });
  1290. },
  1291. goCourse(item) {
  1292. console.log('sdsf', item)
  1293. if (item.topicId) {
  1294. this.$router.push({
  1295. path: "/goodsTopic",
  1296. query: {
  1297. topicId: item.topicId,
  1298. },
  1299. })
  1300. return
  1301. }
  1302. this.$router.push({
  1303. path: "/course-list",
  1304. query: {
  1305. educationId: item.educationId ? item.educationId : item.id || "",
  1306. projectId: item.projectId || "",
  1307. businessId: item.educationId ? item.id : "",
  1308. },
  1309. });
  1310. },
  1311. slideChangeTransitionStart(e) {
  1312. this.color = this.colors[this.$refs.mySwiper.swiper.realIndex];
  1313. },
  1314. advertisingList() {
  1315. this.$request
  1316. .advertisinghomeLocationList({
  1317. platform: 2, //1小程序2PC网站
  1318. status: 1,
  1319. locationKey: "home-banner", //首页轮播KEY
  1320. })
  1321. .then((res) => {
  1322. this.swiperOptions.autoplay.delay = res.data[0].intervalTime * 1000;
  1323. /**
  1324. * 如果存在-调用轮播图列表
  1325. */
  1326. if (res.data.length) {
  1327. this.$request
  1328. .advertisingList({ locationId: res.data[0].locationId })
  1329. .then((res) => {
  1330. this.bannerList = res.rows;
  1331. this.colors = res.rows.map((item) => {
  1332. return item.color ? item.color : "rgba(225,225,225,0.1)";
  1333. });
  1334. this.color = this.colors[0];
  1335. });
  1336. }
  1337. });
  1338. },
  1339. go(path, query) {
  1340. this.$router.push({
  1341. path,
  1342. query,
  1343. });
  1344. },
  1345. mouseover() {
  1346. clearTimeout(this.timer);
  1347. this.showBox = true;
  1348. },
  1349. mouseLeave() {
  1350. clearTimeout(this.timer);
  1351. this.timer = setTimeout(() => {
  1352. this.showBox = false;
  1353. }, 500);
  1354. },
  1355. login() {
  1356. this.$refs.loginForm.validate((valid) => {
  1357. if (valid) {
  1358. this.isLogin = true;
  1359. let loginForm = JSON.parse(JSON.stringify(this.loginForm));
  1360. loginForm.pwd = this.$tools.encryptor(loginForm.pwd);
  1361. console.log(this.loginForm);
  1362. this.$request
  1363. .login(loginForm)
  1364. .then((res) => {
  1365. localStorage.setItem("user_account", res.data.user_account);
  1366. localStorage.setItem("token", res.data.token);
  1367. if (res.data.full_info) {
  1368. // localStorage.setItem("user_account", res.data.user_account);
  1369. // localStorage.setItem("token", res.data.token);
  1370. this.getInfo();
  1371. } else {
  1372. this.indexUserAccount = res.data.user_account;
  1373. this.indexToken = res.data.token;
  1374. this.isLogin = false;
  1375. // 弹窗
  1376. this.bindShow = true;
  1377. }
  1378. })
  1379. .catch((err) => {
  1380. this.isLogin = false;
  1381. this.$message({
  1382. message: err.msg,
  1383. type: "error",
  1384. });
  1385. });
  1386. }
  1387. });
  1388. },
  1389. /**
  1390. * 获取登录短信
  1391. */
  1392. getLoginSms() {
  1393. this.$refs.loginSmsForm.validateField("tel", (valid) => {
  1394. if (!valid) {
  1395. if (this.countDown == 0) {
  1396. if (this.getLoginCodeLock) {
  1397. return;
  1398. }
  1399. this.getLoginCodeLock = true;
  1400. this.$request
  1401. .getLoginSms({ tel: this.loginSmsForm.tel })
  1402. .then((res) => {
  1403. this.getLoginCodeLock = false;
  1404. this.$message({
  1405. message: `验证码已发送`,
  1406. type: "success",
  1407. });
  1408. this.countDown = 60;
  1409. this.countDownTimer = setInterval(() => {
  1410. if (this.countDown == 0) {
  1411. clearInterval(this.countDownTimer);
  1412. } else {
  1413. this.countDown--;
  1414. }
  1415. }, 1000);
  1416. })
  1417. .catch((err) => {
  1418. this.$message.error(err.msg);
  1419. this.getLoginCodeLock = false;
  1420. });
  1421. }
  1422. }
  1423. });
  1424. },
  1425. /**
  1426. * 手机号登录
  1427. */
  1428. loginSms() {
  1429. this.$refs.loginSmsForm.validate((valid) => {
  1430. if (valid) {
  1431. this.isloginSms = true;
  1432. this.$request
  1433. .loginSms(this.loginSmsForm)
  1434. .then((res) => {
  1435. this.isloginSms = false;
  1436. localStorage.setItem("user_account", res.data.user_account);
  1437. localStorage.setItem("token", res.data.token);
  1438. this.$tools.setUuid(new Date().valueOf() + "");
  1439. if (res.data.full_info) {
  1440. this.getInfo();
  1441. } else {
  1442. this.indexUserAccount = res.data.user_account;
  1443. this.indexToken = res.data.token;
  1444. this.bindShow = true;
  1445. }
  1446. })
  1447. .catch((err) => {
  1448. this.isloginSms = false;
  1449. this.$message({
  1450. message: err.msg,
  1451. type: "error",
  1452. });
  1453. });
  1454. }
  1455. });
  1456. },
  1457. /**
  1458. * 消息提示
  1459. */
  1460. getmsg() {
  1461. this.$request.informUserselectLastUnStudyMsg().then((res) => {
  1462. if (res.data && res.data.id) {
  1463. let today = new Date(new Date().toLocaleDateString()).getTime();
  1464. if (localStorage.getItem("msg")) {
  1465. let ary = JSON.parse(localStorage.getItem("msg"));
  1466. if (ary.updateTime === today) {
  1467. this.msgShow = false;
  1468. return;
  1469. }
  1470. }
  1471. this.$nextTick(() => {
  1472. this.msgData = res.data;
  1473. this.msgShow = true;
  1474. });
  1475. } else {
  1476. this.msgShow = false;
  1477. }
  1478. });
  1479. },
  1480. /**
  1481. * 获取用户登录信息
  1482. */
  1483. getInfo() {
  1484. this.$request
  1485. .getInfo({fromPlat: 2})
  1486. .then((res) => {
  1487. this.loginForm = {};
  1488. this.loginSmsForm = {};
  1489. this.isLogin = false;
  1490. this.isloginSms = false;
  1491. this.setUserInfo(res.data);
  1492. this.getmsg();
  1493. })
  1494. .catch((err) => {
  1495. this.isLogin = false;
  1496. this.isloginSms = false;
  1497. this.$message({
  1498. message: err.msg,
  1499. type: "error",
  1500. });
  1501. });
  1502. },
  1503. bind() {
  1504. this.$refs.bindForm.validate((valid) => {
  1505. if (valid) {
  1506. this.isBind = true;
  1507. let bindForm = JSON.parse(JSON.stringify(this.bindForm));
  1508. bindForm.token = this.indexToken;
  1509. this.$request
  1510. .bindIdCard(bindForm)
  1511. .then((res) => {
  1512. this.isBind = false;
  1513. this.bindShow = false;
  1514. this.$message({
  1515. message: "关联成功",
  1516. type: "success",
  1517. });
  1518. localStorage.setItem("user_account", this.indexUserAccount);
  1519. localStorage.setItem("token", this.indexToken);
  1520. this.$tools.setUuid(new Date().valueOf() + "");
  1521. this.getInfo();
  1522. })
  1523. .catch((err) => {
  1524. this.isBind = false;
  1525. this.$message({
  1526. message: err.msg,
  1527. type: "error",
  1528. });
  1529. });
  1530. }
  1531. });
  1532. },
  1533. bindNext() {
  1534. this.bindShow = false;
  1535. this.indexToken = "";
  1536. this.indexUserAccount = "";
  1537. this.getInfo();
  1538. },
  1539. },
  1540. };
  1541. </script>
  1542. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1543. <style scoped lang="scss">
  1544. .text_align {
  1545. text-align: center;
  1546. font-size: 18px;
  1547. margin: 40px 0px;
  1548. }
  1549. .home {
  1550. .header {
  1551. background: #ffffff;
  1552. &__header {
  1553. box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.04);
  1554. .text-list {
  1555. height: 40px;
  1556. line-height: 40px;
  1557. text-align: right;
  1558. font-size: 0;
  1559. a {
  1560. color: #3f8dfd;
  1561. font-size: 14px;
  1562. padding: 0 14px;
  1563. &:nth-last-of-type(1) {
  1564. padding-right: 0;
  1565. border-left: 1px solid #3f8dfd;
  1566. }
  1567. }
  1568. }
  1569. .icon-list {
  1570. height: 40px;
  1571. line-height: 40px;
  1572. text-align: right;
  1573. font-size: 0;
  1574. a {
  1575. color: #3f8dfd;
  1576. font-size: 14px;
  1577. padding: 0 14px;
  1578. position: relative;
  1579. .icon {
  1580. font-size: 20px;
  1581. }
  1582. .modal-box {
  1583. width: 162px;
  1584. background: #ffffff;
  1585. box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.1);
  1586. border-radius: 8px;
  1587. position: absolute;
  1588. top: 34px;
  1589. left: -40px;
  1590. li {
  1591. margin-left: 10px;
  1592. border-bottom: 1px solid #eeeeee;
  1593. height: 40px;
  1594. line-height: 40px;
  1595. cursor: pointer;
  1596. padding-left: 5px;
  1597. color: #666666;
  1598. text-align: left;
  1599. &:hover {
  1600. background: #eeeeee;
  1601. color: #3f8dfd;
  1602. }
  1603. &:nth-last-of-type(1) {
  1604. border: 0;
  1605. }
  1606. }
  1607. }
  1608. }
  1609. }
  1610. }
  1611. &__body {
  1612. margin-top: 16px;
  1613. .logo {
  1614. float: left;
  1615. img {
  1616. width: 162px;
  1617. height: 33px;
  1618. }
  1619. h1 {
  1620. background: url("~@/assets/logo.png") no-repeat center;
  1621. width: 162px;
  1622. height: 33px;
  1623. }
  1624. }
  1625. .search {
  1626. float: left;
  1627. margin-left: 160px;
  1628. width: 648px;
  1629. background: #fafbfc;
  1630. border: 1px solid #3f8dfd;
  1631. border-radius: 8px;
  1632. display: flex;
  1633. overflow: hidden;
  1634. &__select {
  1635. width: 76px;
  1636. border-right: 1px solid #fff;
  1637. select {
  1638. text-align: center;
  1639. width: 100%;
  1640. height: 100%;
  1641. border: 0;
  1642. outline: none;
  1643. }
  1644. }
  1645. &__input {
  1646. flex: 1;
  1647. input {
  1648. width: 100%;
  1649. height: 100%;
  1650. }
  1651. }
  1652. &__btn {
  1653. padding: 0;
  1654. text-align: center;
  1655. width: 80px;
  1656. height: 40px;
  1657. line-height: 40px;
  1658. font-size: 14px;
  1659. border-radius: 0;
  1660. }
  1661. }
  1662. .contact {
  1663. float: right;
  1664. padding-left: 45px;
  1665. background: url("~@/assets/cus.png") no-repeat left top;
  1666. &__phone {
  1667. font-size: 18px;
  1668. font-family: Microsoft YaHei;
  1669. font-weight: bold;
  1670. color: #666666;
  1671. }
  1672. &__time {
  1673. font-size: 14px;
  1674. font-family: Microsoft YaHei;
  1675. font-weight: 400;
  1676. color: #666666;
  1677. }
  1678. }
  1679. }
  1680. }
  1681. .section {
  1682. margin-top: 40px;
  1683. .tabs {
  1684. margin-left: 324px;
  1685. .tab {
  1686. display: inline-block;
  1687. width: 138px;
  1688. height: 40px;
  1689. font-size: 16px;
  1690. text-align: center;
  1691. line-height: 40px;
  1692. color: #333;
  1693. &.active {
  1694. color: #3f8dfd;
  1695. background: #f0f5fc;
  1696. }
  1697. }
  1698. }
  1699. .swiper-wrap {
  1700. transition: background 0.3s;
  1701. height: 400px;
  1702. position: relative;
  1703. .container {
  1704. position: relative;
  1705. height: 400px;
  1706. .left-box {
  1707. position: absolute;
  1708. top: -40px;
  1709. left: 0;
  1710. height: 440px;
  1711. width: 300px;
  1712. z-index: 10;
  1713. &__header {
  1714. height: 40px;
  1715. line-height: 40px;
  1716. color: #fff;
  1717. font-size: 16px;
  1718. background: #3f8dfd;
  1719. text-align: center;
  1720. }
  1721. &__body {
  1722. position: relative;
  1723. height: 400px;
  1724. background: rgba(0, 0, 0, 0.5);
  1725. overflow: hidden;
  1726. &:hover {
  1727. overflow: visible;
  1728. .slide-list {
  1729. opacity: 1;
  1730. left: 100%;
  1731. }
  1732. }
  1733. .slide-list {
  1734. opacity: 0;
  1735. transition: all 0.3s;
  1736. width: 672px;
  1737. padding: 0;
  1738. background: rgba(255, 255, 255, 1);
  1739. position: absolute;
  1740. top: 0;
  1741. left: 0;
  1742. padding-left: 24px;
  1743. z-index: 10;
  1744. &__item {
  1745. min-height: 80px;
  1746. display: flex;
  1747. align-items: center;
  1748. border-bottom: 1px solid #ddd;
  1749. &:nth-last-of-type(1) {
  1750. border: 0;
  1751. }
  1752. .title {
  1753. cursor: pointer;
  1754. color: #fff;
  1755. width: 120px;
  1756. height: 28px;
  1757. border: 1px solid #ffffff;
  1758. border-radius: 14px;
  1759. background: #3f8dfd;
  1760. line-height: 26px;
  1761. text-align: center;
  1762. border-radius: 15px;
  1763. margin-right: 10px;
  1764. }
  1765. .nav {
  1766. flex: 1;
  1767. display: flex;
  1768. flex-wrap: wrap;
  1769. li {
  1770. margin: 9px 24px 9px 0;
  1771. display: flex;
  1772. .text {
  1773. cursor: pointer;
  1774. font-size: 14px;
  1775. font-family: Microsoft YaHei;
  1776. font-weight: 400;
  1777. color: #666;
  1778. }
  1779. }
  1780. }
  1781. }
  1782. }
  1783. .bg {
  1784. backdrop-filter: blur(10px);
  1785. position: absolute;
  1786. left: 0;
  1787. top: 0;
  1788. width: 100%;
  1789. height: 100%;
  1790. z-index: 12;
  1791. }
  1792. .list {
  1793. position: relative;
  1794. z-index: 22;
  1795. padding-left: 16px;
  1796. li {
  1797. padding: 12px 0;
  1798. height: 80px;
  1799. border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  1800. display: flex;
  1801. &:nth-last-of-type(1) {
  1802. border: 0;
  1803. }
  1804. .text {
  1805. flex: 1;
  1806. &__title {
  1807. cursor: pointer;
  1808. font-size: 16px;
  1809. font-family: Microsoft YaHei;
  1810. font-weight: 400;
  1811. color: #ffffff;
  1812. }
  1813. &__desc {
  1814. margin-top: 16px;
  1815. .item {
  1816. font-size: 14px;
  1817. font-family: Microsoft YaHei;
  1818. font-weight: 400;
  1819. color: #ffffff;
  1820. margin-right: 30px;
  1821. }
  1822. }
  1823. }
  1824. }
  1825. }
  1826. }
  1827. }
  1828. .swiper {
  1829. .swiper-slide {
  1830. cursor: pointer;
  1831. height: 400px;
  1832. img {
  1833. width: 100%;
  1834. height: 100%;
  1835. }
  1836. }
  1837. .swiper-pagination {
  1838. text-align: right;
  1839. padding-right: 324px;
  1840. /deep/ .swiper-pagination-bullet {
  1841. background: rgba(255, 255, 255, 0.4);
  1842. &-active {
  1843. background: rgba(255, 255, 255, 1);
  1844. }
  1845. }
  1846. }
  1847. }
  1848. .right-box {
  1849. width: 300px;
  1850. background: rgba(0, 0, 0, 0.5);
  1851. position: absolute;
  1852. right: 0;
  1853. bottom: 0;
  1854. top: 0;
  1855. z-index: 10;
  1856. .bg {
  1857. backdrop-filter: blur(10px);
  1858. position: absolute;
  1859. left: 0;
  1860. top: 0;
  1861. width: 100%;
  1862. height: 100%;
  1863. z-index: 2;
  1864. }
  1865. .no-login {
  1866. position: relative;
  1867. z-index: 10;
  1868. .input {
  1869. margin: 16px;
  1870. height: 40px;
  1871. background: #ffffff;
  1872. border-radius: 8px;
  1873. input {
  1874. padding: 0 16px;
  1875. width: 100%;
  1876. height: 100%;
  1877. font-size: 14px;
  1878. color: #333;
  1879. &::placeholder {
  1880. color: #999;
  1881. }
  1882. }
  1883. .btn {
  1884. font-size: 14px;
  1885. font-family: Microsoft YaHei;
  1886. font-weight: 400;
  1887. color: #3f8dfd;
  1888. white-space: nowrap;
  1889. cursor: pointer;
  1890. }
  1891. }
  1892. .submit {
  1893. margin: 16px;
  1894. font-size: 16px;
  1895. margin-top: 16px;
  1896. box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.08);
  1897. display: block;
  1898. width: 268px;
  1899. }
  1900. .bottom-text {
  1901. margin: 16px;
  1902. display: flex;
  1903. justify-content: space-between;
  1904. .text {
  1905. color: #fff;
  1906. }
  1907. }
  1908. }
  1909. .has-login {
  1910. position: relative;
  1911. z-index: 10;
  1912. padding: 14px 0 0 14px;
  1913. .userinfo {
  1914. display: flex;
  1915. align-items: center;
  1916. .avatar {
  1917. width: 40px;
  1918. height: 40px;
  1919. }
  1920. .nickname {
  1921. font-size: 16px;
  1922. font-family: Microsoft YaHei;
  1923. font-weight: bold;
  1924. color: #ffffff;
  1925. margin-left: 7px;
  1926. }
  1927. }
  1928. .type-list {
  1929. display: flex;
  1930. margin-top: 28px;
  1931. padding-bottom: 14px;
  1932. border-bottom: 1px solid #fff;
  1933. &__item {
  1934. cursor: pointer;
  1935. margin-right: 38px;
  1936. .img {
  1937. width: 64px;
  1938. height: 64px;
  1939. }
  1940. .text {
  1941. text-align: center;
  1942. margin-top: 10px;
  1943. font-size: 14px;
  1944. font-family: Microsoft YaHei;
  1945. font-weight: 400;
  1946. color: #ffffff;
  1947. }
  1948. &:nth-last-of-type(1) {
  1949. margin-right: 0;
  1950. }
  1951. }
  1952. }
  1953. .history {
  1954. border-bottom: 1px solid #fff;
  1955. padding-bottom: 15px;
  1956. .btn {
  1957. margin-top: 15px;
  1958. width: 64px;
  1959. height: 24px;
  1960. border: 1px solid #ffffff;
  1961. border-radius: 8px;
  1962. text-align: center;
  1963. line-height: 24px;
  1964. color: #fff;
  1965. }
  1966. .title {
  1967. cursor: pointer;
  1968. margin-top: 15px;
  1969. padding-right: 15px;
  1970. font-size: 14px;
  1971. font-family: Microsoft YaHei;
  1972. font-weight: 400;
  1973. color: #ffffff;
  1974. }
  1975. .progress {
  1976. margin-top: 15px;
  1977. display: flex;
  1978. justify-content: space-between;
  1979. padding-right: 15px;
  1980. span {
  1981. font-size: 14px;
  1982. font-family: Microsoft YaHei;
  1983. font-weight: 400;
  1984. color: #ffffff;
  1985. }
  1986. }
  1987. }
  1988. }
  1989. }
  1990. }
  1991. }
  1992. }
  1993. .course {
  1994. background: #f5f7fa;
  1995. padding-top: 40px;
  1996. &__header {
  1997. display: flex;
  1998. align-items: center;
  1999. justify-content: space-between;
  2000. padding-bottom: 15px;
  2001. border-bottom: 1px solid #DCDCDC;
  2002. .lefts {
  2003. display: flex;
  2004. }
  2005. .title {
  2006. background: url("~@/assets/video.png") no-repeat left center;
  2007. padding-left: 36px;
  2008. font-size: 24px;
  2009. font-family: YouSheBiaoTiHei;
  2010. font-weight: 400;
  2011. color: #333333;
  2012. text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
  2013. }
  2014. }
  2015. .tabs {
  2016. margin-left: 28px;
  2017. display: flex;
  2018. align-items: center;
  2019. .tab {
  2020. cursor: pointer;
  2021. color: #888888;
  2022. font-size: 14px;
  2023. margin-right: 32px;
  2024. &.active {
  2025. font-weight: 600;
  2026. color: #222222;
  2027. }
  2028. }
  2029. }
  2030. .pagination {
  2031. padding: 30px 0;
  2032. text-align: center;
  2033. }
  2034. &__body {
  2035. .list {
  2036. width: 100%;
  2037. .course-item {
  2038. float: left;
  2039. }
  2040. }
  2041. }
  2042. &__footer {
  2043. overflow: hidden;
  2044. .btn {
  2045. cursor: pointer;
  2046. width: 72px;
  2047. height: 28px;
  2048. line-height: 28px;
  2049. background: #D5E4FF;
  2050. border-radius: 4px;
  2051. // margin: 20px auto 40px;
  2052. color: #3F8DFD;
  2053. text-align: center;
  2054. transition: all 0.2s;
  2055. &:hover {
  2056. color: #fff;
  2057. box-shadow: 0px 8px 4px 0px rgba(7, 82, 208, 0.08);
  2058. background: #3f8dfd;
  2059. }
  2060. }
  2061. }
  2062. }
  2063. .bank {
  2064. background: #fff;
  2065. padding-top: 40px;
  2066. &__header {
  2067. display: flex;
  2068. align-items: center;
  2069. justify-content: space-between;
  2070. padding-bottom: 15px;
  2071. border-bottom: 1px solid #DCDCDC;
  2072. .lefts {
  2073. display: flex;
  2074. }
  2075. .title {
  2076. background: url("~@/assets/exercise.png") no-repeat left center;
  2077. padding-left: 36px;
  2078. font-size: 24px;
  2079. font-family: YouSheBiaoTiHei;
  2080. font-weight: 400;
  2081. color: #333333;
  2082. text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
  2083. }
  2084. }
  2085. .tabs {
  2086. margin-left: 40px;
  2087. display: flex;
  2088. align-items: center;
  2089. .tab {
  2090. cursor: pointer;
  2091. color: #888888;
  2092. font-size: 14px;
  2093. margin-right: 32px;
  2094. &.active {
  2095. font-weight: 600;
  2096. color: #222222;
  2097. }
  2098. }
  2099. }
  2100. .pagination {
  2101. padding: 30px 0;
  2102. text-align: center;
  2103. }
  2104. &__body {
  2105. .list {
  2106. width: 100%;
  2107. .bank-item {
  2108. float: left;
  2109. }
  2110. }
  2111. }
  2112. &__footer {
  2113. overflow: hidden;
  2114. .btn {
  2115. cursor: pointer;
  2116. width: 72px;
  2117. height: 28px;
  2118. line-height: 28px;
  2119. background: #D5E4FF;
  2120. border-radius: 4px;
  2121. // margin: 20px auto 40px;
  2122. color: #3F8DFD;
  2123. text-align: center;
  2124. transition: all 0.2s;
  2125. &:hover {
  2126. color: #fff;
  2127. box-shadow: 0px 8px 4px 0px rgba(7, 82, 208, 0.08);
  2128. background: #3f8dfd;
  2129. }
  2130. }
  2131. }
  2132. }
  2133. .bind {
  2134. /deep/ .el-dialog__header {
  2135. display: none;
  2136. }
  2137. /deep/ .el-dialog__body {
  2138. padding: 0;
  2139. overflow: unset;
  2140. }
  2141. &__close {
  2142. position: absolute;
  2143. right: 0;
  2144. top: -28px;
  2145. width: 24px;
  2146. height: 24px;
  2147. line-height: 24px;
  2148. text-align: center;
  2149. color: #eee;
  2150. border: 1px solid #eee;
  2151. border-radius: 50%;
  2152. }
  2153. &__header {
  2154. height: 40px;
  2155. text-align: center;
  2156. line-height: 40px;
  2157. border-bottom: 1px solid #eeeeee;
  2158. }
  2159. &__body {
  2160. height: 248px;
  2161. padding: 24px;
  2162. position: relative;
  2163. box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.04);
  2164. border-radius: 8px;
  2165. .submit {
  2166. width: 100%;
  2167. }
  2168. .bind-next {
  2169. font-size: 14px;
  2170. text-align: center;
  2171. color: #999;
  2172. margin-top: 10px;
  2173. cursor: pointer;
  2174. }
  2175. }
  2176. }
  2177. }
  2178. .fade-enter,
  2179. .fade-leave-to {
  2180. opacity: 0;
  2181. height: 0;
  2182. }
  2183. .fade-enter-to,
  2184. .fade-leave {
  2185. opacity: 1;
  2186. height: 122px;
  2187. }
  2188. .fade-enter-active,
  2189. .fade-leave-active {
  2190. transition: all 0.3s;
  2191. }
  2192. .dis_flex {
  2193. user-select: none;
  2194. display: flex;
  2195. align-items: center;
  2196. justify-content: center;
  2197. .dis_flex_wxloginImg {
  2198. cursor: pointer;
  2199. width: 76px;
  2200. height: 76px;
  2201. border-radius: 50%;
  2202. overflow: hidden;
  2203. background-color: #fff;
  2204. line-height: 76px;
  2205. text-align: center;
  2206. img {
  2207. vertical-align: middle;
  2208. width: 40px;
  2209. height: 40px;
  2210. }
  2211. }
  2212. }
  2213. /deep/ .el-badge__content.is-fixed {
  2214. top: 7px;
  2215. }
  2216. .dis_plays {
  2217. display: flex;
  2218. align-items: center;
  2219. }
  2220. .toolbth {
  2221. border-radius: 55px;
  2222. background-color: #fff;
  2223. color: #3f8dfd;
  2224. font-size: 14px;
  2225. padding: 5px 14px;
  2226. margin-right: 16px;
  2227. user-select: none;
  2228. cursor: pointer;
  2229. }
  2230. </style>
  2231. <style lang="scss">
  2232. .tooltipStyle {
  2233. background-color: #3f8dfd !important;
  2234. color: #fff;
  2235. }
  2236. .tooltipStyle .popper__arrow {
  2237. border-bottom-color: #3f8dfd!important;
  2238. }
  2239. .tooltipStyle .popper__arrow::after {
  2240. border-bottom-color: #3f8dfd!important;
  2241. }
  2242. </style>