Browse Source

首页服务保障

dujingxian 4 years ago
parent
commit
330a146961
5 changed files with 32 additions and 9 deletions
  1. 16 2
      src/App.vue
  2. 3 1
      src/router/index.ts
  3. 5 4
      src/views/index/index.vue
  4. 7 2
      src/views/social/social.ts
  5. 1 0
      src/views/user/info.vue

+ 16 - 2
src/App.vue

@@ -11,12 +11,23 @@
         </keep-alive>
         <router-view class="app-body" v-if="!$route.meta.keepAlive"/>
         <div class="tab-nav nav-bar" v-if="$route.meta.showTab">
-                <a  href="javascript:;" v-for="(i,index) in data.tabs" :key="index" :class="{active:index == data.thatnum}" @click="addClassName(index)">
+                <!-- <a  href="javascript:;" v-for="(i,index) in data.tabs" :key="index" :class="{active:index == data.thatnum}" @click="addClassName(index)">
                     <router-link :to="i.url">
                         <img v-if="data.thatnum!=index"  :src="i.img"    class="first weui-tabbar__icon">
                         <img v-if="data.thatnum==index"  :src="i.active" class="last first weui-tabbar__icon">
                     </router-link>
-                </a>
+                </a> -->
+                <el-row>
+                    <el-col :span="8" v-for="(i,index) in data.tabs" :key="index">
+                        <a href="javascript:;" :class="{active:index == data.thatnum}" @click="addClassName(index)">
+                            <router-link :to="i.url">
+                                <img v-if="data.thatnum!=index"  :src="i.img"    class="first weui-tabbar__icon">
+                                <img v-if="data.thatnum==index"  :src="i.active" class="last first weui-tabbar__icon">
+                            </router-link>
+                        </a>
+                        
+                    </el-col>
+                </el-row>
         </div>
     </div>
 </template>
@@ -97,8 +108,10 @@ import login from "./store/module/login";
         border-top: 1px solid #f0f0f0;
         background: #fff;
         z-index: 999;
+        // height: 50px;
         img{
             width: 100%;
+            // height: 100%;
         }
     }
 
@@ -106,6 +119,7 @@ import login from "./store/module/login";
         /*margin-top: 45px;*/
         /*margin-bottom: 5rem;*/
         overflow: hidden;
+        // padding-bottom: 5rem;
     }
 
     .bar-nav .title {

+ 3 - 1
src/router/index.ts

@@ -16,7 +16,7 @@ const verify_router_list: string[] = ['index', 'other', 'login'];
 
 // 跳转之前
 router.beforeEach((to, from, next) => {
-     next();
+    //  next();
     // let token = HttpRequest.getInstance().getToken('refresh_token');
     // if (Utils.getInstance().inArray(to.name, verify_router_list) === false && !token) {
     //     // 跳转路径在验证路由内且未登录,跳转至登录
@@ -29,6 +29,8 @@ router.beforeEach((to, from, next) => {
     //     next();
     // }
 
+    next();
+
 });
 
 

+ 5 - 4
src/views/index/index.vue

@@ -1,6 +1,7 @@
 <script src="index.ts"></script>
 <template>
-    <div class="index-wrap" style="margin-bottom: 5rem">
+    <!-- style="margin-bottom: 5rem" -->
+    <div class="index-wrap" >
         <div class="index-lunbo">
             <el-carousel :interval="2000" indicator-position="none">
                 <!--            <el-carousel-item>-->
@@ -117,12 +118,12 @@
         margin-top: 1rem;
         // margin-bottom: 8rem;
         // margin-bottom: 10rem;
-        padding: 0 1.292rem 8rem;
+        padding: 0 1.292rem;
         .el-row {
             margin-bottom: 0.833rem;
         }
-        .el-row:last-child() {
-            margin-bottom: 0;
+        .el-row:last-child {
+            margin-bottom: 5rem;
         }
     }
 

+ 7 - 2
src/views/social/social.ts

@@ -241,12 +241,17 @@ export default class Social extends Vue {
     }
     // 微信快捷进入,登陆之后才可进入
     @Watch('$route', {immediate: true}) isUserInfo(newVal: any, oldVal: any) {
+        // this.data.social_type.value == null || this.data.id_card.value == null
         // 真实姓名
         const realname = localStorage.getItem('realname')
-        // console.log('realname1', realname);
+        const social_type = localStorage.getItem('social_type')
+        const id_card = localStorage.getItem('id_card')
+        console.log('realname1', realname);
+        console.log('social_type', social_type);
+        console.log('id_card', id_card);
         // console.log('newVal.path', newVal.path);
         // console.log('path', newVal.path === '/social' && realname == 'null');
-        if (newVal.path === '/social' && realname == 'null') {
+        if (newVal.path === '/social' && realname == '' || social_type == 'null' || id_card == 'null') {
             this.$router.replace('/user/info')
             // 提示
             Message({

+ 1 - 0
src/views/user/info.vue

@@ -82,6 +82,7 @@ import login from "@/store/module/login";
             localStorage.setItem("nickname", res.data.nickname);
             localStorage.setItem("realname", res.data.realname);
             localStorage.setItem("is_town", res.data.is_town);
+            localStorage.setItem("id_card", res.data.id_card);
             this.ShowCity();
             this.showSocialType();
             this.wShowUserInfo()