首页 > 其他 > 详细

提交表单传值

时间:2018-09-25 20:15:24      阅读:167      评论:0      收藏:0      [点我收藏+]
data: {
localImage: app.globalData.localImage,
com_mobile: null,//电话号码
com_password: null,//密码
},
 
/**
* 提交表单 注册
*/
submit: function (e) {
console.log(e)
let value = e.detail.value;
/**
* 判断每个input是否为空
*/
if (value.Phone_number == ‘‘) {
wx.showToast({
title: ‘手机号码不能为空‘,
icon: ‘none‘,
})
return false;
} else if (value.Verification_Code == ‘‘) {
wx.showToast({
title: ‘验证码不能为空‘,
icon: ‘none‘,
})
return false;
} else if (value.Verification_Code !=code) {
wx.showToast({
title: ‘验证码不正确‘,
icon: ‘none‘,
})
return false;
} else if (value.Password == ‘‘) {
wx.showToast({
title: ‘密码不能为空‘,
icon: ‘none‘,
})
return false;
} else if (value.Password2 == ‘‘) {
wx.showToast({
title: ‘重复密码不能为空‘,
icon: ‘none‘,
})
return false;
} else if (value.password2 != value.password1) {
wx.showToast({
title: ‘密码和重复密码不相同‘,
icon: ‘none‘,
})
return false;
}
let data = {
com_mobile: value.Phone_number,
com_password: utilMd5.hexMD5(value.Password),
}
console.log(JSON.stringify(data))
wx.navigateTo({
url: ‘../Perfect_information/Perfect_information?data=‘ + JSON.stringify(data)
})
},
 //新页面接收值
var last_page_data=null//全局
 
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
that = this;
last_page_data = JSON.parse(options.data)
console.log(last_page_data)
},

提交表单传值

原文:https://www.cnblogs.com/xiaoruaning/p/9702970.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!