| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 | 
							
- var app = getApp()
 
- var api = require('../../utils/api.js');
 
- Page({
 
-   data: {
 
-     date: '',
 
-     typeEnum: [
 
-       '短假', '长假'
 
-     ],
 
-     selectedType: 0
 
-   },
 
-   onLoad: function () {
 
-     let date = this.getNowFormatDate();
 
-     this.setData({
 
-       date: date
 
-     })
 
-   },
 
-   getNowFormatDate() {
 
-     var date = new Date();
 
-     var seperator1 = "-";
 
-     var year = date.getFullYear();
 
-     var month = date.getMonth() + 1;
 
-     var strDate = date.getDate();
 
-     if(month >= 1 && month <= 9) {
 
-       month = "0" + month;
 
-     }
 
-         if (strDate >= 0 && strDate <= 9) {
 
-       strDate = "0" + strDate;
 
-     }
 
-         var currentdate = year + seperator1 + month + seperator1 + strDate;
 
-     return currentdate;
 
-   },
 
-   bindDateChange: function(e) {
 
-     console.log('picker发送选择改变,携带值为', e.detail.value)
 
-     this.setData({
 
-       date: e.detail.value
 
-     })
 
-   },
 
-   formSubmit: function (e) {
 
-     let value = e.detail.value
 
-     wx.request({
 
-       url: api.applyLeaveUrl,
 
-       method: 'GET',
 
-       data: {
 
-         'student_id': wx.getStorageSync('pt_student').id,
 
-         'date': value.date,
 
-         'type': value.type == 0 ? '1' : '2',
 
-         'days': value.days,
 
-         'remark': value.remark
 
-       },
 
-       success: res => {
 
-         if(res.data.status == 'success') {
 
-           wx.showToast({
 
-             title: '请假成功',
 
-             icon: 'none',
 
-             duration: 800
 
-           })
 
-         } else {
 
-           wx.showToast({
 
-             title: res.data.info,
 
-             icon: 'none',
 
-             duration: 800
 
-           })
 
-         }
 
-       }
 
-     })
 
-   }
 
- })
 
 
  |