Bladeren bron

我的课表 数据对接

zhangshuling 4 jaren geleden
bovenliggende
commit
dee4a6030a
3 gewijzigde bestanden met toevoegingen van 33 en 27 verwijderingen
  1. 11 4
      pages/Components/classList/classList.js
  2. 20 1
      pages/Components/classList/classList.wxml
  3. 2 22
      pages/schedule/schedule.wxml

+ 11 - 4
pages/Components/classList/classList.js

@@ -4,13 +4,20 @@ Component({
    * 组件的属性列表
    */
   properties: {
-    showLeaveNum:{
-      type:Boolean,
+    showLeaveNum: {
+      type: Boolean,
       value: false
     },
     showFlag:{
       type: Boolean,
       value: true
+    },
+    date: {
+      type: String
+    },
+    list: {
+      type: Array,
+      value: []
     }
   },
 
@@ -18,14 +25,14 @@ Component({
    * 组件的初始数据
    */
   data: {
-    
+
   },
 
   /**
    * 组件的方法列表
    */
   methods: {
-    getLeaveNumList:function(){
+    getLeaveNumList: function () {
       wx.navigateTo({
         url: '/pages/leaveRecord/leaveRecord',
       })

+ 20 - 1
pages/Components/classList/classList.wxml

@@ -1,4 +1,5 @@
 <view class="class-container">
+  <!--
   <view class="class-view">
     <view class="class-date">2021-02-22 星期一</view>
     <view class="class-list">
@@ -18,6 +19,24 @@
       </view>
     </radio-group>
     </view>
-    
+  </view>-->
+
+  <view class="class-view">
+    <view class="class-date">{{date}} {{week}}</view>
+    <view class="class-list">
+      <view class="class-box" wx:for="{{list}}" wx:key="index">
+        <view class="class-name"><text class="class-type">{{item.kindId == 1 ? '1v1':'集体'}}</text>{{item.classesName}}</view>
+        <view class="class-time">{{item.bt}} ~ {{item.et}}</view>
+        <view class="class-room">{{item.roomName}}</view>
+        <view class="class-flag">
+          <span wx:if="{{item.status == 0 || item.status == 11 || item.status == 12 || item.status == 4}}">{{item.isAttend == 1 ?'已' : '待'}}上课</span>
+          <span wx:if="{{item.status == 2}}">已请假</span>
+          <span wx:if="{{item.status == 3}}">已调出</span>
+          <span wx:if="{{item.status == 11 || item.status == 12}}">加课</span>
+          <span wx:if="{{item.status == 5}}">补课</span>
+        </view>
+        <view class="class-teacher">老师:{{item.teacherName}}</view>
+      </view>
+    </view>
   </view>
 </view>

+ 2 - 22
pages/schedule/schedule.wxml

@@ -1,31 +1,11 @@
 <view class="container">
 
   <!-- 日历组件 -->
-  <view class="calendar">
-    <calendar spot="{{eventList}}" bind:change="callSelectDate"></calendar>
-  </view>
+  <calendar spot="{{eventList}}" bind:change="callSelectDate"></calendar>
   <!-- end -->
 
   <!-- 课表列表 -->
-  <view class="class-view">
-    <view class="class-date">{{date}} {{week}}</view>
-    <view class="class-list">
-      <view class="class-box" wx:for="{{dateList}}" wx:key="index">
-        <view class="class-name"><text class="class-type">{{item.kindId == 1 ? '1v1':'集体'}}</text>{{item.classesName}}</view>
-        <view class="class-time">{{item.bt}} ~ {{item.et}}</view>
-        <view class="class-room">{{item.roomName}}</view>
-        <view class="class-flag">
-          <span wx:if="{{item.status == 0 || item.status == 11 || item.status == 12 || item.status == 4}}">{{item.isAttend == 1 ?'已' : '待'}}上课</span>
-          <span wx:if="{{item.status == 2}}">已请假</span>
-          <span wx:if="{{item.status == 3}}">已调出</span>
-          <span wx:if="{{item.status == 11 || item.status == 12}}">加课</span>
-          <span wx:if="{{item.status == 5}}">补课</span>
-        </view>
-        <view class="class-teacher">老师:{{item.teacherName}}</view>
-      </view>
-    </view>
-  </view>
-
+   <classList date="{{date}}" list="{{dateList}}"></classList>
   <!-- end -->
 
 </view>