1 line
5.7 KiB
JavaScript
1 line
5.7 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["Account-vue"],{"77be":function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.showPage?"account backWhile":"account"},[t.showPage?n("div",{staticClass:"account_welcome"},[n("img",{attrs:{src:"img/welcome_login.png",alt:""}}),n("van-button",{style:{background:t.currentTheme},attrs:{round:!0,type:"default"},on:{click:t.hiddenWelcome}},[t._v(" 立 即 登 录 ")]),n("p",[t._v(" 还没有账号?快来"),n("span",{on:{click:t.nowAdd}},[t._v(" 注册")])])],1):n("div",{staticClass:"account_action"},[n("van-tabs",{attrs:{"line-height":7,"line-width":30,border:!1,color:t.textColor,"title-active-color":t.textColor},on:{change:t.changeAction},model:{value:t.AccountAction,callback:function(e){t.AccountAction=e},expression:"AccountAction"}},[n("van-tab",{attrs:{title:"登 录"}},[n("div",{staticClass:"login"},[n("div",{staticClass:"username_input input"},[n("div",{staticClass:"tips"},[t._v("用户名")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.UserInfo.name,expression:"UserInfo.name"}],style:{color:t.textColor},attrs:{type:"text"},domProps:{value:t.UserInfo.name},on:{input:function(e){e.target.composing||t.$set(t.UserInfo,"name",e.target.value)}}})]),n("div",{staticClass:"userpwd_input"},[n("div",{staticClass:"tips"},[t._v("密码")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.UserInfo.pwd,expression:"UserInfo.pwd"}],style:{color:t.textColor},attrs:{type:"password"},domProps:{value:t.UserInfo.pwd},on:{input:function(e){e.target.composing||t.$set(t.UserInfo,"pwd",e.target.value)}}})]),n("van-button",{style:{background:t.currentTheme},attrs:{round:!0,type:"default"},on:{click:t.UserLogin}},[t._v("登 录")])],1)]),n("van-tab",{attrs:{title:"注 册"}},[n("div",{staticClass:"login"},[n("div",{staticClass:"username_input input"},[n("div",{staticClass:"tips"},[t._v("用户名")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.UserInfo.name,expression:"UserInfo.name"}],style:{color:t.textColor},attrs:{type:"text"},domProps:{value:t.UserInfo.name},on:{input:function(e){e.target.composing||t.$set(t.UserInfo,"name",e.target.value)}}})]),n("div",{staticClass:"userpwd_input"},[n("div",{staticClass:"tips"},[t._v("手机号")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.UserInfo.phone,expression:"UserInfo.phone"}],style:{color:t.textColor},attrs:{type:"text"},domProps:{value:t.UserInfo.phone},on:{input:function(e){e.target.composing||t.$set(t.UserInfo,"phone",e.target.value)}}})]),n("div",{staticClass:"userpwd_input"},[n("div",{staticClass:"tips"},[t._v("密码")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.UserInfo.pwd,expression:"UserInfo.pwd"}],style:{color:t.textColor},attrs:{type:"password"},domProps:{value:t.UserInfo.pwd},on:{input:function(e){e.target.composing||t.$set(t.UserInfo,"pwd",e.target.value)}}})]),n("van-button",{style:{background:t.currentTheme},attrs:{round:!0,type:"default"},on:{click:t.addUser}},[t._v("注 册")])],1)])],1),n("van-grid",{attrs:{border:!1}},t._l(t.themeColor,(function(e,o){return n("van-grid-item",{on:{click:function(n){return t.changeTheme(e)}}},[n("div",{staticClass:"color-item",style:{background:e.backgroundColor}})])})),1)],1)])},r=[],s=(n("0d15"),n("63ff"),n("e5af")),a={data:function(){return{UserInfo:{name:"lb",pwd:"1234567890",phone:"15155145354"},showPage:!0,left:50,AccountAction:0,currentTheme:"linear-gradient(to right, #efe5f2 0%, #cd6cf2 100%)",textColor:"#9a99f6",titleName:"登 录",themeColor:[{textColor:"#9a99f6",backgroundColor:"linear-gradient(to right, #efe5f2 0%, #cd6cf2 100%)"},{textColor:"rgb(250, 108, 159)",backgroundColor:"linear-gradient(to right,#fa6c9f 0%,#ffe140 80%,#ffe140 100%)"},{textColor:"rgb(68, 234, 118)",backgroundColor:"linear-gradient(to right,#44ea76 0%,#39fad7 80%,#39fad7 100%)"}]}},inject:["close","open"],beforeRouteEnter:function(t,e,n){n((function(t){return t.close()}))},beforeRouteLeave:function(t,e,n){this.open(),n()},methods:{UserLogin:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(0!==this.UserInfo.name.length&&0!==this.UserInfo.pwd.length){t.next=4;break}this.$toast.fail("信息不完整,请检查"),t.next=9;break;case 4:return console.log(this.$route.query.from),t.next=7,this.$http.userService.UserLogin(this.UserInfo);case 7:e=t.sent,void 0!==e&&(this.$router.push({path:"/"}),localStorage.setItem("token",e.token));case 9:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),addUser:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(0!==this.UserInfo.name.length&&0!==this.UserInfo.pwd.length&&0!==this.UserInfo.phone.length){t.next=4;break}this.$toast.fail("信息不完整,请检查"),t.next=10;break;case 4:return t.next=6,this.$http.userService.UserAdd(this.UserInfo);case 6:e=t.sent,console.log(e),this.$toast.success("注册成功请登录"),this.AccountAction=0;case 10:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),hiddenWelcome:function(){this.showPage=!1},nowAdd:function(){this.showPage=!1,this.AccountAction=1},changeTheme:function(t){this.textColor=t.textColor,this.currentTheme=t.backgroundColor},changeAction:function(t){0==t?(this.left=50,this.titleName="登 录"):(this.left=240,this.titleName="注 册")}}},i=a,c=(n("8760"),n("5511")),l=Object(c["a"])(i,o,r,!1,null,"57af00ca",null);e["default"]=l.exports},8760:function(t,e,n){"use strict";var o=n("c30f"),r=n.n(o);r.a},c30f:function(t,e,n){}}]); |