kk.shi лет назад: 3
Родитель
Сommit
735c8a9e0b

+ 6 - 1
api/welfareMall.js

@@ -173,7 +173,12 @@ class WelfareMall extends request {
     return this.postRequest(`${this.BASE_URL}open/hexiao/list`, params);
   }
 
-
+  /**
+   * 获取订单
+   */
+  static discernStoreStaff(params) {
+    return this.postRequest(`${this.BASE_URL}open/staff/discern-store-staff`, params);
+  }
 
 
 

+ 5 - 1
app.json

@@ -21,7 +21,11 @@
     "pages/luckDraw/profile",
     "pages/luckDraw/recordPrize",
     "pages/welfareMall/coupon/coupon",
-    "pages/welfareMall/writeOff/writeOff"
+    "pages/welfareMall/writeOff/writeOff",
+    "pages/welfareMall/staff/staff",
+    "pages/welfareMall/staff/isStaff",
+    "pages/welfareMall/staff/distinguish",
+    "pages/welfareMall/staff/noStaff"
   ],
   "window": {
     "backgroundTextStyle": "light",

BIN
images/welfareMall/staff-logo.png


+ 92 - 0
pages/welfareMall/staff/distinguish.js

@@ -0,0 +1,92 @@
+// pages/welfareMall/staff/distinguish.js
+import WelfareMall from '../../../api/welfareMall'
+import { parseTime } from '../../../utils/util'
+import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.discernStoreStaff();
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+  
+  discernStoreStaff: async function(){
+    /**
+     * 根据手机识别职员信息
+     */
+      let resStaff = await WelfareMall.discernStoreStaff({
+        mobile: "18703607235",
+      });
+      if(resStaff.data.found){
+        setTimeout(function () {
+          wx.redirectTo({
+            url:"../staff/isStaff"
+          })
+        }, 2000) //延迟时间
+        
+      } else {
+        setTimeout(function () {
+          wx.redirectTo({
+            url:"../staff/noStaff"
+          })
+        }, 2) //延迟时间
+      }
+    },
+})

+ 4 - 0
pages/welfareMall/staff/distinguish.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationStyle": "custom"
+}

+ 2 - 0
pages/welfareMall/staff/distinguish.wxml

@@ -0,0 +1,2 @@
+<!--pages/welfareMall/staff/distinguish.wxml-->
+<view class="distinguish"></view>

+ 10 - 0
pages/welfareMall/staff/distinguish.wxss

@@ -0,0 +1,10 @@
+/* pages/welfareMall/staff/distinguish.wxss */
+page{
+  height: 100%;
+}
+.distinguish{
+  width: 100%;
+  height: 100%;
+  background-image: url(https://dy.shpr.top/welfareGo/distinguish.gif);
+  background-size: 100% 100%;
+}

+ 66 - 0
pages/welfareMall/staff/isStaff.js

@@ -0,0 +1,66 @@
+// pages/welfareMall/staff/judgeStaff.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/welfareMall/staff/isStaff.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

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

@@ -0,0 +1,2 @@
+<!--pages/welfareMall/staff/judgeStaff.wxml-->
+<text>pages/welfareMall/staff/judgeStaff.wxml</text>

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

@@ -0,0 +1 @@
+/* pages/welfareMall/staff/judgeStaff.wxss */

+ 66 - 0
pages/welfareMall/staff/noStaff.js

@@ -0,0 +1,66 @@
+// pages/welfareMall/staff/onStaff.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 7 - 0
pages/welfareMall/staff/noStaff.json

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

+ 14 - 0
pages/welfareMall/staff/noStaff.wxml

@@ -0,0 +1,14 @@
+<!--pages/welfareMall/staff/noStaff.wxml-->
+<page-wrap id="Page">
+  <custom-page head-bg-image="https://dy.shpr.top/welfareGo/staffbg.png">
+    <topbar slot="head" title="" back-color="" title-color="" />
+    <view slot="body" class="sign-scroll-body">
+      <view class="noStaff-head flex-column">
+        <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>
+  </custom-page>
+</page-wrap>

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

@@ -0,0 +1,42 @@
+/* pages/welfareMall/staff/noStaff.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{
+  height: 40rpx;
+  font-size: 36rpx;
+  font-weight: 500;
+  color: #F6C6A3;
+}

+ 66 - 0
pages/welfareMall/staff/staff.js

@@ -0,0 +1,66 @@
+// pages/welfareMall/staff/staff.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/welfareMall/staff/staff.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
pages/welfareMall/staff/staff.wxml

@@ -0,0 +1,2 @@
+<!--pages/welfareMall/staff/staff.wxml-->
+<text>pages/welfareMall/staff/staff.wxml</text>

+ 1 - 0
pages/welfareMall/staff/staff.wxss

@@ -0,0 +1 @@
+/* pages/welfareMall/staff/staff.wxss */