index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492
  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="login(1)">登录</a>
  8. <a @click="login(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. <a @click="go('/person-center')">
  15. <i class="el-icon-user-solid icon"></i>
  16. </a>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="header__body">
  21. <div class="container clearfix">
  22. <a class="logo">
  23. <img
  24. v-if="header.companyLogo"
  25. :src="$tools.splitImgHost(header.companyLogo)"
  26. alt=""
  27. />
  28. <h1 v-else></h1>
  29. </a>
  30. <div class="search">
  31. <div class="search__select">
  32. <select>
  33. <option value="1" selected>课程</option>
  34. <option value="2">题库</option>
  35. </select>
  36. </div>
  37. <div class="search__input">
  38. <input type="text" />
  39. </div>
  40. <div class="search__btn">搜索</div>
  41. </div>
  42. <div class="contact" v-if="header.serviceTel.status == 1">
  43. <div class="contact__phone">{{ header.serviceTel.tel }}</div>
  44. <div class="contact__time">
  45. 周一至周日 {{ header.serviceTel.time }}
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </header>
  51. <section class="section">
  52. <div class="container">
  53. <div class="tabs">
  54. <template v-for="(item, index) in showNav(header.Nav)">
  55. <a v-if="item.name === '首页'" :key="index" class="tab active"
  56. >首页</a
  57. >
  58. <a
  59. v-if="item.name === '走进祥粤'"
  60. :key="index"
  61. class="tab"
  62. target="view_window"
  63. href="https://www.xyyxt.net/abount"
  64. >走进祥粤</a
  65. >
  66. <a
  67. v-if="item.name === '课程'"
  68. :key="index"
  69. class="tab"
  70. @click="go('/course-list')"
  71. >课程</a
  72. >
  73. <a
  74. v-if="item.name === '题库'"
  75. :key="index"
  76. class="tab"
  77. @click="go('/bank-list')"
  78. >题库</a
  79. >
  80. </template>
  81. </div>
  82. </div>
  83. <div class="swiper-wrap" :style="{ background: color }">
  84. <div class="container">
  85. <div class="left-box">
  86. <div class="left-box__header">课程导航</div>
  87. <div class="left-box__body">
  88. <ul class="list">
  89. <li v-for="(item, index) in 5" :key="index">
  90. <div class="text">
  91. <div class="text__title">继续教育</div>
  92. <div class="text__desc">
  93. <a class="item">建造师-一级</a>
  94. <a class="item">建造师-一级</a>
  95. </div>
  96. </div>
  97. </li>
  98. </ul>
  99. </div>
  100. </div>
  101. <div class="swiper">
  102. <swiper
  103. ref="mySwiper"
  104. @slideChangeTransitionStart="slideChangeTransitionStart($event)"
  105. class=""
  106. v-bind:options="swiperOptions"
  107. >
  108. <swiper-slide
  109. v-for="(item, index) in bannerList"
  110. v-bind:key="index"
  111. >
  112. <img
  113. :src="$tools.splitImgHost(item.adverUrl, true, 1272)"
  114. alt=""
  115. />
  116. </swiper-slide>
  117. <div class="swiper-pagination" slot="pagination"></div>
  118. <!-- <div class="swiper-button-prev" slot="button-prev"></div>
  119. <div class="swiper-button-next" slot="button-next"></div> -->
  120. </swiper>
  121. </div>
  122. <div class="right-box">
  123. <div class="no-login" v-if="!userInfo">
  124. <template v-if="loginType == 1">
  125. <el-form :model="loginForm" ref="loginForm" :rules="loginRules">
  126. <div class="input">
  127. <el-form-item prop="account">
  128. <el-input
  129. autocomplete="off"
  130. v-model="loginForm.account"
  131. placeholder="请输入手机号或身份证号"
  132. ></el-input>
  133. </el-form-item>
  134. </div>
  135. <div class="input">
  136. <el-form-item prop="pwd">
  137. <el-input
  138. autocomplete="new-password"
  139. type="password"
  140. v-model="loginForm.pwd"
  141. placeholder="请输入密码"
  142. ></el-input>
  143. </el-form-item>
  144. </div>
  145. <el-button
  146. type="primary"
  147. class="submit"
  148. @click="login"
  149. :loading="isLogin"
  150. >登录</el-button
  151. >
  152. <div class="bottom-text">
  153. <a class="text" @click="loginType = 2">手机验证码登录</a>
  154. <a class="text" @click="go('/login?state=2')">注册</a>
  155. </div>
  156. </el-form>
  157. </template>
  158. <template v-if="loginType == 2">
  159. <el-form
  160. :model="loginSmsForm"
  161. ref="loginSmsForm"
  162. :rules="loginSmsRules"
  163. >
  164. <div class="input">
  165. <el-form-item prop="tel">
  166. <el-input
  167. autocomplete="off"
  168. v-model="loginSmsForm.tel"
  169. placeholder="请输入手机号"
  170. ></el-input>
  171. </el-form-item>
  172. </div>
  173. <div class="input">
  174. <el-form-item prop="code">
  175. <el-input
  176. autocomplete="off"
  177. v-model="loginSmsForm.code"
  178. placeholder="请输入验证码"
  179. >
  180. <span slot="suffix" @click="getLoginSms" class="btn">{{
  181. countDown == 0
  182. ? "获取验证码"
  183. : `${countDown}秒重新获取`
  184. }}</span>
  185. </el-input>
  186. </el-form-item>
  187. </div>
  188. <el-button
  189. type="primary"
  190. class="submit"
  191. :loading="isloginSms"
  192. @click="loginSms()"
  193. >登录</el-button
  194. >
  195. <div class="bottom-text">
  196. <a class="text" @click="loginType = 1">账号密码登录</a>
  197. <a class="text" @click="go('/login?state=2')">注册</a>
  198. </div>
  199. </el-form>
  200. </template>
  201. </div>
  202. <div class="has-login" v-else>
  203. <div class="userinfo">
  204. <img src="@/assets/ava.png" class="avatar" alt="" />
  205. <div class="nickname">倪虹洁</div>
  206. </div>
  207. <div class="type-list">
  208. <div
  209. class="type-list__item"
  210. @click="go('/person-center/my-course')"
  211. >
  212. <img src="@/assets/kc.png" alt="" />
  213. <div class="text">课程</div>
  214. </div>
  215. <div class="type-list__item">
  216. <img src="@/assets/tk.png" alt="" />
  217. <div class="text">题库</div>
  218. </div>
  219. <div class="type-list__item">
  220. <img src="@/assets/dd.png" alt="" />
  221. <div class="text">订单</div>
  222. </div>
  223. </div>
  224. <div class="history">
  225. <div class="btn">上次播放</div>
  226. <div class="title">2022年二级建造师建设工程施工管理</div>
  227. <div class="progress">
  228. <span>已学70%</span>
  229. <span>2022-02-17</span>
  230. </div>
  231. </div>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. </section>
  237. <section class="course">
  238. <div class="container">
  239. <div class="course__header">
  240. <div class="title">推荐课程</div>
  241. <div class="tabs">
  242. <div
  243. v-for="(item, index) in goodsList1"
  244. :key="index"
  245. class="tab"
  246. :class="active1 === index ? 'active' : ''"
  247. @click="active1 = index"
  248. >
  249. {{ item.projectName + " - " + item.businessName }}
  250. </div>
  251. </div>
  252. </div>
  253. <div class="course__body">
  254. <p
  255. v-if="
  256. !goodsList1[active1].goodsList ||
  257. goodsList1[active1].goodsList.length === 0
  258. "
  259. class="text_align"
  260. >
  261. 该业务层次无推荐课程
  262. </p>
  263. <ul v-else class="list clearfix">
  264. <template v-for="(item, index) in goodsList1[active1].goodsList">
  265. <li
  266. class="course-item"
  267. v-if="index < 8"
  268. :key="index"
  269. @click="goodsDetail(item, 1)"
  270. >
  271. <div class="course-item__img">
  272. <div class="note" v-if="item.year">{{ item.year }}</div>
  273. <img
  274. v-if="item.coverUrl"
  275. :src="$tools.splitImgHost(item.coverUrl)"
  276. alt=""
  277. />
  278. </div>
  279. <div class="course-item__title">
  280. {{ item.goodsName }}
  281. </div>
  282. <div class="course-item__desc">
  283. <div class="price">¥{{ item.standPrice }}</div>
  284. <a class="add" @click.stop="addCart(item)">加购物车</a>
  285. </div>
  286. </li>
  287. </template>
  288. </ul>
  289. </div>
  290. <div class="course__footer">
  291. <div class="btn" @click="go('/course-list')">查看更多</div>
  292. </div>
  293. </div>
  294. </section>
  295. <section class="bank">
  296. <div class="container">
  297. <div class="bank__header">
  298. <div class="title">推荐题库</div>
  299. <div class="tabs">
  300. <div
  301. v-for="(item, index) in goodsList2"
  302. :key="index"
  303. class="tab"
  304. :class="active2 === index ? 'active' : ''"
  305. @click="active2 = index"
  306. >
  307. {{ item.projectName + " - " + item.businessName }}
  308. </div>
  309. </div>
  310. </div>
  311. <div class="bank__body">
  312. <p
  313. v-if="
  314. !goodsList2[active2].goodsList ||
  315. goodsList2[active2].goodsList.length === 0
  316. "
  317. class="text_align"
  318. >
  319. 该业务层次无推荐题库
  320. </p>
  321. <ul v-else class="list clearfix">
  322. <template v-for="(item, index) in goodsList2[active2].goodsList">
  323. <li
  324. class="bank-item"
  325. v-if="index < 8"
  326. :key="index"
  327. @click="goodsDetail(item, 2)"
  328. >
  329. <div class="bank-item__img">
  330. <div class="note" v-if="item.year">{{ item.year }}</div>
  331. <img
  332. v-if="item.coverUrl"
  333. :src="$tools.splitImgHost(item.coverUrl)"
  334. alt=""
  335. />
  336. </div>
  337. <div class="bank-item__title">
  338. {{ item.goodsName }}
  339. </div>
  340. <div class="bank-item__desc">
  341. <div class="price">¥{{ item.standPrice }}</div>
  342. <a class="add" @click.stop="addCart(item)">加购物车</a>
  343. </div>
  344. </li>
  345. </template>
  346. </ul>
  347. </div>
  348. <div class="bank__footer">
  349. <div class="btn" @click="go('/bank-list')">查看更多</div>
  350. </div>
  351. </div>
  352. </section>
  353. <el-dialog
  354. :visible.sync="bindShow"
  355. width="348px"
  356. center
  357. :close-on-click-modal="false"
  358. :close-on-press-escape="false"
  359. class="bind"
  360. >
  361. <a class="bind__close" @click="bindNext">X</a>
  362. <div class="bind__header">关联学员身份</div>
  363. <div class="bind__body">
  364. <el-form
  365. class="bind-form"
  366. ref="bindForm"
  367. :model="bindForm"
  368. :rules="bindForm"
  369. >
  370. <el-form-item prop="realname"
  371. ><el-input placeholder="真实姓名" v-model="bindForm.realname">
  372. </el-input
  373. ></el-form-item>
  374. <el-form-item prop="idCard">
  375. <el-input placeholder="身份证号码" v-model="bindForm.idCard">
  376. </el-input
  377. ></el-form-item>
  378. <el-button
  379. class="submit"
  380. type="primary"
  381. :loading="isBind"
  382. round
  383. @click="bind"
  384. >确定</el-button
  385. >
  386. <div class="bind-next" @click="bindNext">下次再关联</div>
  387. </el-form>
  388. </div>
  389. </el-dialog>
  390. <ToolBar></ToolBar>
  391. <Footer></Footer>
  392. </div>
  393. </template>
  394. <script>
  395. import Footer from "@/components/footer/index";
  396. import ToolBar from "@/components/toolbar/index";
  397. import { swiper, swiperSlide } from "vue-awesome-swiper";
  398. import { mapGetters, mapMutations } from "vuex";
  399. import "swiper/swiper-bundle.css";
  400. export default {
  401. name: "Home",
  402. components: {
  403. swiper,
  404. swiperSlide,
  405. Footer,
  406. ToolBar,
  407. },
  408. computed: {
  409. ...mapGetters(["userInfo", "token", "header"]),
  410. showNav: function () {
  411. return function (list) {
  412. var newList = [];
  413. if (list) {
  414. newList = list.filter((item) => {
  415. return item.status === 1;
  416. });
  417. }
  418. return newList;
  419. };
  420. },
  421. },
  422. data() {
  423. return {
  424. indexToken: "",
  425. indexUserAccount: "",
  426. colors: ["red", "green", "blue", "gray", "black"],
  427. color: "",
  428. countDown: 0,
  429. countDownTimer: null,
  430. loginRules: {
  431. account: [
  432. { required: true, trigger: "blur", message: "请输入手机号/身份证号" },
  433. ],
  434. pwd: [{ required: true, trigger: "blur", message: "请输入密码" }],
  435. },
  436. loginSmsRules: {
  437. code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
  438. tel: [{ required: true, trigger: "blur", message: "请输入手机号" }],
  439. },
  440. bindRules: {
  441. code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
  442. tel: [{ required: true, trigger: "blur", message: "请输入手机号" }],
  443. pwd: [{ required: true, trigger: "blur", message: "请输入密码" }],
  444. read: [{ required: true, trigger: "blur", message: "请勾选服务协议" }],
  445. },
  446. bindShow: false,
  447. loginType: 1,
  448. loginForm: {},
  449. loginSmsForm: {},
  450. bindForm: {},
  451. isLogin: false,
  452. isLoginSms: false,
  453. isBind: false,
  454. getLoginCodeLock: false,
  455. isloginSms: false,
  456. swiperOptions: {
  457. loop: true,
  458. speed: 300,
  459. autoplay: {
  460. delay: 3000,
  461. stopOnLastSlide: false,
  462. disableOnInteraction: false,
  463. },
  464. // 显示分页
  465. pagination: {
  466. el: ".swiper-pagination",
  467. clickable: true, //允许分页点击跳转
  468. },
  469. // 设置点击箭头
  470. navigation: {
  471. nextEl: ".swiper-button-next",
  472. prevEl: ".swiper-button-prev",
  473. },
  474. },
  475. bannerList: [],
  476. goodsList1: [{}], //推荐课程列表
  477. goodsList2: [{}], //推荐题库列表
  478. active1: 0, //推荐课程index
  479. active2: 0, //推荐题库index
  480. };
  481. },
  482. mounted() {
  483. this.getActivityList();
  484. // this.color = this.colors[0];
  485. this.advertisingList();
  486. },
  487. methods: {
  488. ...mapMutations(["setUserInfo"]),
  489. /**
  490. * 查看商品详情
  491. */
  492. goodsDetail(item, type) {
  493. if (type === 1) {
  494. this.$router.push({
  495. path: "/course-detail/" + item.goodsId,
  496. });
  497. }
  498. if (type === 2) {
  499. this.$router.push({
  500. path: "/bank-detail/" + item.goodsId,
  501. });
  502. }
  503. },
  504. /**
  505. * 加入购物车
  506. */
  507. addCart(item) {
  508. this.$request
  509. .addCart({ goodsId: item.goodsId })
  510. .then((res) => {
  511. if (res) {
  512. this.$message({
  513. message: "加入购物车成功",
  514. type: "success",
  515. });
  516. }
  517. })
  518. .catch((err) => {
  519. this.$message({
  520. message: err.msg,
  521. type: "warning",
  522. });
  523. });
  524. },
  525. /**
  526. * 获取推荐商品
  527. */
  528. getActivityList() {
  529. this.$request
  530. .appCommonActivityRecommendList({ platform: 2, status: 1 })
  531. .then((res) => {
  532. let goodsList1 = []; //推荐视频商品
  533. let goodsList2 = []; //推荐题库商品
  534. res.rows.forEach((item) => {
  535. if (item.type === 1) {
  536. goodsList1.push(item);
  537. }
  538. if (item.type === 2) {
  539. goodsList2.push(item);
  540. }
  541. });
  542. this.goodsList1 = goodsList1;
  543. this.goodsList2 = goodsList2;
  544. });
  545. },
  546. slideChangeTransitionStart(e) {
  547. this.color = this.colors[this.$refs.mySwiper.swiper.realIndex];
  548. },
  549. advertisingList() {
  550. this.$request
  551. .advertisinghomeLocationList({
  552. platform: 2, //1小程序2PC网站
  553. status: 1,
  554. locationKey: "home-banner", //首页轮播KEY
  555. })
  556. .then((res) => {
  557. /**
  558. * 如果存在-调用轮播图列表
  559. */
  560. if (res.data.length) {
  561. this.$request
  562. .advertisingList({ locationId: res.data[0].locationId })
  563. .then((res) => {
  564. this.bannerList = res.rows;
  565. this.colors = res.rows.map((item) => {
  566. return item.color ? item.color : "rgba(225,225,225,0.1)";
  567. });
  568. this.color = this.colors[0];
  569. });
  570. }
  571. });
  572. },
  573. go(path) {
  574. this.$router.push({
  575. path,
  576. });
  577. },
  578. login() {
  579. this.$refs.loginForm.validate((valid) => {
  580. if (valid) {
  581. this.isLogin = true;
  582. this.$request
  583. .login(this.loginForm)
  584. .then((res) => {
  585. if (res.data.full_info) {
  586. localStorage.setItem("user_account", res.data.user_account);
  587. localStorage.setItem("token", res.data.token);
  588. this.getInfo();
  589. } else {
  590. this.indexUserAccount = res.data.user_account;
  591. this.indexToken = res.data.token;
  592. this.isLogin = false;
  593. //弹窗
  594. this.bindShow = true;
  595. }
  596. })
  597. .catch((err) => {
  598. this.isLogin = false;
  599. this.$message({
  600. message: err.msg,
  601. type: "error",
  602. });
  603. });
  604. }
  605. });
  606. },
  607. /**
  608. * 获取登录短信
  609. */
  610. getLoginSms() {
  611. this.$refs.loginSmsForm.validateField("tel", (valid) => {
  612. if (!valid) {
  613. if (this.countDown == 0) {
  614. if (this.getLoginCodeLock) {
  615. return;
  616. }
  617. this.getLoginCodeLock = true;
  618. this.$request
  619. .getLoginSms({ tel: this.loginSmsForm.tel })
  620. .then((res) => {
  621. this.getLoginCodeLock = false;
  622. this.$message({
  623. message: `验证码已发送`,
  624. type: "success",
  625. });
  626. this.countDown = 60;
  627. this.countDownTimer = setInterval(() => {
  628. if (this.countDown == 0) {
  629. clearInterval(this.countDownTimer);
  630. } else {
  631. this.countDown--;
  632. }
  633. }, 1000);
  634. })
  635. .catch((err) => {
  636. this.getLoginCodeLock = false;
  637. });
  638. }
  639. }
  640. });
  641. },
  642. /**
  643. * 手机号登录
  644. */
  645. loginSms() {
  646. this.$refs.loginSmsForm.validate((valid) => {
  647. if (valid) {
  648. this.isloginSms = true;
  649. this.$request
  650. .loginSms(this.loginSmsForm)
  651. .then((res) => {
  652. this.isloginSms = false;
  653. if (res.data.full_info) {
  654. localStorage.setItem("user_account", res.data.user_account);
  655. localStorage.setItem("token", res.data.token);
  656. this.getInfo();
  657. } else {
  658. this.indexUserAccount = res.data.user_account;
  659. this.indexToken = res.data.token;
  660. this.bindShow = true;
  661. }
  662. })
  663. .catch((err) => {
  664. this.isloginSms = false;
  665. this.$message({
  666. message: err.msg,
  667. type: "error",
  668. });
  669. });
  670. }
  671. });
  672. },
  673. /**
  674. * 获取用户登录信息
  675. */
  676. getInfo() {
  677. this.$request
  678. .getInfo()
  679. .then((res) => {
  680. this.islogin = false;
  681. this.isloginSms = false;
  682. this.setUserInfo(res.data);
  683. })
  684. .catch((err) => {
  685. this.islogin = false;
  686. this.isloginSms = false;
  687. this.$message({
  688. message: err.msg,
  689. type: "error",
  690. });
  691. });
  692. },
  693. bind() {
  694. this.$refs.bindForm.validate((valid) => {
  695. if (valid) {
  696. this.isBind = true;
  697. let bindForm = JSON.parse(JSON.stringify(this.bindForm));
  698. bindForm.token = this.indexToken;
  699. this.$request
  700. .bindIdCard(bindForm)
  701. .then((res) => {
  702. this.isBind = false;
  703. this.bindShow = false;
  704. this.$message({
  705. message: "关联成功",
  706. type: "success",
  707. });
  708. localStorage.setItem("user_account", this.indexUserAccount);
  709. localStorage.setItem("token", this.indexToken);
  710. this.getInfo();
  711. })
  712. .catch((err) => {
  713. this.isBind = false;
  714. this.$message({
  715. message: err.msg,
  716. type: "error",
  717. });
  718. });
  719. }
  720. });
  721. },
  722. bindNext() {
  723. this.bindShow = false;
  724. this.indexToken = "";
  725. this.indexUserAccount = "";
  726. },
  727. },
  728. };
  729. </script>
  730. <!-- Add "scoped" attribute to limit CSS to this component only -->
  731. <style scoped lang="scss">
  732. .text_align {
  733. text-align: center;
  734. font-size: 18px;
  735. margin: 40px 0px;
  736. }
  737. .home {
  738. .header {
  739. background: #ffffff;
  740. &__header {
  741. box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.04);
  742. .text-list {
  743. height: 40px;
  744. line-height: 40px;
  745. text-align: right;
  746. font-size: 0;
  747. a {
  748. color: #3f8dfd;
  749. font-size: 14px;
  750. padding: 0 14px;
  751. &:nth-last-of-type(1) {
  752. padding-right: 0;
  753. border-left: 1px solid #3f8dfd;
  754. }
  755. }
  756. }
  757. .icon-list {
  758. height: 40px;
  759. line-height: 40px;
  760. text-align: right;
  761. font-size: 0;
  762. a {
  763. color: #3f8dfd;
  764. font-size: 14px;
  765. padding: 0 14px;
  766. .icon {
  767. font-size: 20px;
  768. }
  769. }
  770. }
  771. }
  772. &__body {
  773. margin-top: 16px;
  774. .logo {
  775. float: left;
  776. img {
  777. width: 162px;
  778. height: 33px;
  779. }
  780. h1 {
  781. background: url("~@/assets/logo.png") no-repeat center;
  782. width: 162px;
  783. height: 33px;
  784. }
  785. }
  786. .search {
  787. float: left;
  788. margin-left: 160px;
  789. width: 648px;
  790. background: #fafbfc;
  791. border: 1px solid #3f8dfd;
  792. border-radius: 8px;
  793. display: flex;
  794. overflow: hidden;
  795. &__select {
  796. width: 76px;
  797. border-right: 1px solid #fff;
  798. select {
  799. text-align: center;
  800. width: 100%;
  801. height: 100%;
  802. border: 0;
  803. outline: none;
  804. }
  805. }
  806. &__input {
  807. flex: 1;
  808. input {
  809. width: 100%;
  810. height: 100%;
  811. }
  812. }
  813. &__btn {
  814. text-align: center;
  815. width: 80px;
  816. height: 40px;
  817. line-height: 40px;
  818. color: #fff;
  819. font-size: 14px;
  820. background: #3f8dfd;
  821. }
  822. }
  823. .contact {
  824. float: right;
  825. padding-left: 45px;
  826. background: url("~@/assets/cus.png") no-repeat left top;
  827. &__phone {
  828. font-size: 18px;
  829. font-family: Microsoft YaHei;
  830. font-weight: bold;
  831. color: #666666;
  832. }
  833. &__time {
  834. font-size: 14px;
  835. font-family: Microsoft YaHei;
  836. font-weight: 400;
  837. color: #666666;
  838. }
  839. }
  840. }
  841. }
  842. .section {
  843. margin-top: 40px;
  844. .tabs {
  845. margin-left: 324px;
  846. .tab {
  847. display: inline-block;
  848. width: 138px;
  849. height: 40px;
  850. font-size: 16px;
  851. text-align: center;
  852. line-height: 40px;
  853. color: #333;
  854. &.active {
  855. color: #3f8dfd;
  856. background: #f0f5fc;
  857. }
  858. }
  859. }
  860. .swiper-wrap {
  861. transition: background 0.3s;
  862. height: 400px;
  863. position: relative;
  864. .container {
  865. position: relative;
  866. .left-box {
  867. position: absolute;
  868. top: -40px;
  869. left: 0;
  870. height: 440px;
  871. width: 300px;
  872. z-index: 10;
  873. &__header {
  874. height: 40px;
  875. line-height: 40px;
  876. color: #fff;
  877. font-size: 16px;
  878. background: #3f8dfd;
  879. text-align: center;
  880. }
  881. &__body {
  882. height: 400px;
  883. background: rgba(0, 0, 0, 0.5);
  884. .list {
  885. padding-left: 16px;
  886. li {
  887. padding: 12px 0;
  888. height: 80px;
  889. border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  890. display: flex;
  891. .text {
  892. &__title {
  893. font-size: 16px;
  894. font-family: Microsoft YaHei;
  895. font-weight: 400;
  896. color: #ffffff;
  897. }
  898. &__desc {
  899. margin-top: 16px;
  900. .item {
  901. font-size: 14px;
  902. font-family: Microsoft YaHei;
  903. font-weight: 400;
  904. color: #ffffff;
  905. margin-right: 30px;
  906. }
  907. }
  908. }
  909. }
  910. }
  911. }
  912. }
  913. .swiper {
  914. .swiper-slide {
  915. height: 400px;
  916. }
  917. }
  918. .right-box {
  919. width: 300px;
  920. background: rgba(0, 0, 0, 0.5);
  921. position: absolute;
  922. right: 0;
  923. bottom: 0;
  924. top: 0;
  925. z-index: 10;
  926. .no-login {
  927. .input {
  928. margin: 16px;
  929. height: 40px;
  930. background: #ffffff;
  931. border-radius: 8px;
  932. input {
  933. padding: 0 16px;
  934. width: 100%;
  935. height: 100%;
  936. font-size: 14px;
  937. color: #333;
  938. &::placeholder {
  939. color: #999;
  940. }
  941. }
  942. .btn {
  943. font-size: 14px;
  944. font-family: Microsoft YaHei;
  945. font-weight: 400;
  946. color: #3f8dfd;
  947. white-space: nowrap;
  948. cursor: pointer;
  949. }
  950. }
  951. .submit {
  952. margin: 16px;
  953. font-size: 16px;
  954. margin-top: 16px;
  955. box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.08);
  956. display: block;
  957. width: 268px;
  958. }
  959. .bottom-text {
  960. margin: 16px;
  961. display: flex;
  962. justify-content: space-between;
  963. .text {
  964. color: #fff;
  965. }
  966. }
  967. }
  968. .has-login {
  969. padding: 14px 0 0 14px;
  970. .userinfo {
  971. display: flex;
  972. align-items: center;
  973. .avatar {
  974. width: 40px;
  975. height: 40px;
  976. }
  977. .nickname {
  978. font-size: 16px;
  979. font-family: Microsoft YaHei;
  980. font-weight: bold;
  981. color: #ffffff;
  982. margin-left: 7px;
  983. }
  984. }
  985. .type-list {
  986. display: flex;
  987. margin-top: 28px;
  988. padding-bottom: 14px;
  989. border-bottom: 1px solid #fff;
  990. &__item {
  991. cursor: pointer;
  992. margin-right: 38px;
  993. .img {
  994. width: 64px;
  995. height: 64px;
  996. }
  997. .text {
  998. text-align: center;
  999. margin-top: 10px;
  1000. font-size: 14px;
  1001. font-family: Microsoft YaHei;
  1002. font-weight: 400;
  1003. color: #ffffff;
  1004. }
  1005. &:nth-last-of-type(1) {
  1006. margin-right: 0;
  1007. }
  1008. }
  1009. }
  1010. .history {
  1011. border-bottom: 1px solid #fff;
  1012. padding-bottom: 15px;
  1013. .btn {
  1014. margin-top: 15px;
  1015. width: 64px;
  1016. height: 24px;
  1017. border: 1px solid #ffffff;
  1018. border-radius: 8px;
  1019. text-align: center;
  1020. line-height: 24px;
  1021. color: #fff;
  1022. }
  1023. .title {
  1024. margin-top: 15px;
  1025. padding-right: 15px;
  1026. font-size: 14px;
  1027. font-family: Microsoft YaHei;
  1028. font-weight: 400;
  1029. color: #ffffff;
  1030. }
  1031. .progress {
  1032. margin-top: 15px;
  1033. display: flex;
  1034. justify-content: space-between;
  1035. padding-right: 15px;
  1036. span {
  1037. font-size: 14px;
  1038. font-family: Microsoft YaHei;
  1039. font-weight: 400;
  1040. color: #ffffff;
  1041. }
  1042. }
  1043. }
  1044. }
  1045. }
  1046. }
  1047. }
  1048. }
  1049. .course {
  1050. background: #f5f7fa;
  1051. padding-top: 40px;
  1052. &__header {
  1053. display: flex;
  1054. align-items: center;
  1055. .title {
  1056. background: url("~@/assets/video.png") no-repeat left center;
  1057. padding-left: 36px;
  1058. font-size: 24px;
  1059. font-family: YouSheBiaoTiHei;
  1060. font-weight: 400;
  1061. color: #333333;
  1062. text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
  1063. }
  1064. .tabs {
  1065. margin-left: 40px;
  1066. display: flex;
  1067. align-items: center;
  1068. .tab {
  1069. cursor: pointer;
  1070. user-select: none;
  1071. // width: 88px;
  1072. padding: 0px 6px;
  1073. height: 24px;
  1074. border: 1px solid #f84e05;
  1075. border-radius: 12px;
  1076. text-align: center;
  1077. line-height: 24px;
  1078. color: #f84e05;
  1079. font-size: 14px;
  1080. margin: 0 4px;
  1081. &.active {
  1082. color: #fff;
  1083. background: #f84e05;
  1084. }
  1085. }
  1086. }
  1087. }
  1088. &__body {
  1089. .list {
  1090. width: 100%;
  1091. .course-item {
  1092. cursor: pointer;
  1093. float: left;
  1094. margin: 100px 9px 0;
  1095. width: 300px;
  1096. height: 178px;
  1097. background: #ffffff;
  1098. box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  1099. border-radius: 10px;
  1100. position: relative;
  1101. background: #fff;
  1102. padding-top: 100px;
  1103. &__img {
  1104. width: 280px;
  1105. height: 178px;
  1106. background: #ffffff;
  1107. box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  1108. border-radius: 10px;
  1109. position: absolute;
  1110. left: 10px;
  1111. top: -78px;
  1112. background: rgba(122, 136, 246, 1);
  1113. overflow: hidden;
  1114. .note {
  1115. position: absolute;
  1116. top: 0px;
  1117. left: 0px;
  1118. z-index: 2;
  1119. width: 80px;
  1120. height: 24px;
  1121. background: #d94404;
  1122. box-shadow: 0px 1px 1px 0px rgba(248, 78, 5, 0.4);
  1123. border-radius: 10px 0px 20px 0px;
  1124. text-align: center;
  1125. line-height: 24px;
  1126. color: #fff;
  1127. }
  1128. img {
  1129. width: 100%;
  1130. height: 100%;
  1131. }
  1132. }
  1133. &__title {
  1134. margin: 0 8px;
  1135. font-size: 14px;
  1136. font-family: Microsoft YaHei;
  1137. font-weight: 400;
  1138. color: #333333;
  1139. line-height: 24px;
  1140. }
  1141. &__desc {
  1142. height: 32px;
  1143. position: absolute;
  1144. left: 0;
  1145. right: 0;
  1146. bottom: 0;
  1147. margin-left: 8px;
  1148. display: flex;
  1149. justify-content: space-between;
  1150. .price {
  1151. font-size: 18px;
  1152. font-family: Microsoft YaHei;
  1153. font-weight: bold;
  1154. color: #ff2d55;
  1155. line-height: 32px;
  1156. }
  1157. .add {
  1158. display: block;
  1159. width: 118px;
  1160. height: 32px;
  1161. line-height: 30px;
  1162. background: #f2f4f7;
  1163. border-radius: 10px 0px 10px 0px;
  1164. font-size: 16px;
  1165. color: #3f8dfd;
  1166. text-align: center;
  1167. transition: all 0.2s;
  1168. &:hover {
  1169. background: #3f8dfd;
  1170. color: #f2f4f7;
  1171. }
  1172. }
  1173. }
  1174. }
  1175. }
  1176. }
  1177. &__footer {
  1178. overflow: hidden;
  1179. .btn {
  1180. cursor: pointer;
  1181. width: 146px;
  1182. height: 40px;
  1183. background: #e3eaf7;
  1184. border-radius: 8px;
  1185. margin: 20px auto 40px;
  1186. color: #3f8dfd;
  1187. text-align: center;
  1188. line-height: 40px;
  1189. transition: all 0.2s;
  1190. &:hover {
  1191. color: #fff;
  1192. box-shadow: 0px 8px 4px 0px rgba(7, 82, 208, 0.08);
  1193. background: #3f8dfd;
  1194. }
  1195. }
  1196. }
  1197. }
  1198. .bank {
  1199. background: #fff;
  1200. padding-top: 40px;
  1201. &__header {
  1202. display: flex;
  1203. align-items: center;
  1204. .title {
  1205. background: url("~@/assets/exercise.png") no-repeat left center;
  1206. padding-left: 36px;
  1207. font-size: 24px;
  1208. font-family: YouSheBiaoTiHei;
  1209. font-weight: 400;
  1210. color: #333333;
  1211. text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
  1212. }
  1213. .tabs {
  1214. margin-left: 40px;
  1215. display: flex;
  1216. align-items: center;
  1217. .tab {
  1218. cursor: pointer;
  1219. user-select: none;
  1220. padding: 0px 6px;
  1221. // width: 88px;
  1222. height: 24px;
  1223. border: 1px solid #437cff;
  1224. border-radius: 12px;
  1225. text-align: center;
  1226. line-height: 24px;
  1227. color: #437cff;
  1228. font-size: 14px;
  1229. margin: 0 4px;
  1230. &.active {
  1231. color: #fff;
  1232. background: #437cff;
  1233. }
  1234. }
  1235. }
  1236. }
  1237. &__body {
  1238. .list {
  1239. width: 100%;
  1240. .bank-item {
  1241. cursor: pointer;
  1242. float: left;
  1243. margin: 100px 9px 0;
  1244. width: 300px;
  1245. height: 178px;
  1246. background: #ffffff;
  1247. box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  1248. border-radius: 10px;
  1249. position: relative;
  1250. background: #fff;
  1251. padding-top: 100px;
  1252. &__img {
  1253. width: 280px;
  1254. height: 178px;
  1255. background: #ffffff;
  1256. box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  1257. border-radius: 10px;
  1258. position: absolute;
  1259. left: 10px;
  1260. top: -78px;
  1261. background: rgba(122, 136, 246, 1);
  1262. overflow: hidden;
  1263. .note {
  1264. position: absolute;
  1265. top: 0px;
  1266. left: 0px;
  1267. z-index: 2;
  1268. width: 80px;
  1269. height: 24px;
  1270. background: #437cff;
  1271. box-shadow: 0px 1px 1px 0px rgba(56, 104, 217, 0.4);
  1272. border-radius: 10px 0px 20px 0px;
  1273. text-align: center;
  1274. line-height: 24px;
  1275. color: #fff;
  1276. }
  1277. img {
  1278. width: 100%;
  1279. height: 100%;
  1280. }
  1281. }
  1282. &__title {
  1283. margin: 0 8px;
  1284. font-size: 14px;
  1285. font-family: Microsoft YaHei;
  1286. font-weight: 400;
  1287. color: #333333;
  1288. line-height: 24px;
  1289. }
  1290. &__desc {
  1291. height: 32px;
  1292. position: absolute;
  1293. left: 0;
  1294. right: 0;
  1295. bottom: 0;
  1296. margin-left: 8px;
  1297. display: flex;
  1298. justify-content: space-between;
  1299. .price {
  1300. font-size: 18px;
  1301. font-family: Microsoft YaHei;
  1302. font-weight: bold;
  1303. color: #ff2d55;
  1304. line-height: 32px;
  1305. }
  1306. .add {
  1307. display: block;
  1308. width: 118px;
  1309. height: 32px;
  1310. line-height: 30px;
  1311. background: #f2f4f7;
  1312. border-radius: 10px 0px 10px 0px;
  1313. font-size: 16px;
  1314. color: #3f8dfd;
  1315. text-align: center;
  1316. transition: all 0.2s;
  1317. &:hover {
  1318. background: #3f8dfd;
  1319. color: #f2f4f7;
  1320. }
  1321. }
  1322. }
  1323. }
  1324. }
  1325. }
  1326. &__footer {
  1327. overflow: hidden;
  1328. .btn {
  1329. cursor: pointer;
  1330. width: 146px;
  1331. height: 40px;
  1332. background: #e3eaf7;
  1333. border-radius: 8px;
  1334. margin: 20px auto 40px;
  1335. color: #3f8dfd;
  1336. text-align: center;
  1337. line-height: 40px;
  1338. transition: all 0.2s;
  1339. &:hover {
  1340. color: #fff;
  1341. box-shadow: 0px 8px 4px 0px rgba(7, 82, 208, 0.08);
  1342. background: #3f8dfd;
  1343. }
  1344. }
  1345. }
  1346. }
  1347. .bind {
  1348. /deep/ .el-dialog__header {
  1349. display: none;
  1350. }
  1351. /deep/ .el-dialog__body {
  1352. padding: 0;
  1353. overflow: unset;
  1354. }
  1355. &__close {
  1356. position: absolute;
  1357. right: 0;
  1358. top: -28px;
  1359. width: 24px;
  1360. height: 24px;
  1361. line-height: 24px;
  1362. text-align: center;
  1363. color: #eee;
  1364. border: 1px solid #eee;
  1365. border-radius: 50%;
  1366. }
  1367. &__header {
  1368. height: 40px;
  1369. text-align: center;
  1370. line-height: 40px;
  1371. border-bottom: 1px solid #eeeeee;
  1372. }
  1373. &__body {
  1374. height: 248px;
  1375. padding: 24px;
  1376. position: relative;
  1377. box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.04);
  1378. border-radius: 8px;
  1379. .submit {
  1380. width: 100%;
  1381. }
  1382. .bind-next {
  1383. font-size: 14px;
  1384. text-align: center;
  1385. color: #999;
  1386. margin-top: 10px;
  1387. cursor: pointer;
  1388. }
  1389. }
  1390. }
  1391. }
  1392. </style>