let $api = require('../../utils/ajaxFn.js') let md5 = require('../../utils/md5.js') const app = getApp() Page({ data: { userStyle:{}, newTwo:"", info:{ newPwd: "", oldPwd: "" } }, onLoad() { this.setData({ userStyle:app.userStyle }) }, getOld(e){ this.setData({ 'info.oldPwd':md5.hex_md5(e.detail.value) }) }, getNem(e){ this.setData({ 'info.newPwd':md5.hex_md5(e.detail.value) }) }, getNemTwo(e){ console.log(3) this.setData({ newTwo: md5.hex_md5(e.detail.value) }) }, save(){ console.log(this.data.newTwo,this.data.info) if(this.data.newTwo != this.data.info.newPwd){ my.showToast({ content: '两次新密码不一致,请确认', duration: 2000, }); return } $api.ajax( '/sib/user/updatePwd', 'POST', (res)=>{ }, (err)=>{ }, true, { ...this.data.info } ) } });