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

员工与非员工页面处理

kk.shi пре 3 година
родитељ
комит
9e65152b35

+ 1 - 1
pages/welfareMall/staff/distinguish.js

@@ -86,7 +86,7 @@ Page({
           wx.redirectTo({
             url:"../staff/noStaff"
           })
-        }, 2) //延迟时间
+        }, 2000) //延迟时间
       }
     },
 })

+ 28 - 3
pages/welfareMall/staff/isStaff.js

@@ -1,18 +1,26 @@
 // pages/welfareMall/staff/judgeStaff.js
+import WelfareMall from '../../../api/welfareMall'
+import { parseTime } from '../../../utils/util'
+import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-
+    isLogin: false,
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.setData({
+      isLogin: getMobileCache() != ''
+    })
+    if(this.data.isLogin){
+      
+    }
   },
 
   /**
@@ -62,5 +70,22 @@ Page({
    */
   onShareAppMessage: function () {
 
-  }
+  },
+  handlePageSizes(e) {
+    this.setData({
+      bodyImageHeight: e.detail.bodyImageHeight
+    })
+  },
+  toWriteOff(e) {
+    const url = "../writeOff/writeOff"
+    wx.navigateTo({
+        url
+    })
+  },
+  toStaff(e) {
+    const url = "../staff/staff"
+    wx.navigateTo({
+        url
+    })
+  },
 })

+ 5 - 1
pages/welfareMall/staff/isStaff.json

@@ -1,3 +1,7 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "topbar": "../../../components/topbar",
+    "custom-page": "../../../components/customPage/customPage"
+  },
+  "navigationStyle": "custom"
 }

+ 18 - 2
pages/welfareMall/staff/isStaff.wxml

@@ -1,2 +1,18 @@
-<!--pages/welfareMall/staff/judgeStaff.wxml-->
-<text>pages/welfareMall/staff/judgeStaff.wxml</text>
+<!--pages/welfareMall/staff/isStaff.wxml-->
+<page-wrap id="Page">
+  <custom-page head-bg-image="https://dy.shpr.top/welfareGo/staffbg.png" bind:sizes="handlePageSizes">
+    <topbar slot="head" title="" back-color="" title-color="" />
+    <view slot="body" class="sign-scroll-body">
+      <view class="noStaff-head flex-column" style="height: {{bodyImageHeight}}px;">
+        <image wx:if="{{!isLogin}}" class="head-noStaff-logo" src="/images/welfareMall/staff-logo.png" />
+        <!-- 获取用户头像 -->
+        <open-data wx:if="{{isLogin}}" class="head-noStaff-logo" type="userAvatarUrl"></open-data>
+        <view class="head-text">欢迎!您进入员工通道!</view>
+      </view>
+      <view class="noStaff-content flex-column">
+        <view class="content-join" catchtap="toWriteOff"></view>
+        <view class="content-partnership" catchtap="toStaff"></view>
+      </view>
+    </view>
+  </custom-page>
+</page-wrap>

+ 66 - 1
pages/welfareMall/staff/isStaff.wxss

@@ -1 +1,66 @@
-/* pages/welfareMall/staff/judgeStaff.wxss */
+/* pages/welfareMall/staff/isStaff.wxss */
+page{
+  background: #F9F9F9;
+  display:flex;
+  flex-flow: column nowrap;
+  justify-content: left;
+  align-items: center;
+  box-sizing: border-box;
+}
+
+/* 垂直方向布局,水平居中 **/
+.flex-column{
+  display: flex;
+  flex-flow: column nowrap;
+  align-items: center;
+  justify-content: left;
+}
+
+/* 水平方向布局,垂直居中 **/
+.flex-row{
+  display: flex;
+  flex-flow: row nowrap;
+  align-items: center;
+  justify-content: center;
+}
+
+.noStaff-head{
+  justify-content: space-between;
+}
+
+.head-noStaff-logo{
+  width: 162rpx;
+  height: 164rpx;
+  border-radius: 50%;
+  overflow :  hidden ;
+}
+
+.head-text{
+  font-size: 36rpx;
+  font-weight: 500;
+  color: #F6C6A3;
+  margin-bottom: 34rpx;
+}
+
+.noStaff-content{
+  background: #F9F9F9;
+}
+
+.noStaff-content{
+  margin-top: 40rpx;
+}
+
+.content-join{
+  width: 676rpx;
+  height: 246rpx;
+  background-image: url(https://dy.shpr.top/welfareGo/write-off.png);
+  background-size: 100% 100%;
+  margin-bottom: 40rpx;
+}
+
+.content-partnership{
+  width: 676rpx;
+  height: 246rpx;
+  background-image: url(https://dy.shpr.top/welfareGo/write-off-staff.png);
+  background-size: 100% 100%;
+}

+ 12 - 5
pages/welfareMall/staff/noStaff.js

@@ -1,18 +1,26 @@
-// pages/welfareMall/staff/onStaff.js
+// pages/welfareMall/staff/noStaff.js
+import WelfareMall from '../../../api/welfareMall'
+import { parseTime } from '../../../utils/util'
+import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-
+    isLogin: false,
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.setData({
+      isLogin: getMobileCache() != ''
+    })
+    if(this.data.isLogin){
+      
+    }
   },
 
   /**
@@ -64,9 +72,8 @@ Page({
 
   },
   handlePageSizes(e) {
-    console.log(e)
     this.setData({
       bodyImageHeight: e.detail.bodyImageHeight
     })
-}
+  }
 })

+ 6 - 2
pages/welfareMall/staff/noStaff.wxml

@@ -5,10 +5,14 @@
     <view slot="body" class="sign-scroll-body">
       <view class="noStaff-head flex-column" style="height: {{bodyImageHeight}}px;">
         <image wx:if="{{!isLogin}}" class="head-noStaff-logo" src="/images/welfareMall/staff-logo.png" />
-          <!-- 获取用户头像 -->
-          <open-data wx:if="{{isLogin}}" class="head-noStaff-logo" type="userAvatarUrl"></open-data>
+        <!-- 获取用户头像 -->
+        <open-data wx:if="{{isLogin}}" class="head-noStaff-logo" type="userAvatarUrl"></open-data>
         <view class="head-text">抱歉!您还不是沪上阿姨员工!</view>
       </view>
+      <view class="noStaff-content flex-column">
+        <view class="content-join"></view>
+        <view class="content-partnership"></view>
+      </view>
     </view>
   </custom-page>
 </page-wrap>

+ 24 - 0
pages/welfareMall/staff/noStaff.wxss

@@ -23,6 +23,7 @@ page{
   align-items: center;
   justify-content: center;
 }
+
 .noStaff-head{
   justify-content: space-between;
 }
@@ -39,4 +40,27 @@ page{
   font-weight: 500;
   color: #F6C6A3;
   margin-bottom: 34rpx;
+}
+
+.noStaff-content{
+  background: #F9F9F9;
+}
+
+.noStaff-content{
+  margin-top: 40rpx;
+}
+
+.content-join{
+  width: 676rpx;
+  height: 246rpx;
+  background-image: url(https://dy.shpr.top/welfareGo/write-off-join.png);
+  background-size: 100% 100%;
+  margin-bottom: 40rpx;
+}
+
+.content-partnership{
+  width: 676rpx;
+  height: 246rpx;
+  background-image: url(https://dy.shpr.top/welfareGo/write-off-partnership.png);
+  background-size: 100% 100%;
 }