Bladeren bron

小程序调整

zhangshuling 3 jaren geleden
bovenliggende
commit
dcf5b71ff6
6 gewijzigde bestanden met toevoegingen van 25 en 7 verwijderingen
  1. 4 0
      pages/index/index.js
  2. 3 0
      pages/makePiano/makePiano.js
  3. 3 4
      pages/piano/piano.js
  4. 4 1
      pages/piano/piano.wxml
  5. 10 1
      pages/piano/piano.wxss
  6. 1 1
      pages/pianoList/pianoList.js

+ 4 - 0
pages/index/index.js

@@ -256,6 +256,10 @@ Page({
     this.queryVideoShow(1)
   },
   loadIndexData: function () {
+    this.setData({
+      'stuShowList': [],
+      'teaShowList': [],
+    })
     const urls = urlDef.urls;
     //获取登录用户数据, 并加载首页数据
     util.apiPost(urls.get_cur_user, {}).then(rs => {

+ 3 - 0
pages/makePiano/makePiano.js

@@ -275,6 +275,9 @@ Page({
 
     let date = w.ds
     let week = w.ws
+    if(week == 0){
+      week = 7
+    }
 
     let params = { 'q.orgId': sid, 'q.studentId': this.data.curStu.studentId, 'q.date': date, 'q.week': week, 'q.timeScope': this.data.timeScope }
     // params['q.timeScope'] = ''; 时段

+ 3 - 4
pages/piano/piano.js

@@ -50,7 +50,8 @@ Page({
     let edd = new Date(now.setDate(now.getDate() + 7));
     let ed = util.formatTime(edd).substring(0, 10).replace(/\//g, '-')
     const date = new Date()
-    this.setData({ beginDate: date.getFullYear()+"-01"+"-01", endDate: ed, list: [] });
+    let m = date.getMonth() + 1;
+    this.setData({ beginDate: date.getFullYear()+"-"+ (m>9 ? '' +m : '0'+m) +"-01", endDate: ed, list: [] });
     this.queryList();
   },
 
@@ -124,8 +125,6 @@ Page({
   },
   canCancel(item) { // 判断是否能取消, 未到预约时间前都能取消,至少提前1个小时
     let t = item.visitDate + ' ' + item.beginTime + ':00';
- 
-
     let vdt = new Date(t.replace(/-/g,'/'));
     let tdt = new Date().getTime();
     if (vdt < tdt) {
@@ -133,7 +132,7 @@ Page({
     }
     // const dayTime = 86400000;
     const dayTime = 3600000;
-    return (vdt - tdt) >= dayTime
+    return item.attend == 0 && (vdt - tdt) >= dayTime
   },
   doCancel: function (e) {
     let id = e.currentTarget.dataset.id

+ 4 - 1
pages/piano/piano.wxml

@@ -14,7 +14,10 @@
       <view>
         <view class="piano-date">
         {{item.createdDate}}
-      </view>
+        </view>
+      <view class="class-status" wx:if="{{item.attend == 0}}">已预约</view>
+      <view class="class-status" wx:if="{{item.attend == 1}}">已点名</view>
+      <view class="class-status" wx:if="{{item.attend == 2}}">已缺勤</view>
       <view class="class-btn" bindtap="doCancel" data-id="{{item.id}}" wx:if="{{item.cancelFlag}}">取消预约</view>
       </view>
     </view>

+ 10 - 1
pages/piano/piano.wxss

@@ -148,7 +148,16 @@ page{
   height: 60rpx;
   line-height: 60rpx;
   position: relative;
-  top: 50rpx;
+  top: 30rpx;
   border-radius: 50rpx;
   font-size: 28rpx;
 }
+
+.class-status{
+  color: #999;
+  text-align: center;
+  height: 30rpx;
+  line-height: 30rpx;
+  position: relative;
+  font-size: 26rpx;
+}

+ 1 - 1
pages/pianoList/pianoList.js

@@ -86,7 +86,7 @@ Page({
     const urls = urlDef.urls;
     let stu = wx.getStorageSync('student');
     if (stu) {
-      let params = {}
+      let params = {'q.status':1}
       params.pageNum = this.data.pageNum
       util.apiPost(urls.get_piano_card_list, params).then(rs => {
         let list = rs.list