index.vue 48 KB

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