// pages/lixiaoshenqing/lixiaoshenqing.js Page({ /** * 页面的初始数据 */ data: { classes:'', s_id:'', name:'', dormitory:'', phone :'', reason:'', l_time:'', b_time:'', place:'', p_phone:'', what:'离校', status:"正在审核" }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, inputclasses:function(e){ this.setData({classes:e.detail.value }) }, inputs_id:function(e){ this.setData({s_id:e.detail.value}) }, inputname:function(e){ this.setData({name:e.detail.value}) }, inputdormitory:function(e){ this.setData({dormitory:e.detail.value}) }, inputphone:function(e){ this.setData({phone:e.detail.value}) }, inputreason:function(e){ this.setData({reason:e.detail.value}) }, inputl_time:function(e){ this.setData({l_time:e.detail.value}) }, inputb_time:function(e){ this.setData({b_time:e.detail.value}) }, inputplace:function(e){ this.setData({place:e.detail.value}) }, inputp_phone:function(e){ this.setData({p_phone:e.detail.value}) }, send:function(){ wx.request({ url: 'http://127.0.0.1:80/sub_leave_school/', method:"POST", data:this.data, header: { 'content-type': 'application/json' // 默认值 }, success(res){ console.log(res.data) if (res.data.code = "200"){ wx.showToast({ title: '提交成功', icon: 'success', duration:1000, success :function (){ setTimeout(function(){ wx.redirectTo({ url: '../chakanjieguo/chankanjieguo', }) },1000) } }) } } }) } })