Forráskód Böngészése

Signed-off-by: yukangzhe <382985154@qq.com>

yukangzhe 3 éve
szülő
commit
3e5d8165f9

+ 2 - 1
app.json

@@ -37,7 +37,8 @@
     "pages/leaveDetail/leaveDetail",
     "pages/uploadShow/uploadShow",
     "pages/pianoDetailCode/pianoDetail",
-    "pages/pianoOrderDetail/pianoOrderDetail"
+    "pages/pianoOrderDetail/pianoOrderDetail",
+    "pages/queue/queue"
   ],
   "window": {
     "backgroundTextStyle": "dark",

BIN
images/boy.png


BIN
images/girl.png


BIN
images/login-bg.png


BIN
images/toDown.png


+ 29 - 3
pages/Components/selectDate/selectDate.js

@@ -21,6 +21,14 @@ Component({
     },
     endDate: {
       type: String
+    },
+    typeFlag:{
+      type:Boolean,
+      default: false
+    },
+    toTop:{
+      type:Number,
+      value: -360
     }
   },
 
@@ -35,6 +43,9 @@ Component({
     yFlag: false,
     animationBox: {},
     animationBg: {},
+    typeArr:['全部','已预约','排队中'],
+    typeIndex: 0,
+    str:{}
   },
 
   /**
@@ -68,7 +79,8 @@ Component({
     resetDate: function () {
       this.setData({
         beginDate: this.data.initDate,
-        endDate: this.data.lastDate
+        endDate: this.data.lastDate,
+        typeIndex: 0
       })
       const date = new Date()
       const dateArr = [date.getFullYear()+"-01"+"-01", this.data.lastDate];
@@ -90,13 +102,13 @@ Component({
       var num = 0
       var opacity = 0
       if (this.data.yFlag == false) {
-        num = 180
+        num = Math.abs(this.data.toTop) / 2 + 30
         opacity = 0.4
         this.setData({
           yFlag: true
         })
       } else {
-        num = -360
+        num = this.data.toTop
         opacity = 0
         this.setData({
           yFlag: false
@@ -118,5 +130,19 @@ Component({
       })
 
     },
+
+    bindPickerChange:function(e){
+      const typeIndex = e.detail.value
+      const name = this.data.typeArr[typeIndex]
+      const str = {
+        typeIndex,
+        name
+      }
+      this.setData({
+        str,
+        typeIndex
+      })
+      // this.triggerEvent("changeType",str)
+    },
   }
 })

+ 22 - 9
pages/Components/selectDate/selectDate.wxml

@@ -1,7 +1,7 @@
 <view class="select-view" bindtap="showSelect">筛选</view>
-  <view class="select-box" animation="{{animationBox}}">
-    <view class="change-time">
-      <view class="select-title">选择时间段:</view>
+<view class="select-box" animation="{{animationBox}}" style="top:{{toTop}}rpx">
+  <view class="change-time">
+    <view class="select-title">选择时间段:</view>
     <view class="select-date-view">
       <view class="section">
         <picker mode="date" value="{{beginDate}}" start="2000-01-01" end="{{endDate}}" bindchange="bindBeginDateChange">
@@ -17,11 +17,24 @@
         </picker>
       </view>
     </view>
+  </view>
+
+  <view class="type-view" wx:if="{{typeFlag}}">
+      <view class="select-title">预约状态:</view>
+      <view class="change-type">
+        <picker bindchange="bindPickerChange" value="{{typeIndex}}" range="{{typeArr}}">
+          <view class="picker change-view">
+            {{typeArr[typeIndex]}}
+            <view class="toDown"><image src="/images/toDown.png"></image></view>
+          </view>
+        </picker>
+      </view>
     </view>
-    <view class="search-btn-view">
-      <view class="search-btn" bindtap="submitDate">确定</view>
-      <view class="reset-btn" bindtap="resetDate">重置</view>
-    </view>
+
+  <view class="search-btn-view">
+    <view class="search-btn" bindtap="submitDate">确定</view>
+    <view class="reset-btn" bindtap="resetDate">重置</view>
   </view>
-  <view class="select-box-bg" bindtap="showSelect" animation="{{animationBg}}" wx:if="{{yFlag == true}}"></view>
-  <view class="height-view"></view>
+</view>
+<view class="select-box-bg" bindtap="showSelect" animation="{{animationBg}}" wx:if="{{yFlag == true}}"></view>
+<view class="height-view"></view>

+ 40 - 2
pages/Components/selectDate/selectDate.wxss

@@ -17,9 +17,9 @@
 .select-box {
   position: fixed;
   background: #FFF;
-  top: -300rpx;
+  /* top: -300rpx; */
   width: 750rpx;
-  height: 300rpx;
+  min-height: 300rpx;
   font-size: 32rpx;
   z-index: 2;
   
@@ -82,4 +82,42 @@
   width: 100%;
   top: 60rpx;
   position: fixed;
+}
+.type-view{
+  display: flex;
+}
+.change-type{
+  display: flex;
+  line-height: 140rpx;
+  margin-left: 20rpx;
+}
+/* .change-type view{
+    height: 70rpx;
+    margin-top: 35rpx;
+    line-height: 70rpx;
+    padding: 0 20rpx;
+    margin-left: 20rpx;
+} */
+
+.curType{
+  color: #FFF;
+  background: #005033;
+  border-color: #005033;
+}
+
+.toDown{
+  width: 32rpx;
+  height: 32rpx;
+  margin-left: 30rpx;
+  margin-top: 4rpx;
+}
+.toDown image{
+  width: 100%;
+  height: 100%;
+}
+.change-view{
+  display: flex;
+  border: none;
+  line-height: 140rpx;
+  font-size: 34rpx;
 }

+ 6 - 3
pages/index/index.wxml

@@ -8,9 +8,10 @@
     </view>
     <view class="head-right">
       <view class="section">
-        <picker bindchange="bindPickerChange" value="{{index}}" range="{{orgItems}}" range-key="orgName">
+        <picker class="picker-box" bindchange="bindPickerChange" value="{{index}}" range="{{orgItems}}" range-key="orgName">
           <view class="picker">
             {{orgItems[index].orgName}}
+            <view class="toDown"><image src="/images/toDown.png"></image></view>
           </view>
         </picker>
       </view>
@@ -68,7 +69,8 @@
       <view class="more" bindtap="getMoreShow" data-type="0">更多</view>
     </view>
     <showView list="{{stuShowList}}" bind:callThumbsUp="doThumbsUp"></showView>
-    <view class="reset-btn" bindtap="queryStudentShow">换一批</view>
+    <view class="reset-btn" bindtap="queryStudentShow" wx:if="{{stuShowList.length > 2}}">换一批</view>
+    <view class="none-more" wx:elif="{{stuShowList.length <= 0 }}">没有更多了~</view>
   </view>
   <!-- end -->
 
@@ -79,7 +81,8 @@
       <view class="more" bindtap="getMoreShow" data-type="1">更多</view>
     </view>
     <showView list="{{teaShowList}}" bind:callThumbsUp="doThumbsUp"></showView>
-    <view class="reset-btn" bindtap="queryTeacherShow">换一批</view>
+    <view class="reset-btn" bindtap="queryTeacherShow" wx:if="{{teaShowList.length > 2}}">换一批</view>
+    <view class="none-more" wx:elif="{{teaShowList.length <= 0 }}">没有更多了~</view>
   </view>
   <!-- end -->
 

+ 23 - 0
pages/index/index.wxss

@@ -43,6 +43,25 @@
   opacity: 1 !important;
 }
 
