Browse Source

Merge branch 'master' of http://git.dgtis.com/qxp/dorm-manager

yanym 5 years ago
parent
commit
e46750fce8
29 changed files with 373 additions and 311 deletions
  1. 2 3
      dorm-manager-wx/app.json
  2. BIN
      dorm-manager-wx/images/audio.png
  3. BIN
      dorm-manager-wx/images/message.png
  4. BIN
      dorm-manager-wx/images/video.png
  5. BIN
      dorm-manager-wx/images/wenhua.png
  6. 9 8
      dorm-manager-wx/pages/login/index.js
  7. 1 1
      dorm-manager-wx/pages/login/index.wxml
  8. 29 29
      dorm-manager-wx/pages/login/login.js
  9. 13 7
      dorm-manager-wx/pages/student/application/application.js
  10. 2 1
      dorm-manager-wx/pages/student/application/application.json
  11. 1 1
      dorm-manager-wx/pages/student/facephoto/facephoto.js
  12. 2 1
      dorm-manager-wx/pages/student/facephoto/facephoto.json
  13. 25 92
      dorm-manager-wx/pages/student/menu/menu.js
  14. 2 1
      dorm-manager-wx/pages/student/menu/menu.json
  15. 5 5
      dorm-manager-wx/pages/student/menu/menu.wxml
  16. 13 2
      dorm-manager-wx/pages/student/pass/pass.js
  17. 2 1
      dorm-manager-wx/pages/student/pass/pass.json
  18. 14 21
      dorm-manager-wx/pages/student/pass/pass.wxml
  19. 4 0
      dorm-manager-wx/pages/student/pass/pass.wxss
  20. 52 9
      dorm-manager-wx/pages/student/statistics/statistics.js
  21. 2 1
      dorm-manager-wx/pages/student/statistics/statistics.json
  22. 26 17
      dorm-manager-wx/pages/student/statistics/statistics.wxml
  23. 7 0
      dorm-manager-wx/pages/student/statistics/statistics.wxss
  24. 69 57
      dorm-manager-wx/pages/user/index.js
  25. 10 1
      dorm-manager-wx/pages/user/index.wxml
  26. 34 1
      dorm-manager-wx/pages/user/index.wxss
  27. 6 4
      dorm-manager-wx/pages/user/setting/index.js
  28. 8 2
      dorm-manager-wx/project.config.json
  29. 35 46
      dorm-manager-wx/utils/api.js

+ 2 - 3
dorm-manager-wx/app.json

@@ -40,20 +40,19 @@
     "pages/user/complaint/complaint",
     "pages/test/test",
     "pages/user/complaintDetail/complaintDetail",
-    
     "pages/student/menu/menu",
     "pages/student/application/application",
     "pages/student/facephoto/facephoto",
     "pages/student/statistics/statistics",
     "pages/student/pass/pass",
-
     "pages/teacher/menu/menu",
     "pages/teacher/visitorcheck/visitorcheck",
     "pages/teacher/statistics/statistics",
     "pages/teacher/pass/pass",
     "pages/teacher/visitorcheckdetail/visitorcheckdetail",
     "pages/teacher/warning/warning",
