// pages/contract/list/add.js import * as UTIL from '../../../utils/util.js'; import * as API from '../../../utils/API.js'; let EVN_CONFIG = require('../../../env/env'); const app = getApp(); Page({ /** * 页面的初始数据 */ data: { isIPX: app.globalData.isIPX, name:'', remark:'', buildingTime: UTIL.formatDate(new Date()) }, onChange(event){ console.log(event); this.setData({ [event.currentTarget.dataset.formname]: event.detail, }) }, goKeep(){ var that = this; if (that.data.name == '') { UTIL.showToastNoneIcon('请填写合同名称!'); return; } wx.showLoading({ title: '加载中', mask:true }) let data = { name:that.data.name, remark:that.data.remark, buildingTime:that.data.buildingTime, method:'POST' } UTIL.httpRequest(API.URL_GET_GETFILLADD, data, { success: (res) => { wx.showToast({ title: "保存成功!", duration: 2000, icon:"success", mask:true }) setTimeout(function(){ wx.hideLoading(); wx.navigateBack({ delta:1 }) },2000) } }) }, bindDateChange: function(e) { console.log('picker发送选择改变,携带值为', e.detail.value) this.setData({ [e.currentTarget.dataset.value]: e.detail.value }) }, back:function(){ wx.navigateBack({ delta: 1 }) }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })