index.vue 38 KB

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