// pages/user/verify/index.js import commonApi from "../../../utils/https/common" import util from "../../../utils/util" Page({ /** * 页面的初始数据 */ data: { id_number:"", name:"" }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, verify:function(){ if(!this.data.name){ wx.showToast({ title: '请输入姓名', icon:'none' }) return; } if(!this.data.id_number){ wx.showToast({ title: '请输入身份证号', icon:'none' }) return; } commonApi.user_post("pbservice/Ztfw/realnameCertificate",{ id_card:this.data.id_number, realname:this.data.name }).then(res=>{ if(res.code==1){ wx.showToast({ title: '认证成功', icon:'success' }) setTimeout(()=>{ util.back() },1000) } }) }, changeName:function(e){ this.setData({ name:e.detail.value }) }, changeId:function(e){ this.setData({ id_number:e.detail.value }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { } })