index.vue 62 KB

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