Browse Source

教师端接口调试

yanym 5 years ago
parent
commit
86137d2c97

+ 97 - 21
dorm-manager-wx/pages/student/menu/menu.js

@@ -5,76 +5,152 @@ Page({
    * 页面的初始数据
    */
   data: {
-    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' }]
+    userInfo: '',
+    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'
+    }]
   },
-  check:function(){
+  check: function() {
     wx.showToast({
       title: '开发维护中',
-      icon:'none'
+      icon: 'none'
     })
   },
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
-
+  onLoad: function(options) {
+    const that = this;
+    let userInfo = wx.getStorageSync('lnkjUserInfo');
+    that.setData({
+      userInfo: userInfo
+    })
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  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() {
 
   }
 })

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

@@ -1,6 +1,6 @@
 <view class="menu">
-  <block wx:for='{{menu}}' wx:key='{{index}}'>
-    <navigator url="../{{item.imagename}}/{{item.imagename}}">
+  <block wx:for='{{userInfo.roleType==10001?menuTeacher:menuStudent}}' wx:key='{{index}}'>
+    <navigator url="/pages/{{userInfo.roleType==10001?'teacher':'student'}}/{{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,8 +9,8 @@
   </block>
 </view>
 <view class="list">
-  <block wx:for='{{list}}' wx:key='{{index}}'>
-    <navigator url="">
+  <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="check" class="line">
         <view class="list-title">
           <image src='/images/{{item.nav}}.png'></image>

+ 1 - 1
dorm-manager-wx/pages/student/pass/pass.wxml

@@ -1,4 +1,4 @@
-<wxs module="filter" src="tool.wxs"></wxs>
+<!-- <wxs module="filter" src="tool.wxs"></wxs> -->
 <view class='wrap'>
     <view>
         <view class='date-show'>