register.js 2.3 KB

12
  1. "use strict";const e=require("../../common/vendor.js"),a=require("../../api/login.js"),d=require("../../common/assets.js"),g={components:{},data(){return{userName:"",password:"",password1:"",registrationID:"",yzcode:"",aback:!0,agree:!1}},onLoad(s){let i=this;e.index.$on("getRegistrationID",function(r){i.registrationID=r})},onShow(){this.$getRegistrationID()},onUnload(){e.index.$off("getRegistrationID")},mounted(){},methods:{doRegister(){if(this.$isEmpty(this.userName)){e.index.showToast({title:"请输入帐号",icon:"none"});return}if(this.$isEmpty(this.password)){e.index.showToast({title:"请输入密码",icon:"none"});return}if(this.password!=this.password1&&e.index.showToast({title:"两次密码输入不一致",icon:"none"}),!this.agree){e.index.showToast({title:"请同意相关协议",icon:"none"});return}var s={phone:this.userName,password:this.password};e.index.showLoading({title:"注册中..."}),a.register(s).then(i=>{i.code==200?(e.index.__f__("log","at pages/auth/register.vue:127","注册好了"),this.doLogin()):(e.index.hideLoading(),e.index.showToast({title:i.msg,icon:"none"}))},i=>{})},doLogin(){var s={phone:this.userName,password:this.password,loginType:1};a.loginByApp(s).then(i=>{e.index.hideLoading(),i.code==200?(e.index.setStorageSync("AppToken",i.token),e.index.setStorageSync("userInfo",JSON.stringify(i.user)),e.index.$emit("refreshIM"),e.index.$emit("showHealthButler"),e.index.reLaunch({url:"/pages/list/index",animationType:"pop-in",animationDuration:100})):e.index.showToast({title:i.msg,icon:"none"})},i=>{})},getRegistrationID(){},handleAgree(){this.agree=!this.agree},goToWeb(s){e.index.setStorageSync("url",s==0?"https://userapp.his.cdwjyyh.com/web/userAgreement":"https://userapp.his.cdwjyyh.com/web/privacyPolicy"),e.index.navigateTo({url:"/pages/index/h5"})}}};function h(s,i,r,p,t,n){return{a:t.userName,b:e.o(o=>t.userName=o.detail.value),c:t.password,d:e.o(o=>t.password=o.detail.value),e:t.password1,f:e.o(o=>t.password1=o.detail.value),g:e.o((...o)=>n.doRegister&&n.doRegister(...o)),h:d._imports_0,i:!t.agree,j:d._imports_1,k:t.agree,l:e.o((...o)=>n.handleAgree&&n.handleAgree(...o)),m:e.o(o=>n.goToWeb(0)),n:e.o(o=>n.goToWeb(1))}}const c=e._export_sfc(g,[["render",h]]);wx.createPage(c);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/auth/register.js.map