Sfoglia il codice sorgente

手机适配部分功能

y595705120 9 mesi fa
parent
commit
4f9d88aafc

+ 1 - 3
src/assets/css/course.css

@@ -1,6 +1,4 @@
-.m-course-list {
-    width: 1020px;
-  }
+
   .m-course-list li {
     width: 248px;
     height: 190px;

+ 2 - 5
src/assets/css/main.css

@@ -69,11 +69,7 @@ form {
 }
 
 
-@media screen and   (max-width: 639px){
-  .p-wrap-full{
-      width: 100%;
-  }
-}
+
 
 .btn-r {
     width: 80px;
@@ -233,6 +229,7 @@ a, span {
 
 .m-right-block {
   width: 1009px;
+  float: right;
   min-height: 700px;
   background: #fff;
   border-left: 1px solid #e8e8e8;

+ 33 - 0
src/assets/css/mobile.css

@@ -0,0 +1,33 @@
+@media screen and   (max-width: 639px){
+  .p-wrap-full{
+      width: 100%;
+  }
+  .m-login{
+    margin: 20px auto;
+    float:center;
+  }
+  .m-header{
+    width:100%;
+  }
+  .waphide{
+    display:none;
+  }
+  .header .logo {
+    font-size: 30px;
+  }
+  .m-left-block{
+    width: 0px;
+  }
+  .m-right-block{
+    width:100%;
+    float:none;
+    margin: 10px auto;
+  }
+  .m-course-list{
+    width: 100%;
+    margin: 10px auto;
+  }
+  .mh576{
+    width: 100%;
+  }
+}

+ 2 - 5
src/containers/center/class/train/index.vue

@@ -1,12 +1,9 @@
 <template>
-  <div class="m-right-block fr mh576">
-    <!-- uiView: myStudyContent -->
-
-
+  <div class="m-right-block  mh576">
     <div class="right-block-bd ng-scope" ui-view="myStudyContent" style="position: relative;">
       <div class="panel-tit clear">
         <p class="fl">课程</p>
-        <div class="tc">
+        <div class="tc waphide">
           <strong class="tc" style="color: red;font-size: 1.2rem;">{{setting.noticeMsg}}</strong>
         </div>
       </div>

+ 1 - 1
src/containers/center/components/menu/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="m-left-block fl lwh-sider" center-sider="">
+  <div class="m-left-block fl lwh-sider waphide" center-sider="">
     <div class="user-block" style="width:150px;cursor:pointer">
       <img style="width:140px;height:160px"
         class="user-img"

+ 1 - 1
src/containers/center/components/navbar/index.vue

@@ -3,7 +3,7 @@
     <div class="p-wrap-full clear">
       <div class="logo fl" style="padding-top: 24px;">
         <a href="javascript:void(0)" style="text-decoration: none"
-            class="rel ng-binding" @click="$router.push('/')">
+            class="rel ng-binding waphide" @click="$router.push('/')">
            三明市建设人才服务中心
           <div class="hover-block" style="padding-top: 24px;">
 

+ 1 - 1
src/containers/center/play/components/iCourseInfo.vue

@@ -1,6 +1,6 @@
 
 <template>
-    <el-row class="p20">
+    <el-row class="p20 waphide">
       <el-col :lg="6" :md="6" :span="6">
         <el-progress
           class="mprocess"

+ 1 - 1
src/containers/center/play/components/iCourseInfoTest.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-row class="p20">
+  <el-row class="p20 waphide">
     <el-col :span="6">
       <img :src="tpl.tb" width="200px" style="border-radius: 20px;" />
     </el-col>

+ 1 - 1
src/containers/center/play/components/iCourseInfoXsExtra.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-row class="p20">
+  <el-row class="p20 waphide">
     <el-col :span="6">
       <img :src="tpl.tb" width="200px" style="border-radius: 20px;" />
     </el-col>

+ 2 - 2
src/containers/center/play/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="m-right-block fr mh576">
+  <div class="m-right-block mh576">
     <ICourseInfoTest  v-if="tpl.type=='检测试验人员'" :info="info" :tpl="tpl" @printCert="printCert" @startExam="startExam"></ICourseInfoTest>
     <ICourseInfoXsExtra v-else-if="tpl.testXs>0"
     :extraXs="extraXs"  :info="info"
@@ -55,7 +55,7 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="操作" prop="xs" align="center" width="80">
+            <el-table-column label="操作" fixed="right" prop="xs" align="center" width="80">
               <template v-slot="{row, $index}">
                 <el-button @click="loadMedia(row, $index)" type="text">播放</el-button>
               </template>

+ 7 - 0
src/containers/login/components/loginBase.css

@@ -76,6 +76,13 @@ input[type=radio] {
 .m-login {
   width: 290px;
   height: 350px;
+  float:right;
+}
+
+@media screen and   (max-width: 639px){
+  .m-login {
+    float: none;
+  }
 }
 
 .m-login .login-tips {

+ 1 - 1
src/containers/login/components/unLogin.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="m-login opacity-bg fr">
+  <div class="m-login opacity-bg">
     <div ng-if="!sureUseLogin" class="ng-scope">
       <div class="tit">学员/单位管理员登录</div>
 

+ 0 - 1
src/containers/login/login.css

@@ -4,7 +4,6 @@ div {
     display: block;
 }
 
-
 .training-category {
   width: 880px;
   height: 350px;

+ 19 - 10
src/containers/login/login.vue

@@ -1,9 +1,12 @@
 <template>
   <div class="ng-scope">
-    <navbar :user="userInfo" @openLoginDialog="openLoginDialog"></navbar>
+    <div class="waphide">
+      <navbar :user="userInfo" @openLoginDialog="openLoginDialog"></navbar>
+    </div>
+
     <div class="banner-box">
       <div class="p-wrap-full clear pt30">
-        <el-card class="training-category opacity-bg fl" style="border-radius: 20px;padding-top: -5px;" >
+        <el-card class="training-category opacity-bg fl waphide" style="border-radius: 20px;padding-top: -5px;" >
           <h2 align="center" style="background-color: white; color: #000000;padding-top:5px;">文件通知</h2>
           <el-table :data="postList"  highlight-current-row
           :show-header="false" height="240px" >
@@ -28,15 +31,18 @@
 
         </el-card>
 
-        <div class="m-login opacity-bg fr">
+        <div class="m-login opacity-bg">
           <is-login v-if="loginOk" :user="userInfo" @logout="logout"></is-login>
           <un-login v-else @login="login" :err="err"></un-login>
         </div>
       </div>
     </div>
+    <!--  -->
+    <div class="waphide">
+      <learn-time></learn-time>
+    </div>
 
-    <learn-time></learn-time>
-    <div class="p-wrap-full mb20 ng-scope">
+    <div class="p-wrap-full mb20 ng-scope waphide">
       <div class="title-box mt5 clear">
         <h2 class="title">课程分类</h2>
       </div>
@@ -54,14 +60,14 @@
       </el-row>
     </div>
 
-    <div class="right-nav">
+    <div class="right-nav waphide">
       <img class="right-img" src="../../assets/wxapp.jpg" alt="">
       <p>使用小程序</p>
       <p>学习更轻松</p>
     </div>
 
 
-    <div class="p-wrap-full ng-scope">
+    <div class="p-wrap-full ng-scope waphide">
       <div class="title-box mt5 clear">
         <h2 class="title">友情链接</h2>
       </div>
@@ -128,23 +134,26 @@ export default {
   created(){
     this.getPostList()
     this.loginOk = false
+    console.log("created", this.userInfo);
     if( this.userInfo && this.userInfo.token && this.userInfo.uid){
       this.loadBaseInfo().then(res=>{
+        console.log("loadBaseInfo", res);
          if( !res || !res.uid ){
            this.loginOk = false
-           this.doLogout().then( res=>{
-             this.$router.push('/')
-           } )
+           this.doLogout()
          }else{
            this.loginOk = true
          }
       })
+    }else{
+      console.log("loadBaseInfo", this.userInfo.uid,this.userInfo.token );
     }
   },
   methods: {
     ...mapActions("user", ["loadBaseInfo", "doLogout", "doLogin"]),
     logout() {
       this.doLogout().then( res=>{
+        console.log("loginOk", res);
         this.loginOk = false;
       } )
     },

+ 1 - 0
src/main.js

@@ -7,6 +7,7 @@ import ElementUI from 'element-ui'
 import 'element-ui/lib/theme-chalk/index.css'
 import './assets/css/base.css'
 import './assets/css/main.css'
+import './assets/css/mobile.css'
 import { store } from '@/store/index'
 import md5 from 'js-md5';
 Vue.prototype.$md5 = md5;

+ 3 - 0
src/router/index.js

@@ -48,6 +48,9 @@ export default new Router({
   routes: [{
       path: '/',
       name: 'login',
+      meta:{
+        keepAlive: true,
+      },
       component: login,
     },
     {

+ 3 - 1
src/store/module/user.js

@@ -18,6 +18,7 @@ export const user = {
   mutations: {
     setUserInfo(state, userInfo) {
       state.userInfo = userInfo
+      console.log("setUserInfo", userInfo)
     },
     setNotice(state, courseId) {
       state.notices[courseId] = true;
@@ -42,6 +43,7 @@ export const user = {
       state.userInfo = { ...state.userInfo,
         ...userInfo
       }
+      console.log("ResetUserInfo", userInfo)
     }
   },
   actions: {
@@ -51,6 +53,7 @@ export const user = {
     }) {
       let res = await httpServer("User.baseInfo", {})
       if (res.code != 0 && res.code != 200) {
+        console.log("errLogout", res.code, res.msg)
         commit('LoginOut', {})
         return false
       }
@@ -88,7 +91,6 @@ export const user = {
     async doLogin({
       commit
     }, param) {
-      console.log("loginStart", res)
       let res = await httpServer("Auth.LoginStudy", param)
       if (res.code == 200) {
         commit('setUserInfo', res.data)