|
- // 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:''
- },
- 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,
- id:that.data.id,
- method:'POST'
- }
- UTIL.httpRequest(API.URL_GET_GETFILLEDIT, 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) {
- let data = {
- method:'GET'
- }
- var that = this;
- UTIL.httpRequest(API.URL_GET_GETFILLGET + options.id, data, {
- success: (res) => {
- that.setData({
- name: res.data.name,
- buildingTime: res.data.buildingTime,
- remark: res.data.remark,
- id:options.id
- })
- }
- })
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
-
- }
- })
|