Browse Source

Merge branch 'master' of http://39.106.8.246:3003/sagacloud/sagacloud-sagacare-weChat

anxiaoxia 1 year ago
parent
commit
6108979cba

+ 1 - 1
project.private.config.json

@@ -14,7 +14,7 @@
       "list": [
         {
           "name": "",
-          "pathName": "pages/auth/index",
+          "pathName": "pages/bindTenant/index",
           "query": "",
           "launchMode": "default",
           "scene": null

+ 3 - 3
src/packagesEnv/pages/administration/chooseIdentity.wpy

@@ -102,7 +102,7 @@
         <div class="info">{{ userInfo.manageUserType==3?'行政管理员':'' }}</div>
         <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
       </div>
-      <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
+      <image class="checked-icon"  src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
    </div>
 
    <div class="bind-btn-box">
@@ -138,8 +138,8 @@ wepy.page({
   },
   methods: {
     loginAdmin() {
-      //this.qrCodeId 
-      confirmLogin({ qrCodeId: 'd3d390917bd34372a479ba5ff27fc453'})
+      //
+      confirmLogin({ qrCodeId: this.qrCodeId })
         .then((res) => {
           if (res.result == 'success') {
             wx.navigateTo({

+ 11 - 8
src/packagesEnv/pages/administration/index.wpy

@@ -74,7 +74,7 @@
     <div class="aImageDiv">
       <image class="image" :src="h5StaticPath+'administration.png'" mode="widthFix" />
     </div>
-    <div class="aLink">行政端:sagacare.tenants.link</div>
+    <div class="aLink">行政端:amp.sagacloud.cn/sgadmin</div>
     <div class="aLink">用电脑打开上方行政端网址<span class="copy" @click="goto">复制网址</span></div>
   </div>
   <div class="bottom">
@@ -92,9 +92,7 @@ import eventHub from '@/common/eventHub';
 import { mapState } from '@wepy/x';
 import store from '@/store';
 import config from '@/config';
-import {
-  checkHasUserInfo,
-} from '@/service/user.js';
+import { checkHasUserInfo } from '@/service/user.js';
 
 wepy.page({
   store,
@@ -110,10 +108,15 @@ wepy.page({
     }),
   },
   methods: {
-    goto:function(){
-      wx.navigateTo({
-            url: `/packagesEnv/pages/administration/chooseIdentity`,
-          });
+    goto: function() {
+      wx.setClipboardData({
+        data: 'https://amp.sagacloud.cn/sgadmin',
+        success(res) {   
+        },
+      });
+      // wx.navigateTo({
+      //   url: `/packagesEnv/pages/administration/chooseIdentity`,
+      // });
     },
     scanQrcode: function() {
       wx.scanCode({

+ 6 - 6
src/packagesEnv/pages/home/index.wpy

@@ -52,7 +52,7 @@
     white-space: nowrap;
     margin-top: 27px;
     // padding: 0 20px;
-    overflow: hidden;
+    // overflow: hidden;
   }
   .scroll-view-item {
     position: relative;
@@ -117,8 +117,8 @@
     z-index: 2;
     white-space: nowrap;
     margin-top: 25px;
-    // padding: 0 20px;
-    overflow: hidden;
+    //  padding: 0 20px;
+    // overflow: hidden;
   }
   .scroll-view-item2 {
     display: inline-block;
@@ -180,7 +180,7 @@
       margin-right: 15rpx;
       float: left;
       background: #fff;
-      margin-bottom: 8px;
+      margin-bottom: 16px;
       padding-top: 12px;
       box-sizing: border-box;
       .menuImg {
@@ -237,7 +237,7 @@
   <div class="projectTitle"  @click="showProject"><span class="name">{{nowCompanyName}}</span><van-icon name="arrow-down" size="20"/></div>
   <div class="projectInfo">成为一家牛的让员工幸福的企业</div>
   <div class="weather"><image class="image" :src="h5StaticPath+weather.imgname"/><span class="value">{{weather.temperature}}℃</span><span class="text">{{weather.text}}</span></div>
-  <scroll-view scroll-x="true" class="scroll-view">
+  <scroll-view scroll-x="{{true}}"   show-scrollbar="{{false}}" class="scroll-view" enhanced>
     <view class="scroll-view-item">
       <div class="itemCont" v-if="reSpaceId"   @click="goEnv('homeShowEnv')">
         <div class="spaceName"><div class="name">{{ reSpaceName }}</div><span class="resident">常驻工区</span></div>
@@ -247,7 +247,7 @@
     </view>
     <view class="scroll-view-item"><div class="itemCont envirItem" @click="goToIntroduce('environment')">环境健康小知识<van-icon name="arrow" size="20"/></div></view>
   </scroll-view>  
-   <scroll-view scroll-x="true" class="scroll-view2">
+   <scroll-view scroll-x="{{true}}" class="scroll-view2"  show-scrollbar="{{false}}" enhanced>
     <view class="scroll-view-item2" v-if="showCard.openLight" @click="goEnv('openLamp')"><div class="title">开启照明</div><div class="info">快速启动</div><div class="imageDiv">
       <image class="image" :src="h5StaticPath+'lamb.png'"/>
     </div></view>

+ 3 - 0
src/packagesEnv/pages/search/index.wpy

@@ -13,6 +13,7 @@ page {
     display: flex;
     position: relative;
     margin: 40rpx auto;
+    margin-top: 0;
     margin-bottom: 32rpx;
     width: 670rpx;
     height: 96rpx;
@@ -296,6 +297,7 @@ import eventHub from '@/common/eventHub';
 import { mapState } from '@wepy/x';
 import store from '@/store';
 import utils from '@/common/utils';
+import { checkHasUserInfo } from '@/service/user.js';
 import { findControllSpace } from '@/packagesEnv/api/mapApi';
 import testMixin from '@/mixins/test';
 
@@ -325,6 +327,7 @@ wepy.page({
     }),
   },
   onLoad() {
+    checkHasUserInfo()
     this.init();
   },
   onReady() {

+ 119 - 76
src/pages/auth/index.wpy

@@ -1,87 +1,126 @@
 <style lang="less">
-.login-box {
-  padding-top: 40px;
-  .avatar-wrapper {
-    padding: 0px;
-    width: 196rpx;
-    height: 196rpx;
-    border-radius: 50%;
-    image {
+page {
+  width: 100%;
+  height: 100%;
+}
+.auth-box {
+  position: relative;
+  box-sizing: border-box;
+  padding-top: 136rpx;
+  width: 100%;
+  background: #fff;
+  height: 100%;
+  .login-box {
+    // position: absolute;
+    padding-top: 40px;
+    .avatar-wrapper {
+      position: relative;
+      padding: 0px;
       width: 196rpx;
       height: 196rpx;
       border-radius: 50%;
+      background: transparent;
+      image {
+        position: absolute;
+        left: 0;
+        top: 0;
+        width: 198rpx;
+        height: 198rpx;
+        z-index: 333;
+        border-radius: 50%;
+      }
     }
-  }
-  .avatar-tip {
-    text-align: center;
-    font-family: PingFang SC;
-    font-size: 28rpx;
-    font-weight: 400;
-    line-height: 44rpx;
-    text-align: center;
-  }
-
-  .bind-btn-box {
-    position: fixed;
-    bottom: 228rpx;
-    left: 50%;
-    transform: translateX(-50%);
-    .bind-btn {
-      width: 548rpx;
-      height: 100rpx;
-      line-height: 100rpx;
-      border-radius: 56rpx;
-      background: rgba(61, 203, 204, 1);
-      border: none;
-      font-family: PingFang SC;
-      font-size: 32rpx;
-      font-weight: 400;
-      letter-spacing: 0px;
+    .avatar-tip {
       text-align: center;
-      color: #fff;
-    }
-    .bind-btn-tip {
-      //styleName: 14/常规;
       font-family: PingFang SC;
-      padding-top: 32rpx;
       font-size: 28rpx;
       font-weight: 400;
       line-height: 44rpx;
       text-align: center;
-      color: rgba(139, 148, 158, 1);
     }
-  }
 
-  .home-btn {
-    margin-top: 240rpx;
-    width: 548rpx;
-    height: 100rpx;
-    line-height: 100rpx;
-    border-radius: 56rpx;
-    border: 1px solid rgba(61, 203, 204, 1);
+    .bind-btn-box {
+      position: fixed;
+      bottom: 228rpx;
+      left: 50%;
+      transform: translateX(-50%);
+      z-index: 999;
+      .bind-btn {
+        width: 548rpx;
+        height: 100rpx;
+        line-height: 100rpx;
+        border-radius: 56rpx;
+        background: rgba(61, 203, 204, 1);
+        border: none;
+        font-family: PingFang SC;
+        font-size: 32rpx;
+        font-weight: 400;
+        letter-spacing: 0px;
+        text-align: center;
+        color: #fff;
+      }
+      .bind-btn-tip {
+        //styleName: 14/常规;
+        font-family: PingFang SC;
+        padding-top: 32rpx;
+        font-size: 28rpx;
+        font-weight: 400;
+        line-height: 44rpx;
+        text-align: center;
+        color: rgba(139, 148, 158, 1);
+      }
+    }
+
+    .home-btn {
+      margin-top: 240rpx;
+      width: 548rpx;
+      height: 100rpx;
+      line-height: 100rpx;
+      border-radius: 56rpx;
+      border: 1px solid rgba(61, 203, 204, 1);
+    }
+  }
+  .top {
+    position: absolute;
+    width: 100%;
+    top: 0;
+    z-index: 33;
+  }
+  .bottom {
+    position: absolute;
+    width: 100%;
+    bottom: 0;
+    z-index: 33;
   }
 }
 </style>
 <template>
- <div class="login-box">
-  <button class="avatar-wrapper"
-    v-if="canIUseGetUserProfile"
-    open-type="chooseAvatar" 
-    bind:chooseavatar="onChooseAvatar">
-    <image class="avatar" src="{{avatarUrl}}"/>
-  </button>  
-  <div class="avatar-tip" v-if="canIUseGetUserProfile">可点击获取头像</div>
-  <div class="bind-btn-box">
-   <button class="bind-btn"
-   open-type="getPhoneNumber"
-   bindgetphonenumber="phonenumberAuth"
-   >微信手机号认证</button>
-   <!-- @click="goBindTenant" -->
-   <!-- bindgetphonenumber="phonenumberAuth" -->
-   <div class="bind-btn-tip">确保是入职公司使用的手机号</div>
+<div class="auth-box">
+  <page-top-bar title=" " 
+  titleColor="#1B2129"></page-top-bar>
+  <image class="top" src="{{h5StaticPath}}/page-bind-tenant/auth-top.jpg"/>
+  <div class="login-box">
+    <button class="avatar-wrapper"
+      v-if="canIUseGetUserProfile"
+      open-type="chooseAvatar" 
+      bind:chooseavatar="onChooseAvatar">
+      <image class="avatar" src="{{avatarUrl}}"/>
+    </button>  
+    <div class="avatar-tip" v-if="canIUseGetUserProfile">可点击获取头像</div>
+    <div class="bind-btn-box">
+    <button class="bind-btn"
+    open-type="getPhoneNumber"
+    bindgetphonenumber="phonenumberAuth"
+    >微信手机号认证</button>
+    <!-- @click="goBindTenant" -->
+    <!-- bindgetphonenumber="phonenumberAuth" -->
+    <div class="bind-btn-tip">确保是入职公司使用的手机号</div>
+    </div>
+    <!-- <button class="home-btn" @click="goHome">首页</button> -->
   </div>
-  <!-- <button class="home-btn" @click="goHome">首页</button> -->
- </div>
+  <image class="bottom" src="{{h5StaticPath}}/page-bind-tenant/auth-bottom.jpg"/>
+
+</div>
 </template>
 
 <script>
@@ -96,14 +135,15 @@ let defaultAvatarUrl =
 wepy.page({
   store,
   config: {
-    navigationBarTitleText: 'test'
+    navigationBarTitleText: 'test',
   },
   data: {
     nicknameValue: '',
+    h5StaticPath: config.h5StaticPath,
     avatarUrl: defaultAvatarUrl,
     msg: '测试数据',
     canIUseGetUserProfile: false,
-    userInformation: wx.getStorageSync('userInformation')
+    userInformation: wx.getStorageSync('userInformation'),
   },
   onLoad() {
     if (wx.getUserProfile) {
@@ -125,13 +165,13 @@ wepy.page({
           console.log(res.data);
           that.avatarUrl = 'data:image/png;base64,' + res.data;
           setAvatar(that.avatarUrl);
-        }
+        },
       });
     },
     getPageCompanyByPhone() {},
     goHome() {
       wx.navigateTo({
-        url: '/packagesEnv/pages/home/index'
+        url: '/packagesEnv/pages/home/index',
       });
     },
     // 手机号认证
@@ -145,7 +185,7 @@ wepy.page({
     // code 换取手机号
     getHttpPhoneNumber(code) {
       getHttpPhoneNumber(code)
-        .then(res => {
+        .then((res) => {
           let data = res.data || {};
           let phoneNumber = data.purePhoneNumber;
           if (phoneNumber) {
@@ -155,22 +195,25 @@ wepy.page({
             console.log('没获取到手机号');
           }
         })
-        .catch(error => {
+        .catch((error) => {
           console.log('获取手机号的接口失败');
         });
     },
     goBindTenant() {
       console.log('被点击了');
       wx.navigateTo({
-        url: '/pages/bindTenant/index'
+        url: '/pages/bindTenant/index',
       });
-    }
+    },
   },
-  created() {}
+  created() {},
 });
 </script>
 <config>
 {
-navigationBarTitleText: '首页',
+navigationStyle:"custom",
+usingComponents: {
+    'page-top-bar': '~@/components/common/page-top-bar',      
+  },
 }
 </config>

+ 6 - 5
src/pages/bindTenant/index.wpy

@@ -209,19 +209,19 @@ wepy.page({
     // 获取租户数据
     getPageCompanyByPhone() {
       getCompanyDataByPhone().then((res) => {
+        let data = res ;
         console.log(res);
-        let data = res;
         if (data && data.length) {
           this.tenantData = data;
           this.initTentData();
           this.selecItem = this.tenantData[0];
         } else {
           wx.showToast({
-            title: '未获得公司服务权限!',
+            title: '您的手机号还未获得公司服务权限!',
             duration: 5000,
             icon: 'none',
           });
-          this.goHome();
+          this.returnLogin();
         }
       });
     },
@@ -234,9 +234,10 @@ wepy.page({
         url: '/packagesEnv/pages/home/index',
       });
     },
+    //  返回登录页面
     returnLogin() {
-      wx.navigateTo({
-        url: 'pages/index',
+      wx.redirectTo({
+        url: '/pages/index',
       });
     },
     goEnv() {

+ 7 - 3
src/pages/index.wpy

@@ -11,7 +11,11 @@ page {
 .login {
   width: 100%;
   height: 100%;
-  background: rgba(0, 0, 0.2);
+  // background-size: 100% 100%;
+  background-repeat: no-repeat;
+  background-position: center;
+  background-size: cover;
+  // background: rgba(0, 0, 0.2);
   image {
     position: relative;
     width: 384rpx;
@@ -42,9 +46,9 @@ page {
 </style>
 <template>
   <div class="login-box">
-    <page-top-bar title="" 
+    <page-top-bar title=" " 
   titleColor="#1B2129"></page-top-bar>
-   <div class="login">
+   <div class="login" :style="{'background-image':'url('+h5StaticPath+'/page-bind-tenant/login-bg.jpg)'}">
        <image src="{{h5StaticPath +'/page-bind-tenant/logo_title.png'}}" alt=""/>
        <button class="bind-btn"
         @click.stop="goBindTenant">登录</button>

+ 1 - 4
src/service/user.js

@@ -96,11 +96,8 @@ function wxLogin (type) {
 // 获取租户信息
 function getCompanyDataByPhone() {
   return new Promise((resolve, reject) => {
-    let userPhone = wx.getStorageSync('userPhone');
     let userInfo = store.state.user.userInfo;
-    if (!userPhone) {
-      userPhone = userInfo.phone
-    }
+    let userPhone = userInfo.phone || wx.getStorageSync('userPhone');
     let params = {
       phone: userPhone
     }