FANGLH 7 жил өмнө
parent
commit
8cb9e5aadf
39 өөрчлөгдсөн 1482 нэмэгдсэн , 214 устгасан
  1. 8 4
      app.json
  2. BIN
      img/common_nodata.png
  3. 2 1
      pages/applyjoinapprovel/applyjoinapprovel.js
  4. 19 1
      pages/approval/approval.js
  5. 230 0
      pages/bindphone/bindphone.js
  6. 3 0
      pages/bindphone/bindphone.json
  7. 26 0
      pages/bindphone/bindphone.wxml
  8. 29 0
      pages/bindphone/bindphone.wxss
  9. 66 0
      pages/corporateInfo/corporateInfo.js
  10. 3 0
      pages/corporateInfo/corporateInfo.json
  11. 41 0
      pages/corporateInfo/corporateInfo.wxml
  12. 14 0
      pages/corporateInfo/corporateInfo.wxss
  13. 32 0
      pages/home/home.js
  14. 5 10
      pages/home/home.wxml
  15. 3 0
      pages/home/home.wxss
  16. 70 7
      pages/mine/mine.js
  17. 5 4
      pages/mine/mine.wxml
  18. 144 1
      pages/minusapply/minusapply.js
  19. 20 25
      pages/minusapply/minusapply.wxml
  20. 6 3
      pages/minusapply/minusapply.wxss
  21. 28 1
      pages/perinfo/perinfo.js
  22. 13 13
      pages/perinfo/perinfo.wxml
  23. 45 29
      pages/point/point.js
  24. 21 20
      pages/point/point.wxml
  25. 189 20
      pages/pointapply/pointapply.js
  26. 15 25
      pages/pointapply/pointapply.wxml
  27. 7 2
      pages/pointapply/pointapply.wxss
  28. 106 0
      pages/selectStaff/selectStaff.js
  29. 3 0
      pages/selectStaff/selectStaff.json
  30. 4 0
      pages/selectStaff/selectStaff.wxml
  31. 5 0
      pages/selectStaff/selectStaff.wxss
  32. 115 0
      pages/selectnorm/selectnorm.js
  33. 3 0
      pages/selectnorm/selectnorm.json
  34. 29 0
      pages/selectnorm/selectnorm.wxml
  35. 47 0
      pages/selectnorm/selectnorm.wxss
  36. 39 0
      utils/JSONUtil.js
  37. 63 44
      utils/baseUtils.js
  38. 1 1
      utils/network.js
  39. 23 3
      utils/wxconstant.js

+ 8 - 4
app.json

