Kaynağa Gözat

整合学生端和教师端

wangjinbiao 5 yıl önce
ebeveyn
işleme
5e789b1b77

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

@@ -99,6 +99,9 @@ Page({
             title: '上传成功',
             title: '上传成功',
             icon:'none'
             icon:'none'
           })
           })
+          that.setData({
+            msg:''
+          })
           // if (that.data.pathscount==1){
           // if (that.data.pathscount==1){
           //   wx.redirectTo({
           //   wx.redirectTo({
           //     url: '/pages/success/index',
           //     url: '/pages/success/index',
@@ -124,13 +127,18 @@ Page({
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
     let that=this
     let that=this
+    wx.showLoading({
+      title: '正在加载',
+    })
     wx.request({
     wx.request({
       url: api.getYouTuImage,
       url: api.getYouTuImage,
       data:{loginId:wx.getStorageSync('loginId')},
       data:{loginId:wx.getStorageSync('loginId')},
       success(res){
       success(res){
+        wx.hideLoading()
         that.setData({
         that.setData({
           ditufile: res.data.img?api.total.split('.if')[0] + res.data.img:'',
           ditufile: res.data.img?api.total.split('.if')[0] + res.data.img:'',
-          fengmianfile: res.data.showImg? api.total.split('.if')[0] + res.data.showImg:''
+          fengmianfile: res.data.showImg? api.total.split('.if')[0] + res.data.showImg:'',
+          msg:res.data.msg=='Success'?'':res.data.msg
         })
         })
       }
       }
     })
     })

+ 1 - 0
dorm-manager-wx/pages/student/facephoto/facephoto.wxml

@@ -16,4 +16,5 @@
     </view>
     </view>
   </view>
   </view>
 </view>
 </view>
+<view style="text-align:center;color:red;margin-top:30rpx;">{{msg}}</view>
 <!-- <button bindtap="submit">提交</button> -->
 <!-- <button bindtap="submit">提交</button> -->

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

@@ -126,11 +126,11 @@ Page({
         }
         }
         debugger
         debugger
         for (let index in res.data.data){
         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]
-        }
+          res.data.data[index].openTime = new Date(res.data.data[index].openTime).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ").split(' ')[1];
         that.setData({
         that.setData({
           dataList:res.data.data
           dataList:res.data.data
         })
         })
+        }
       }
       }
     })
     })
   }
   }

+ 31 - 82
dorm-manager-wx/pages/user/index.js

@@ -1,35 +1,19 @@
 const api = require('../../utils/api.js');
 const api = require('../../utils/api.js');
-const app = getApp(),
-  {
-    globalData: {
-      util: {
-        regeneratorRuntime,
-        goLogin,
-        navigate_auth_native,
-        getUserInfo
-      }
-    }
-  } = app;
+// const app = getApp(),
+//   {
+//     globalData: {
+//       util: {
+//         regeneratorRuntime,
+//         goLogin,
+//         navigate_auth_native,
+//         getUserInfo
+//       }
+//     }
+//   } = app;
 Page({
 Page({
   onLoad() {
   onLoad() {
+    
     this.setData({
     this.setData({
-      // topList: [
-      //   {
-      //     title: '系统消息',
-      //     icon: 'systemMsg',
-      //     url: 'message/index',
-      //   },
-      //   {
-      //     title: '用户信息',
-      //     icon: 'material',
-      //     url: 'myInfo/index',
-      //   },
-      //   {
-      //     title: '一键定位',
-      //     icon: 'nav',
-      //     url: 'localtion/index',
-      //   }
-      // ],
       list: [
       list: [
         {
         {
           title: '个人信息',
           title: '个人信息',
@@ -37,45 +21,6 @@ Page({
           url: '../student/user/user',
           url: '../student/user/user',
 
 
         },
         },
-        // {
-        //   title: '我的预约',
-        //   icon: 'yuyue',
-        //   url: 'reservation/index',
-
-        // },
-        // {
-        //   title: '我的排队',
-        //   icon: 'paidui',
-        //   url: '',
-        // },
-        // {
-        //   title: '我的材料',
-        //   icon: 'cailiao',
-        //   url: 'myData/myData',
-
-        // },
-        // {
-        //   title: '我的收藏',
-        //   icon: 'shoucang',
-        //   url: 'myCollect/index',
-
-        // },
-        // {
-        //   title: '我的评价',
-        //   icon: 'assess',
-        //   url: 'assess/assess',
-
-        // },
-        // {
-        //   title: '我的咨询',
-        //   icon: 'zixun',
-        //   url: 'advisory/advisory',
-        // },
-        // {
-        //   title: '我的投诉',
-        //   icon: 'tousu',
-        //   url: 'complaint/complaint',
-        // },
         {
         {
           title: '我的设置',
           title: '我的设置',
           icon: 'shezhi',
           icon: 'shezhi',
@@ -85,20 +30,24 @@ Page({
 
 
     })
     })
   },
   },
-  async onShow() {
-    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
-      })
-    }
+  onShow() {
+    let userInfo = wx.getStorageSync('user')
+    this.setData({
+      photo: userInfo.headImage ? api.total.split('.if')[0] + userInfo.headImage :'/images/head.png',
+      viewName: userInfo.userName
+    })
+    // if (!userInfo){
+    //   let { viewName = '', photo = '' } = await getUserInfo()
+    //   this.setData({
+    //     photo,
+    //     viewName
+    //   })
+    // }else{
+    //   this.setData({
+    //     photo: userInfo.avatarUrl,
+    //     viewName: userInfo.nickName
+    //   })
+    // }
   },
   },
   navigate_auth:function(e){
   navigate_auth:function(e){
     wx.navigateTo({
     wx.navigateTo({
@@ -142,6 +91,6 @@ Page({
       },
       },
     })
     })
   },
   },
-  goLogin,
+  // goLogin,
   // navigate_auth_native
   // navigate_auth_native
 })
 })