Browse Source

整合学生端和教师端

wangjinbiao 5 years ago
parent
commit
c6979f0042

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

@@ -49,12 +49,13 @@
     "pages/teacher/visitorcheck/visitorcheck",
     "pages/teacher/statistics/statistics",
     "pages/teacher/pass/pass",
-    "pages/teacher/suggestion/list",
-    "pages/teacher/suggestion/detail",
     "pages/teacher/visitorcheckdetail/visitorcheckdetail",
     "pages/teacher/warning/warning",
     "pages/teacher/facephoto/facephoto",
-    "pages/student/user/user"
+    "pages/student/user/user",
+    "pages/student/proposal/proposal",
+    "pages/student/proposalList/proposalList",
+    "pages/student/proposalDetails/proposalDetails"
   ],
   "window": {
     "navigationBarBackgroundColor": "#fff",

+ 9 - 6
dorm-manager-wx/pages/student/menu/menu.js

@@ -41,7 +41,9 @@ Page({
       },
       {
         'title': '投诉建议',
-        nav: 'tousu'
+        nav: 'tousu',
+        url:'proposal',
+        status:true
       },
       {
         'title': '问卷调查',
@@ -76,22 +78,23 @@ Page({
     listTeacher: [{
       'title': '预警提醒',
       nav: 'yujing-2',
-      Url: 'warning',
       url: 'warning'
     }, {
       'title': '报表管理',
       nav: 'baobiaoguanli'
     }, {
       'title': '投诉建议',
-      nav: 'tousu',
-      Url: 'suggestion',
-      url: 'list'
+      nav: 'tousu'
     }, {
       'title': '报修管理',
       nav: 'baoxiu'
     }]
   },
-  check: function() {
+  check: function(e) {
+    console.log(e)
+    if(e.currentTarget.dataset.status){
+      return false
+    }
     wx.showToast({
       title: '模块开发中',
       icon: 'none'

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

@@ -10,8 +10,8 @@
 </view>
 <view class="list">
   <block wx:for='{{userInfo.roleType==10001?listTeacher:listStudent}}' wx:key='{{index}}'>
-    <navigator url="/pages/{{userInfo.roleType==10001?'teacher':'student'}}/{{item.Url}}/{{item.url}}">
-      <view catchtap="{{item.url?'':'check'}}" class="line">
+    <navigator url="/pages/{{userInfo.roleType==10001?'teacher':'student'}}/{{item.url}}/{{item.url}}">
+      <view catchtap="{{item.url?'':'check'}}" data-status="{{item.status}}" data-url="{{item.url}}" class="line">
         <view class="list-title">
           <image src='/images/{{item.nav}}.png'></image>
           <view>{{item.title}}</view>

+ 7 - 4
dorm-manager-wx/pages/student/pass/pass.js

@@ -124,13 +124,16 @@ Page({
           })
           return false
         }
-        debugger
         for (let index in res.data.data){
-          res.data.data[index].openTime = new Date(res.data.data[index].openTime).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ").split(' ')[1];
+          var date = new Date(res.data.data[index].openTime);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+          var h = date.getHours() < 10 ? '0' + date.getHours()+':' : date.getHours() + ':';
+          var m = date.getMinutes() < 10 ? '0' + date.getMinutes()+':' : date.getMinutes() + ':';
+          var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
+          res.data.data[index].openTime = h + m + s;
+        }
         that.setData({
-          dataList:res.data.data
+          dataList: res.data.data
         })
-        }
       }
     })
   }

+ 4 - 0
dorm-manager-wx/pages/student/statistics/statistics.js

@@ -25,6 +25,9 @@ Page({
   },
   req: function (start,end){
     let that = this
+    wx.showLoading({
+      title: '正在加载',
+    })
     wx.request({
       url: api.selfInfo,
       data: {
@@ -37,6 +40,7 @@ Page({
         // res.data.data.nomalOutTimes = 40
         // res.data.data.laterTimes = 50
         // res.data.data.UnreturnedTimes = 20
+        wx.hideLoading()
         that.setData({
           data: res.data.data
         })

+ 12 - 7
dorm-manager-wx/pages/user/index.js

@@ -18,7 +18,13 @@ Page({
         {
           title: '个人信息',
           icon: 'user-icon',
-          url: '../student/user/user',
+          url: '/pages/student/user/user',
+
+        },
+        {
+          title: '我的投诉建议',
+          icon: 'user-icon',
+          url: '/pages/student/proposalList/proposalList',
 
         },
         {
@@ -33,7 +39,7 @@ Page({
   onShow() {
     let userInfo = wx.getStorageSync('user')
     this.setData({
-      photo: userInfo.headImage ? api.total.split('.if')[0] + userInfo.headImage :'/images/head.png',
+      photo: userInfo.headImage ? api.total.split('.if')[0]+userInfo.headImage :'/images/default-urser.png',
       viewName: userInfo.userName
     })
     // if (!userInfo){
@@ -73,13 +79,12 @@ Page({
           },
           success(res) {
             wx.hideLoading()
-            console.log(res)
             if (JSON.parse(res.data).status == true) {
-              let user = wx.getStorageSync('userInfo')
-              user.avatarUrl = api.total.split('.if')[0] + JSON.parse(res.data).headImage
-              wx.setStorageSync('userInfo', user)
+              let user = wx.getStorageSync('user')
+              user.headImage =  JSON.parse(res.data).headImage
+              wx.setStorageSync('user', user)
               that.setData({
-                photo: user.avatarUrl
+                photo: api.total.split('.if')[0]+user.headImage
               })
               wx.showToast({
                 title: '修改成功',

+ 8 - 13
dorm-manager-wx/utils/api.js

@@ -92,10 +92,12 @@ const index = 2,
     selfInfo: 'access/selfInfo.if', //访客统计
     editorAlumniVisitor: 'visitor/editorAlumniVisitor.if', //访客申请
     getUserInfo: 'userinfo/getUserInfo.if', //查询用户信息
-    updateUserHeadImage: 'userinfo/updateUserHeadImage.if', //上传用户和底库图片
-    updateimage: 'userinfo/updateImage.if', //修改用户头像
-    getYouTuImage: 'userinfo/getYouTuImage.if', //获取学生人脸自助上传图片
-
+    updateUserHeadImage: 'userinfo/updateUserHeadImage.if',//上传用户和底库图片
+    updateimage: 'userinfo/updateImage.if',//修改用户头像
+    getYouTuImage: 'userinfo/getYouTuImage.if',//获取学生人脸自助上传图片
+    submitPropose:'proposePort/submitPropose.if',//投诉建议
+    findProposeList:'proposePort/findProposeList.if',//投诉建议查询列表
+    findProposeDetails:'proposePort/findProposeDetails.if',//投诉建议列表明细
     //宿管系统--教师端
     getDeptInfo: 'deptInfo/getDeptInfolevel.if', //获取学院信息
     getRegisterInfo: 'dormManage/registerInfo.if', //获取注册和未注册的用户信息
@@ -103,17 +105,10 @@ const index = 2,
     getDeviceInfo: 'access/selectDevices.if', //获取所有设备信息
     getPassInfo: '/access/getAccess.if', //通行记录
     getStatisticsInfo: '/access/statisticsBy.if', //考勤统计
+    getOutAndInInfo: '/access/outAndIn.if', //已出已归记录
     getVisitorInfo: '/visitor/searchInviteVisitor.if', //查询访客详情
     getVisitorCheck: '/visitor/approvalAlumniVisitor.if', //访客信息审批
-    getunInByCount: '/access/unInByCount.if', //按天查询未归记录
-    getOutAndInInfo: '/access/InAndOut.if', //已出已归记录
-    getUnInInfo: '/access/unIn.if', //未归记录
-    getLateIn: '/access/lateIn.if', //晚归记录
-    getInUnOunt: '/access/InUnOunt.if', //未出记录
-    getUnOut: '/access/unOut.if', //查询没有进出记录的人员情况
-    getSuggestionList: '/proposePort/findProposeList.if', //获取投诉列表
-    getSuggestionDetail: '/proposePort/findProposeDetails.if', //获取投诉列表详情
-    getSuggestionResponse: '/proposePort/answerPropose.if', //投诉建议回复
+    getUnInfo: '/access/unIn.if', //未归记录
 
     total: '.if', //图片拼接域名
   },