FANGLH 7 éve
szülő
commit
e7d018c76e

+ 2 - 1
app.json

@@ -1,10 +1,11 @@
 {
   "pages": [
     "pages/home/home",
+    "pages/register/register",
     "pages/approval/approval",
+    "pages/point/point",
     "pages/applyjoinapprovel/applyjoinapprovel",
     "pages/corporateInfo/corporateInfo",
-    "pages/point/point",
     "pages/minusapply/minusapply",
     "pages/selectStaff/selectStaff",
     "pages/pointapply/pointapply",

+ 54 - 38
pages/approval/approval.js

@@ -3,6 +3,8 @@ var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
 var baseutils = require('../../utils/baseUtils.js')
 var netUtil = require('../../utils/network.js')
+var pageSize = 1
+var isregistered
 
 Page({
 
@@ -31,6 +33,7 @@ Page({
    */
   onLoad: function (options) {
     var that = this
+    isregistered = wx.getStorageSync('isregistered')
     /** 
      * 获取系统信息 
      */
@@ -44,21 +47,31 @@ Page({
       }
     })
 
-    // that.getHisOrderData()
-    that.getAllApproval()
+    
   },
   getAllApproval:function(){
     var that = this
-    var data = { openid: wx.getStorageSync('openid'), 
+    var data = { 
+      openid: wx.getStorageSync('openid'),
+      pageCount: 20,
+      pageSize: pageSize
     }
     var url = baseUrl + BASEURL.getUrl.getAllApproval
     netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
       if(res.data.success && res.data.data){
-        that.setData({
-          already: res.data.data.already,
-          wait: res.data.data.wait,
-          fill: res.data.data.fill
-        })
+       if(pageSize == 1){
+         that.setData({
+           already: res.data.data.already,
+           wait: res.data.data.wait,
+           fill: res.data.data.fill
+         })
+       }else{
+         that.setData({
+           already: [...that.data.already, ...res.data.data.already],
+           wait: [...that.data.wait, ...res.data.data.wait],
+           fill: [...that.data.fill, ...res.data.data.fill]
+         })
+       }
       }
     }, function (res) {
       wx.showToast({
@@ -75,33 +88,6 @@ Page({
     wx.navigateTo({
       url: '../applyjoinapprovel/applyjoinapprovel' + '?getItemdata=' + JSON.stringify(itemdata) + '&getfromType=' + fromtype,
     })
-  },
-  getHisOrderData: function () {
-    var that = this
-    wx.request({
-      url: baseUrl + BASEURL.getUrl.list,
-      method: 'GET',
-      data: {
-        accountphone: 18130506086,
-        openid: wx.getStorageSync('openId')
-      },
-      header: {
-        'content-type': 'application/json;charset=UTF-8'
-      },
-      success: function (res) {
-        console.log('queryOrder=', res)
-        if (res.data.success) {
-          if (res.data.data.length > 0) {
-            that.setData({
-              allorders: res.data.data
-            })
-          }
-        }
-      }
-    })
-  },
-  ScanPayClick: function () {
-
   },
   /** 
    * 点击tab切换 
@@ -138,7 +124,24 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    isregistered = wx.getStorageSync('isregistered')
+    if (isregistered) {
+      this.getAllApproval()
+    } else {
+      //   wx.showModal({
+      //     title: '提示',
+      //     content: '您当前尚未进行微信授权登录,是否立即前往?',
+      //     success: function (res) {
+      //       if (res.confirm) {
+      //         wx.switchTab({
+      //           url: '../mine/mine',
+      //         })
+      //       } else if (res.cancel) {
+      //         return
+      //       }
+      //     }
+      //   })
+    }
   },
 
   /**
@@ -159,14 +162,27 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-
+    var that = this
+    wx.showNavigationBarLoading() //在标题栏中显示加载
+    pageSize = 1
+    that.getAllApproval()
+    //模拟加载
+    setTimeout(function () {
+      // complete
+      wx.hideNavigationBarLoading() //完成停止加载
+      wx.stopPullDownRefresh() //停止下拉刷新
+    }, 2000);
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-
+    pageSize++;
+    this.getAllApproval()
+    wx.showNavigationBarLoading();
+    var that = this;
+    setTimeout(function () { wx.hideNavigationBarLoading() }, 2000);
   },
 
   /**

+ 1 - 1
pages/approval/approval.json

@@ -1,4 +1,4 @@
 {
   "navigationBarTitleText": "审批",
-  "disableScroll": true
+  "enablePullDownRefresh": true
 }

+ 1 - 1
pages/corporateInfo/corporateInfo.wxml

@@ -2,7 +2,7 @@
 
 <view class='top_view'>
   <view><image class='img_sty' src='../../img/common_header_boy.png'></image></view>
-  <view class='companyname_sty'>双子羯科技有限公司</view>
+  <view class='companyname_sty'>摩双子羯克己无限公私</view>
 </view>
 
 <!-- <view wx:for='{{comDataList}}'> -->

+ 4 - 4
pages/home/home.js

@@ -3,7 +3,7 @@ var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
 var baseutils = require('../../utils/baseUtils.js')
 var netUtil = require('../../utils/network.js')
-var openid = wx.getStorageSync('openid')
+var isregistered 
 
 Page({
 
@@ -34,7 +34,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-   
+    baseutils.getComOpenid() //获取openid
   },
 
   getAddata:function(){
@@ -72,8 +72,8 @@ Page({
    */
   onShow: function () {
     var that = this
-    if (openid){
-      baseutils.getComOpenid() //获取openid
+    isregistered = wx.getStorageSync('isregistered')
+    if (isregistered){
       baseutils.getPersonlEmp()
       baseutils.judgeisReg()
     }else{

+ 1 - 1
pages/home/home.wxml

@@ -28,7 +28,7 @@
      <view class='commonhline' style='height:3rpx;'></view>
      <view class='commonHview' style='margin:10rpx;height:156rpx;'>
        <view wx:if='{{item.newsimgurl}}'><image src='{{item.newsimgurl}}' class='newsimgs'></image></view>
-        <view  ><image src='../../img/nophoto.png' class='newsimgs'></image></view>
+       <view wx:else><image src='../../img/nophoto.png' class='newsimgs'></image></view>
         <view style='text-align:left;margin-left:10rpx;'  class='commonVview'>
           <view class='commonHview'>
             <view style='margin-top:20rpx;font-size:30rpx;color:#000;overflow:hidden; text-overflow:ellipsis;white-space:nowrap;width:300rpx;width:50%;' >{{item.newstitle}}</view>

+ 49 - 27
pages/mine/mine.js

@@ -4,6 +4,8 @@ var baseUrl = BASEURL.BaseUrl()
 var baseutils = require('../../utils/baseUtils.js')
 var netUtil = require('../../utils/network.js')
 var dateutil = require('../../utils/DateTime.js')
+var isregistered 
+
 Page({
 
   /**
@@ -40,38 +42,49 @@ Page({
   btnClick: function (event) {
     var that = this
     var id = event.currentTarget.id
+    isregistered = wx.getStorageSync('isregistered')
+    console.log('isregistered', isregistered)
+    if (!isregistered) {
+      if (wx.getStorageSync('wxnickName')) {
+        if (id == that.data.idgoBind) {
+          wx.navigateTo({
+            url: '../bindphone/bindphone',
+          })
+          return
+        }
+      }else{
+        that.comToast('您当前尚未进行微信授权登录')
+        return
+      }
+    }
+    if (!isregistered) {
+      wx.showModal({
+        title: '提示',
+        content: '您当前尚未与企业关联绑定,是否立即去绑定?',
+        success: function (res) {
+          if (res.confirm) {
+            wx.navigateTo({
+              url: '../bindphone/bindphone',
+            })
+          } else if (res.cancel) {
+            return
+          }
+        }
+      })
+      return
+    }
 
     if (id == that.data.idMyInfo){
-      if (!that.data.isregistered){
-        wx.showModal({
-          title: '提示',
-          content: '您当前尚未与企业关联绑定,是否立即去绑定?',
-          success: function (res) {
-            if (res.confirm) {
-              wx.navigateTo({
-                url: '../bindphone/bindphone',
-              })
-            } else if (res.cancel) {
-              return
-            }
-          }
-        })
-      }else{
         wx.navigateTo({
           url: '../perinfo/perinfo',
         })
-      }
     } else if (id == that.data.idCompanyInfo){
       wx.navigateTo({
         url: '../corporateInfo/corporateInfo',
       })
     } else if (id == that.data.idAbout){
       
-    } else if (id == that.data.idgoBind){
-      wx.navigateTo({
-        url: '../bindphone/bindphone',
-      })
-    }
+    } 
   },
   /**
    * 生命周期函数--监听页面显示
@@ -85,7 +98,10 @@ Page({
       headerImg: wx.getStorageSync('wxavatarUrl'),
       wxNickname: wx.getStorageSync('wxnickName'),
     })
-
+    isregistered = wx.getStorageSync('isregistered')
+    if (!isregistered){
+      return
+    }
     that.getMyRank()
   },
 
@@ -101,6 +117,7 @@ Page({
         if (res.data.data.pointdata){
           var pointdata = res.data.data.pointdata
           that.setData({
+            isregistered: res.data.data.isregistered,
             pointdata: pointdata,
             "curmonth_points": pointdata.curmonth_points, //本月当前积分
             "curmonth_rank": pointdata.curmonth_rank,//本月当前排名
@@ -121,7 +138,8 @@ Page({
   bindGetUserInfo: function (e) {
     var that = this
     var userInfo = e.detail.userInfo
-    // console.log('bindGetUserInfo', userInfo)
+    if (!userInfo) return
+    console.log('bindGetUserInfo', userInfo)
     var nickName = userInfo.nickName
     var avatarUrl = userInfo.avatarUrl
     var gender = userInfo.gender //性别 0:未知、1:男、2:女
@@ -129,11 +147,9 @@ Page({
     var city = userInfo.city
     var country = userInfo.country
     if (nickName && avatarUrl) {
-      
-      baseutils.getComOpenid() //获取openid
       baseutils.getPersonlEmp()
       baseutils.judgeisReg()
-
+      that.getMyRank()
       that.setData({
         wxNickname: nickName,
         wxHeader: avatarUrl,
@@ -148,7 +164,13 @@ Page({
 
   },
 
-
+  comToast: function (title) {
+    wx.showToast({
+      title: title,
+      icon: 'none',
+      duration: 2000
+    })
+  },
 
 
 

+ 1 - 1
pages/perinfo/perinfo.wxml

@@ -1,7 +1,7 @@
  <view class='commonHview'>
         <view class='add_item_left_sty'>
           <view style='color:#333333;font-size:30rpx;'>手机号</view>
-          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>18130506086</view>
+          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>{{InfoData.empPhone}}</view>
         </view>
         <view class='add_item_right_sty'>
           <!-- <view class='deit_sty'>编辑</view> -->

+ 68 - 25
pages/point/point.js

@@ -3,6 +3,8 @@ var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
 var baseutils = require('../../utils/baseUtils.js')
 var netUtil = require('../../utils/network.js')
+var pageSize = 1
+var isregistered 
 
 Page({
 
@@ -42,34 +44,49 @@ Page({
         });
       }
     })
-
-    // that.getRank()
+    
   },
-  // getRank:function(){
-  //   var that = this
-  //   var data = { openid: wx.getStorageSync('openid') }
-  //   var url = baseUrl + BASEURL.getUrl.BindgetRanking
-  //   netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
-
-  //   }, function (res) {
-  //     wx.showToast({
-  //       title: '加载数据失败',
-  //       icon: 'none',
-  //       duration: 2000
-  //     })
-  //   })
-  // },
+ 
+ gotoWxlogin:function(){
+    wx.showModal({
+      title: '提示',
+      content: '您当前尚未进行微信授权登录,是否立即前往?',
+      success: function (res) {
+        if (res.confirm) {
+          wx.switchTab({
+            url: '../mine/mine',
+          })
+        } else if (res.cancel) {
+          return
+        }
+      }
+    })
+  
+ },
   getHisPointData: function () {
     var that = this
-    var data = { openid: wx.getStorageSync('openid') }
+    var data = { 
+      openid: wx.getStorageSync('openid'),
+      pageCount:20,
+      pageSize: pageSize
+      }
     var url = baseUrl + BASEURL.getUrl.getAllRank
     netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
       if(res.data.success && res.data.data){
-        that.setData({
-          addList: res.data.data.addList,
-          minusList: res.data.data.minusList,
-          points_rank: res.data.data.points_rank
-        })
+       if(pageSize == 1){
+         that.setData({
+           addList: res.data.data.addList,
+           minusList: res.data.data.minusList,
+           points_rank: res.data.data.points_rank
+         })
+       }else{
+         that.setData({
+           addList: [...that.data.addList, ...res.data.data.addList],
+           minusList: [...that.data.minusList, ...res.data.data.minusList],
+           points_rank: [...that.data.points_rank, ...res.data.data.points_rank],
+         })
+
+       }
       }
     }, function (res) {
       wx.showToast({
@@ -82,11 +99,19 @@ Page({
 
   },
   enterAddPoint:function(){
+    if (!isregistered) {
+      this.gotoWxlogin()
+      return
+    } 
     wx.navigateTo({
       url: '../pointapply/pointapply',
     })
   },
   enterMinusPoint:function(){
+    if (!isregistered) {
+      this.gotoWxlogin()
+      return
+    }
     wx.navigateTo({
       url: '../minusapply/minusapply',
     })
@@ -139,7 +164,12 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-    this.getHisPointData()
+    isregistered = wx.getStorageSync('isregistered')
+    if (isregistered) {
+      this.getHisPointData()
+    } else {
+      // that.gotoWxlogin()
+    }
   },
 
   /**
@@ -160,14 +190,27 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-
+    var that = this
+    wx.showNavigationBarLoading() //在标题栏中显示加载
+    pageSize = 1
+    that.getHisPointData()
+    //模拟加载
+    setTimeout(function () {
+      // complete
+      wx.hideNavigationBarLoading() //完成停止加载
+      wx.stopPullDownRefresh() //停止下拉刷新
+    }, 2000);
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-
+    pageSize++;
+    this.getHisPointData()
+    wx.showNavigationBarLoading();
+    var that = this;
+    setTimeout(function () { wx.hideNavigationBarLoading() }, 2000);
   },
 
   /**

+ 66 - 0
pages/register/register.js

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

+ 3 - 0
pages/register/register.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "员工注册"
+}

+ 73 - 0
pages/register/register.wxml

@@ -0,0 +1,73 @@
+ <view class='commonHview'>
+        <view class='add_item_left_sty'>
+          <view style='color:#333333;font-size:30rpx;'>手机号</view>
+          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>18130506086</view>
+        </view>
+        <view class='add_item_right_sty'>
+          <!-- <view class='deit_sty'>编辑</view> -->
+        </view>
+    </view>
+  <view class='commonhline' style='height:20rpx;'></view>
+
+   <view class='commonHview'>
+        <view class='add_item_left_sty'>
+          <view style='color:#333333;font-size:30rpx;'>姓名</view>
+          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>{{InfoData.empName}}</view>
+        </view>
+        <view class='add_item_right_sty'>
+          <!-- <view class='deit_sty'>编辑</view> -->
+        </view>
+    </view>
+  <view class='commonhline' style='height:3rpx;'></view>
+   <view class='commonHview'>
+        <view class='add_item_left_sty'>
+          <view style='color:#333333;font-size:30rpx;'>性别</view>
+          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>{{InfoData.sex}}</view>
+        </view>
+        <view class='add_item_right_sty'>
+          <!-- <view class='deit_sty'>编辑</view> -->
+        </view>
+    </view>
+  <view class='commonhline' style='height:20rpx;'></view>
+
+     <view class='commonHview'>
+        <view class='add_item_left_sty'>
+          <view style='color:#333333;font-size:30rpx;'>入职日期</view>
+          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>{{InfoData.empEntry}}</view>
+        </view>
+        <view class='add_item_right_sty'>
+          <!-- <view class='deit_sty'>编辑</view> -->
+        </view>
+    </view>
+  <view class='commonhline' style='height:3rpx;'></view>
+   <view class='commonHview'>
+        <view class='add_item_left_sty'>
+          <view style='color:#333333;font-size:30rpx;'>出生日期</view>
+          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>{{InfoData.empBirth}}</view>
+        </view>
+        <view class='add_item_right_sty'>
+          <!-- <view class='deit_sty'>编辑</view> -->
+        </view>
+    </view>
+  <view class='commonhline' style='height:3rpx;'></view>
+
+     <view class='commonHview'>
+        <view class='add_item_left_sty'>
+          <view style='color:#333333;font-size:30rpx;'>个人邮箱</view>
+          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>{{InfoData.empEmail}}</view>
+        </view>
+        <view class='add_item_right_sty'>
+          <!-- <view class='deit_sty'>编辑</view> -->
+        </view>
+    </view>
+  <view class='commonhline' style='height:3rpx;'></view>
+   <view class='commonHview'>
+        <view class='add_item_left_sty'>
+          <view style='color:#333333;font-size:30rpx;'>所属公司</view>
+          <view style='color:#666666;font-size:30rpx;margin-top:20rpx;'>{{InfoData.station}}</view>
+        </view>
+        <view class='add_item_right_sty'>
+          <!-- <view class='deit_sty'>编辑</view> -->
+        </view>
+    </view>
+  <view class='commonhline' style='height:3rpx;'></view>

+ 10 - 0
pages/register/register.wxss

@@ -0,0 +1,10 @@
+.add_item_left_sty{
+  width: 90%;text-align: left;height: 100rpx;padding: 20rpx 40rpx;
+}
+.add_item_right_sty{
+  width: 10%;text-align: right;height: 100rpx;padding: 20rpx 40rpx;
+}
+.deit_sty{
+  text-align: center;font-size: 22rpx;color: #333333;border-radius: 5rpx;margin-top: 20rpx;
+  background-color: #E6E6E6;padding: 5rpx;width: 60rpx;
+}

+ 1 - 0
utils/wxconstant.js

@@ -28,6 +28,7 @@ const getUrl = {
   getInvoices: 'inte/invoices/getInvoices', //获取提交的单据详情  
   withdrawInvoices: 'inte/invoices/withdrawInvoices', //撤回未审批的  
   approval: 'inte/invoices/approval', //审批  
+  regist:'inte/employee/regist',//员工注册
 }
 module.exports = {
   BaseUrl: BaseUrl,