@@ -1,12 +1,16 @@
 {
   "pages": [
     "pages/home/home",
-    "pages/pointapply/pointapply",
-    "pages/applyjoinapprovel/applyjoinapprovel",
-    "pages/minusapply/minusapply",
-    "pages/perinfo/perinfo",
+    "pages/corporateInfo/corporateInfo",
     "pages/approval/approval",
     "pages/point/point",
+    "pages/minusapply/minusapply",
+    "pages/selectStaff/selectStaff",
+    "pages/pointapply/pointapply",
+    "pages/selectnorm/selectnorm",
+    "pages/perinfo/perinfo",
+    "pages/bindphone/bindphone",
+    "pages/applyjoinapprovel/applyjoinapprovel",
     "pages/mine/mine"
   ],
   "window": {

BIN
img/common_nodata.png


+ 2 - 1
pages/applyjoinapprovel/applyjoinapprovel.js

@@ -1,7 +1,8 @@
 // pages/applyjoinapprovel/applyjoinapprovel.js
 var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
-
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
 
 Page({
 

+ 19 - 1
pages/approval/approval.js

@@ -1,6 +1,8 @@
 // pages/Hisorders/Hisorders.js
 var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
 
 Page({
 
@@ -41,7 +43,23 @@ Page({
       }
     })
 
-    that.getHisOrderData()
+    // that.getHisOrderData()
+    that.getAllApproval()
+  },
+  getAllApproval:function(){
+    var that = this
+    var data = { openid: wx.getStorageSync('openid'), 
+    }
+    var url = baseUrl + BASEURL.getUrl.getAllApproval
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
   },
   waitApproItemClick:function(){
     wx.navigateTo({

+ 230 - 0
pages/bindphone/bindphone.js

@@ -0,0 +1,230 @@
+var timer; // 计时器
+var BASEURL = require('../../utils/wxconstant.js')
+var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
+var code
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    clickCode: false,
+    phoneNumber: '',
+    countdownTime: 59,
+    vCode: ''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+  },
+
+  bindNow: function (event) {
+    var that = this
+    console.log(event.detail.value)
+    let phone = event.detail.value.phoneNumber
+    let vcode = event.detail.value.vCode
+
+    if (!phone) {
+      that.lackToast('未填手机号')
+      return
+    }
+    if (!vcode) {
+      that.lackToast('未填验证码')
+      return
+    }
+
+    if(vcode != code){
+      that.lackToast('验证码不正确,请重新输入')
+      return
+    }
+    var data = { 
+      openid: wx.getStorageSync('openid'),
+      empPhone:phone
+    }
+    var url = baseUrl + BASEURL.getUrl.Binding 
+    netUtil.requestLoading(url, data, '正在加载数据...', 'POST', function (res) {
+      if (res.data.success) {
+        wx.showToast({
+          title: res.data.data,
+          icon: 'none',
+          duration: 2000
+        })
+        wx.setStorageSync('accountphone', phone)
+        // var pages = getCurrentPages()
+        // var prevPage = pages[pages.length - 1]  //当前界面
+        // var prevPage = pages[pages.length - 2]  //上一个页面
+        // prevPage.setData({
+
+        // })
+        setTimeout(function () {
+          wx.navigateBack({
+          })
+        }, 2000)
+      } else {
+        wx.showToast({
+          title: res.data.message,
+          icon: 'none',
+          duration: 2000
+        })
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+
+
+    return
+    wx.login({
+      success: res => {
+        wx.request({
+          url: baseUrl + BASEURL.getUrl.getOpenid,  //获取openid
+          method: 'GET',
+          header: {
+            'content-type': 'application/x-www-form-urlencoded'
+          },
+          data: {
+            code: res.code
+          },
+          success: function (res) {
+            console.log('res2=', res)
+            if (res.data) {
+              var openId = res.data.data.openid
+              if (!openId) return
+              //进行绑定
+              wx.request({
+                url: baseUrl + BASEURL.getUrl.Binding + '?empPhone=' + phone +  '&openid=' + openId,
+                method: 'POST',
+                data: {
+                },
+                header: {
+                  'content-type': 'application/json;charset=UTF-8',
+                },
+                success: function (res) {
+                  console.log('bindable=', res)
+                  if (res.data.success) {
+                    wx.showToast({
+                      title: res.data.data,
+                      icon: 'none',
+                      duration: 2000
+                    })
+                    wx.setStorageSync('accountphone', phone)
+                    // var pages = getCurrentPages()
+                    // var prevPage = pages[pages.length - 1]  //当前界面
+                    // var prevPage = pages[pages.length - 2]  //上一个页面
+                    // prevPage.setData({
+
+                    // })
+                    setTimeout(function () {
+                      wx.navigateBack({
+                      })
+                    }, 3000)
+                  } else {
+                    wx.showToast({
+                      title: res.data.bdfall2,
+                      icon: 'none',
+                      duration: 2000
+                    })
+                  }
+                }
+              })
+            }
+          }
+        })
+      }
+    })
+  },
+  /**
+  * 监听新手机号输入值
+  */
+  getphoneNumber: function (e) {
+    this.setData({
+      phoneNumber: e.detail.value
+    })
+  },
+  getvCode: function () {
+    var that = this
+    if (!that.data.phoneNumber) {
+      that.lackToast('未填手机号')
+      return
+    }
+    console.log('phoneNumber', that.data.phoneNumber)
+
+    var data = { empPhone: that.data.phoneNumber }
+    var url = baseUrl + BASEURL.getUrl.sendCode
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if (res.data && res.data.message == 'OK'){
+        wx.showToast({
+          title: '短信已发送',
+          duration: 2000
+        })
+        code = res.data.code
+        that.setData({
+          clickCode: true,
+          // vCode:code
+        })
+        that.TimerHandle()
+      }else{
+        wx.showToast({
+          title: res.data.message,
+          icon:'none',
+          duration: 2000
+        })
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+
+  },
+
+  TimerHandle: function () {
+    var that = this
+    timer = setTimeout(function () {
+      if (parseInt(that.data.countdownTime) == 0) {
+        that.setData({
+          countdownTime: 59,
+          clickCode: false
+        })
+        clearTimeout(timer);
+      } else {
+        let time = that.numberAdd2(parseInt(that.data.countdownTime) - 1)
+        that.setData({
+          countdownTime: time
+        })
+        that.TimerHandle()
+        // console.log('time=' + time)
+      }
+    }, 1000)
+  },
+  numberAdd2: function (num) {
+    let result
+    if (num < 10) {
+      result = '0' + num
+    } else {
+      result = num
+    }
+    return result
+  },
+
+  lackToast: function (title) {
+    if (title == '') {
+      title = '缺填必选项'
+    }
+    wx.showToast({
+      title: title,
+      icon:'none',
+      duration: 2000
+    });
+  },
+ 
+})

+ 3 - 0
pages/bindphone/bindphone.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "手机绑定"
+}

+ 26 - 0
pages/bindphone/bindphone.wxml

@@ -0,0 +1,26 @@
+<!-- <view style='background:#EFEFF4;height:winHeight'> -->
+<form bindsubmit='bindNow'>
+
+  <view class='commonHview' style='margin-top:50rpx; height:90rpx;'>
+    <view class='register_left_str' style='width:35%;' >国家/地区</view>
+     <view class='register_left_str2' >中国(+86)</view>
+     <view  style='width:20%;'><image class='nextImg' src='../../img/next.png'></image></view>
+  </view>
+  <view class='commonhline' style='height:3rpx;'></view>
+  <view class='commonHview' style='height:90rpx;'>
+  <view class='register_left_str'>手机号码:</view>
+  <view class='register_input' style=' width:40%;'>
+  <input name="phoneNumber" maxlength='16' value='{{phoneNumber}}' placeholder='填写手机号码' bindinput='getphoneNumber' maxlength='11' placeholder-style='color:#B2B2B2;'></input></view>
+  <view style='height:90rpx;width:3rpx;background-color:#F5F5F5;'></view>
+  <view wx:if='{{!clickCode}}' style='font-size:30rpx; line-height: 90rpx;margin-left:10rpx;color:#1AAD19;text-align: right;' bindtap='getvCode'>获取验证码</view>
+   <view wx:else style='font-size:30rpx; line-height: 90rpx;margin-left:10rpx;color:#B2B2B2'>{{countdownTime}}S后重新获取</view>
+</view>
+<view class='commonhline' style='height:3rpx;'></view>
+<view class='commonHview' style='height:90rpx;' >
+  <view class='register_left_str'>验证码</view>
+  <view class='register_input'>
+  <input name="vCode" type='number' maxlength='6' value='{{vCode}}' placeholder='输入验证码' placeholder-style='color:#B2B2B2;'></input></view>
+</view>
+<button  form-type='submit' class='comBtn' hover-class="commonclick-btn">立即绑定</button>
+</form>
+<!-- </view> -->

+ 29 - 0
pages/bindphone/bindphone.wxss

@@ -0,0 +1,29 @@
+.register_left_str{
+  width: 25%;
+  font-size: 30rpx;
+  text-align: left;
+  margin: 20rpx 0rpx 10rpx 20rpx;
+  color: #000;
+}
+.register_left_str2{
+  font-size: 30rpx;
+  text-align: left;
+  margin: 20rpx 0rpx 10rpx 0rpx;
+  color: #000;
+  width: 80%;
+}
+.register_input{
+  font-size: 30rpx;
+  height: 60rpx;
+  width: 40%;
+  margin-top: 15rpx;
+ 
+}
+
+.nextImg{
+  width: 20rpx;
+  height: 30rpx;
+  border-radius:15rpx;
+  margin: 35rpx 0 0 40rpx;
+  text-align: right;
+}

+ 66 - 0
pages/corporateInfo/corporateInfo.js

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

+ 3 - 0
pages/corporateInfo/corporateInfo.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "企业信息"
+}

+ 41 - 0
pages/corporateInfo/corporateInfo.wxml

@@ -0,0 +1,41 @@
+<view class='commonhline' style='height:20rpx;'></view>
+
+<view class='top_view'>
+  <view><image class='img_sty' src='../../img/common_header_boy.png'></image></view>
+  <view class='companyname_sty'>双子羯科技有限公司</view>
+</view>
+
+<!-- <view wx:for='{{comDataList}}'> -->
+    <view class='commonhline' style='height:2rpx;'></view>
+
+    <view class='commonHview'>
+      <view class='shu_sty'></view>
+      <view class='title_sty'>概况介绍:</view>
+    </view>
+
+    <view class='context_sty'>017 年 1 月 10 日, 世界权 威市场调查机构 欧睿国际 (Euromonitor)正式签署发布的 2016 年全球大型家用电器品 牌零售量数据显示: XXX 大型家用电器 2016 年品牌零售量占 全球市场的 10.3%,居全球第一,这是自 2009 年以来 XXX 第 8 次蝉联全球第一。此外,冰箱、洗衣机、酒柜、冷柜也分 别以大幅度领先第二名的品牌零售量继续蝉联全球第一
+    </view>
+<!-- </view> -->
+
+ <view class='commonhline' style='height:2rpx;'></view>
+
+    <view class='commonHview'>
+      <view class='shu_sty'></view>
+      <view class='title_sty'>企业文化:</view>
+    </view>
+
+    <view class='context_sty'>017 年 1 月 10 日, 世界权 威市场调查机构 欧睿国际 (Euromonitor)正式签署发布的 2016 年全球大型家用电器品 牌零售量数据显示: XXX 大型家用电器 2016 年品牌零售量占 全球市场的 10.3%,居全球第一,这是自 2009 年以来 XXX 第 8 次蝉联全球第一。此外,冰箱、洗衣机、酒柜、冷柜也分 别以大幅度领先第二名的品牌零售量继续蝉联全球第一
+
+
+    </view>
+
+     <view class='commonhline' style='height:2rpx;'></view>
+
+    <view class='commonHview'>
+      <view class='shu_sty'></view>
+      <view class='title_sty'>主营范围:</view>
+    </view>
+
+    <view class='context_sty'>017 年 1 月 10 日, 世界权 威市场调查机构 欧睿国际 (Euromonitor)正式签署发布的 2016 年全球大型家用电器品 牌零售量数据显示: XXX 大型家用电器 2016 年品牌零售量占 全球市场的 10.3%,居全球第一,这是自 2009 年以来 XXX 第 8 次蝉联全球第一。此外,冰箱、洗衣机、酒柜、冷柜也分 别以大幅度领先第二名的品牌零售量继续蝉联全球第一
+    </view>
+

+ 14 - 0
pages/corporateInfo/corporateInfo.wxss

@@ -0,0 +1,14 @@
+.top_view{
+  display: flex;flex-direction: column;text-align: center;width: 100%;padding:50rpx 0rpx;
+}.img_sty{
+  height: 160rpx;width: 160rpx;border-radius: 50%;border:2px solid #fff;
+  box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
+}.companyname_sty{
+  font-size: 30rpx;color: #333333;
+}.shu_sty{
+  width: 6rpx;height: 30rpx;background-color: #313131 ;margin: 20rpx 10rpx 20rpx 30rpx;
+}.title_sty{
+  margin-top: 17rpx; color: #333333;font-size: 30rpx;
+}.context_sty{
+  font-size: 24rpx;color: #666666;padding: 5rpx 50rpx;
+}

+ 32 - 0
pages/home/home.js

@@ -1,6 +1,8 @@
 // pages/home/home.js
 var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
 
 Page({
 
@@ -23,15 +25,40 @@ Page({
     autoplay: true,
     interval: 5000,
     duration: 500,
+    homedata:{},
+    noticeContent:'这是公告'
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+   
+  },
+
+  getAddata:function(){
+    var that = this
+    var data = { openid: wx.getStorageSync('openid') }
+    var url = baseUrl + BASEURL.getUrl.getAd
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if (res.data.success){
+        that.setData({
+          homedata: res.data.data,
+          noticeContent: res.data.data.announcement[0].noticeContent
+        })
+        // console.log('homedata', that.data.homedata)
 
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
   },
 
+
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -43,7 +70,12 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    var that = this
+    baseutils.getComOpenid() //获取openid
+    baseutils.getPersonlEmp()
+    baseutils.judgeisReg()
 
+    that.getAddata()   //获取home广告信息
   },
 
   /**

+ 5 - 10
pages/home/home.wxml

@@ -16,7 +16,7 @@
    <view class='announcement_sty'>
       <view class='announcement_sty1'>
         <image src='../../img/announcement.png'  class='announcement_img'></image>
-         <view class='ann_right' style="{{orientation}}:{{marqueeDistance}}px;">公告内容</view>
+         <view class='ann_right' style="{{orientation}}:{{marqueeDistance}}px;">{{noticeContent}}</view>
       </view>
     </view>
 
@@ -24,25 +24,20 @@
     <view><image style='width:30rpx;height:30rpx;margin-top:10rpx;line-height:30rpx;' src='../../img/speaker.png'></image></view>
     <view style='font-size:26rpx;color:#000;margin-left:10rpx;margin-top:8rpx;'>最新资讯</view>
     </view>
-    <view class='commonVview' wx:for='{{[1,2,3,4,5]}}' bindtap='newsItemClick' data-newsid='{{item.cid}}'>
+    <view class='commonVview' wx:for='{{homedata.newsData}}' bindtap='newsItemClick' data-newsid='{{item.cid}}'>
      <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 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%;' >这是标题</view>
-          <view style='font-size:24rpx;color:#999999;margin-top:40rpx;text-align:right;width:40%;'>2018-09-19</view>
+            <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>
+          <view style='font-size:24rpx;color:#999999;margin-top:40rpx;text-align:right;width:40%;'>{{item.gtmCreate}}</view>
           </view>
-        <view class='newContextSty'>这是内容</view>
+        <view class='newContextSty'>{{item.content}}</view>
         </view>
      </view>
     
     </view>
-
-
-
-
-
   </view>
 </scroll-view>

+ 3 - 0
pages/home/home.wxss

@@ -11,4 +11,7 @@
   width: 130rpx;height: 130rpx;margin-top: 10rpx;
 }.newContextSty{
   font-size:28rpx;color:#999999; overflow:hidden; text-overflow:ellipsis;white-space:nowrap;width:640rpx;margin-top: 20rpx;
+}.ann_right{
+  left:50rpx;
+  color: #000000;overflow:hidden; text-overflow:ellipsis;white-space:nowrap;font-size:28rpx; margin:7rpx 20rpx;
 }

+ 70 - 7
pages/mine/mine.js

@@ -1,7 +1,9 @@
 // pages/mine/mine.js
 var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
-
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
+var dateutil = require('../../utils/DateTime.js')
 Page({
 
   /**
@@ -9,9 +11,17 @@ Page({
    */
   data: {
    //id
+    isregistered:false,
     idMyInfo:'idMyInfo',
     idCompanyInfo: 'idCompanyInfo',
     idAbout: 'idAbout',
+    idgoBind:'idgoBind',
+    pointdata:{},//本月、上月积分及排名
+
+    "curmonth_points": 520, //本月当前积分
+    "curmonth_rank": 1,//本月当前排名
+    "lastmonth_points": 520,//上月积分
+    "lastmonth_rank": 1 //上月排名
   },
 
   /**
@@ -25,36 +35,89 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-
+    
   },
   btnClick: function (event) {
     var that = this
     var id = event.currentTarget.id
 
     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: '../perinfo/perinfo',
+        url: '../corporateInfo/corporateInfo',
       })
-    } else if (id == that.data.idCompanyInfo){
-
     } else if (id == that.data.idAbout){
       
+    } else if (id == that.data.idgoBind){
+      wx.navigateTo({
+        url: '../bindphone/bindphone',
+      })
     }
   },
   /**
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    var that = this
     this.setData({
-      isRegistered: wx.getStorageSync('isRegistered'),
+      isregistered: wx.getStorageSync('isregistered'),
       isLogin: wx.getStorageSync('wxnickName') ? true : false,
       canIUse: wx.canIUse('button.open-type.getUserInfo'),
       headerImg: wx.getStorageSync('wxavatarUrl'),
       wxNickname: wx.getStorageSync('wxnickName'),
-      isRegistered: wx.getStorageSync('isRegistered'),
     })
+
+    that.getMyRank()
   },
 
+  getMyRank:function(){
+  var that = this
+  var data = { 
+    openid: wx.getStorageSync('openid'),
+   }
+    var url = baseUrl + BASEURL.getUrl.getRank
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if (res.data.success){
+        wx.setStorageSync('isregistered', res.data.data.isregistered)
+        if (res.data.data.pointdata){
+          var pointdata = res.data.data.pointdata
+          that.setData({
+            pointdata: pointdata,
+            "curmonth_points": pointdata.curmonth_points, //本月当前积分
+            "curmonth_rank": pointdata.curmonth_rank,//本月当前排名
+            "lastmonth_points": pointdata.lastmonth_points,//上月积分
+            "lastmonth_rank": pointdata.lastmonth_rank //上月排名
+          })
+
+        }
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
   bindGetUserInfo: function (e) {
     var that = this
     var userInfo = e.detail.userInfo

+ 5 - 4
pages/mine/mine.wxml

@@ -11,18 +11,19 @@
     <view wx:if='{{headerImg.length == 0 || headerImg == null}}'><image class='headerImg' src='{{wxHeader}}' bindtap='btnClick' id='{{idHeader}}' > </image></view> 
     <view wx:else><image class='headerImg' src='{{headerImg}}'> </image></view> 
     <view class='loginname'>{{wxNickname}}</view>
+    <view wx:if='{{!isregistered}}'  class='loginname' style='text-decoration:underline;' bindtap='btnClick' id='{{idgoBind}}'> 关联手机(企业信息)</view>
     </view>
   </view>
    
  <view class='headerdata' wx:if='{{isLogin}}'>
     <view class='commonHview' style='margin-left:30rpx;'>
         <view style='width:50%;'>
-            <view class='h_data_left'>本月当前积分: <text class='h_data_right'>520</text></view>
-            <view class='h_data_left'>本月当前排名: <text class='h_data_right'>520</text></view>
+            <view class='h_data_left'>本月当前积分: <text class='h_data_right'>{{curmonth_points}}</text></view>
+            <view class='h_data_left'>本月当前排名: <text class='h_data_right'>{{curmonth_rank}}</text></view>
         </view>
         <view style='width:50%;'>
-            <view class='h_data_left'>上月积分:<text class='h_data_right'>520</text></view>
-            <view class='h_data_left'>上月排名:<text class='h_data_right'>520</text></view>
+            <view class='h_data_left'>上月积分:<text class='h_data_right'>{{lastmonth_points}}</text></view>
+            <view class='h_data_left'>上月排名:<text class='h_data_right'>{{lastmonth_rank}}</text></view>
         </view>
     </view>
  </view>

+ 144 - 1
pages/minusapply/minusapply.js

@@ -1,6 +1,10 @@
 // pages/minusapply/minusapply.js
 var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
+var dateutil = require('../../utils/DateTime.js')
+var myInfoData = wx.getStorageSync('myInfoData')
 
 Page({
 
@@ -12,7 +16,11 @@ Page({
     minusPerson:'吴彦祖',
     minusTime:'2018-09-20',
     minusName:'',
-    minusPoints:50
+    minusPoints:50,
+    itemPerson:{},
+    itemNorm: { normItem: '请选择', normScore:'' },//所选规则数据
+    CotegoryArray: [],
+    Cotegory: [],
   },
 
   /**
@@ -25,6 +33,94 @@ Page({
       isDetails: isDetails
     })
     that.changeTitle()
+    that.initView()
+
+    that.getCotegory()//获得分类列表
+  },
+  minusSubmit: function (event){
+    var that = this
+    var object = event.detail.value
+    console.log(object)
+
+    var minusName = object.minusName
+    var minusPoints = object.minusPoints
+    var minusReason = object.minusReason
+    var itemNorm = that.data.itemNorm
+    var itemPerson = that.data.itemPerson
+
+    if (!minusName) {
+      that.comToast('请选择被扣人')
+      return
+    }
+    if (!minusPoints) {
+      that.comToast('请选择扣分标准')
+      return
+    }
+    if (!minusReason) {
+      that.comToast('请输入扣分原由')
+      return
+    }
+
+    var data = {
+      openid: wx.getStorageSync('openid'),
+      reasons: minusReason,
+      normId: itemNorm.normId,
+      adviceId: itemPerson.empId
+    }
+    var url = baseUrl + BASEURL.getUrl.saveMinusInvoices
+    netUtil.requestLoading(url, data, '正在加载数据...', 'POST', function (res) {
+      if (res.data.success) {
+        that.comToast("提交成功")
+        setTimeout(function () {
+          wx.navigateBack({
+          })
+        }, 1000)
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
+  getCotegory: function () {
+    var that = this
+    var data = { parentId: 0 }
+    var url = baseUrl + BASEURL.getUrl.getCotegory
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if (res.data.success && res.data.data) {
+        that.setData({
+          Cotegory: res.data.data
+        })
+        var array = []
+        for (var i = 0; i < res.data.data.length; i++) {
+          array[i] = res.data.data[i].categoryName
+          if (i == res.data.data.length - 1) {
+            console.log('array', array)
+            that.setData({
+              CotegoryArray: array
+            })
+          }
+        }
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
+  bindPickerChange: function (e) {
+    var that = this
+    console.log('picker发送选择改变,携带值为', e.detail)
+    var categoryId = that.data.Cotegory[e.detail.value].categoryId
+    if (categoryId) {
+      wx.navigateTo({
+        url: '../selectnorm/selectnorm' + '?getcategoryId=' + categoryId+'&getAddType='+false,
+      })
+    }
   },
 
   /**
@@ -46,6 +142,53 @@ Page({
       title: that.data.mername
     })
   },
+  initView: function () {
+    var that = this
+    var nowTime = dateutil.getComDate(new Date, 'yy-mm-dd')
+    that.setData({
+      minusTime: nowTime
+    })
+    // console.log('nowTime', nowTime)
+  },
+
+  comToast: function (title) {
+    wx.showToast({
+      title: title,
+      icon: 'none',
+      duration: 2000
+    })
+  },
+
+  /**
+   * 选择被扣人对象
+   */
+  selctMinusPerson:function(){
+    wx.navigateTo({
+      url: '../selectStaff/selectStaff',
+    })
+    // return
+    // var that = this
+    // var data = {  }
+    // var url = baseUrl + BASEURL.getUrl.getAllEmp
+    // netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+
+    // }, function (res) {
+    //   wx.showToast({
+    //     title: '加载数据失败',
+    //     icon: 'none',
+    //     duration: 2000
+    //   })
+    // })
+  },
+
+
+
+
+
+
+
+
+
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 20 - 25
pages/minusapply/minusapply.wxml

@@ -2,9 +2,7 @@
 <form bindsubmit='minusSubmit'>
 
 <view class='commonHview' wx:if='{{isDetails}}'>
-  <view class='left_sty'>
-    扣分人
-  </view>
+  <view class='left_sty'>扣分人</view>
    <view class='right_sty'>
         <input class='input_sty'  type='text'  name='minusPerson' value='{{minusPerson}}' disabled='{{isDetails}}'></input>
     </view>
@@ -12,9 +10,7 @@
 <view class='commonhline' style='height:3rpx;'></view>
 
 <view class='commonHview'>
-  <view class='left_sty'>
-    日期
-  </view>
+  <view class='left_sty'>日期</view>
    <view class='right_sty'>
         <input class='input_sty'  type='text'  name='minusTime' value='{{minusTime}}' disabled='true'></input>
     </view>
@@ -22,43 +18,42 @@
 <view class='commonhline' style='height:3rpx;'></view>
 
 <view class='commonHview'>
-  <view class='left_sty'>
-    被扣人
-  </view>
-   <view class='right_sty' style='display: flex;flex-direction: row;'>
-      <view><input class='input_sty' disabled='true' value='{{minusName}}' placeholder='请选择' type='text' name='minusName' disabled='{{isDetails}}'></input></view>
-    <view wx:if='{{!isDetails}}'><image class='nextImg' src='../../img/next.png'> </image></view>
+  <view class='left_sty'>被扣人</view>
+   <view class='right_sty' style='display: flex;flex-direction: row;margin-right:0rpx;'>
+      <view><input class='input_sty' disabled='true' value='{{itemPerson.empName}}' placeholder='请选择' type='text' name='minusName' bindtap='selctMinusPerson' placeholder-style='color:#666666;'></input></view>
     </view>
+    <view ><image class='nextImg' src='../../img/next.png'> </image></view>
 </view>
 <view class='commonhline' style='height:3rpx;'></view>
 
 <view class='commonHview'>
-  <view class='left_sty'>
-    被扣标准
-  </view>
-   <view class='right_sty' style='display: flex;flex-direction: row;'>
-      <view><input class='input_sty' disabled='true' value='{{minusNorm}}' placeholder='请选择' type='text' name='minusNorm' disabled='{{isDetails}}'></input></view>
+  <view class='left_sty'>扣分标准</view>
+   <!-- <view class='right_sty' style='display: flex;flex-direction: row;'>
+      <view><input class='input_sty' disabled='true' value='{{minusNorm}}' placeholder='请选择' type='text' name='minusNorm' ></input></view>
     <view wx:if='{{!isDetails}}'><image class='nextImg' src='../../img/next.png'> </image></view>
+    </view> -->
+
+     <view class='right_sty1' >
+        <picker bindchange="bindPickerChange" value="{{CotegoryArray[index].name}}" range="{{CotegoryArray}}" >
+          <view>{{itemNorm.normItem}}</view>
+        </picker>
     </view>
+    <view><image class='nextImg'src='../../img/next.png'> </image></view>
 </view>
 <view class='commonhline' style='height:3rpx;'></view>
 
 <view class='commonHview'>
-  <view class='left_sty'>
-    被扣数值
-  </view>
+  <view class='left_sty'>扣分数值</view>
    <view class='right_sty' style='display: flex;flex-direction: row;'>
-      <view><input class='input_sty' disabled='true' value='{{minusPoints}}' placeholder='请选择' type='text' name='minusPoints' disabled='{{isDetails}}'></input></view>
+      <view><input class='input_sty' disabled='true' value='{{itemNorm.normScore}}'  type='text' name='minusPoints' ></input></view>
     </view>
 </view>
 <view class='commonhline' style='height:3rpx;'></view>
 
 <view class='commonHview'>
-  <view class='left_sty'  style='width: 20%;'>
-    被扣事情
-  </view>
+  <view class='left_sty'  style='width: 20%;'>扣分原由</view>
    <view class='righttextarea' >
-        <textarea placeholder='请输入...' name='applyReason' maxlength='200' disabled='{{isDetails}}'> </textarea>
+        <textarea placeholder='请输入...' name='minusReason' maxlength='200' disabled='{{isDetails}}'> </textarea>
     </view>
 </view>
 <view class='commonhline' style='height:20rpx;'></view>

+ 6 - 3
pages/minusapply/minusapply.wxss

@@ -2,7 +2,7 @@
   width: 50%;height: 100rpx;text-align: left;color: #333333;font-size: 30rpx;line-height: 100rpx;margin-left: 20rpx;
 }
 .right_sty{
-  width: 50%;height: 100rpx;text-align: right;color: #666666;font-size: 30rpx;line-height: 100rpx;margin-right: 20rpx;
+   width: 50%;height: 100rpx;text-align: right;color: #666666;font-size: 30rpx;line-height: 100rpx;margin-right: 20rpx;
 }.input_sty{
   margin-top: 20rpx;
 }.righttextarea{
@@ -11,7 +11,10 @@
   margin: 30rpx;
   text-align: left;color: #666666;height: 300rpx;
 }.nextImg{
-  width: 20rpx;
+   width: 20rpx;
   height: 30rpx;
-  text-align: left;margin:30rpx 10rpx;
+  text-align: right;margin:30rpx 20rpx;
+}.right_sty1{
+ height: 100rpx;color: #666666;font-size: 30rpx;padding-top: 20rpx;width: 70%;text-align: right;
+  line-height: 50rpx;
 }

+ 28 - 1
pages/perinfo/perinfo.js

@@ -1,6 +1,8 @@
 // pages/perinfo/perinfo.js
 var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
 
 Page({
 
@@ -8,16 +10,41 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    InfoData:{}
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    var that = this
+    that.getInfoData()
+  },
 
+  getInfoData: function(){
+    var that = this
+    var data = { openid: wx.getStorageSync('openid') }
+    var url = baseUrl + BASEURL.getUrl.getEmp
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if(res.data.success && res.data.data){
+        that.setData({
+          InfoData: res.data.data
+        })
+        if (res.data.success && res.data.data) {
+          wx.setStorageSync("myInfoData", res.data.data)
+          // console.log('myInfoData', wx.getStorageSync('myInfoData'))
+        }
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
   },
 
+
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 13 - 13
pages/perinfo/perinfo.wxml

@@ -4,7 +4,7 @@
           <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 class='deit_sty'>编辑</view> -->
         </view>
     </view>
   <view class='commonhline' style='height:20rpx;'></view>
@@ -12,20 +12,20 @@
    <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;'>吴彦祖</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 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;'></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 class='deit_sty'>编辑</view> -->
         </view>
     </view>
   <view class='commonhline' style='height:20rpx;'></view>
@@ -33,20 +33,20 @@
      <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;'>2018-09-20</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 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;'>2018-09-20</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 class='deit_sty'>编辑</view> -->
         </view>
     </view>
   <view class='commonhline' style='height:3rpx;'></view>
@@ -54,20 +54,20 @@
      <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@163.com</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 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;'>英唐集团</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 class='deit_sty'>编辑</view> -->
         </view>
     </view>
   <view class='commonhline' style='height:3rpx;'></view>

+ 45 - 29
pages/point/point.js

@@ -1,6 +1,8 @@
 // pages/point/point.js
 var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
 
 Page({
 
@@ -8,10 +10,6 @@ Page({
    * 页面的初始数据
    */
   data: {
-    allorders: [],
-    todayorders: [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6,1, 2, 3, 4, 5, 6],
-    weekorders: [1, 2, 3],
-    monthorders: [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4],
     // tab切换  
     currentTab: 0,
     clientHeight: '',
@@ -21,6 +19,10 @@ Page({
       */
     winWidth: 0,
     winHeight: 0,
+
+    addList:[],
+    minusList:[],
+    points_rank:{}
   },
 
   /**
@@ -41,31 +43,43 @@ Page({
       }
     })
 
-    that.getHisOrderData()
+    // that.getRank()
   },
-  getHisOrderData: function () {
+  // 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
+  //     })
+  //   })
+  // },
+  getHisPointData: 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
-            })
-          }
-        }
+    var data = { openid: wx.getStorageSync('openid') }
+    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
+        })
       }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
     })
+
+
   },
   enterAddPoint:function(){
     wx.navigateTo({
@@ -77,9 +91,11 @@ Page({
       url: '../minusapply/minusapply',
     })
   },
-  addListClick:function(){
+  addListClick:function(event){
+    // console.log("点击了", event.currentTarget.dataset.item)
+    var itemdata = event.currentTarget.dataset.item
     wx.navigateTo({
-      url: '../pointapply/pointapply?getisDetails='+true,
+      url: '../pointapply/pointapply?getisDetails=' + true + '&getItemdata=' + JSON.stringify(itemdata),
     })
   },
   minusListClick:function(){
@@ -92,7 +108,7 @@ Page({
     */
   swichNav: function (e) {
     var that = this;
-    console.log('swichNav=', e)
+    // console.log('swichNav=', e)
     if (this.data.currentTab == e.target.dataset.current) {
       return false;
     } else {
@@ -123,7 +139,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    this.getHisPointData()
   },
 
   /**

+ 21 - 20
pages/point/point.wxml

@@ -18,22 +18,22 @@
     <view class="swiper-tab-list {{currentTab==2 ? 'on' : ''}}" data-current="2" bindtap="swichNav">积分排名</view>  
 </view>  
 
- <view wx:if='{{(currentTab == 1 && todayorders.length == 0) || (currentTab == 2 && weekorders.length == 0) || (currentTab == 0 && monthorders.length == 0)}}' class='nodata_view'>
-     <view><image class='nodata_style' src='../../resource/images/common_nodata.png'></image></view> 
+ <view wx:if='{{(currentTab == 0 && addList.length == 0) || (currentTab == 1 && minusList.length == 0) || (currentTab == 2 && points_rank.all_points.length == 0)}}' class='nodata_view'>
+     <view><image class='nodata_style' src='../../img/common_nodata.png'></image></view> 
 </view> 
 
 <swiper current="{{currentTab}}" class="swiper-box" duWration="300" style="height:{{winHeight-31}}px;margin:85rpx 0 0 0;" bindchange="bindChange">
       <swiper-item>  
       <scroll-view  scroll-y="true" style="height:100%;">
-      <block wx:for='{{todayorders}}'>
-         <template is='addPointTem' data='{{...item}}' /> 
-      </block>
+      <view wx:for='{{addList}}' bindtap='addListClick' data-item='{{item}}' >
+         <template is='addPointTem' data='{{...item}}'  /> 
+      </view>
      </scroll-view> 
     </swiper-item> 
 
       <swiper-item>  
       <scroll-view  scroll-y="true" style="height:100%;">
-      <block wx:for='{{weekorders}}'>
+      <block wx:for='{{minusList}}' bindtap='minusListClick' data-item='{{item}}' >
          <template is='minusPointTem' data='{{...item}}'/> 
       </block>
      </scroll-view> 
@@ -42,18 +42,17 @@
       <swiper-item >  
       <scroll-view  scroll-y="true" style="height:100%;">
         <view class='commonHview' style='background-color:#B1F4AE;height:100rpx;'>
-          <view style='color:#333333;font-size:30rpx;text-align:left;margin:25rpx;width:50%;'>当前排名:1</view>
-          <view style='color:#666666;font-size:30rpx;text-align:right;margin:25rpx;width:50%;'>5201314 积分</view>
+          <view style='color:#333333;font-size:30rpx;text-align:left;margin:25rpx;width:50%;'>当前排名:{{points_rank.my_rank.rank}}</view>
+          <view style='color:#666666;font-size:30rpx;text-align:right;margin:25rpx;width:50%;'>{{points_rank.my_rank.point}} 积分</view>
         </view>
-      <block wx:for='{{monthorders}}'>
-         <!-- <template is='pointRankTem' data='{{...item}}'/>  -->
+      <block wx:for='{{points_rank.all_points}}'>
           <view class='commonHview' style='height:100rpx;'>
   
-          <view  wx:if='{{index == 0}}' style='color:#F60000;font-size:30rpx;text-align:left;margin:25rpx;width:50%;' >{{index+1}} <text style='color:#333333'>吴彦祖</text></view>
-          <view  wx:elif='{{index == 1}}' style='color:#FF9700;font-size:30rpx;text-align:left;margin:25rpx;width:50%;' >{{index+1}} <text style='color:#333333'>吴彦祖</text></view>
-          <view  wx:elif='{{index == 2}}' style='color:#09C44D;font-size:30rpx;text-align:left;margin:25rpx;width:50%;' >{{index+1}} <text style='color:#333333'>吴彦祖</text></view>
-          <view  wx:else style='color:#666666;font-size:30rpx;text-align:left;margin:25rpx;width:50%;' >{{index+1}} 吴彦祖</view>
-          <view style='color:#666666;font-size:30rpx;text-align:right;margin:25rpx;width:50%;'>5201314 积分</view>
+          <view  wx:if='{{index == 0}}' style='color:#F60000;font-size:30rpx;text-align:left;margin:25rpx;width:50%;' >{{index+1}} <text style='color:#333333'>{{item.name}}</text></view>
+          <view  wx:elif='{{index == 1}}' style='color:#FF9700;font-size:30rpx;text-align:left;margin:25rpx;width:50%;' >{{index+1}} <text style='color:#333333'>{{item.name}}</text></view>
+          <view  wx:elif='{{index == 2}}' style='color:#09C44D;font-size:30rpx;text-align:left;margin:25rpx;width:50%;' >{{index+1}} <text style='color:#333333'>{{item.name}}</text></view>
+          <view  wx:else style='color:#666666;font-size:30rpx;text-align:left;margin:25rpx;width:50%;' >{{index+1}} {{item.name}}</view>
+          <view style='color:#666666;font-size:30rpx;text-align:right;margin:25rpx;width:50%;'>{{item.point}} 积分</view>
     </view>
     <view class='commonhline' style='height:3rpx;'></view>
       </block>
@@ -63,21 +62,23 @@
 
 
 <template name='addPointTem'> 
-    <view class='commonHview' bindtap='addListClick'>
+    <view class='commonHview'  >
         <view class='add_item_left_sty'>
           <view style='color:#333333;font-size:30rpx;'>加分标准</view>
-          <view style='color:#20AB41;font-size:30rpx;margin-top:20rpx;'>+520</view>
+          <view style='color:#20AB41;font-size:30rpx;margin-top:20rpx;'>{{score}}</view>
         </view>
         <view class='add_item_right_sty'>
-          <view style='color:#666666;font-size:26rpx;'>通过</view>
-          <view style='color:#666666;font-size:26rpx;margin-top:20rpx;'>2018-09-19</view>
+          <view wx:if='{{invoicesStatus==1}}' style='color:#666666;font-size:26rpx;' >待通过</view>
+          <view wx:elif='{{invoicesStatus==2}}' style='color:#666666;font-size:26rpx;' >已通过</view>
+          <view wx:elif='{{invoicesStatus==3}}' style='color:#666666;font-size:26rpx;' >不通过</view>
+          <view style='color:#666666;font-size:26rpx;margin-top:20rpx;'>{{invoicesDate}}</view>
         </view>
     </view>
      <view class='commonhline' style='height:3rpx;'></view>
 </template>
 
 <template name='minusPointTem'> 
-    <view class='commonHview'  bindtap='minusListClick'>
+    <view class='commonHview'  >
         <view class='add_item_left_sty'>
           <view style='color:#333333;font-size:30rpx;'>扣分标准</view>
           <view style='color:#CB0404;font-size:30rpx;margin-top:20rpx;'>-250</view>

+ 189 - 20
pages/pointapply/pointapply.js

@@ -1,6 +1,10 @@
 // pages/pointapply/pointapply.js
 var BASEURL = require('../../utils/wxconstant.js')
 var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
+var dateutil = require('../../utils/DateTime.js')
+var myInfoData = wx.getStorageSync('myInfoData')
 
 Page({
 
@@ -8,23 +12,119 @@ Page({
    * 页面的初始数据
    */
   data: {
-    isDetails: false, //加分申请详情时状态
+    applyJob:'',
+    applyName:'',
     applyStatus:'待审批',
     applyTime:'2018-09-20',
-    applyNorm:'标准1',
-    applyReason:''
+    itemNorm: { normItem: '请选择' },//所选规则数据
+    applyReason:'',
+    CotegoryArray:[],
+    Cotegory:[],
+    invoicesStatus: 0,//单据状态1:待审批,2:已审批,3:不同意?
+    isDetails: false, //加分申请详情时状态
+    applyNorm:'',
+    detailsData:{} ,   
   },
   /**
-    *修改Title
-    */
-  changeTitle: function () {
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var that = this 
+    var isDetails = options.getisDetails
+    var itemdata 
+    if (options.getItemdata){
+      itemdata = JSON.parse(options.getItemdata)
+      that.setData({
+        isDetails: isDetails
+      })
+    }
+    console.log('itemdata', itemdata)
+    that.initView(itemdata) //修改标题
+    that.getCotegory()//获得分类列表
+    // that.getDept()//获取公司部门列表
+
+  },
+  bindPickerChange: function (e) {
+    var that = this
+    console.log('picker发送选择改变,携带值为', e.detail)
+    var categoryId = that.data.Cotegory[e.detail.value].categoryId
+    if (categoryId){
+      wx.navigateTo({
+        url: '../selectnorm/selectnorm' + '?getcategoryId=' + categoryId + '&getAddType=' + true,
+      })
+    }
+  },
+  getDept:function(){
+    var that = this
+    var data = { parentId:0}
+    var url = baseUrl + BASEURL.getUrl.getDept
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
+  getCotegory:function(){
+    var that = this
+    var data = { parentId: 0 }
+    var url = baseUrl + BASEURL.getUrl.getCotegory
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if(res.data.success && res.data.data){
+        that.setData({
+          Cotegory:res.data.data
+        })
+        var array = []
+        for (var i = 0; i < res.data.data.length; i++){
+          array[i] = res.data.data[i].categoryName
+          if (i == res.data.data.length-1){
+            console.log('array', array)
+            that.setData({
+              CotegoryArray:array 
+            })
+          }
+        }
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
+  initView: function (itemdata){
     var that = this;
     var isDetails = that.data.isDetails
     var title
-    if(isDetails){
+    if (isDetails) {
       title = '加分申请详情'
-    }else{
+      if (itemdata && itemdata.invoicesId){
+        var invoicesStatus = itemdata.invoicesStatus
+        var applyStatus 
+
+        if (invoicesStatus == 0){
+          applyStatus = '待审批'
+        } else if (invoicesStatus == 1){
+          applyStatus = '已审批'
+        }else{
+          applyStatus = '未通过'
+        }
+        that.setData({
+          applyStatus: applyStatus,
+          invoicesStatus: invoicesStatus,
+        })
+        that.initDetailsView(itemdata.invoicesId)
+      }
+    } else {
       title = '积分申请'
+      that.setData({
+        applyJob: myInfoData.station,
+        applyName: myInfoData.empName
+      })
     }
     that.setData({
       mername: title
@@ -32,17 +132,11 @@ Page({
     wx.setNavigationBarTitle({
       title: that.data.mername
     })
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    var that = this 
-    var isDetails = options.getisDetails
+    var nowTime = dateutil.getComDate(new Date,'yy-mm-dd')
     that.setData({
-      isDetails: isDetails
+      applyTime: nowTime
     })
-    that.changeTitle()
+    // console.log('nowTime', nowTime)
   },
  /**
    * 提交申请
@@ -54,15 +148,41 @@ Page({
 
     var applyName = object.applyName
     var applyJob = object.applyJob
-    var applyNorm = object.applyNorm
+    var itemNorm = that.data.itemNorm
     var applyReason = object.applyReason
 
     var applyName = object.applyName
 
+    if (!itemNorm.normId) {
+      that.comToast('请选择申请标准')
+      return
+    }
     if (!applyReason){
       that.comToast('请输入申请事由')
       return
     }
+
+    var data = { 
+      openid: wx.getStorageSync('openid'), 
+      reasons: applyReason,
+      normId: itemNorm.normId
+    }
+    var url = baseUrl + BASEURL.getUrl.saveAddInvoices
+    netUtil.requestLoading(url, data, '正在加载数据...', 'POST', function (res) {
+      if(res.data.success){
+        that.comToast("提交成功")
+        setTimeout(function(){
+          wx.navigateBack({
+          })
+        },1000)
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
   },
 
   comToast: function (title) {
@@ -72,11 +192,56 @@ Page({
       duration: 2000
     })
   },
+
+
+/**
+ * 根据invoicesId 获取加分单据详情数据
+ */
+  initDetailsView: function (invoicesId){
+    var that =this
+
+    var data = { invoicesId: invoicesId}
+    var url = baseUrl + BASEURL.getUrl.getInvoices
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if (res.data.success && res.data.data){
+        that.setData({
+          detailsData: res.data.data,
+          applyTime: res.data.data.invoicesDate,
+          applyName: res.data.data.fillName,
+          applyNorm: res.data.data.normName,
+          applyReason: res.data.data.reasons,
+        })
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
   /**
-   * 撤回
+   * 撤回 : 目前做的是删除单据操作
    */
   cancelApply:function(){
-
+    var that = this
+    var data = { invoicesId: that.data.detailsData.invoicesId }
+    var url = baseUrl + BASEURL.getUrl.withdrawInvoices
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if(res.data.success && res.data.data){
+        that.comToast(res.data.data)
+        setTimeout(function () {
+          wx.navigateBack({
+          })
+        }, 1000)
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
   },
 
 
@@ -94,6 +259,10 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    var that = this
+    that.setData({
+      applyNorm:that.data.itemNorm.normItem
+    })
 
   },
 

+ 15 - 25
pages/pointapply/pointapply.wxml

@@ -1,9 +1,7 @@
 <form bindsubmit='applySubmit'>
 
 <view class='commonHview' wx:if='{{isDetails}}'>
-  <view class='left_sty'>
-    状态
-  </view>
+  <view class='left_sty'>状态</view>
    <view class='right_sty'>
         <input class='input_sty'  type='text'  name='applyStatus' value='{{applyStatus}}' disabled='{{isDetails}}'></input>
     </view>
@@ -11,9 +9,7 @@
 <view class='commonhline' style='height:3rpx;'></view>
 
 <view class='commonHview'>
-  <view class='left_sty'>
-    申请时间
-  </view>
+  <view class='left_sty'>申请时间</view>
    <view class='right_sty'>
         <input class='input_sty'  type='text'  name='applyTime' value='{{applyTime}}' disabled='true'></input>
     </view>
@@ -22,43 +18,37 @@
 
 
 <view class='commonHview'>
-  <view class='left_sty'>
-    申请人
-  </view>
+  <view class='left_sty'>申请人</view>
    <view class='right_sty'>
-      <input class='input_sty'  placeholder='请输入姓名' type='text' maxlength='10' name='applyName' disabled='{{isDetails}}'></input>
+      <input class='input_sty'  placeholder='请输入姓名' type='text' maxlength='10' name='applyName' disabled='{{isDetails}}' value='{{applyName}}'></input>
     </view>
 </view>
 <view class='commonhline' style='height:3rpx;'></view>
 
 
 <view class='commonHview'>
-  <view class='left_sty'>
-    申请人岗位
-  </view>
+  <view class='left_sty'>申请人岗位</view>
    <view class='right_sty'>
-      <input class='input_sty'  placeholder='请输入岗位' type='text' maxlength='10' name='applyJob' disabled='{{isDetails}}' ></input>
+      <input class='input_sty'  placeholder='请输入岗位' type='text' maxlength='10' name='applyJob' disabled='{{isDetails}}' value='{{applyJob}}'></input>
     </view>
 </view>
 <view class='commonhline' style='height:3rpx;'></view>
 
 
 <view class='commonHview'>
-  <view class='left_sty'>
-    申请标准
-  </view>
-   <view class='right_sty' style='display: flex;flex-direction: row;'>
-      <view><input class='input_sty' disabled='true' value='{{applyNorm}}' type='text' maxlength='10' name='applyNorm'    disabled='{{isDetails}}'></input></view>
-    <view><image class='nextImg' src='../../img/next.png'> </image></view>
+  <view class='left_sty' style='width: 30%;'>申请标准</view>
+   <view class='right_sty1' >
+        <picker disabled='{{isDetails}}' bindchange="bindPickerChange" value="{{CotegoryArray[index].name}}" range="{{CotegoryArray}}" >
+          <view>{{applyNorm}}</view>
+        </picker>
     </view>
+    <view><image class='nextImg'src='../../img/next.png'> </image></view>
 </view>
 <view class='commonhline' style='height:3rpx;'></view>
 
 
 <view class='commonHview'>
-  <view class='left_sty' style='width: 10%;'>
-    事由
-  </view>
+  <view class='left_sty' style='width: 10%;'>事由</view>
    <view class='righttextarea' >
         <textarea placeholder='请输入...' name='applyReason' maxlength='200' disabled='{{isDetails}}' value='{{applyReason}}'> </textarea>
     </view>
@@ -67,5 +57,5 @@
 
 
 <button wx:if='{{!isDetails}}' class='comBtn' formType="submit" hover-class="commonclick-btn">提交申请</button>
-<button wx:if='{{isDetails}}'class='comBtn' hover-class="commonclick-btn" bindtap='cancelApply'>撤回</button>
-</form>
+<button wx:if='{{isDetails && invoicesStatus == 1}}'class='comBtn' hover-class="commonclick-btn" bindtap='cancelApply'>撤回</button>
+</form>

+ 7 - 2
pages/pointapply/pointapply.wxss

@@ -3,7 +3,12 @@
 }
 .right_sty{
   width: 50%;height: 100rpx;text-align: right;color: #666666;font-size: 30rpx;line-height: 100rpx;margin-right: 20rpx;
-}.input_sty{
+}
+.right_sty1{
+ height: 100rpx;color: #666666;font-size: 30rpx;padding-top: 20rpx;width: 70%;text-align: right;
+  line-height: 50rpx;
+}
+.input_sty{
   margin-top: 20rpx;
 }
 .righttextarea{
@@ -14,5 +19,5 @@
 }.nextImg{
   width: 20rpx;
   height: 30rpx;
-  text-align: left;margin:30rpx 10rpx;
+  text-align: right;margin:30rpx 20rpx;
 }

+ 106 - 0
pages/selectStaff/selectStaff.js

@@ -0,0 +1,106 @@
+var BASEURL = require('../../utils/wxconstant.js')
+var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
+
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    staffData:[]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var that = this
+    that.getStaffData()
+  },
+
+  getStaffData:function(){
+    var that = this
+    var data = {}
+    var url = baseUrl + BASEURL.getUrl.getAllEmp
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if (res.data.success && res.data.data){
+        that.setData({
+          staffData: res.data.data
+        })
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
+
+  itemClick: function (e) {
+    var that = this
+    let item = e.target.dataset.item
+    var pages = getCurrentPages()
+    var prevPage = pages[pages.length - 1]  //当前界面
+    var prevPage = pages[pages.length - 2]  //上一个页面
+
+    prevPage.setData({
+      itemPerson: item
+    })
+    console.log('item', item)
+
+    wx.navigateBack({
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/selectStaff/selectStaff.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "选择员工"
+}

+ 4 - 0
pages/selectStaff/selectStaff.wxml

@@ -0,0 +1,4 @@
+
+ <block wx:for='{{staffData}}'>
+       <button class='nav_right_items' bindtap="itemClick" data-item='{{item}}'>{{item.empName}}({{item.remarks}})</button>
+</block>

+ 5 - 0
pages/selectStaff/selectStaff.wxss

@@ -0,0 +1,5 @@
+.nav_right_items{
+  min-height:40px;
+  line-height: 40px;
+  margin: 6px 0;font-size: 24rpx;background-color: #fff;text-align: center;
+}

+ 115 - 0
pages/selectnorm/selectnorm.js

@@ -0,0 +1,115 @@
+// pages/ordermain/ordermain.js
+var Jsonutil = require('../../utils/JSONUtil.js')
+var BASEURL = require('../../utils/wxconstant.js')
+var baseUrl = BASEURL.BaseUrl()
+var baseutils = require('../../utils/baseUtils.js')
+var netUtil = require('../../utils/network.js')
+var isAddType = true //默认是加分申请规则
+
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+    navLeftItems: [],
+    navRightItems: [],
+    curName: '',
+    curIndex: 0,
+
+    NormData:[]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var id = options.getcategoryId
+    isAddType = options.getAddType
+    this.getNormByCategoryId(id)
+
+    console.log('isAddType', isAddType)
+  },
+
+  getNormByCategoryId:function(id){
+    var that = this
+
+    var data = { parentId:id}
+    var url = baseUrl + BASEURL.getUrl.getNormByCategoryId
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      // console.log('res='+JSON.stringify(res))
+      if(res.data.success && res.data.data){
+        var rightnorm = []
+        if (isAddType == true){
+          rightnorm = res.data.data[0].typedata.addnorm
+        }else{
+          rightnorm = res.data.data[0].typedata.minus
+        }
+        that.setData({
+          NormData: res.data.data,
+          curName: res.data.data[0].typeName,
+          navRightItems: rightnorm
+        })
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
+  switchRightTab:function(e){
+    var that = this
+    let itemname = e.target.dataset.itemname
+    var typedata = e.target.dataset.typedata
+    var rightnorm = []
+    if (isAddType == true) {
+      rightnorm = typedata.addnorm
+    } else {
+      rightnorm = typedata.minus
+    }
+    that.setData({
+      curName:itemname,
+      navRightItems: rightnorm
+    })
+
+    console.log('itemname', itemname)
+    console.log('typedata', typedata)
+  },
+  itemClick:function(e){
+    var that = this
+    let item = e.target.dataset.item
+
+    var pages = getCurrentPages()
+    var prevPage = pages[pages.length - 1]  //当前界面
+    var prevPage = pages[pages.length - 2]  //上一个页面
+
+    prevPage.setData({
+      itemNorm: item,
+    })
+    console.log('item', item)
+
+    wx.navigateBack({
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    var that = this
+    that.setData({
+      wxavatarUrl: wx.getStorageSync('wxavatarUrl'),
+      wxnickName: wx.getStorageSync('wxnickName')
+    })
+
+  }
+})

+ 3 - 0
pages/selectnorm/selectnorm.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "选择规范"
+}

+ 29 - 0
pages/selectnorm/selectnorm.wxml

@@ -0,0 +1,29 @@
+  <scroll-view scrool-y='true'>
+          <scroll-view scroll-y = "true" style="height:1200rpx;">
+            <view class="nav_left">
+              <block wx:for="{{NormData}}">
+                <view class="nav_left_items {{curName == item.typeName ? 'active' : ''}}" bindtap="switchRightTab" data-itemname="{{item.typeName}}" data-typedata='{{item.typedata}}'>{{item.typeName}}</view>
+              </block>
+             </view>
+        </scroll-view>
+
+
+        <view class="nav_right">
+            <scroll-view scroll-y = "true" style="height:1200rpx;">
+            <!--暂无数据  -->
+            <view  wx:if='{{noData}}' class='nodata_view'>
+              <view><image class='nodata_style' src='../../img/common_nodata.png'></image></view>
+              <!-- <view style='font-size:30rpx;text-align:top;'>暂无菜品</view>     -->
+            </view>
+
+             <block wx:for='{{navRightItems}}'>
+                <button class='nav_right_items' bindtap="itemClick" data-item='{{item}}'>{{item.normItem}}({{item.normScore}})</button>
+                <!-- <view class='commonhline' style='height:3rpx;'></view> -->
+             </block>
+          </scroll-view>
+      </view>
+  </scroll-view>
+
+
+
+  

+ 47 - 0
pages/selectnorm/selectnorm.wxss

@@ -0,0 +1,47 @@
+.nav_left{
+  display: inline-block;
+  width: 25%;
+  height: 100%;
+  background: #f5f5f5;
+  text-align: center;
+}
+
+
+.nav_left .nav_left_items{
+  height: 30px;
+  line-height: 30px;
+  padding: 6px 0;
+  border-bottom: 1px solid #dedede;
+  font-size: 24rpx;
+}.nav_left .nav_left_items.active{
+  background: #fff;
+}.nav_right{
+  position: absolute;
+  top: 0;
+  right: 0;
+  flex: 1;
+  width: 75%;
+  height: 100%;
+  padding: 10px;
+  background: #fff;
+  box-sizing: border-box;
+}
+.nav_right_items{
+  min-height:40px;
+  line-height: 40px;
+  margin: 6px 0;font-size: 24rpx;background-color: #fff;text-align: center;
+}
+
+/* start 无数据时 样式  */
+.nodata_style{
+  width:200rpx;
+  height:200rpx;
+  text-align:center;
+}
+.nodata_view{
+  display: flex;
+  flex-direction: column;
+  text-align:center;
+  margin-top:200rpx;
+}
+/* edn 无数据时 样式  */

+ 39 - 0
utils/JSONUtil.js

@@ -0,0 +1,39 @@
+function objToStrMap(obj) {
+  let strMap = new Map();
+  for (let k of Object.keys(obj)) {
+    strMap.set(k, obj[k]);
+  }
+  return strMap;
+}
+function strMapToObj(strMap) {
+  let obj = Object.create(null);
+  for (let [k, v] of strMap) {
+    obj[k] = v;
+  }
+  return obj;
+}
+function strMapToJson(strMap) {
+  return JSON.stringify(strMapToObj(strMap));
+}
+function mapToJson(map) {
+  return JSON.stringify([...map]);
+}
+
+/**
+ * 将map对象转换为JSONString
+ */
+function mapToJsonStr(strMap) {
+  return JSON.stringify(strMapToObj(strMap));
+}
+/**
+ * 将JSONString对象转换为map
+ */
+function jsonToStrMap(jsonStr) {
+  return objToStrMap(JSON.parse(jsonStr));
+}
+module.exports = {
+  mapToJsonStr: mapToJsonStr,
+  jsonToStrMap: jsonToStrMap,
+  strMapToJson: strMapToJson,
+  strMapToObj: strMapToObj
+}

+ 63 - 44
utils/baseUtils.js

@@ -1,52 +1,14 @@
 var netUtil = require('network.js')
 var baseUrl = require('wxconstant.js').BaseUrl()
+var getUrl = require('wxconstant.js').getUrl
+var dateutil = require('DateTime.js')
 
-//判断是否进行注册
-function judgeisReg(openid){
-  var url = baseUrl + 'loan/enterprise/getEnterpriseDO'
-  var data = {
-    openid: openid
-  }
-  netUtil.requestLoading(url, data, '正在请求...', 'POST', function (res) {
-    if (res.data.data) {
-      var isFinancing = res.data.data.isFinancing
-      var isRegistered = res.data.data.isRegistered
-      if (isRegistered == false){
-        wx.showModal({
-          title: '提示',
-          content: '您当前尚未进行注册认证,是否立即前去认证',
-          success:function(res){
-            console.log(res)
-            if (res.confirm == true && res.cancel == false){
-              wx.navigateTo({
-                url: '../registered/registered',
-              })
-            }
-          }
-        })
-      }
-      try {
-        wx.setStorageSync('isFinancing', isFinancing)
-        wx.setStorageSync('isRegistered', isRegistered)
-      } catch (e) {
-
-      }
-    }
-  }, function (res) {
-    wx.showToast({
-      title: '数据获取失败',
-      icon: 'none',
-      duration: 2000
-    })
-  })
-
-}
 //公用获取openid方法
 function getComOpenid(){
   var openid
   wx.login({
     success: function (res) {
-      var url = baseUrl + 'usr/getOpenid'
+      var url = baseUrl + getUrl.getOpenid
       if (res.code) {
         var data = {
           code: res.code
@@ -54,8 +16,8 @@ function getComOpenid(){
         netUtil.requestLoading(url, data, '正在请求...', 'GET', function (res) {
           if (res.data) {
             if (res.data.data.openid) {
-              wx.setStorageSync('openid', res.data.data.openid)
               openid = res.data.data.openid
+              wx.setStorageSync('openid', openid)
             }
           }
         }, function (res) {
@@ -68,10 +30,67 @@ function getComOpenid(){
       }
     }
   })
-
   return openid
 }
+
+/**
+ * 公共获取用户信息的方法 
+ */
+function getPersonlEmp(){
+  var data = { openid: wx.getStorageSync('openid') }
+  var url = baseUrl + getUrl.getEmp
+  netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+    if(res.data.success && res.data.data){
+      wx.setStorageSync("myInfoData", res.data.data)
+      // console.log('myInfoData', wx.getStorageSync('myInfoData'))
+    }
+  }, function (res) {
+    wx.showToast({
+      title: '加载数据失败',
+      icon: 'none',
+      duration: 2000
+    })
+  })
+}
+
+/**
+ * 公共获取用户是否关联绑定公司信息
+ */
+function judgeisReg(){
+  var data = {
+    openid: wx.getStorageSync('openid'),
+  }
+  var url = baseUrl + getUrl.getRank
+  netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+    if (res.data.success) {
+      var isregistered = res.data.data.isregistered
+      wx.setStorageSync('isregistered', isregistered)
+      if (!isregistered){
+        wx.showModal({
+          title: '提示',
+          content: '您当前尚未与企业关联绑定,是否立即去绑定?',
+          success: function (res) {
+            if (res.confirm) {
+              wx.navigateTo({
+                url: '../bindphone/bindphone',
+              })
+            } else if (res.cancel) {
+              return
+            }
+          }
+        })
+      }
+    }
+  }, function (res) {
+    wx.showToast({
+      title: '加载数据失败',
+      icon: 'none',
+      duration: 2000
+    })
+  })
+}
 module.exports = {
   judgeisReg: judgeisReg,
-  getComOpenid: getComOpenid
+  getComOpenid: getComOpenid,
+  getPersonlEmp: getPersonlEmp
 }

+ 1 - 1
utils/network.js

@@ -53,7 +53,7 @@ module.exports = {
 //引用:
 // var that = this
 // var data = { openid: wx.getStorageSync('openid') }
-// var url = baseUrl + 'usr/getUsr'
+// var url = baseUrl + BASEURL.getUrl.getAllNorm
 // netUtil.requestLoading(url, data, '正在加载数据...', 'POST', function (res) {
 
 // }, function (res) {

+ 23 - 3
utils/wxconstant.js

@@ -1,13 +1,33 @@
 function BaseUrl(){
-  var baseUrl = 'https://www.akuiguoshu.com/'
+  var baseUrl = 'http://192.168.253.130:8080/integral/'
   return baseUrl
 }
 function getTXMapApiKay(){
   return 'HPYBZ-IFY2J-E5KFY-K24IF-Q3UMS-GJFBV'
 }
 const getUrl = {
-  getOpenid:'fruits/wxpay/getOpenid',
-  getAd: 'fruits/fruits/ad/getAd',
+  getOpenid:'inte/employee/getOpenid', //获取Openid
+  Binding: 'inte/employee/binding', //关联用户
+  sendCode: 'inte/employee/sendCode', //获取验证码
+  getAd: 'inte/ad/getAd', //获取首页轮播图等
+  getRank: 'inte/score/getRank', //根据当前总积分取月排名
+  regist: 'inte/employee/regist', //员工注册
+  getDept: 'inte/department/getDept',  //获取公司部门列表
+  getCotegory: 'inte/category/getCotegory', //获得分类列表
+  getNorm: 'inte/norm/getNorm', //获取相应的规章制度详情
+  getAllApproval: 'inte/invoices/getAllApproval', //获取审批相关(待审批,已审批,发起)
+  saveMinusInvoices: 'inte/invoices/saveMinusInvoices', //保存扣积分
+  getAllRank: 'inte/invoices/getAllRank', //获取所有排名及加减分记录
+
+  getAllEmp: 'inte/employee/getAllEmp', //获取所有员工
+  getEmp: 'inte/employee/getEmp', //保存扣积分
+  getAllRank: 'inte/invoices/getAllRank', //获取所有排名及加减分记录
+  saveAddInvoices: 'inte/invoices/saveAddInvoices', //保存加积分
+  saveMinusInvoices: 'inte/invoices/saveMinusInvoices', //保存扣积分 
+  getNormByCategoryId: 'inte/norm/getNormByCategoryId', //获取分类下相应的规章制度
+  getInvoices: 'inte/invoices/getInvoices', //获取提交的单据详情  
+  withdrawInvoices: 'inte/invoices/withdrawInvoices', //撤回未审批的  
+  
 }
 module.exports = {
   BaseUrl: BaseUrl,