Bläddra i källkod

更新代码10-28

wangjinbiao 5 år sedan
förälder
incheckning
de11b9e25f

+ 4 - 4
dorm-manager-wx/pages/home/index.js

@@ -26,20 +26,20 @@ Page({
     iconList: [{
       picUrl: '/images/message.png',
       content: '通知公告',
-      url: '/pages/home/list/index'
+      url: './list/index?type=administrationInfo&title=行政动态'
     },
     {
       picUrl: '/images/video.png',
       content: '媒体科大',
-      url: '/pages/home/list/index'
+      url: './list/index?type=servicePacesetter&title=服务标兵'
     }, {
       picUrl: '/images/audio.png',
       content: '科大视听',
-      url: '/pages/home/list/index'
+      url: './list/index?type=administrationInfo&title=行政动态'
     }, {
       picUrl: '/images/wenhua.png',
       content: '校园文化',
-      url: '/pages/home/list/index'
+      url: './list/index?type=administrationInfo&title=行政动态'
     }
     ],
 

+ 10 - 9
dorm-manager-wx/pages/login/login.js

@@ -6,8 +6,8 @@ Page({
    * 页面的初始数据
    */
   data: {
-    array: ['学生', '教师'],
-    index: 0,
+    // array: ['学生', '教师'],
+    // index: 0,
   },
 
   bindPickerChange(e) {
@@ -33,13 +33,14 @@ Page({
         loginPwd:e.detail.value.password
       },
       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',
-            })
+        debugger
+        if (res.data.status =='success'){//10001:老师,10002:学生
+          wx.setStorageSync('user', res.data.data)
+          wx.setStorageSync('loginId', e.detail.value.account)
+          if (res.data.data.roleType=='10002'){
+              wx.switchTab({
+                url: '/pages/student/menu/menu',
+              })
           }
         }else{
           wx.showToast({

+ 2 - 2
dorm-manager-wx/pages/login/login.wxml

@@ -2,14 +2,14 @@
   <view class="top">
     <image mode="aspectFill" src='/images/logo.png'></image>
   </view>
-  <view class="picker">
+  <!-- <view class="picker">
     <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
       <view class="weui-input">
         <span>{{array[index]}}</span>
         <image src='/images/jiantou-bottom.png'></image>
       </view>
     </picker>
-  </view>
+  </view> -->
   <view class="input">
     <input placeholder="请输入您的账号" name='account' placeholder-class="plac"></input>
   </view>

+ 1 - 0
dorm-manager-wx/pages/login/login.wxss

@@ -2,6 +2,7 @@
 .top{
   text-align: center;
   margin-top: 120rpx;
+  margin-bottom: 100rpx;
 }
 .top image{
   width: 220rpx;

+ 75 - 0
dorm-manager-wx/pages/student/user/user.js

@@ -0,0 +1,75 @@
+const api = require('../../../utils/api.js');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+    let that=this
+    wx.request({
+      url: api.getUserInfo,
+      data:{loginId:wx.getStorageSync('loginId')},
+      success(res){
+        that.setData({
+          student:res.data
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
dorm-manager-wx/pages/student/user/user.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "个人信息"
+}

+ 22 - 0
dorm-manager-wx/pages/student/user/user.wxml

@@ -0,0 +1,22 @@
+<view class="list">
+  <view class="line">
+    <view>学生姓名:</view>
+    <input value="{{student.name}}"></input>
+  </view>
+  <view class="line">
+    <view>所属院系:</view>
+    <input value="{{student.parentDeptName}}"></input>
+  </view>
+  <view class="line">
+    <view>所属班级:</view>
+    <input value="{{student.deptName}}"></input>
+  </view>
+  <view class="line">
+    <view>所属宿舍:</view>
+    <input value="{{student.roomName}}"></input>
+  </view>
+  <view class="line">
+    <view>联系电话:</view>
+    <input value="{{student.phone}}"></input>
+  </view>
+</view>

+ 28 - 0
dorm-manager-wx/pages/student/user/user.wxss

@@ -0,0 +1,28 @@
+page{
+  background: #f5f5f5
+}
+.list{
+  width: 100%;
+  background:#fff;
+}
+.line{
+  width: 690rpx;
+  margin: 0 auto;
+  display: flex;
+  height: 60rpx;
+  align-items: center;
+  border-bottom: 1rpx solid #f5f5f5;
+  padding-top: 30rpx;
+}
+.line view{
+  font-size: 28rpx;
+  color:#333;
+}
+.line input{
+  font-size: 28rpx;
+  color:#333;
+  margin-left: 20rpx;
+}
+.list :last-child{
+  border:none;
+}

+ 1 - 1
dorm-manager-wx/pages/user/index.js

@@ -77,7 +77,7 @@ Page({
         // },
         {
           title: '我的设置',
-          icon: 'setting',
+          icon: 'shezhi',
           url: 'setting/index',
         }
       ]

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

@@ -36,7 +36,7 @@ Page({
   },
   preview: function () {
     wx.previewImage({
-      urls: ['http://img.mp.itc.cn/upload/20160428/b52be3dc215d4ecd844bf922be46f278_th.jpg'],
+      urls: ['https://mp.weixin.qq.com/wxopen/qrcode?action=download&fakeid=3827135683&token=849973044&type=0&pixsize=336&line_r=undefined&line_g=undefined&line_b=undefined'],
     })
   }
 })