Quellcode durchsuchen

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

yukangzhe vor 3 Jahren
Ursprung
Commit
b9580c93aa

+ 1 - 1
app.js

@@ -68,7 +68,7 @@ App({
   },
 
   globalData: {
-    ver:'1.0.8',
+    ver:'1.0.9',
     userInfo: null,
     openId: '',
     imageUrl: 'https://app.schoolwisdoms.com/static/wx/images/',

+ 8 - 2
app.json

@@ -1,5 +1,10 @@
 {
-  "plugins": {},
+  "plugins": {
+    "citySelector": {
+      "version": "1.0.0",
+      "provider": "wx63ffb7b7894e99ae"
+    }
+  },
   "pages": [
     "pages/login/login",
     "pages/student/student",
@@ -38,7 +43,8 @@
     "pages/uploadShow/uploadShow",
     "pages/pianoDetailCode/pianoDetail",
     "pages/pianoOrderDetail/pianoOrderDetail",
-    "pages/queue/queue"
+    "pages/queue/queue",
+    "pages/agreement/agreement"
   ],
   "window": {
     "backgroundTextStyle": "dark",

BIN
images/home.png


BIN
images/my-agreement.png


BIN
images/none-list.png


BIN
images/toDown2.png


+ 82 - 0
pages/Components/city/city.js

@@ -0,0 +1,82 @@
+// pages/Components/city/city.js
+const city = require('../../../utils/city')
+const app = getApp()
+Component({
+  attached: function() {
+    // 在组件实例进入页面节点树时执行
+    this.setData({
+      hot: city.hotCity.hot,
+      cityList:city.citys,
+      city:wx.getStorageSync('wxLocalName').city
+    })
+  },
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    src:"https://app.schoolwisdoms.com/static/wx/images/",
+    hot:[],
+    cityList:[],
+    cityArr:["TOP","A","B","C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","W","X","Y","Z"],
+    tipHide: 1,
+    showTimeOut:null,
+    tipText:"",
+    city:''
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    changeTitle:function(e){
+      var idName = e.target.dataset.id
+      clearTimeout(this.data.showTimeOut)
+      this.setData({
+        tipHide: 0,
+        tipText: idName
+      })
+      this.data.showTimeOut = setTimeout(() => {
+        this.setData({
+          tipHide: 1,
+        })
+      }, 800);
+      
+     if(idName != "TOP"){
+      var me = this;
+      var query = wx.createSelectorQuery().in(me);
+      query.selectViewport().scrollOffset()
+      query.select("#"+idName).boundingClientRect();
+      query.exec(function (res) {
+        var miss = res[0].scrollTop + res[1].top - 93;
+        wx.pageScrollTo({
+          scrollTop: miss,
+          duration: 0
+        });
+      });
+     } else{
+      wx.pageScrollTo({
+        scrollTop: 0,
+        duration: 0
+      });
+     }
+    },
+
+    getCity:function(e){
+      var json = wx.getStorageSync('wxLocalName')
+      json.city = e.currentTarget.dataset.name + "市"
+      wx.setStorageSync('wxLocalName', json)
+      wx.navigateBack({
+        delta: 0,
+      })
+    }
+  },
+
+ 
+})

+ 4 - 0
pages/Components/city/city.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 41 - 0
pages/Components/city/city.wxml

@@ -0,0 +1,41 @@
+<!--pages/Components/city/city.wxml-->
+<my-logo>
+<navTop title="选择城市"></navTop>
+<view class="container">
+  <view class="localView">
+    <view class="localImg">
+      <image src="{{src}}local-0121.png"></image>
+    </view>
+    <view>
+      当前位置
+    </view>
+    <view class="localName">
+      {{city}}
+    </view>
+  </view>
+  <view class="middle-title">
+    热门城市
+  </view>
+  <view class="hot-view">
+    <view class="hot-list" wx:for="{{hot}}" wx:key="index" bindtap="getCity" data-name="{{item.name}}">
+      {{item.name}}
+    </view>
+  </view>
+  <view class="city-view">
+    <view class="city-title" wx:for="{{cityArr}}" wx:for-item="item" wx:key="i" wx:for-index="index">
+      <view class="city-title-view" wx:if="{{index > 0}}" id="{{item}}">{{item}}</view>
+      <view class="city-name" wx:for="{{cityList}}" wx:for-item="citem" wx:key="j" wx:for-index="cindex">
+        <view wx:if="{{item == cindex}}" wx:for="{{citem}}" wx:for-item="nitem" wx:key="k">
+          <view class="city-name-view" bindtap="getCity" data-name="{{nitem.name}}">{{nitem.name}}</view>
+        </view>
+      </view>
+    </view>
+  </view>
+</view>
+<view class="select-view">
+  <view wx:for="{{cityArr}}" wx:for-item="item" wx:key="i" wx:for-index="index" bindtap="changeTitle" data-id="{{item}}">
+    {{item}}
+  </view>
+</view>
+<view class="tip-view {{tipHide == 1 ? 'tip-view-hide' : ''}}">{{tipText}}</view>
+</my-logo>

+ 106 - 0
pages/Components/city/city.wxss

@@ -0,0 +1,106 @@
+/* pages/Components/city/city.wxss */
+.container{
+  padding: 0;
+  margin: 0;
+}
+image{
+  width: 40rpx;
+  height: 40rpx;
+}
+.localView{
+  display: flex;
+  width: 700rpx;
+  margin: 0 25rpx;
+  color: #999;
+  font-size: 28rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+}
+.localView image{
+  padding-top: 20rpx;
+  margin-right: 10rpx;
+}
+.localName{
+  margin-left: 20rpx;
+  color: #333 !important;
+  font-size: 36rpx;
+  width: 500rpx;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+.middle-title{
+  height: 100rpx;
+  line-height: 100rpx;
+  width: 750rpx;
+  background: #f1f1f1;
+  text-indent: 25rpx;
+  margin-top: 20rpx;
+  color: #666;
+}
+.hot-view{
+  display: grid;
+  justify-content: space-between;
+  grid-template-columns: repeat(auto-fill, 150rpx);
+  grid-gap: 10px;
+  width: 700rpx;
+  margin: 20rpx 25rpx;
+  height: 160rpx;
+}
+.hot-list{
+  width: 148rpx;
+  height: 58rpx;
+  line-height: 60rpx;
+  text-align: center;
+  border: 1rpx solid #999 ;
+  color: #999;
+  align-items: space-around;
+  border-radius: 10rpx;
+  font-size: 24rpx;
+  margin-bottom: 20rpx;
+}
+
+.city-title{
+  width: 750rpx;
+ 
+}
+.city-title-view{
+  background: #f1f1f1;
+  height: 60rpx;
+  line-height: 60rpx;
+  color: #999;
+  font-size: 24rpx;
+  text-indent: 25rpx;
+}
+.city-name-view{
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 32rpx;
+  border-bottom: 1px solid #eee;
+  width: 725rpx;
+  margin-left: 25rpx;
+}
+.select-view{
+  position: fixed;
+  right: 20rpx;
+  top: 25%;
+  font-size: 24rpx;
+  text-align: center;
+  height: 40rpx;
+  line-height: 40rpx;
+  /* color: #EC3A4E; */
+  color: #cc6031;
+}
+.tip-view{
+  position: fixed;
+  height: 100rpx;
+  width: 100rpx;
+  top: 50%;
+  margin-top: -50rpx;
+  left: 50%;
+  margin-left: -50rpx;
+  font-size: 80rpx;
+}
+.tip-view-hide{
+  opacity: 0;
+}

+ 4 - 0
pages/Components/selectDate/selectDate.js

@@ -35,6 +35,10 @@ Component({
     toTop:{
       type:Number,
       value: -360
+    },
+    title:{
+      type:String,
+      value: '筛选'
     }
   },
 

+ 16 - 11
pages/Components/selectDate/selectDate.wxml

@@ -1,16 +1,19 @@
-<view class="select-view" bindtap="showSelect">筛选</view>
+<view class="select-view" bindtap="showSelect">{{title}}<image src="/images/toDown2.png" class="toDownImg"></image></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="{{initChangeDate}}" bindchange="bindBeginDateChange">
+        <picker mode="date" value="{{beginDate}}" start="2000-01-01" end="{{initChangeDate}}"
+          bindchange="bindBeginDateChange">
           <view class="picker">
             {{beginDate}}
           </view>
         </picker>
         <view> 至 </view>
-        <picker mode="date" value="{{endDate}}" start="{{beginDate}}" end="{{initChangeDate}}" bindchange="bindEndDateChange">
+        <picker mode="date" value="{{endDate}}" start="{{beginDate}}" end="{{initChangeDate}}"
+          bindchange="bindEndDateChange">
           <view class="picker">
             {{endDate}}
           </view>
@@ -20,16 +23,18 @@
   </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 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>
-        </picker>
-      </view>
+        </view>
+      </picker>
     </view>
+  </view>
 
   <view class="search-btn-view">
     <view class="search-btn" bindtap="submitDate">确定</view>

+ 7 - 0
pages/Components/selectDate/selectDate.wxss

@@ -120,4 +120,11 @@
   border: none;
   line-height: 140rpx;
   font-size: 34rpx;
+}
+.toDownImg{
+  width: 32rpx;
+    height: 32rpx;
+    position: absolute;
+    top: 17rpx;
+    margin-left: 20rpx;
 }

+ 72 - 0
pages/agreement/agreement.js

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

+ 4 - 0
pages/agreement/agreement.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "用户协议"
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 262 - 0
pages/agreement/agreement.wxml


+ 36 - 0
pages/agreement/agreement.wxss

@@ -0,0 +1,36 @@
+.container{
+  text-align: justify;
+  width: 700rpx;
+  margin: 0 auto;
+  line-height: 2;
+  font-size: 28rpx;
+  padding-bottom: 40rpx;
+}
+.title{
+  text-align: center;
+  font-size: 48rpx;
+  margin-bottom: 40rpx;
+  text-indent: 0;
+}
+
+.bold{
+  font-weight: bold;
+}
+.top{
+  margin-top: 20rpx;
+  text-indent: 0 !important;
+}
+view{
+  text-indent: 56rpx;
+}
+.btn{
+  width: auto;
+  margin: 60rpx auto;
+  color: #FFF;
+  background: #005033;
+  text-align: center;
+  height: 100rpx;
+  line-height: 100rpx;
+  text-indent: 0;
+  font-size: 28rpx;
+}

+ 99 - 0
pages/index/index.js

@@ -2,6 +2,7 @@
 const app = getApp()
 const util = require("../../utils/util")
 const urlDef = require("../../utils/urls")
+var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
 Page({
 
   /**
@@ -157,6 +158,7 @@ Page({
     this.setData({
       isShow: wx.getStorageSync('isShow'),
     })
+    this.localtionMethod()
   },
 
   /**
@@ -170,6 +172,10 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    const latlng = wx.getStorageSync('latlng')
+    if(!latlng){
+      this.localtionMethod()
+    }
     if(!wx.getStorageSync('openId')){
       wx.redirectTo({
         url: '/pages/login/login',
@@ -416,5 +422,98 @@ Page({
     }).catch(e => {
       console.log(e);
     })
+  },
+
+  getMyLocal: function () {
+    //获取当前定位具体位置名称
+    var qqmapsdk = new QQMapWX({
+      key: 'FCLBZ-ZQ2Y3-DC23W-3EXRK-LUKX6-W7F6Z'
+    });
+    var that = this
+    var lat = wx.getStorageSync('latlng').latitude;
+    var lng = wx.getStorageSync('latlng').longitude;
+    // 在组件实例进入页面节点树时执行
+    qqmapsdk.reverseGeocoder({
+      location: {
+        latitude: lat,
+        longitude: lng
+      },
+      success: function (res) {
+        //获取当前地址成功
+        that.setData({
+          address: res.result.address,
+          location: {
+            latitude: res.result.location.lat,
+            longitude: res.result.location.lng
+          }
+        })
+
+        const name = res.result.address_component.city
+
+        wx.setStorageSync('wxLocalName', name)
+        // const locationNavTop  = that.selectComponent("#locationNavTop")
+        // locationNavTop.getAddr()
+        // that.getLocationList(res.result.address_reference)
+      },
+      fail: function (res) {
+        console.log('获取当前地址失败');
+      }
+    });
+  },
+
+  localtionMethod: function () {
+    const that = this
+    wx.getLocation({
+      type: 'wgs84',
+      success(res) {
+        // console.log(res)
+        wx.setStorageSync('latlng', res)
+        that.getCoder()
+        that.getMyLocal()
+      },
+      fail(res) {
+        wx.hideLoading({
+          success: (res) => {
+            wx.showModal({
+              title: '提示',
+              content: "定位失败,请检查手机'位置服务'或GPS功能已开启并授权小程序位置信息",
+              success(res){
+                if(res.confirm){
+                  wx.openSetting({
+                    success (res) {
+                      console.log(res.authSetting)
+                      // res.authSetting = {
+                      //   "scope.userInfo": true,
+                      //   "scope.userLocation": true
+                      // }
+                    }
+                  })
+                }
+              }
+            })
+          },
+        })
+      }
+    })
+  },
+
+  getCoder:function(){
+    const lat = wx.getStorageSync('latlng').latitude
+    const lng = wx.getStorageSync('latlng').longitude
+    wx.request({
+      url: 'https://apis.map.qq.com/ws/geocoder/v1/?location='+lat+','+lng+"&key=FCLBZ-ZQ2Y3-DC23W-3EXRK-LUKX6-W7F6Z",
+      method: 'GET',
+      success: function( res ) {
+        let cityCode = res.data.result.ad_info.city_code
+        let nationCode = res.data.result.ad_info.nation_code
+        cityCode = cityCode.substring(nationCode.length, cityCode.length)
+        wx.setStorageSync('adCode', cityCode)
+      },
+      fail:function(res){
+        console.log(res)
+      }
+    })
   }
+
+
 })

+ 5 - 0
pages/login/login.js

@@ -72,6 +72,11 @@ Page({
     this.update()
     
   },
+  toAgreement:function(){
+    wx.navigateTo({
+      url: '/pages/agreement/agreement',
+    })
+  },
 
   //判断版本号
   getVersion: function () {

+ 3 - 3
pages/login/login.wxml

@@ -12,10 +12,10 @@
 		<view class="slogan-en">Be Excellent<text class="nbsp"></text>Better To Do</view>
 		<view class="slogan-zn">艾克斯朗<text class="nbsp"></text>培养与众不同的你</view>
 		<view class="agreement-view">
-		登录即表示同意<text class="agreement-text">《艾克斯朗平台相关协议》</text>
-	</view>
+			登录即表示同意<text class="agreement-text" bindtap="toAgreement">《艾克斯朗平台相关协议》</text>
+		</view>
 	</view>
-	
+
 	<!-- <button wx:if="{{!isShow}}" class="button" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" hidden="{{btnShow}}">
 		登陆
 	</button> -->

+ 165 - 44
pages/makePiano/makePiano.js

@@ -2,18 +2,25 @@
 const app = getApp()
 const util = require("../../utils/util")
 const urlDef = require("../../utils/urls")
+
+const key = 'FCLBZ-ZQ2Y3-DC23W-3EXRK-LUKX6-W7F6Z'; // 使用在腾讯位置服务申请的key
+const referer = '艾克斯朗学生端'; // 调用插件的app的名称
+const hotCitys = '武汉'; // 用户自定义的的热门城市
+const citySelector = requirePlugin('citySelector');
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
+    refreshFlag: 1,
+    homeName: '',
     animationBox: {},
     animationBg: {},
     weekList: [],
     curIndex: 0,
     array: [
-      '全部时间',
+      // '全部时间',
       '08:00 ~ 10:00',
       '10:00 ~ 12:00',
       '12:00 ~ 14:00',
@@ -22,10 +29,9 @@ Page({
       '18:00 ~ 20:00',
       '20:00 ~ 22:00',
     ],
-    index: 0,
-    schoolList: [
-    ],
-    loading: '上拉加载',
+    index: -1,
+    schoolList: [],
+    loading: '加载中...',
     flag: 0,
     curStu: null,
     pageNum: 0,
@@ -35,6 +41,19 @@ Page({
     yFlag: false
   },
 
+  getTimeDate:function(e){
+    if(e.currentTarget.dataset.value == this.data.index){
+      this.setData({
+        index: -1,
+      })
+    } else{
+      this.setData({
+        index: e.currentTarget.dataset.value,
+      })
+    }
+   
+  },
+
   getWeek: function (e) {
     this.setData({
       curIndex: e.currentTarget.dataset.index,
@@ -51,10 +70,12 @@ Page({
   },
   selectTime: function () {
     let timeScope = '0,0'
-    if (this.data.index > 0) {
-      timeScope = this.data.array[this.data.index].replace(/\s*/g, '').replace('~', ',').replace(/:00/g,'')
+    if (this.data.index >= 0) {
+      timeScope = this.data.array[this.data.index].replace(/\s*/g, '').replace('~', ',').replace(/:00/g, '')
     }
-    this.setData({ timeScope: timeScope })
+    this.setData({
+      timeScope: timeScope
+    })
     this.showSelect()
 
     this.setData({
@@ -64,21 +85,22 @@ Page({
     this.queryList()
   },
 
-  resetTime:function(){
+  resetTime: function () {
     let timeScope = '0,0'
-    this.setData({ timeScope , index: 0})
+    this.setData({
+      timeScope,
+      index: -1,
+    })
     this.showSelect()
     this.queryList()
   },
 
   localtionMethod: function () {
-    var that = this
+    const that = this
     wx.getLocation({
       type: 'wgs84',
       success(res) {
-        // console.log(res)
-        wx.setStorageSync('latlng', res)
-        that.queryList()
+        that.locationAfter()
       },
       fail(res) {
         wx.hideLoading({
@@ -86,6 +108,23 @@ Page({
             wx.showModal({
               title: '提示',
               content: "定位失败,请检查手机'位置服务'或GPS功能已开启并授权小程序位置信息",
+              success(res) {
+                if (res.confirm) {
+                  wx.openSetting({
+                    success(res) {
+                      console.log(res.authSetting)
+                      // res.authSetting = {
+                      //   "scope.userInfo": true,
+                      //   "scope.userLocation": true
+                      // }
+                    }
+                  })
+                } else {
+                  wx.navigateBack({
+                    delta: 1,
+                  })
+                }
+              }
             })
           },
         })
@@ -101,19 +140,19 @@ Page({
     var num = 0
     var opacity = 0
     if (this.data.yFlag == false) {
-      num = 165
+      num = -300
       opacity = 0.4
       this.setData({
         yFlag: true
       })
     } else {
-      num = -360
+      num = 165
       opacity = 0
       this.setData({
         yFlag: false
       })
     }
-    animation.translateY(num).step()
+    animation.translateX(num).step()
     this.setData({
       animationBox: animation.export()
     })
@@ -147,9 +186,10 @@ Page({
       list.push(json)
     }
     this.setData({
-      weekList: list
+      weekList: list,
+      homeName: wx.getStorageSync('wxLocalName')
     })
-    this.localtionMethod()
+
   },
 
   /**
@@ -163,7 +203,41 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-    this.queryList()
+    this.localtionMethod()
+  },
+  locationAfter: function () {
+    const selectedCity = citySelector.getCity();
+    if (selectedCity) {
+      this.setData({
+        homeName: selectedCity.fullname,
+        schoolList: []
+      })
+      wx.setStorageSync('latlng', selectedCity.location)
+      wx.setStorageSync('adCode', selectedCity.id)
+      wx.setStorageSync('wxLocalName', selectedCity.fullname)
+    } else {
+      if (wx.getStorageSync('latlng')) {
+        this.setData({
+          homeName: wx.getStorageSync('wxLocalName')
+        })
+      } else {
+        this.selectCity()
+      }
+    }
+    if(this.data.refreshFlag == 1){
+      this.setData({
+        schoolList: [],
+        refreshFlag: 0
+      })
+      this.queryList()
+    }
+    
+  },
+
+  selectCity: function () {
+    wx.navigateTo({
+      url: `plugin://citySelector/index?key=${key}&referer=${referer}&hotCitys=${hotCitys}`,
+    })
   },
 
   /**
@@ -193,7 +267,10 @@ Page({
   onReachBottom: function () {
     if (this.data.hasNextPage) {
       let pn = this.data.pageNum
-      this.setData({ loading: '加载中', 'pageNum': ++pn })
+      this.setData({
+        loading: '加载中',
+        'pageNum': ++pn
+      })
       this.queryList()
     }
   },
@@ -208,12 +285,18 @@ Page({
     const urls = urlDef.urls;
     let stu = wx.getStorageSync('student');
     if (stu) {
-      this.setData({ curStu: stu })
+      this.setData({
+        curStu: stu,
+      })
       let latlng = wx.getStorageSync('latlng')
       let latitude = latlng.latitude //30.55473
       let longitude = latlng.longitude
-      let countyCode = '420101'
-      let params = { 'q.coordinate': longitude + ',' + latitude, 'q.studentId': stu.studentId };
+      // let countyCode = '420101'
+      let countyCode = wx.getStorageSync('adCode')
+      let params = {
+        'q.coordinate': longitude + ',' + latitude,
+        'q.studentId': stu.studentId
+      };
       // 'q.regionId': countyCode.substring(0, 4) + '00'
       params['q.regionId'] = countyCode.substring(0, 4) + '00'
       params.pageNum = this.data.pageNum
@@ -224,11 +307,12 @@ Page({
           s.dist = this.showDist(s.distance)
         })
 
-
+        const schoolNum = "("+list.length+")"
         this.setData({
           'hasNextPage': rs.hasNextPage,
-          'loading': rs.hasNextPage ? '下拉刷新' : '没有更多数据',
-          'schoolList': this.data.schoolList.concat(list)
+          'loading': rs.hasNextPage ? '上拉加载' : '没有更多数据',
+          'schoolList': this.data.schoolList.concat(list),
+          schoolNum
         })
 
         // 默认查询第一个学校的课程
@@ -249,10 +333,23 @@ Page({
   },
   selectSchool: function (e) {
     let index = e.currentTarget.dataset.index;
-    let id = e.currentTarget.dataset.id;
+    // let id = e.currentTarget.dataset.id;
+
+    // this.setData({
+    //   'schoolIndex': index
+    // })
+    // this.queryClassesList(id)
+    let moreFlag = 'schoolList['+index+'].moreFlag'
+    if(this.data.schoolList[index].moreFlag){
+      this.setData({
+        [moreFlag] : false
+      })
+    } else {
+      this.setData({
+        [moreFlag] : true
+      })
+    }
 
-    this.setData({ 'schoolIndex': index })
-    this.queryClassesList(id)
   },
   collectSchool: function (e) {
     let id = e.currentTarget.dataset.id;
@@ -269,19 +366,40 @@ Page({
     const urls = urlDef.urls;
 
     let sl = this.data.schoolList;
-    let s = sl.filter(o => o.id == this.data.schoolList[this.data.schoolIndex].id)[0];
+    for (var i in sl) {
+      let s = sl.filter(o => o.id == this.data.schoolList[i].id)[0];
 
-    let w = this.data.weekList[this.data.curIndex];
+      let w = this.data.weekList[this.data.curIndex];
 
-    let date = w.ds
-    let week = w.ws + 1;
+      let date = w.ds
+      let week = w.ws + 1;
 
-    let params = { 'q.orgId': this.data.schoolList[this.data.schoolIndex].id, 'q.studentId': this.data.curStu.studentId, 'q.date': date, 'q.week': week, 'q.timeScope': this.data.timeScope }
-    // params['q.timeScope'] = ''; 时段
-    util.apiPost(urls.query_school_attence, params).then(rs => {
-      s.items = rs
-      this.setData({ schoolList: sl })
-    })
+      let params = {
+        'q.orgId': this.data.schoolList[i].id,
+        'q.studentId': this.data.curStu.studentId,
+        'q.date': date,
+        'q.week': week,
+        'q.timeScope': this.data.timeScope
+      }
+      // params['q.timeScope'] = ''; 时段
+      util.apiPost(urls.query_school_attence, params).then(rs => {
+        for (var j in rs) {
+          if (rs[j].studentVisitNum > 0 || rs[j].studentWaitNum > 0) {
+            s.moreFlag = true
+            break
+          } else {
+            s.moreFlag = false
+          }
+        }
+        if(s.collect == 1){
+          s.moreFlag = true
+        }
+        s.items = rs
+        this.setData({
+          schoolList: sl
+        })
+      })
+    }
   },
   doAppointment: function (e) {
     wx.showLoading({
@@ -292,7 +410,7 @@ Page({
     const index = e.currentTarget.dataset.index
     const cIndex = e.currentTarget.dataset.cindex
 
-    if(this.data.schoolList[index].items[cIndex].hasVisitNum >= this.data.schoolList[index].items[cIndex].maxNum){
+    if (this.data.schoolList[index].items[cIndex].hasVisitNum >= this.data.schoolList[index].items[cIndex].maxNum) {
       wx.hideLoading({
         success: (res) => {
           wx.showToast({
@@ -308,7 +426,7 @@ Page({
     const urls = urlDef.urls;
     let w = this.data.weekList[this.data.curIndex];
     let sid = this.data.schoolList[this.data.schoolIndex].id
-    util.apiPost(urls.do_appointment + '?q.studentId=' + this.data.curStu.studentId + '&q.planId=' + id + '&q.orgId=' +  sid + '&q.visitDate=' + w.ds).then(rs => {
+    util.apiPost(urls.do_appointment + '?q.studentId=' + this.data.curStu.studentId + '&q.planId=' + id + '&q.orgId=' + sid + '&q.visitDate=' + w.ds).then(rs => {
       if (rs.success > 0) {
         wx.showToast({
           title: '预约成功'
@@ -319,15 +437,18 @@ Page({
           title: rs.msg,
           icon: 'none',
         })
+        this.queryList()
       }
     });
   },
   toQueueUp(e) {
     let id = e.currentTarget.dataset.id;
+    let index = e.currentTarget.dataset.index
     let w = this.data.weekList[this.data.curIndex];
-    let sid = this.data.schoolList[this.data.schoolIndex].id
+    let sid = this.data.schoolList[index].id
+    
     wx.navigateTo({
-      url: '/pages/queue/queue?planId=' + id + '&orgId=' +  sid + '&visitDate=' + w.ds
+      url: '/pages/queue/queue?planId=' + id + '&orgId=' + sid + '&visitDate=' + w.ds
     })
   }
 })

+ 39 - 22
pages/makePiano/makePiano.wxml

@@ -1,10 +1,13 @@
 <view class="container">
-  <!-- 筛选按钮 -->
-  <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-date-view">
+      <view class="time-list-view">
+        <view class="{{index == tIndex ? 'curTimeDate' : ''}}" wx:for-item="tItem" wx:for="{{array}}" wx:for-index="tIndex" wx:key="tIndex" bindtap="getTimeDate" data-value="{{tIndex}}">
+          {{tItem}}</view>
+      </view>
+      <!-- <view class="select-date-view">
         <view class="section">
           <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
             <view class="picker">
@@ -12,15 +15,14 @@
             </view>
           </picker>
         </view>
-      </view>
+      </view> -->
     </view>
     <view class="search-btn-view">
-      <view class="search-btn" bindtap="selectTime">确定</view>
       <view class="reset-btn" bindtap="resetTime">重置</view>
+      <view class="search-btn" bindtap="selectTime">确定</view>
     </view>
   </view>
   <view class="select-box-bg" bindtap="showSelect" animation="{{animationBg}}" wx:if="{{yFlag == true}}"></view>
-  <view class="height-view"></view>
   <!-- end -->
 
   <!-- 日期选择 -->
@@ -35,49 +37,64 @@
   </view>
   <!-- end -->
 
+  <!-- 筛选按钮 -->
+  <view class="home-view">
+  <view class="home-box"  bindtap="selectCity">
+    <view class="home-img">
+      <image src="/images/home.png"></image>
+    </view>
+    <view class="home-name">{{homeName}}{{schoolNum}}</view>
+  </view>
+  <view class="select-view" bindtap="showSelect">筛选</view>
+  </view>
+  <!-- end -->
+
   <!-- 校区列表 -->
   <view class="school-view">
     <view class="school-list">
-      <view class="school-box" wx:for="{{schoolList}}" wx:key="index">
+      <view class="school-box" wx:for="{{schoolList}}" wx:key="index" wx:for-item="sitem">
         <view class="school-title">
-          <view class="school-name">{{ item.name}}</view>
+          <view class="school-name">{{ sitem.name}}</view>
           <view class="school-dis">
             <view class="disImg">
               <image src="/images/local.png"></image>
             </view>
-            <view class="disNum">{{ item.dist}}</view>
+            <view class="disNum">{{ sitem.dist}}</view>
           </view>
         </view>
         <view class="school-addr">
-          <view class="address">{{ item.address}}</view>
-          <view class="showMore {{schoolIndex == index ? 'curSchool' : ''}}" bindtap="selectSchool" data-id="{{ item.id}}" data-index="{{index}}">
+          <view class="address">{{ sitem.address}}</view>
+          <view wx:if="{{ sitem.items.length > 0}}" class="showMore {{sitem.moreFlag ? 'curSchool' : ''}}" bindtap="selectSchool" data-id="{{ sitem.id}}" data-index="{{index}}">
             <image class="" src="/images/showMore.png"></image>
           </view>
         </view>
         <view class="school-tel">
-          <view class="telNum">{{ item.telephone}}</view>
-          <view class="getTel"  bindtap="collectSchool" data-id="{{ item.id}}" >
-            <image src="{{ item.collect == 1? '/images/cur-getTel.png' : '/images/getTel.png'}}"></image>
+          <view class="telNum">{{ sitem.telephone}}</view>
+          <view class="getTel"  bindtap="collectSchool" data-id="{{ sitem.id}}" >
+            <image src="{{ sitem.collect == 1? '/images/cur-getTel.png' : '/images/getTel.png'}}"></image>
           </view>
         </view>
-        <view class="school-class-list" wx:if="{{schoolIndex == index}}">
-          <view class="class-none" wx:if="{{(! item.items) ||  item.items.length == 0}}">该时间段未排课</view>
-          <view class="class-list"  wx:for="{{ item.items}}" wx:key="cIndex" wx:for-index="cItem">
+        <view class="school-class-list">
+          <view class="class-none" wx:if="{{(! sitem.items) ||  sitem.items.length == 0}}">该时间段未排课</view>
+          <view class="class-list" wx:if="{{sitem.moreFlag}}"  wx:for="{{sitem.items}}" wx:for-item="citem" wx:key="cIndex" wx:for-index="items">
             <view class="class-box">
               <view class="class-time">
-                {{ item.time}}
+                {{ citem.time}}
               </view>
               <view class="wait-tip">
-                <text wx:if="{{item.pd_num && item.pd_num > 0}}">排队中,前面还有{{item.pd_num}}人</text>
+                <text wx:if="{{citem.pd_num && citem.pd_num > 0}}">排队中,总共还有{{citem.pd_num}}人</text>
               </view>
               <view class="class-get-view">
                 <view class="class-stu-num">
-                  {{ item.hasVisitNum}}/{{ item.maxNum}}
+                  {{ citem.hasVisitNum}}/{{ citem.maxNum}}
+                </view>
+                <view class="class-get-btn" wx:if="{{citem.studentVisitNum > 0}}" >
+                 已预约
                 </view>
-                <view class="class-get-btn wait-btn" wx:if="{{item.hasVisitNum >= item.maxNum}}" bindtap="toQueueUp" data-index="{{index}}" data-cindex="{{cItem}}" data-id="{{item.id}}">
+                <view class="class-get-btn wait-btn" wx:elif="{{citem.hasVisitNum >= citem.maxNum}}" bindtap="toQueueUp" data-index="{{index}}" data-cindex="{{items}}" data-id="{{citem.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 class="class-get-btn" wx:elif="{{citem.hasVisitNum < citem.maxNum}}" bindtap="doAppointment" data-index="{{index}}" data-cindex="{{items}}" data-id="{{citem.id}}">
                  预约
                 </view>
               </view>

+ 63 - 21
pages/makePiano/makePiano.wxss

@@ -9,7 +9,8 @@ page{
 
 /* 筛选按钮 */
 .select-view {
-  height: 60rpx;
+  margin-left: auto;
+  /* height: 60rpx;
   line-height: 60rpx;
   background: #005033;
   color: #FFF;
@@ -17,7 +18,7 @@ page{
   font-size: 32rpx;
   position: fixed;
   width: 750rpx;
-  z-index: 3;
+  z-index: 3; */
 }
 
 .height-view {
@@ -27,9 +28,9 @@ page{
 .select-box {
   position: fixed;
   background: #FFF;
-  top: -240rpx;
-  width: 750rpx;
-  height: 300rpx;
+  right: -600rpx;
+  width: 520rpx;
+  height: 100%;
   font-size: 32rpx;
   z-index: 2;
   
@@ -46,20 +47,24 @@ page{
   line-height: 60rpx;
 }
 .picker{
-  margin: 0 10rpx;
-  padding: 0 20rpx;
+  /* margin: 0 10rpx;
+  padding: 0 20rpx; */
   height: 60rpx;
   line-height: 60rpx;
-  border-radius: 5rpx;
   font-weight: 600;
+  width: 240rpx;
+  text-align: center;
 }
 .select-title{
   height: 140rpx;
   line-height: 140rpx;
   margin-left: 25rpx;
-  width: 240rpx;
+  width: 200rpx;
   text-align: center;
 }
+.select-date-view{
+  width: 300rpx;
+}
 
 .select-box-bg{
   background: #333;
@@ -67,31 +72,35 @@ page{
   z-index: 1;
   height: 100%;
   width: 100%;
-  top: 60rpx;
+  top: 0;
   position: fixed;
 }
 .search-btn-view{
   display: flex;
-    width: 400rpx;
-    margin: 20rpx auto;
+    position: absolute;
+    bottom: 0;
+    width: 100%;
 }
 .search-btn-view view{
   margin: 0 auto;
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 36rpx;
 }
 .search-btn{
-  height: 60rpx;
-  line-height: 60rpx;
-  width: 150rpx;
-  border-radius: 10rpx;
+  /* height: 60rpx;
+  line-height: 60rpx; */
+  width: 50%;
+  /* border-radius: 10rpx; */
   background: #005033;
   text-align: center;
   color: #FFF;
 }
 .reset-btn{
-  height: 60rpx;
-  line-height: 60rpx;
-  width: 150rpx;
-  border-radius: 10rpx;
+  /* height: 60rpx;
+  line-height: 60rpx; */
+  width: 50%;
+  /* border-radius: 10rpx; */
   background: #f1f1f1;
   text-align: center;
   color: #666;
@@ -247,4 +256,37 @@ page{
   color: #999;
   text-align: center;
 }
-/* end */
+/* end */
+
+.home-view{
+  display: flex;
+  width: 700rpx;
+  padding: 25rpx;
+  background: #FFF;
+}
+.home-box{
+  display: flex;
+}
+.home-img{
+  width: 40rpx;
+  height: 40rpx;
+}
+.home-img image{
+  width: 100%;
+  height: 100%;
+}
+.home-name{
+  height: 48rpx;
+  line-height: 48rpx;
+  margin-left: 10rpx;
+}
+.time-list-view view{
+  height: 70rpx;
+  line-height: 70rpx;
+  margin: 35rpx 0;
+  padding: 0 10rpx;
+}
+.curTimeDate{
+  color: #FFF;
+  background: #005033;
+}

+ 7 - 0
pages/myself/myself.wxml

@@ -87,6 +87,13 @@
 				</view>
 				<image lazy-load mode="aspectFill" class="li-arrow" src="{{imageUrl? imageUrl+'arrow0603.png' : ''}}"></image>
 			</view>
+			<view class="list-item"  catchtap="goNavigateTo" data-url="/pages/agreement/agreement">
+				<view class="li-left">
+					<image lazy-load mode="aspectFill" class="li-icon" src="/images/my-agreement.png"></image>
+					<text>用户协议</text>
+				</view>
+				<image lazy-load mode="aspectFill" class="li-arrow" src="{{imageUrl? imageUrl+'arrow0603.png' : ''}}"></image>
+			</view>
 		</view>
 	</view>
 </view>

+ 29 - 4
pages/piano/piano.js

@@ -12,14 +12,25 @@ Page({
     endDate: null,
     list: [
     ],
-    loading: '上拉加载',
+    loading: '加载中...',
     flag: 0,
     pageNum: 0,
     hasNextPage: true,
-    type: ''
+    type: '',
+    ruleShow: false,
   },
 
-
+  ruleShow:function(){
+    if(this.data.ruleShow){
+      this.setData({
+        ruleShow: false
+      })
+    }else{
+      this.setData({
+        ruleShow:true
+      })
+    }
+  },
 
   getPiano: function () {
     wx.navigateTo({
@@ -118,12 +129,26 @@ Page({
         })
         this.setData({
           'hasNextPage': rs.hasNextPage,
-          'loading': rs.hasNextPage ? '下拉刷新' : '没有更多数据',
+          'loading': rs.hasNextPage ? '上拉加载' : '没有更多数据',
           'list': this.data.list.concat(list)
         })
+        this.getCount()
       })
     }
   },
+
+  getCount:function(){
+    const urls = urlDef.urls;
+    let stu = wx.getStorageSync('student');
+    util.apiPost(urls.query_appointment_count, {'q.studentId': stu.studentId}).then(rs => {
+     if(rs[0] <= 0){
+       this.setData({
+        ruleShow:true
+       })
+     }
+    })
+  },
+
   canCancel(item) { // 判断是否能取消, 未到预约时间前都能取消,至少提前1个小时
     let t = item.visitDate + ' ' + item.beginTime + ':00';
     let vdt = new Date(t.replace(/-/g,'/'));

+ 54 - 11
pages/piano/piano.wxml

@@ -1,9 +1,12 @@
 <view class="container">
 
   <!-- 时间筛选 -->
-  <selectDate bind:getDates="getDates" beginDate="{{beginDate}}" endDate="{{endDate}}" typeFlag="{{true}}" toTop="{{-440}}" bind:changeType="changeType"></selectDate>
+  <view>
+    <selectDate bind:getDates="getDates" title="{{'历史课程'}}" beginDate="{{beginDate}}" endDate="{{endDate}}"
+      typeFlag="{{true}}" toTop="{{-440}}" bind:changeType="changeType"> </selectDate>
+  </view>
   <!-- end -->
-  
+
   <view class="piano-list">
     <view class="piano-box" wx:for="{{list}}" wx:key="index">
       <view class="piano-detail">
@@ -13,18 +16,58 @@
       </view>
       <view>
         <view class="piano-date">
-        {{item.createdDate}}
+          {{item.createdDate}}
         </view>
-      <view class="class-status" wx:if="{{item.attend == 0 && item.type != '2'}}">已预约</view>
-      <view class="class-status" wx:if="{{item.attend == 0 && item.type == '2'}}">排队中</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-btn" bindtap="doCancel" data-id="{{item.id}}" wx:if="{{item.cancelFlag && item.type == '1'}}">取消预约</view>
-      <view class="class-btn cancelList" bindtap="doCancelQueue" data-id="{{item.id}}" wx:if="{{item.type == '2'}}">取消排队</view>
+        <view class="class-status" wx:if="{{item.attend == 0 && item.type != '2'}}">已预约</view>
+        <view class="class-status" wx:if="{{item.attend == 0 && item.type == '2'}}">排队中</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-btn" bindtap="doCancel" data-id="{{item.id}}"
+          wx:if="{{item.cancelFlag && item.type == '1'}}">取消预约</view>
+        <view class="class-btn cancelList" bindtap="doCancelQueue" data-id="{{item.id}}" wx:if="{{item.type == '2'}}">
+          取消排队</view>
       </view>
     </view>
   </view>
   <view class="getPiano" bindtap="getPiano">去预约</view>
-  <view class="loading">{{loading}}</view> 
+  <view class="loading">{{loading}}</view>
+
+  <view class="rule-view" bindtap="ruleShow">规则</view>
+  <view class="rule-bg"  bindtap="ruleShow" wx:if="{{ruleShow}}"></view>
+  <view class="rule-box" wx:if="{{ruleShow}}">
+    <view class="rule-title">练琴规则</view>
+    <view>
+      1. 7*24 随时约 ,约课时间在练琴卡有效期内即可
+    </view>
+    <view>
+      2. 每人最多有2次约课机会,每次30分钟,(换句话说:一天最多可以约1个小时
+    </view>
+    <view>
+      3. 必须消课后,该次数自动释放,(例如:某学生,约5号. 6号各一次,当5号练完后,立刻释放一次约课机会,学生又可以约下一次)
+    </view>
+    <view>
+      4. 惩罚机制:如旷课,未出席,所约课程结束时间起计算,惩罚72小时内无法约课,该惩罚时间可由学校自行设置。(例如:例如:某学生,约5号17:00-17:30. 6号各一次,5号缺席,6号已约课程可正常出席,但无法再约课,且惩罚发的时间段为:5号的17:30起的72小时后)<br />
+    </view>
+    <view>
+      5. 消息提醒推送:提前90分钟,主动推送给家长已约好的时间段提醒,给2个选择框:准时出席,请假
+    </view>
+    <view>
+      6. 取消机制为:提前60分钟前取消,不予惩罚。请假的时间可由学校自行设置。
+    </view>
+    <view>
+      7. 候补机制:当学生有约课机会时,如该时间段满员,该时段出现候补字样。所有的约课,都针对某一时间段的时间。
+    </view>
+    <view>
+      8. 前台权限:如有家长忘记或遗漏选择请假,前台有释放任意空位的权限
+    </view>
+    <view>
+      9. 考勤:在约可以的有效时间段内,学生可以进行人脸或指纹打卡
+    </view>
+    <view>
+      10. 取消惩罚:校长对缺勤的学员取消预约限制
+    </view>
+    <view class="close-rule" bindtap="ruleShow" wx:if="{{ruleShow}}">X</view>
+  </view>
+  
 </view>

+ 61 - 1
pages/piano/piano.wxss

@@ -27,7 +27,7 @@ page{
 }
 
 .piano-time {
-  font-weight: 600;
+  font-weight: 400;
 }
 
 .piano-date {
@@ -170,4 +170,64 @@ page{
 .cancelList{
   border-color: #cc6031;
   color: #cc6031;
+}
+
+.rule-view{
+  background: #cc6031;
+    color: #FFF;
+    width: 100rpx;
+    line-height: 50rpx;
+    text-align: center;
+    border-radius: 100rpx 0 0 100rpx;
+    position: fixed;
+    bottom: 45rpx;
+    right: 0;
+    font-size: 24rpx;
+    text-indent: 24rpx;
+}
+.rule-bg{
+  position: fixed;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  background: #333;
+  opacity: 0.3;
+  z-index: 4;
+}
+.rule-box{
+  position: fixed;
+  top: 50%;
+  margin-top: -450rpx;
+  width: 650rpx;
+  height: 850rpx;
+  left: 25rpx;
+  background: #FFF;
+  z-index: 5;
+  overflow: auto;
+  line-height: 1.8;
+  color: #666;
+  font-size: 24rpx;
+  border: 25rpx solid #FFF;
+  border-radius: 20rpx;
+}
+
+.rule-title{
+  font-size: 36rpx;
+  text-align: center;
+  margin: 20rpx;
+  color: #333;
+}
+.close-rule{
+  position: fixed;
+    width: 60rpx;
+    line-height: 60rpx;
+    color: #333;
+    text-align: center;
+    border-radius: 60rpx;
+    top: 50%;
+    z-index: 5;
+    margin-top: -430rpx;
+    right: 50rpx;
+    border: 1rpx solid #333;
+    background: #FFF;
 }

+ 1 - 1
pages/pianoDetail/pianoDetail.js

@@ -218,7 +218,7 @@ Page({
         bussType: '15',
         sourceId: _this.id,
         amount: _this.payMoney,
-        openId: wx.getStorageSync('openId'),
+        openId: wx.getStorageSync('openId'), 
         appId: app.globalData.appId
       }).then(res => {
         wx.hideLoading({

+ 16 - 6
pages/queue/queue.js

@@ -7,6 +7,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    ShowBtn: false,
     planId: undefined,
     orgId: undefined,
     waitDate: undefined,
@@ -31,14 +32,14 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-
+   
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    
   },
 
   /**
@@ -52,7 +53,7 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-
+    
   },
 
   /**
@@ -99,6 +100,14 @@ Page({
           title: '排队成功',
           icon: 'success'
         })
+        let pages = getCurrentPages();
+        let prevPage = pages[pages.length - 2]
+        prevPage.setData({
+          refreshFlag: 1
+        })
+        this.setData({
+          list:[]
+        })
         this.queryList()
       }
     })
@@ -112,19 +121,20 @@ Page({
       if(list.length > 0){
         let stuId = wx.getStorageSync('student').studentId
         for(var i in list){
+          list[i].name = list[i].name.substring(0,1)+ "*"+list[i].name.substring(list[i].name.length -1,list[i].name.length)
           if(list[i].studentId == stuId){
             this.setData({
               btnFlag: false
             })
-            break
           }
         }
       }
 
       this.setData({
         'hasNextPage': rs.hasNextPage,
-        'loading': rs.hasNextPage ? '下拉刷新' : '没有更多数据',
-        'list': this.data.list.concat(list)
+        'loading': rs.hasNextPage ? '上拉加载' : '没有更多数据',
+        'list': this.data.list.concat(list),
+        ShowBtn: true
       })
     })
   },

+ 1 - 1
pages/queue/queue.json

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

+ 6 - 2
pages/queue/queue.wxml

@@ -1,4 +1,8 @@
 <view class="container">
+  <view class="none-view" wx:if="{{list.length <= 0}}">
+    <image src="/images/none-list.png"></image>
+    <view class="none-tip">还没有人排队哦 ~~</view>
+  </view>
   <view class="list-view">
     <view class="list-box" wx:for="{{list}}" wx:key="index">
       <view class="list-img">
@@ -17,6 +21,6 @@
     </view>
   </view>
   
-  <view class="queueBtn"  bindtap="doQueueUp" wx:if="{{btnFlag}}">预约</view>
-  <view class="queueBtn cancelBtn" wx:else>已预约</view>
+  <view class="queueBtn"  bindtap="doQueueUp" wx:if="{{btnFlag && ShowBtn}}">排队</view>
+  <view class="queueBtn cancelBtn" wx:else>排队中</view>
 </view>

+ 20 - 1
pages/queue/queue.wxss

@@ -55,4 +55,23 @@
 }
 .list-view{
   padding-bottom: 100rpx;
-}
+}
+
+.none-view{
+  width: 396rpx;
+  height: 258rpx;
+  position: absolute;
+  top: 30%;
+  left: 50%;
+  margin-left: -198rpx;
+}
+.none-view image{
+  width: 100%;
+  height: 100%;
+}
+.none-tip{
+  text-align: center;
+  height: 100rpx;
+  line-height: 100rpx;
+  color: #999;
+}

+ 2 - 2
project.private.config.json

@@ -13,8 +13,8 @@
     "miniprogram": {
       "list": [
         {
-          "name": "pages/queue/queue",
-          "pathName": "pages/queue/queue",
+          "name": "pages/agreement/agreement",
+          "pathName": "pages/agreement/agreement",
           "query": "",
           "scene": null
         }

+ 1 - 0
utils/urls.js

@@ -164,6 +164,7 @@ export const urls = {
   do_appointment: schoolBase + '/student/appointment',
   do_appointment_check: schoolBase + '/student/checkCard',
   query_appointment_list: crudListBase + '?statement=ExercisePlanMapper.queryReserve',
+  query_appointment_count: crudListBase + '?statement=ExercisePlanMapper.queryHasVisitCount',
   cancel_appointment: schoolBase + '/timetable/updateExercisePlanStatus',
   queueUp: schoolBase + '/exerciseVisit/waitInsert',
   delete_queue: schoolBase + '/crud/delete/exerciseWait',

+ 1 - 7
utils/util.js

@@ -161,10 +161,6 @@ function setAccessHeader(accessKey, appId) {
 
 function apiPost(url, params, contentType) {
   return new Promise((resolve, reject) => {
-    wx.showLoading({
-      title: '加载中',
-      mask: true
-    })
     let headers = getHeaders();
     headers['Content-Type'] = 'application/x-www-form-urlencoded';
     if (contentType) {
@@ -193,9 +189,7 @@ function apiPost(url, params, contentType) {
         })
       },
       complete: res =>{
-        wx.hideLoading({
-          success: (res) => {},
-        })
+        
       }
     })
   }).catch(err => {