FANGLH 7 жил өмнө
parent
commit
1bd56dd094

+ 3 - 2
app.json

@@ -1,15 +1,16 @@
 {
   "pages": [
     "pages/home/home",
+    "pages/corporateInfo/corporateInfo",
+    "pages/pointRank/pointRank",
+    "pages/mine/mine",
     "pages/about/about",
     "pages/point/point",
     "pages/pointapply/pointapply",
     "pages/approval/approval",
-    "pages/mine/mine",
     "pages/perinfo/perinfo",
     "pages/register/register",
     "pages/applyjoinapprovel/applyjoinapprovel",
-    "pages/corporateInfo/corporateInfo",
     "pages/minusapply/minusapply",
     "pages/selectStaff/selectStaff",
     "pages/selectnorm/selectnorm",

BIN
img/home_banner1.png


BIN
img/home_banner2.png


BIN
img/logo_img.png


+ 1 - 0
pages/corporateInfo/corporateInfo.wxml

@@ -1,5 +1,6 @@
 <view class='commonhline' style='height:20rpx;'></view>
 
+<view ><image src='../../img/logo_img.png' class='logo_img_sty'></image></view>
 <view class='top_view'>
   <view><image class='img_sty' src='../../img/common_header_boy.png'></image></view>
   <view class='companyname_sty'>摩双子羯有限公司</view>

+ 2 - 0
pages/corporateInfo/corporateInfo.wxss

@@ -11,4 +11,6 @@
   margin-top: 17rpx; color: #333333;font-size: 30rpx;
 }.context_sty{
   font-size: 24rpx;color: #666666;padding: 5rpx 50rpx;
+}.logo_img_sty{
+  height: 80rpx;width: 180rpx;position: fixed;top: 5%;left: 5%;
 }

+ 2 - 2
pages/home/home.js

@@ -13,10 +13,10 @@ Page({
   data: {
     imgUrls: [
       {
-        "aa_urla": "../../img/home_banner.png"
+        "aa_urla": "../../img/home_banner1.png"
       },
       {
-        "aa_urla": "../../img/home_banner.png"
+        "aa_urla": "../../img/home_banner2.png"
       },
       {
         "aa_urla": "../../img/home_banner.png"

+ 1 - 3
pages/home/home.wxml

@@ -1,9 +1,7 @@
 <scroll-view scroll-y='true'>
   <view>
-
-
                 <!--start 轮播图片  -->
-      <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-active-color='#FF0000' bindchange="SIChange" style=' width:100%;height:392rpx;' circular='true'>
+      <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-active-color='#FF0000' bindchange="SIChange" style=' width:100%;height:300rpx;' circular='true'>
       <block wx:for="{{imgUrls}}">
         <swiper-item>
           <image src="{{item.aa_urla}}" class="slide-image" style='width:100%; height:392rpx;'  bindtap="clickGGItem" data-data="{{item}}"/>

+ 6 - 1
pages/mine/mine.js

@@ -13,6 +13,7 @@ Page({
    */
   data: {
    //id
+    idTypeRank:'idTypeRank',
     isregistered:false,
     idMyInfo:'idMyInfo',
     idCompanyInfo: 'idCompanyInfo',
@@ -64,7 +65,11 @@ Page({
       })
       return
     }
-   
+    if (id == that.data.idTypeRank){
+      wx.navigateTo({
+        url: '../pointRank/pointRank',
+      })
+    }
     if (!isregistered) {
       wx.showModal({
         title: '提示',

+ 20 - 13
pages/mine/mine.wxml

@@ -13,21 +13,21 @@
     <view class='loginname'>{{wxNickname}}</view>
     <view wx:if='{{!isregistered}}'  class='loginname' style='text-decoration:underline;' bindtap='btnClick' id='{{idgoBind}}'> 关联手机(企业信息)</view>
     </view>
+
+    <view class='headerdata commonHview'  wx:if='{{isLogin}}'>
+            <view style='width:50%;'>
+                <view class='h_data_left' wx:if='{{curmonth_points>0}}'>本月当前积分: <text class='h_data_right' >{{curmonth_points}}</text></view>
+                 <view class='h_data_left'  wx:else>本月当前积分: <text class='h_data_right1' style='color:#FF0000;'>{{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'>{{lastmonth_points}}</text></view>
+                <view class='h_data_left'>上月排名:<text class='h_data_right'>{{lastmonth_rank}}</text></view> 
+            </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' wx:if='{{curmonth_points>0}}'>本月当前积分: <text class='h_data_right' >{{curmonth_points}}</text></view>
-            <view class='h_data_left'  wx:else>本月当前积分: <text class='h_data_right1' style='color:#FF0000;'>{{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'>{{lastmonth_points}}</text></view>
-            <view class='h_data_left'>上月排名:<text class='h_data_right'>{{lastmonth_rank}}</text></view>
-        </view>
-    </view>
- </view>
+ 
     <view style='height:32rpx;width:100%;background-color:#F2F2F2;'></view>
 
 <view class='commonHview'  >
@@ -54,4 +54,11 @@
   </view>
  <view class='commonhline' style='height:3rpx;'></view>
 
+<view class='commonHview'  >
+    <view class='menuhview' bindtap='btnClick' id='{{idTypeRank}}'>
+    <view class='menuText1' >类别排名</view>
+    </view>
+    <view style='width:5%;' ><image class='nextImg' src='../../img/next.png'> </image></view>
+  </view>
+ <view class='commonhline' style='height:3rpx;'></view>
 </view>

+ 3 - 3
pages/mine/mine.wxss

@@ -26,9 +26,9 @@
 }.newHeaderView{
   z-index:99;position: fixed;left: 5%; display: flex;
   flex-direction: row;
-}.headerdata{
-   z-index:99;position: fixed;height: 220rpx;width: 560rpx;background: #FFF;
-   border-radius: 20rpx 20rpx 0 0;left: 13%;top: 18%;opacity: 0.9;
+}.headerdata{ 
+   z-index:99;position: fixed;height: 200rpx;width: 560rpx;background: #FFF;
+   border-radius: 20rpx 20rpx 0 0;left: 13%;top: 20%;opacity: 0.6;
 }
 .h_data_left{
 color:#666666;font-size:24rpx;margin-top: 30rpx;

+ 202 - 0
pages/pointRank/pointRank.js

@@ -0,0 +1,202 @@
+// pages/pointRank/pointRank.js
+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
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    lastTypeId:'',
+    firstType:'请选择',
+    secondType:'请选择',
+    pointData:[],
+    CotegoryArray: [],
+    Cotegory: [],
+    CotegoryArray2:[],
+    Cotegory2:[]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var that = this
+    // that.getRankData()
+    // return
+    that.getCotegory()//获得分类列表
+  },
+  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
+    var categoryName = that.data.Cotegory[e.detail.value].categoryName
+    if (categoryName && categoryId) {
+      that.setData({
+        firstType: categoryName,
+        CotegoryArray2: [],
+        Cotegory2: [],
+        secondType:'请选择',
+        lastTypeId: categoryId,
+        pointData: [],
+      })
+      that.getSecondType(categoryId)
+      that.getRankData(categoryId)
+    }
+  },
+  bindPickerChange2: function (e) {
+    var that = this
+    console.log('picker发送选择改变,携带值为', e.detail)
+    var lastTypeId
+    var secondTypeItem
+    if (that.data.Cotegory2[e.detail.value].typedata.addnorm){
+      secondTypeItem = that.data.Cotegory2[e.detail.value].typedata.addnorm[0]
+    } else if (that.data.Cotegory2[e.detail.value].typedata.minus){
+      secondTypeItem = that.data.Cotegory2[e.detail.value].typedata.minus[0]
+    }else {
+      return
+    }
+    lastTypeId = secondTypeItem.categoryId
+    var categoryName = that.data.Cotegory[e.detail.value].categoryName
+    if (categoryName && lastTypeId) {
+      that.setData({
+        lastTypeId: lastTypeId,
+        secondType: categoryName,
+        pointData: [],
+      })
+      that.getRankData(lastTypeId)
+    }
+  },
+
+
+  getSecondType: 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 array = []
+        for (var i = 0; i < res.data.data.length; i++) {
+          array[i] = res.data.data[i].typeName
+          if (i == res.data.data.length - 1) {
+            console.log('array', array)
+            that.setData({
+              CotegoryArray2: array,
+              Cotegory2:res.data.data
+            })
+          }
+        }
+
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
+
+  getRankData:function(id){
+    var that = this
+    id = 2
+    var data = { categoryId: id, pageCount: 20, pageSize: pageSize}
+    var url = baseUrl + BASEURL.getUrl.getByNormRank
+    netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
+      if (res.data.success && res.data.data) {
+        that.setData({
+          pointData: res.data.data
+        })
+      }
+    }, function (res) {
+      wx.showToast({
+        title: '加载数据失败',
+        icon: 'none',
+        duration: 2000
+      })
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/pointRank/pointRank.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "类别排名"
+}

+ 30 - 0
pages/pointRank/pointRank.wxml

@@ -0,0 +1,30 @@
+<template name='pointRankTem'>
+    <view class='commonHview' style='height:100rpx;'>
+          <view style='color:#333333;font-size:30rpx;text-align:left;margin:25rpx;width:50%;'>{{index}}.吴彦祖</view>
+          <view style='color:#666666;font-size:30rpx;text-align:right;margin:25rpx;width:50%;'>520131 积分</view>
+    </view>
+    <view class='commonhline' style='height:3rpx;'></view>
+</template>
+
+<view class='commonHview'>
+
+   <view class='select_item'><picker  bindchange="bindPickerChange" value="{{CotegoryArray[index]}}" range="{{CotegoryArray}}" >{{firstType}}</picker></view>
+   <view class='select_item'><picker bindchange="bindPickerChange2" value="{{CotegoryArray2[index]}}" range="{{CotegoryArray2}}" >{{secondType}}</picker></view>
+</view>
+
+
+ <block wx:for='{{pointData}}'>
+          <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'>{{item.empName}}</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.empName}}</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.empName}}</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.sums}} 积分</view>
+    </view>
+    <view class='commonhline' style='height:3rpx;'></view>
+</block>
+
+ <view wx:if='{{pointData.length == 0}}' class='nodata_view'>
+     <view><image class='nodata_style' src='../../img/common_nodata.png'></image></view> 
+</view> 

+ 3 - 0
pages/pointRank/pointRank.wxss

@@ -0,0 +1,3 @@
+.select_item{
+  height: 60rpx;width: 300rpx;background-color: #FF0000;font-size: 28rpx;color: #666666;line-height: 60rpx;text-align: center;margin: 20rpx 40rpx;border-radius: 20rpx;
+}

+ 6 - 3
pages/pointapply/pointapply.js

@@ -16,7 +16,8 @@ Page({
     applyName:'',
     applyStatus:'',
     applyTime:'',
-    itemNorm: { normItem: '请选择' },//所选规则数据
+    addPoints:'',
+    itemNorm: { normItem: '请选择', normScore:'' },//所选规则数据
     applyReason:'',
     CotegoryArray:[],
     Cotegory:[],
@@ -210,7 +211,8 @@ Page({
           applyName: res.data.data.fillName,
           applyNorm: res.data.data.normName,
           applyReason: res.data.data.reasons,
-          applyJob: res.data.data.fillStation
+          applyJob: res.data.data.fillStation,
+          addPoints: res.data.data.score
         })
       }
     }, function (res) {
@@ -262,7 +264,8 @@ Page({
   onShow: function () {
     var that = this
     that.setData({
-      applyNorm:that.data.itemNorm.normItem
+      applyNorm:that.data.itemNorm.normItem,
+      addPoints: that.data.itemNorm.normScore
     })
 
   },

+ 7 - 0
pages/pointapply/pointapply.wxml

@@ -48,6 +48,13 @@
 </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='{{addPoints}}'  type='text' name='addPoints' ></input></view>
+    </view>
+</view>
+<view class='commonhline' style='height:3rpx;'></view>
 
 <view class='commonHview'>
   <view class='left_sty' style='width: 10%;'>事由</view>

+ 2 - 0
utils/wxconstant.js

@@ -39,6 +39,8 @@ const getUrl = {
   withdrawInvoices: '/integral/inte/invoices/withdrawInvoices/', //撤回未审批的  
   approval: '/integral/inte/invoices/approval/', //审批  
   regist:'/integral/inte/employee/regist/',//员工注册
+  getByNormRank: '/integral/inte/invoices/getByNormRank/',//根据类别排序
+  getByNormIdRank: '/integral/inte/invoices/getByNormIdRank/'//规范明细排名
 }
 module.exports = {
   BaseUrl: BaseUrl,