| 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(t){let o=this;e.index.$on("getRegistrationID",function(r){o.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 t={phone:this.userName,password:this.password};e.index.showLoading({title:"注册中..."}),a.register(t).then(o=>{o.code==200?(console.log("注册好了"),this.doLogin()):(e.index.hideLoading(),e.index.showToast({title:o.msg,icon:"none"}))},o=>{})},doLogin(){var t={phone:this.userName,password:this.password,loginType:1};a.loginByApp(t).then(o=>{e.index.hideLoading(),o.code==200?(e.index.setStorageSync("AppToken",o.token),e.index.setStorageSync("userInfo",JSON.stringify(o.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:o.msg,icon:"none"})},o=>{})},getRegistrationID(){},handleAgree(){this.agree=!this.agree},goToWeb(t){e.index.setStorageSync("url",t==0?"https://userapp.his.cdwjyyh.com/web/userAgreement":"https://userapp.his.cdwjyyh.com/web/privacyPolicy"),e.index.navigateTo({url:"/pages/index/h5"})}}};function h(t,o,r,p,s,n){return{a:s.userName,b:e.o(i=>s.userName=i.detail.value),c:s.password,d:e.o(i=>s.password=i.detail.value),e:s.password1,f:e.o(i=>s.password1=i.detail.value),g:e.o((...i)=>n.doRegister&&n.doRegister(...i)),h:d._imports_0$3,i:!s.agree,j:d._imports_1$3,k:s.agree,l:e.o((...i)=>n.handleAgree&&n.handleAgree(...i)),m:e.o(i=>n.goToWeb(0)),n:e.o(i=>n.goToWeb(1))}}const c=e._export_sfc(g,[["render",h]]);wx.createPage(c);
|