-    "pages/teacher/facephoto/facephoto"
+    "pages/teacher/facephoto/facephoto",
+    "pages/student/user/user"
   ],
   "window": {
     "navigationBarBackgroundColor": "#fff",

BIN
dorm-manager-wx/images/audio.png


BIN
dorm-manager-wx/images/message.png


BIN
dorm-manager-wx/images/video.png


BIN
dorm-manager-wx/images/wenhua.png


+ 9 - 8
dorm-manager-wx/pages/login/index.js

@@ -15,7 +15,7 @@ const app = getApp(),
 
 Page({
   data: {
-    tab: ['个人', '法人']
+    tab: ['微信授权登录']
   },
   onLoad() {
     const identity = wx.getStorageSync("identity") | 0
@@ -27,13 +27,14 @@ Page({
     this.setData({ identity })
   },
   async wxLogin({ detail: { userInfo } }) {
-    const { data: { identity = 0 } } = this,
-      code = await new Promise(_ => wx.login({ success: ({ code }) => _(code) })),
-      { userId, _err } = await post(login, { userInfo: { ...userInfo, identity }, code });
-    if (_err) return _err.status && showTip('登录失败');
-    showTip('登录成功')
-    wx.setStorageSync('userId', app.globalData.userId = userId)
-    identity != this.identity && wx.setStorageSync('identity', identity)
+    wx.setStorageSync('userInfo', userInfo)
+    // const { data: { identity = 0 } } = this,
+    //   code = await new Promise(_ => wx.login({ success: ({ code }) => _(code) })),
+    //   { userId, _err } = await post(login, { userInfo: { ...userInfo, identity }, code });
+    // if (_err) return _err.status && showTip('登录失败');
+    // showTip('登录成功')
+    // wx.setStorageSync('userId', app.globalData.userId = userId)
+    // identity != this.identity && wx.setStorageSync('identity', identity)
     navigateBack()
   },
 

+ 1 - 1
dorm-manager-wx/pages/login/index.wxml

@@ -1,4 +1,4 @@
-<view class='switch'>
+<view class='switch' style="display:none">
   <view wx:for='{{tab}}' bindtap='select' data-identity='{{index}}' class="{{index== identity ?'select':''}}">
     {{item}}
   </view>

+ 29 - 29
dorm-manager-wx/pages/login/login.js

@@ -1,7 +1,5 @@
 // pages/login/login.js
 const api = require('../../utils/api.js');
-const app=getApp();
-
 Page({
 
   /**
@@ -18,30 +16,32 @@ Page({
       index: e.detail.value
     })
   },
-  formSubmit(e) {
-    let that = this
-    if (!e.detail.value.account && !e.detail.value.password) {
+  formSubmit(e){
+    let that=this
+    if (!e.detail.value.account && !e.detail.value.password){
       wx.showToast({
         title: '请输入账号或密码',
-        icon: 'none'
+        icon:'none'
       })
       return false;
     }
     wx.request({
       url: api.userLogin,
-      method: 'GET',
-      data: {
-        loginId: e.detail.value.account,
-        loginPwd: e.detail.value.password
+      method:'GET',
+      data:{
+        loginId:e.detail.value.account,
+        loginPwd:e.detail.value.password
       },
-      success(res) {
-        if (res.data.status == 'success') {
-          wx.setStorageSync('loginId', e.detail.value.account)
-          wx.setStorageSync('lnkjUserInfo', res.data.data)
-          wx.switchTab({
-            url: '/pages/student/menu/menu',
-          })
-        } else {
+      success(res){
+        if(res.data.status=='success'){
+          if(that.data.index==0){//学生端
+            wx.setStorageSync('user', res.data.data)
+            wx.setStorageSync('loginId', e.detail.value.account)
+            wx.switchTab({
+              url: '/pages/student/menu/menu',
+            })
+          }
+        }else{
           wx.showToast({
             title: res.data.message,
             icon: 'none'
@@ -53,65 +53,65 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function(options) {
+  onLoad: function (options) {
 
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function() {
-    if (wx.getStorageSync('loginId')) {
+  onReady: function () {
+    if (wx.getStorageSync('loginId')){
       wx.showLoading({
         title: '正在自动登录',
       })
-      setTimeout(function() {
+      setTimeout(function(){
         wx.switchTab({
           url: '/pages/student/menu/menu',
         })
-      }, 1000)
+      },1000)
     }
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function() {
+  onShow: function () {
 
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide: function() {
+  onHide: function () {
 
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function() {
+  onUnload: function () {
 
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh: function() {
+  onPullDownRefresh: function () {
 
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function() {
+  onReachBottom: function () {
 
   },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function() {
+  onShareAppMessage: function () {
 
   }
 })

+ 13 - 7
dorm-manager-wx/pages/student/application/application.js

@@ -1,11 +1,11 @@
-// pages/student/application/application.js
+const api = require('../../../utils/api.js');
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    array: ['中国', '美国', '巴西', '日本'],
+    array: ['身份证', '护照', '临时身份证', '军官证'],
     index:0,
     codetext:'获取验证码',
     current:0
@@ -45,7 +45,7 @@ Page({
       that.data.codetext--
     }, 1000);
     wx.request({
-      url: app.sendPhoneCode,
+      url: api.sendPhoneCode,
       data: { 'phone': that.data.phone},
       success(res){
         console.log(res)
@@ -91,7 +91,7 @@ Page({
       return false
     }
     wx.uploadFile({
-      url: 'http://192.168.100.234:8080/oneportal/visitor/editorAlumniVisitor.if',
+      url: api.editorAlumniVisitor,
       filePath: that.data.photo[0],
       header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8', },
       name: 'file',
@@ -106,12 +106,18 @@ Page({
           'remarks': '',
       },
       success(res) {
-        console.log(res)
-        if (JSON.parse(res.data).youtuMessage.errorno == 0) {
-          wx.showToast({
+        console.log(JSON.parse(res.data))
+        res = JSON.parse(res.data)
+        if (res.errno == 0) {
+          wx.showToast({ 
             title: '上传成功',
             icon: 'none'
           })
+        }else{
+          wx.showToast({
+            title: res.data,
+            icon: 'none'
+          })
         }
       }
     })

+ 2 - 1
dorm-manager-wx/pages/student/application/application.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "访客申请"
 }

+ 1 - 1
dorm-manager-wx/pages/student/facephoto/facephoto.js

@@ -1,4 +1,4 @@
-// pages/student/facephoto/facephoto.js
+const api = require('../../../utils/api.js');
 Page({
 
   /**

+ 2 - 1
dorm-manager-wx/pages/student/facephoto/facephoto.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "人脸自助"
 }

+ 25 - 92
dorm-manager-wx/pages/student/menu/menu.js

@@ -5,143 +5,76 @@ Page({
    * 页面的初始数据
    */
   data: {
-    roleType: '',
-    menuStudent: [{
-        'title': '人脸自助',
-        imagename: 'facephoto',
-        left: '#fec38f',
-        right: '#ff8980'
-      },
-      {
-        'title': '访客申请',
-        imagename: 'application',
-        left: '#bdc1ff',
-        right: '#ac8efd'
-      },
-      {
-        'title': '通行记录',
-        imagename: 'pass',
-        left: '#9fd9fc',
-        right: '#7abcf2'
-      },
-      {
-        'title': '考勤统计',
-        imagename: 'statistics',
-        left: '#ffca93',
-        right: '#fdb957'
-      }
-    ],
-    listStudent: [{
-      'title': '报修服务',
-      nav: 'baoxiu'
-    }, {
-      'title': '快递物流',
-      nav: 'kuaidi'
-    }, {
-      'title': '投诉建议',
-      nav: 'tousu'
-    }, {
-      'title': '问卷调查',
-      nav: 'diaocha'
-    }],
-    menuTeacher: [{
-        'title': '人脸自助',
-        imagename: 'facephoto',
-        left: '#fec38f',
-        right: '#ff8980'
-      },
-      {
-        'title': '访客审核',
-        imagename: 'visitorcheck',
-        left: '#bdc1ff',
-        right: '#ac8efd'
-      },
-      {
-        'title': '通行记录',
-        imagename: 'pass',
-        left: '#9fd9fc',
-        right: '#7abcf2'
-      },
-      {
-        'title': '考勤统计',
-        imagename: 'statistics',
-        left: '#ffca93',
-        right: '#fdb957'
-      }
-    ],
-    listTeacher: [{
-      'title': '预紧提醒',
-      nav: 'yujing-2',
-      url: 'warning'
-    }, {
-      'title': '报表管理',
-      nav: 'baobiaoguanli'
-    }, {
-      'title': '投诉建议',
-      nav: 'tousu'
-    }, {
-      'title': '报修管理',
-      nav: 'baoxiu'
-    }]
+    menu: [
+     { 'title': '人脸自助', imagename: 'facephoto',left:'#fec38f',right:'#ff8980' },
+      { 'title': '访客申请', imagename: 'application', left: '#bdc1ff', right: '#ac8efd' },
+      { 'title': '通行记录', imagename: 'pass', left: '#9fd9fc', right: '#7abcf2' }, 
+      { 'title': '考勤统计', imagename: 'statistics', left: '#ffca93', right: '#fdb957' }
+     ],
+    list: [{ 'title': '报修服务', nav: 'baoxiu' }, 
+    { 'title': '快递物流', nav: 'kuaidi' }, 
+    { 'title': '投诉建议', nav: 'tousu' }, 
+    { 'title': '问卷调查', nav: 'diaocha' }]
+  },
+  check:function(){
+    wx.showToast({
+      title: '开发维护中',
+      icon:'none'
+    })
   },
-
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function(options) {
-    const that = this;
-    let roleType = wx.getStorageSync('lnkjUserInfo').roleType;
-    that.setData({
-      roleType: roleType
-    })
+  onLoad: function (options) {
+
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function() {
+  onReady: function () {
 
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function() {
+  onShow: function () {
 
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide: function() {
+  onHide: function () {
 
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function() {
+  onUnload: function () {
 
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh: function() {
+  onPullDownRefresh: function () {
 
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function() {
+  onReachBottom: function () {
 
   },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function() {
+  onShareAppMessage: function () {
 
   }
 })

+ 2 - 1
dorm-manager-wx/pages/student/menu/menu.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "宿管大厅"
 }

+ 5 - 5
dorm-manager-wx/pages/student/menu/menu.wxml

@@ -1,6 +1,6 @@
 <view class="menu">
-  <block wx:for='{{roleType==10001?menuTeacher:menuStudent}}' wx:key='{{index}}'>
-    <navigator url="/pages/{{roleType==10001?'teacher':'student'}}/{{item.imagename}}/{{item.imagename}}">
+  <block wx:for='{{menu}}' wx:key='{{index}}'>
+    <navigator url="../{{item.imagename}}/{{item.imagename}}">
       <view class="menu-list" style="background-image: linear-gradient(to right, {{item.left}} , {{item.right}});">
         <image class="menu-icon" src='/images/{{item.imagename}}.png'></image>
         <view class='menu-title'>{{item.title}}</view>
@@ -9,9 +9,9 @@
   </block>
 </view>
 <view class="list">
-  <block wx:for='{{roleType==10001?listTeacher:listStudent}}' wx:key='{{index}}'>
-    <navigator url="/pages/{{roleType==10001?'teacher':'student'}}/{{item.url}}/{{item.url}}">
-      <view class="line">
+  <block wx:for='{{list}}' wx:key='{{index}}'>
+    <navigator url="">
+      <view catchtap="check" class="line">
         <view class="list-title">
           <image src='/images/{{item.nav}}.png'></image>
           <view>{{item.title}}</view>

+ 13 - 2
dorm-manager-wx/pages/student/pass/pass.js

@@ -113,12 +113,23 @@ Page({
   req(time){
     let that=this
     wx.request({
-      url: app.getAccessInfo,
+      url: api.getAccessInfo,
       method: 'GET',
       data: { 'loginId': wx.getStorageSync('loginId'), 'time': time },
       success(res) {
         wx.hideLoading()
-        console.log(res)
+        if (res.data.data.length==0){
+          that.setData({
+            dataList: res.data.data
+          })
+          return false
+        }
+        for (let index in res.data.data){
+          res.data.data[index].openTime = (new Date(parseInt(res.data.data[index].openTime)).toLocaleString().replace(/:\d{1,2}$/, ' ')).split(' ')[1]
+        }
+        that.setData({
+          dataList:res.data.data
+        })
       }
     })
   }

+ 2 - 1
dorm-manager-wx/pages/student/pass/pass.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "通行记录"
 }

+ 14 - 21
dorm-manager-wx/pages/student/pass/pass.wxml

@@ -1,3 +1,4 @@
+<wxs module="filter" src="tool.wxs"></wxs>
 <view class='wrap'>
     <view>
         <view class='date-show'>
@@ -19,26 +20,18 @@
     </view>
 </view>
 <view class="list">
-  <view class="line">
-    <view class="line-top">
-      <view class="line-ps" style="background:#3e61fd"></view>
-      <view class="line-data">08:34</view>
-      <view class="line-title">正常外出</view>
+  <block wx:for='{{dataList}}' wx:key='{{index}}'>
+    <view class="line">
+      <view class="line-top">
+        <view class="line-ps" style="background:#3e61fd"></view>
+        <view class="line-data">{{item.openTime}}</view>
+        <view class="line-title">{{item.state}}</view>
+      </view>
+      <view class="line-bottom">
+        <image src="/images/dizhi.png"></image>
+        <view>{{item.deviceName}}</view>
+      </view>
     </view>
-    <view class="line-bottom">
-      <image src="/images/dizhi.png"></image>
-      <view>电子学院一号宿舍楼东门</view>
-    </view>
-  </view>
-  <view class="line">
-    <view class="line-top">
-      <view class="line-ps" style="background:#3e61fd"></view>
-      <view class="line-data">08:34</view>
-      <view class="line-title">正常外出</view>
-    </view>
-    <view class="line-bottom">
-      <image src="/images/dizhi.png"></image>
-      <view>电子学院一号宿舍楼东门</view>
-    </view>
-  </view>
+  </block>
+  <view class="nodata">{{dataList.length==0?'暂无数据':''}}</view>
 </view>

+ 4 - 0
dorm-manager-wx/pages/student/pass/pass.wxss

@@ -158,4 +158,8 @@
   font-size: 30rpx;
   color: #666;
   margin-left: 10rpx;
+}
+.nodata{
+  text-align: center;
+  margin: 30rpx 0rpx;
 }

+ 52 - 9
dorm-manager-wx/pages/student/statistics/statistics.js

@@ -1,6 +1,6 @@
 var wxCharts = require('../../../utils/wxcharts.js');
 var data = require('../../../utils/util.js');
-var app = getApp();
+const api = require('../../../utils/api.js');
 var ringChart = null;
 Page({
   data: {
@@ -9,30 +9,73 @@ Page({
     this.setData({
       startdata: e.detail.value
     })
+    this.req(e.detail.value,this.data.enddata)
   },
-  bindendDateChange(){
+  bindendDateChange(e){
     this.setData({
       enddata: e.detail.value
     })
+    this.req(this.data.startdata, e.detail.value)
   },
   touchHandler: function (e) {
     console.log(ringChart.getCurrentDataIndex(e));
   },
   onLoad(options){
     let that=this
+    this.data.startdata = data.getDateStr(data.formatDate(), -30)
+    this.data.enddata = data.formatDate()
+    this.req(this.data.startdata, this.data.enddata)
+    this.setData({
+      user:wx.getStorageSync('user')
+    })
+  },
+  req: function (start,end){
+    let that = this
     wx.request({
-      url: app.selfInfo,
-      data: { 
-        loginId: wx.getStorageSync('loginId'), 
-        start: data.getDateStr(data.formatDate(), -30),
-        end: data.formatDate()
+      url: api.selfInfo,
+      data: {
+        loginId: wx.getStorageSync('loginId'),
+        start: start,
+        end: end
       },
       success(res) {
-        console.log(res)
+        // res.data.data.nomalInTimes=130
+        // res.data.data.nomalOutTimes = 40
+        // res.data.data.laterTimes = 50
+        // res.data.data.UnreturnedTimes = 20
+        that.setData({
+          data: res.data.data
+        })
+        ringChart.updateData({
+          title: {
+            name: '汇总'
+          },
+          subtitle: {
+            color: '#333333'
+          },
+          series: [{
+            name: '成交量1',
+            data: res.data.data.nomalInTimes,
+            stroke: false
+          }, {
+            name: '成交量2',
+              data: res.data.data.nomalOutTimes,
+            stroke: false
+          }, {
+            name: '成交量3',
+              data: res.data.data.laterTimes,
+            stroke: false
+          }, {
+            name: '成交量4',
+              data: res.data.data.UnreturnedTimes,
+            stroke: false
+          }],
+        });
       }
     })
   },
   onReady: function (e) {
+    let that=this
     this.setData({
       enddata:data.formatDate(),
       startdata: data.getDateStr(data.formatDate(),-30)
@@ -67,7 +110,7 @@ Page({
       },
       series: [{
         name: '正常进入',
-        data: 15,
+        data: 25,
         stroke: false,
         color:'#6282f4'
       }, {

+ 2 - 1
dorm-manager-wx/pages/student/statistics/statistics.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "考勤统计"
 }

+ 26 - 17
dorm-manager-wx/pages/student/statistics/statistics.wxml

@@ -1,7 +1,7 @@
 <view class="top">
   <view class="top-line">
     <view class="top-name">姓名:</view>
-    <view class="top-content">王孤独</view>
+    <view class="top-content">{{user.userName}}</view>
   </view>
   <view class="top-line">
     <view class="top-name">开始日期:</view>
@@ -33,44 +33,53 @@
   <view class="charts-right">
     <view class="charts-line">
       <view class="charts-icon1 charts-icon"></view>
-      <view class="charts-data">正常进入:314次</view>
+      <view class="charts-data">正常进入:{{data.nomalInTimes}}次</view>
     </view>
     <view class="charts-line">
       <view class="charts-icon2 charts-icon"></view>
-      <view class="charts-data">正常外出:314次</view>
+      <view class="charts-data">正常外出:{{data.nomalOutTimes}}次</view>
     </view>
     <view class="charts-line">
       <view class="charts-icon3 charts-icon"></view>
-      <view class="charts-data">  晚归:314次</view>
+      <view class="charts-data">  晚归:{{data.laterTimes}}次</view>
     </view>
     <view class="charts-line">
       <view class="charts-icon4 charts-icon"></view>
-      <view class="charts-data"> 未归寝:314次</view>
+      <view class="charts-data"> 未归寝:{{data.UnreturnedTimes}}次</view>
     </view>
   </view>
 </view>
 <view class="bottom">
   <view class="bottom-view">
-    <view class="bottom-line">
-      <view class="bottom-bigback bottom-bigback1">
-        <view class="bottom-smllback bottom-smllback1">
-          <text>1次</text>
+    <view>
+      <view class="bottom-line">
+        <view class="bottom-bigback bottom-bigback1">
+          <view class="bottom-smllback bottom-smllback1">
+            <text>2次</text>
+          </view>
         </view>
       </view>
+      <view class="bottom-title">1日未归寝</view>
     </view>
-    <view class="bottom-line">
-      <view class="bottom-bigback bottom-bigback2">
-        <view class="bottom-smllback bottom-smllback2">
-          <text>2次</text>
+    <view>
+      <view class="bottom-line">
+        <view class="bottom-bigback bottom-bigback2">
+          <view class="bottom-smllback bottom-smllback2">
+            <text>2次</text>
+          </view>
         </view>
       </view>
+      <view class="bottom-title">1日未归寝</view>
     </view>
-    <view class="bottom-line">
-      <view class="bottom-bigback bottom-bigback3">
-        <view class="bottom-smllback bottom-smllback3">
-          <text>3次</text>
+    <view>
+      <view class="bottom-line">
+        <view class="bottom-bigback bottom-bigback3">
+          <view class="bottom-smllback bottom-smllback3">
+            <text>2次</text>
+          </view>
         </view>
       </view>
+      <view class="bottom-title">1日未归寝</view>
     </view>
   </view>
 </view>

+ 7 - 0
dorm-manager-wx/pages/student/statistics/statistics.wxss

@@ -11,6 +11,7 @@ page{
 }
 .top-line{
   height: 60rpx;
+  line-height: 60rpx;
   display: flex;
   margin-top: 20rpx;
   padding: 0rpx 56rpx;
@@ -168,4 +169,10 @@ page{
 }
 .bottom-smllback3{
   background-image: linear-gradient(to right, #8fa5f5 , #7893f3);
+}
+.bottom-title{
+  text-align: center;
+  font-size: 24rpx;
+  color:#333;
+  margin-top: 10rpx;
 }

+ 69 - 57
dorm-manager-wx/pages/user/index.js

@@ -12,72 +12,72 @@ const app = getApp(),
 Page({
   onLoad() {
     this.setData({
-      topList: [
-        {
-          title: '系统消息',
-          icon: 'systemMsg',
-          url: 'message/index',
-        },
-        {
-          title: '用户信息',
-          icon: 'material',
-          url: 'myInfo/index',
-        },
-        {
-          title: '一键定位',
-          icon: 'nav',
-          url: 'localtion/index',
-        }
-      ],
+      // topList: [
+      //   {
+      //     title: '系统消息',
+      //     icon: 'systemMsg',
+      //     url: 'message/index',
+      //   },
+      //   {
+      //     title: '用户信息',
+      //     icon: 'material',
+      //     url: 'myInfo/index',
+      //   },
+      //   {
+      //     title: '一键定位',
+      //     icon: 'nav',
+      //     url: 'localtion/index',
+      //   }
+      // ],
       list: [
         {
-          title: '我的办件',
-          icon: 'banjian',
-          url: 'handling/handling',
+          title: '个人信息',
+          icon: 'user-icon',
+          url: '../student/user/user',
 
         },
-        {
-          title: '我的预约',
-          icon: 'yuyue',
-          url: 'reservation/index',
+        // {
+        //   title: '我的预约',
+        //   icon: 'yuyue',
+        //   url: 'reservation/index',
 
-        },
+        // },
         // {
         //   title: '我的排队',
         //   icon: 'paidui',
         //   url: '',
         // },
-        {
-          title: '我的材料',
-          icon: 'cailiao',
-          url: 'myData/myData',
+        // {
+        //   title: '我的材料',
+        //   icon: 'cailiao',
+        //   url: 'myData/myData',
 
-        },
-        {
-          title: '我的收藏',
-          icon: 'shoucang',
-          url: 'myCollect/index',
+        // },
+        // {
+        //   title: '我的收藏',
+        //   icon: 'shoucang',
+        //   url: 'myCollect/index',
 
-        },
-        {
-          title: '我的评价',
-          icon: 'assess',
-          url: 'assess/assess',
+        // },
+        // {
+        //   title: '我的评价',
+        //   icon: 'assess',
+        //   url: 'assess/assess',
 
-        },
-        {
-          title: '我的咨询',
-          icon: 'zixun',
-          url: 'advisory/advisory',
-        },
-        {
-          title: '我的投诉',
-          icon: 'tousu',
-          url: 'complaint/complaint',
-        },
+        // },
+        // {
+        //   title: '我的咨询',
+        //   icon: 'zixun',
+        //   url: 'advisory/advisory',
+        // },
+        // {
+        //   title: '我的投诉',
+        //   icon: 'tousu',
+        //   url: 'complaint/complaint',
+        // },
         {
           title: '我的设置',
-          icon: 'shezhi',
+          icon: 'setting',
           url: 'setting/index',
         }
       ]
@@ -85,13 +85,25 @@ Page({
     })
   },
   async onShow() {
-    let { viewName = '', photo = '' } = await getUserInfo()
-    this.setData({
-      photo,
-      viewName
+    let userInfo = wx.getStorageSync('userInfo')
+    if (!userInfo){
+      let { viewName = '', photo = '' } = await getUserInfo()
+      this.setData({
+        photo,
+        viewName
+      })
+    }else{
+      this.setData({
+        photo: userInfo.avatarUrl,
+        viewName: userInfo.nickName
+      })
+    }
+  },
+  navigate_auth:function(e){
+    wx.navigateTo({
+      url: e.currentTarget.dataset.url,
     })
-
   },
   goLogin,
-  navigate_auth_native
+  // navigate_auth_native
 })

+ 10 - 1
dorm-manager-wx/pages/user/index.wxml

@@ -15,4 +15,13 @@
     </view>
   </view>
 </view>
-<list template="nav" templateList="{{list}}"></list>
+<!-- <list template="nav" templateList="{{list}}"></list> -->
+<block wx:for='{{list}}' wx:for-key='{{index}}'>
+  <view class='nav' catchtap='navigate_auth' data-url='{{item.url}}'>
+    <image class='nav-icon' src='/images/{{item.icon}}.png' mode="widthFix" />
+    <view class='nav-content'>
+      <text>{{item.title}}</text>
+      <image src='/images/jiantou.png'></image>
+    </view>
+  </view>
+</block>

+ 34 - 1
dorm-manager-wx/pages/user/index.wxss

@@ -1,6 +1,6 @@
 .top{
   position: relative;
-  height: 420rpx;
+  /* height: 420rpx; */
   
 }
 .top-bg{
@@ -63,3 +63,36 @@
   margin-top: 20rpx;
 }
 
+
+
+/* components/item/index.wxss */
+/* 导航 */
+.nav{
+  padding:   30rpx;
+   border-bottom: 1rpx solid #efefef;
+  display: flex;
+  align-items: center;
+  background: white;
+}
+/* .nav-icon{
+  line-height: 0;
+} */
+.nav-icon {
+  width:34rpx;
+}
+.nav-content{
+  margin-left: 20rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  width: 100%;
+}
+.nav-content text{
+  font-size: 30rpx;
+  color: #333;
+}
+.nav-content image{
+  width: 14rpx;
+  height: 26rpx;
+  /* margin-right: 30rpx; */
+}

+ 6 - 4
dorm-manager-wx/pages/user/setting/index.js

@@ -23,10 +23,12 @@ Page({
     wx.showModal({
       content: '确定退出登录?',
       success: async ({ confirm }) => {
-        if (!confirm) return
-        logout()
-        await goHome()
-        showTip('已退出')
+        if (confirm){
+          wx.clearStorageSync()
+          wx.reLaunch({
+            url: '/pages/login/login',
+          })
+        }
       }
 
     })

+ 8 - 2
dorm-manager-wx/project.config.json

@@ -19,7 +19,7 @@
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.8.1",
-	"appid": "wxd70b689f20c7fd7f",
+	"appid": "wxc5354a2bae93233c",
 	"projectname": "dorm-manager-wx",
 	"isGameTourist": false,
 	"simulatorType": "wechat",
@@ -42,7 +42,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 34,
+			"current": 35,
 			"list": [
 				{
 					"id": 0,
@@ -288,6 +288,12 @@
 					"pathName": "pages/teacher/menu/menu",
 					"query": "flag=1&preService=PERSON_ZT&code=31&titleName=其他",
 					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "我的信息",
+					"pathName": "pages/student/user/user",
+					"scene": null
 				}
 			]
 		}

+ 35 - 46
dorm-manager-wx/utils/api.js

@@ -1,5 +1,5 @@
 //index 0开发环境   1测试环境   2正式环境
-const index = 0,
+const index = 2,
   api = {
     login: 'auth/login_by_weixin', //登录
     getMyPrivateMsgCount: 'message/getMyPrivateMsgCount', //加载是否有未读消息
@@ -8,8 +8,8 @@ const index = 0,
     clubDetails: 'organize/detail', //  委办局详情
     guidanceDocList: 'items/guidanceDocList', // 服务大厅 办事指南 
     newsDetail: 'news/read', //新闻详情
-    newsList: 'news/list', //新闻列表
-    allDept: 'getAllVillagesDept.if',
+    newsList: 'news/list',   //新闻列表
+    allDept:'getAllVillagesDept.if',
 
     // level: 'getAllDeptByLevel.if', //服务大厅部门类别
     // levelDetail: 'getPreServiceByParam.if', //服务大厅事项列表
@@ -20,9 +20,9 @@ const index = 0,
 
     reservationDetail: 'reservation/getInfo.if', //预约详情	
     reservationCancel: 'reservation/cancel.if', //取消预约
-    reservationSave: 'reservation/save.if', //在线预约
+    reservationSave: 'reservation/save.if',//在线预约
     reservationServiceList: 'getReservationServiceList.if', //可预约部门列表
-    reservationDateStatus: 'reservation/getReservationCount.if', //查询事项某个日期的预约情况
+    reservationDateStatus: 'reservation/getReservationCount.if',//查询事项某个日期的预约情况
     myCase: 'getPreApasinfoListByUserId.if', //我的办件
     // param: 'getPreServiceByParam.if', //事项办理
     caseDetail: 'getPreApasinfoDetails.if', //办件详情
@@ -39,9 +39,9 @@ const index = 0,
     // LevelDetail: 'getPreServiceByParam.if', //服务大厅事项列表
     // Guide: 'getPreServiceByUnid.if',//查询办事详情
     // MyReservation: 'reservation/getPageList.if',//我的预约
-    ReservationDetail: 'reservation/getInfo.if', //预约详情
-    ReservationCancel: 'reservation/cancel.if', //取消预约
-    sendVerifCode: '/sms//sendVerifCode.if', //发送短信验证码
+    ReservationDetail: 'reservation/getInfo.if',//预约详情
+    ReservationCancel: 'reservation/cancel.if',//取消预约
+    sendVerifCode: '/sms//sendVerifCode.if',//发送短信验证码
 
     // Param: 'getPreServiceByParam.if',//事项办理
     // Code: 'getClassificationByCode.if',//证件类型
@@ -50,67 +50,56 @@ const index = 0,
     // UploadImg: 'uploadFile.if',//上传
     // SetImg: 'material/getList',//选择我的材料,材料列表
     // SaveDataName: 'material/save',//保存我的材料,设置材料名称
-    Apasinfo: 'savePreApasinfo.if', //提交在线办理表单
-    UploadAudio: 'getPreServiceByServiceName.if', //语音文件上传
-    HotService: 'getHotServiceList.if', //搜索咨询对象
+    Apasinfo: 'savePreApasinfo.if',//提交在线办理表单
+    UploadAudio: 'getPreServiceByServiceName.if',//语音文件上传
+    HotService: 'getHotServiceList.if',//搜索咨询对象
     // myData: 'material/getList',//我的材料
     // addData: 'material/save',//上传资料
     // deleteData: 'material/delete',//删除材料
-    advisoryList: 'consulting/getListPage', //我的咨询
-    advisoryDetail: 'consulting/getInfo', //咨询详情
+    advisoryList: 'consulting/getListPage',//我的咨询
+    advisoryDetail: 'consulting/getInfo',//咨询详情
 
 
     // new apis
 
-    departments: 'getAllDeptByLevel.if', //部门列表
+    departments: 'getAllDeptByLevel.if',//部门列表
     server: 'getClassificationByCode.if', //根据code得到相应类型
     handles: 'getPreServiceByParam.if', //服务大厅事项列表
     guide: 'getPreServiceByUnid.if',
     getUser: 'user/getUserInfo', //获取用户信息
     updateUser: 'user/updateUserInfo', //更新用户信息
     uploadImg: 'uploadFile.if', //上传图片
-    myMaterial: 'material/getList', //我的材料
-    addMaterial: 'material/save', //上传资料
-    delMaterial: 'material/delete', //删除材料
+    myMaterial: 'material/getList',//我的材料
+    addMaterial: 'material/save',//上传资料
+    delMaterial: 'material/delete',//删除材料
     myReservation: 'reservation/getPageList.if', //我的预约
 
-    addCollect: 'collect/save', //添加收藏
-    delCollect: 'collect/cancel', //删除收藏
+    addCollect: 'collect/save',//添加收藏
+    delCollect: 'collect/cancel',//删除收藏
     myCollection: 'collect/getListByUserId', //我的收藏 
-    verifSmsCode: 'sms/verifSmsCode.if', //验证手机验证码是否正确
-    evaluate: 'evaluate/save.if', //增加评价
-    evaluateList: 'evaluate/list.if', //评价列表
-    evaluateInfo: 'evaluate/info.if', //评价详情
+    verifSmsCode:'sms/verifSmsCode.if',//验证手机验证码是否正确
+    evaluate:'evaluate/save.if',//增加评价
+    evaluateList:'evaluate/list.if',//评价列表
+    evaluateInfo:'evaluate/info.if',//评价详情
 
 
 
 
     // 宿管系统--学生端
-    getAccessInfo: 'access/getAccessInfo.if', //通行记录
-    sendPhoneCode: 'visitor/sendPhoneCode.if', //访客申请
-    userLogin: 'appletLogin/userLogin.if', //登录
-    selfInfo: 'access/selfInfo.if', //访客统计
-
-    //宿管系统--教师端
-    getDeptInfo: 'deptInfo/getDeptInfolevel.if', //获取学院信息
-    getRegisterInfo: 'dormManage/registerInfo.if', //获取注册和未注册的用户信息
-    getVisitorCheckInfo: 'visitor/visitorInfo.if', //获取审批中和已审批的访客信息
-    getDeviceInfo: 'access/selectDevices.if', //获取所有设备信息
-    getPassInfo: '/access/getAccess.if', //通行记录
-    getStatisticsInfo: '/access/statistics.if', //考勤统计
-    getOutAndInInfo: '/access/outAndIn.if', //已出已归记录
-    getVisitorInfo: '/visitor/searchInviteVisitor.if', //查询访客详情
-    getVisitorCheck: '/visitor/approvalAlumniVisitor.if', //访客信息审批
-    getUnInfo: '/access/unIn.if' //未归记录
+    getAccessInfo: 'access/getAccessInfo.if',//发送短信验证码
+    sendPhoneCode:'visitor/sendPhoneCode.if',//访客申请
+    userLogin:'appletLogin/userLogin.if',//登录
+    selfInfo:'access/selfInfo.if',//访客统计
+    editorAlumniVisitor:'visitor/editorAlumniVisitor.if',//访客申请
+    getUserInfo:'userinfo/getUserInfo.if'//查询用户信息
   },
-  [root] = [
-    ["http://10.32.2.209:7088/oneportal/"],
-    // ["http://192.168.0.27:9082/wx/"],
-    ["http://192.168.0.27:8080/wx/"],
-    ["https://zhll.dgtis.com/wx/"]
-  ][index]
+  [oneportal, root] =
+    [["http://192.168.100.234:8080/oneportal/", "https://zhll.dgtis.com/wx/"],
+      ["http://192.168.100.254:9082/wx/", "https://zhll.dgtis.com/wx/"],
+      ["https://dorm.dgtis.com/oneportal/", "https://zhll.dgtis.com/wx/"]][index]
 Object.keys(api).forEach(x => {
   let v = api[x]
-  api[x] = `${root}${v}`
+  api[x] = `${/\.if$/.test(v) ? oneportal : root}${v}`
+  // api[x] = `${root}${v}`
 })
 module.exports = api