Browse Source

公共导航栏样式调整完成

sys 2 years ago
parent
commit
aeb412308a

+ 12 - 8
components/en-utils/en-nav/en-nav.vue

@@ -1,12 +1,10 @@
 <template>
   <view class="">
-    <view class="header" :style="style">
-      <view class="flexbox" :class="{'flexbox-xcx':(isXcx && rightShow)}"
+    <view class="header"  :style="style">
+      <view class="flexbox"  :class="{'flexbox-xcx':(isXcx && rightShow)}"
         :style="[{'height': customBarH + 'px', 'padding-top': statusBarH + 'px','background':bgckgroundBox}]">
-        <view @tap="goBack">
-          <text  class="iconfont" v-if="leftShow">
-            &#xe60e;
-          </text>
+        <view class="left-button" @tap="goBack">
+          <image class="back-img"  src="/static/img/common/back.png" mode="aspectFill"></image>
         </view>
 
         <view class="title-text" :style="[{'marginLeft':left +'px'}]">{{title}}</view>
@@ -113,7 +111,7 @@
           this.left=0
           //#endif
           console.log('self.customBarH---------'+this.customBarH)
-          this.$emit('navHeight', this.customBarH-10)
+          this.$emit('navHeight', this.customBarH+this.statusBarH)
         }
       })
       //#ifdef MP-WEIXIN
@@ -135,7 +133,13 @@
     .flexbox {
       display: flex;
       justify-content: space-between;
-      padding: 0 20px;
+      padding: 0 12px;
+      .left-button{
+        .back-img{
+          width: 40rpx;
+          height: 40rpx;
+        }
+      }
       .iconfont{
         color: #333333;
       }

+ 17 - 4
pages/login/localPhoneLogin.vue

@@ -1,22 +1,35 @@
 <template>
   <view>
-
+    <en-nav @navHeight="setNavHeight" ></en-nav>
+    <view class="login-box" :style="{'height':'calc(100vh - '+navHeight+'px)'}"></view>
   </view>
 </template>
 
 <script>
+import EnNav from "@/components/en-utils/en-nav/en-nav";
 export default {
+  components: {EnNav},
   data() {
     return {
-
+      navHeight:40
     }
   },
   methods: {
-
+    setNavHeight(navHeight){
+      console.log('navHeight:'+navHeight)
+      this.navHeight=navHeight
+    }
   }
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+
+.login-box{
+  padding: 82rpx 80rpx 0 80rpx;
+  background-color: #2C405A;
+  box-sizing: border-box;
+
+}
 
 </style>

+ 2 - 7
service/router.js

@@ -11,28 +11,23 @@ router.beforeEach((to, from, next) => {
     let token = to.query.token;
     let m_id = to.query.m_id;
     if (token && m_id) {
-        // store.commit("setCookie", { 'token': token, 'm_id': m_id });
         uni.setStorageSync('token',token);
         uni.setStorageSync('m_id',m_id);
         next('/pages/index/index');
     }
     const userToken = uni.getStorageSync('token')
     const userMid = uni.getStorageSync('m_id')
-    console.log('登陆信息-------'+userToken+'--------------'+userMid)
     if((!userToken || !userMid)  && whiteList.indexOf(to.fullPath)<0){
-        console.log('暂无登陆信息')
-        console.log(to.fullPath )
         if(to.fullPath!=='/pages/login/index'){
-            next('/pages/login/index');
+            // next('/pages/login/index');
         }
     }
-    console.log('前置守卫to----------', to)
     next();
 
 });
 // 全局路由后置守卫
 router.afterEach((to, from) => {
-    console.log('后置守卫to------', to)
+    // console.log('后置守卫to------', to)
 })
 
 export {

+ 12 - 1
service/tools.js

@@ -207,6 +207,17 @@ tools.getPlatform = function () {
     return platForm;
 
 }
-
+tools.leftClick = function () {
+    let pages = getCurrentPages();
+    if (pages.length > 1) {
+        uni.navigateBack({
+            delta: 1
+        })
+    } else {
+        uni.reLaunch({
+            url: '/pages/index/index'
+        });
+    }
+}
 
 export default tools

BIN
static/img/common/back.png