+.toDown{
+  width: 32rpx;
+  height: 32rpx;
+  margin-left: 30rpx;
+  position: absolute;
+  right: 0;
+  top: 8rpx;
+  display: inline-block;
+}
+
+.toDown image{
+  width: 100%;
+  height: 100%;
+}
+
+.picker{
+  position: relative;
+}
+
 /* end */
 
 /* 轮播图 */
@@ -185,4 +204,8 @@
     border: 1px solid #999;
     border-radius: 40rpx;
   }
+  .none-more{
+    text-align: center;
+    color: #999;
+  }
  /* end */

+ 1 - 1
pages/login/login.wxml

@@ -1,6 +1,6 @@
 <!--pages/Components/campusBinding/campusBinding.wxml-->
 <view class="main">
-	<image lazy-load class="background" mode="aspectFill" src="{{imageUrl ? imageUrl+'bg0608.png': ''}}"></image>
+	<image lazy-load class="background" mode="aspectFill" src="../../images/login-bg.png"></image>
 	<image lazy-load class="logo" mode="aspectFill" src="/images/login-logo.png"></image>
 	<!-- <text class="name">艾克斯朗学生端</text> -->
 	<button wx:if="{{isShow && isOpenId}}" class="button" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"

+ 5 - 0
pages/makePiano/makePiano.js

