Преглед изворни кода

Merge branch 'master' into liua

* master:
  提交
  t
  登录优化
  提交
la пре 2 година
родитељ
комит
30d636d65c

+ 16 - 5
src/components/header/index.vue

@@ -1,7 +1,7 @@
 <template>
   <header class="header">
     <div class="main">
-      <h3 class="logo">桐乡艺校</h3>
+      <h3 class="logo" @click="toHome">桐乡艺校</h3>
       <ul class="nav-list">
         <li v-for="item in navList" :class="curNavName==item.name?'selected':''" @click="switchNav(item)">
           {{ item.title }}<span></span></li>
@@ -98,10 +98,15 @@ export default {
   },
   methods: {
     switchNav(item) {
-      this.$router.push({
-        name: item.name
-      });
-      localStorage.setItem('curNav', item.name);
+      if(localStorage.getItem('userInfo')) {
+        this.$router.push({
+          name: item.name
+        });
+        localStorage.setItem('curNav', item.name);
+      } else {
+        this.userLogin();
+      }
+
     },
     userLogin() {
       this.user_name = '';
@@ -142,6 +147,11 @@ export default {
 
           break;
       }
+    },
+    toHome() {
+      this.$router.push({name:'home'});
+      this.curNavName = 'home';
+      localStorage.setItem('curNav', 'home');
     }
   },
   mounted() {
@@ -171,6 +181,7 @@ export default {
   }
 
   .logo {
+    cursor: pointer;
     font-size: 36px;
     line-height: 64px;
     color: #000;

+ 6 - 8
src/pages/home/index.vue

@@ -96,30 +96,29 @@
           <div class="res-icon m-0">
             <img src="/images/home/c-3.png" alt="">
           </div>
-          <h3 class="mt15 font-size-26 text-center">课程资源</h3>
-          <h4 class="mt15 font-size-16 color-6 text-center ph20">课程资源课程资源课程资源 课程资源课程资源
-            课程资源课程资源课程资源 课程资源课程资源</h4>
+          <h3 class="mt15 font-size-26 text-center">作业辅导</h3>
+          <h4 class="mt15 font-size-16 color-6 text-center ph20">作业辅导作业辅导作业辅导作业辅导作业辅导作业辅导作业辅导</h4>
         </a>
         <a href="javascript:;">
           <div class="res-icon m-0">
             <img src="/images/home/c-4.png" alt="">
           </div>
           <h3 class="mt15 font-size-26 text-center">特色课程</h3>
-          <h4 class="mt15 font-size-16 color-6 text-center ph20">特色课程特色课程特色课程</h4>
+          <h4 class="mt15 font-size-16 color-6 text-center ph20">特色课程特色课程特色课程特色课程特色课程特色课程</h4>
         </a>
         <a href="javascript:;">
           <div class="res-icon m-0">
             <img src="/images/home/c-5.png" alt="">
           </div>
           <h3 class="mt15 font-size-26 text-center">家庭教育</h3>
-          <h4 class="mt15 font-size-16 color-6 text-center ph20">家庭教育家庭教育家庭教育 家庭教育</h4>
+          <h4 class="mt15 font-size-16 color-6 text-center ph20">家庭教育家庭教育家庭教育家庭教育家庭教育家庭教育家庭教育</h4>
         </a>
         <a href="javascript:;">
           <div class="res-icon m-0">
             <img src="/images/home/c-6.png" alt="">
           </div>
-          <h3 class="mt15 font-size-26 text-center">拓展课程</h3>
-          <h4 class="mt15 font-size-16 color-6 text-center ph20">拓展课程拓展课程拓展课程</h4>
+          <h3 class="mt15 font-size-26 text-center">资源中心</h3>
+          <h4 class="mt15 font-size-16 color-6 text-center ph20">资源中心资源中心资源中心资源中心资源中心资源中心</h4>
         </a>
       </div>
       <h3 class="title m-65">直播课程</h3>
@@ -194,7 +193,6 @@
 </template>
 <script>
 import commonHeader from "@/components/header/index.vue";
-
 export default {
   components: {
     commonHeader

+ 1 - 1
src/pages/zbkt/index.vue

@@ -18,7 +18,7 @@ function routeTo(url) {
   <div class="flex flex-col w-full items-center">
     <div class="w-full mb-20"><img :src="img_lczs" alt="" class="w-full" /></div>
 
-    <div class="flex justify-between w-1400px mb-20">
+    <div class="flex justify-between w-1200px mb-20">
 
       <div @click="routeTo('/zbkt/ssys')"
         class=" flex shadow-md w-350px h-140px cursor-pointer transform hover:-translate-y-2 rounded-md px-6 py-12">

+ 23 - 2
src/pages/zbkt/wlzb/index.vue

@@ -156,7 +156,7 @@ function hrefTo(href) {
         <div class="flex-auto mr-8">
           <div class="text-lg font-bold mt-7 mb-3">推荐直播</div>
           <div class="flex flex-wrap justify-between">
-            <div class="w-318px h-263px rounded-xl shadow-lg mb-7 flex flex-col overflow-hidden" v-for="i in data">
+            <div class="w-318px h-263px rounded-xl shadow-lg mb-7 flex flex-col overflow-hidden" v-for="i in [...data,...data]">
               <div class="w-full flex-none">
                 <img :src="i.img" alt="" class="w-full h-full">
               </div>
@@ -167,7 +167,28 @@ function hrefTo(href) {
           </div>
         </div>
 
-        <div class="w-320px shadow flex-none"></div>
+        <div class="w-320px shadow flex-none p-6">
+          <div class="text-lg font-bold mt-1 mb-3">直播课程排行榜</div>
+          <template v-for="(i, index) in [...data,...data,...data]">
+            <div v-if="index < 2" class="w-full h-167px rounded-md mb-4 relative overflow-hidden">
+              <img :src="i.img" alt="" class="w-full h-full ">
+              <div class="p-2 absolute z-2 bottom-0 w-full text-white">
+                {{ i.title }}
+              </div>
+            </div>
+
+            <div v-else class="flex mb-4">
+              <div class="w-110px flex-none relative">
+                <img :src="i.img" alt="" class="w-full h-full rounded-sm overflow-hidden">
+                <div class="absolute rounded-sm right-0 top-0 w-20px h-20px bg-hex-6C5DD3 text-white flex_center text-xs">{{index+1}}</div>
+              </div>
+              <div class="px-1 leading-tight">
+                {{ i.title }}
+              </div>
+            </div>
+          </template>
+
+        </div>
       </div>
     </div>
   </div>

+ 9 - 0
src/store/user.js

@@ -0,0 +1,9 @@
+export let user
+if(localStorage.getItem('userInfo')) {
+     user = JSON.parse(localStorage.getItem('userInfo'))
+
+}
+export default {
+    ...user
+}
+

+ 2 - 1
src/utils/request.js

@@ -1,6 +1,7 @@
 import axios from 'axios'
 import { ElMessage } from 'element-plus'
-const token = ''
+import user from '~/store/user';
+const token = user.token
 
 const _request = axios.create({
   baseURL: window.GLOBAL_CONFIG.api,