@@ -151,6 +151,11 @@ Page({
     })
     this.localtionMethod()
   },
+  toQueue:function(){
+    wx.navigateTo({
+      url: '/pages/queue/queue',
+    })
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 11 - 2
pages/makePiano/makePiano.wxml

@@ -67,12 +67,21 @@
               <view class="class-time">
                 {{ item.time}}
               </view>
+              <view class="wait-tip">
+                <text wx:if="{{item.hasVisitNum > item.maxNum}}" bindtap="toQueue">排队中,前面还有10人</text>
+              </view>
               <view class="class-get-view">
                 <view class="class-stu-num">
                   {{ item.hasVisitNum}}/{{ item.maxNum}}
                 </view>
-                <view class="class-get-btn" bindtap="doAppointment" data-index="{{index}}" data-cindex="{{cItem}}" data-id="{{item.id}}">
-                 {{ item.hasVisitNum < item.maxNum ?  '预约' : '已约满'}}
+                <view class="class-get-btn wait-btn" wx:if="{{item.hasVisitNum == item.maxNum}}" bindtap="doAppointment" data-index="{{index}}" data-cindex="{{cItem}}" data-id="{{item.id}}">
+                 排队
+                </view>
+                <view class="class-get-btn wait-btn" wx:elif="{{item.hasVisitNum > item.maxNum}}" bindtap="doAppointment" data-index="{{index}}" data-cindex="{{cItem}}" data-id="{{item.id}}">
+                 取消排队
+                </view>
+                <view class="class-get-btn" wx:elif="{{item.hasVisitNum < item.maxNum}}" bindtap="doAppointment" data-index="{{index}}" data-cindex="{{cItem}}" data-id="{{item.id}}">
+                 预约
                 </view>
               </view>
             </view>

+ 21 - 7
pages/makePiano/makePiano.wxss

@@ -159,6 +159,7 @@ page{
     font-size: 28rpx;
     height: 40rpx;
     line-height: 40rpx;
+    max-width: 200rpx;
   }
   .school-addr,.school-tel{
     height: 60rpx;
@@ -167,6 +168,7 @@ page{
   }
   .address,.telNum{
     width: 600rpx;
+    font-size: 28rpx;
   }
   .showMore{
     width: 32rpx;
@@ -184,25 +186,37 @@ page{
     margin-left: auto;
     padding-top: 10rpx;
   }
-  .class-get-view{
-    margin-left: auto;
-  }
   .class-time{
-    width: 350rpx;
+    width: 185rpx;
   }
   .class-get-view{
-    max-width: 350rpx;
+    max-width: 175rpx;
+    margin-left: auto;
   }
   .class-get-btn{
     color: #FFF;
     background: #005033;
     border-radius: 10rpx;
-    width: 90rpx;
     text-align: center;
     height: 50rpx;
     line-height: 50rpx;
     margin-top: 5rpx;
-    font-size: 24rpx;
+    font-size: 22rpx;
+    padding: 0 5px;
+  }
+  .wait-btn{
+    background: #cc6031;
+  }
+  .wait-tip{
+    width: 340rpx;
+    margin: 0 15rpx;
+  }
+  .wait-tip text{
+    display: block;
+    color: #cc6031;
+    background: #F9F4D6;
+    width: 340rpx;
+    text-align: center;
   }
   .class-box{
     height: 60rpx;

+ 4 - 0
pages/piano/piano.js

@@ -26,6 +26,10 @@ Page({
     })
   },
 
+  changeType:function(e){
+    console.log(e)
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */

+ 4 - 1
pages/piano/piano.wxml

@@ -1,7 +1,7 @@
 <view class="container">
 
   <!-- 时间筛选 -->
-  <selectDate bind:getDates="getDates" beginDate="{{beginDate}}" endDate="{{endDate}}"></selectDate>
+  <selectDate bind:getDates="getDates" beginDate="{{beginDate}}" endDate="{{endDate}}" typeFlag="{{true}}" toTop="{{-440}}" bind:changeType="changeType"></selectDate>
   <!-- end -->
   
   <view class="piano-list">
@@ -18,7 +18,10 @@
       <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-status" wx:if="{{item.attend == 3}}">已取消</view>
+      <view class="class-status listTip" wx:if="{{item.attend == 4}}">排队中,还有10人</view>
       <view class="class-btn" bindtap="doCancel" data-id="{{item.id}}" wx:if="{{item.cancelFlag}}">取消预约</view>
+      <view class="class-btn cancelList" data-id="{{item.id}}" wx:if="{{}}">取消排队</view>
       </view>
     </view>
   </view>

+ 13 - 3
pages/piano/piano.wxss

@@ -11,7 +11,13 @@ page{
   border-bottom: 20rpx solid #f1f1f1;
   background: #FFF;
 }
-
+.piano-box>view:last-child{
+  width: 270rpx;
+  text-align: center;
+}
+.piano-detail{
+  width: 470rpx;
+}
 .piano-detail view {
   height: 60rpx;
   line-height: 60rpx;
@@ -29,7 +35,6 @@ page{
   line-height: 60rpx;
   font-size: 26rpx;
   color: #666;
-  margin-right: 25rpx;
 }
 
 .loading {
@@ -149,6 +154,7 @@ page{
   line-height: 60rpx;
   position: relative;
   top: 30rpx;
+  left: 35rpx;
   border-radius: 50rpx;
   font-size: 28rpx;
 }
@@ -157,7 +163,11 @@ page{
   color: #999;
   text-align: center;
   height: 30rpx;
-  line-height: 30rpx;
+  line-height: 45rpx;
   position: relative;
   font-size: 26rpx;
+}
+.cancelList{
+  border-color: #cc6031;
+  color: #cc6031;
 }

+ 66 - 0
pages/queue/queue.js

@@ -0,0 +1,66 @@
+// pages/queue/queue.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/queue/queue.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "预约用户"
+}

+ 19 - 0
pages/queue/queue.wxml

@@ -0,0 +1,19 @@
+<view class="container">
+  <view class="list-view">
+    <view class="list-box" wx:for="{{5}}" wx:key="index">
+      <view class="list-img">
+        <image src="/images/head.png"></image>
+      </view>
+      <view class="list-detail">
+        <view class="list-name">
+          约课用户
+          <view class="gender-img" wx:if="{{index < 2}}"><image class="boyImg" src="/images/boy.png"></image></view>
+          <view class="gender-img" wx:else><image src="/images/girl.png"></image></view>
+        </view>
+        <view class="list-time">
+          预约时间: 2021-04-14 12:00
+        </view>
+      </view>
+    </view>
+  </view>
+</view>

+ 39 - 0
pages/queue/queue.wxss

@@ -0,0 +1,39 @@
+.list-box{
+  width: 700rpx;
+  margin: 20rpx auto;
+  padding-bottom: 20rpx;
+  border-bottom: 1rpx solid #eee;
+  display: flex;
+}
+.list-img{
+  width: 120rpx;
+  height: 120rpx;
+  margin-right: 30rpx;
+}
+
+.list-img image{
+  width: 100%;
+  height: 100%;
+}
+.list-name{
+  font-size: 32rpx;
+  font-weight: bold;
+  margin: 20rpx 0 10rpx;
+  display: flex;
+}
+.gender-img{
+  width: 40rpx;
+  height: 40rpx;
+  margin-left: 20rpx;
+  padding-top: 2rpx;
+}
+.gender-img image{
+  width: 100%;
+  height: 100%;
+}
+.list-time{
+  color: #999;
+}
+.boyImg{
+  transform: rotate(135deg);
+}

+ 24 - 0
project.private.config.json

@@ -0,0 +1,24 @@
+{
+  "setting": {},
+  "condition": {
+    "plugin": {
+      "list": []
+    },
+    "game": {
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": [
+        {
+          "name": "pages/queue/queue",
+          "pathName": "pages/queue/queue",
+          "query": "",
+          "scene": null
+        }
+      ]
+    }
+  }
+}