pages-login-register.87aae38a.js
10.7 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-login-register"],{"0a2b":function(t,e,n){"use strict";var a=n("ae81"),i=n.n(a);i.a},"14ba":function(t,e,n){"use strict";n("d3b7"),Object.defineProperty(e,"__esModule",{value:!0}),e.request=e.baseURL=void 0;var a="http://yuanjie.n.broing.cn/api/";e.baseURL=a;var i=function(t){return new Promise((function(e,n){uni.request({url:a+t.url,method:t.method||"GET",data:t.data||{},header:{"Content-Type":"application/x-www-form-urlencoded",token:uni.getStorageSync("token")||""},success:function(t){console.log(t,uni.getStorageSync("token")),1==t.data.code?e(t.data.data):(401==t.data.code&&(uni.navigateTo({url:"/login/login"}),uni.clearStorageSync()),n(t.data.msg))},fail:function(t){console.log(t),n(t)}})}))};e.request=i},"1a9f":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAgreement=e.resetPassword=e.sendCode=e.register=e.login=void 0;var a=n("14ba"),i=function(t,e){return(0,a.request)({url:"user/login",method:"post",data:{account:t,password:e}})};e.login=i;var o=function(t,e,n,i){return(0,a.request)({url:"user/register",method:"post",data:{username:t,password:e,mobile:n,code:i}})};e.register=o;var r=function(t,e){return(0,a.request)({url:"sms/send",method:"post",data:{mobile:t,event:e}})};e.sendCode=r;var s=function(t,e,n,i){return(0,a.request)({url:"user/resetpwd",method:"post",data:{mobile:t,captcha:e,newpassword:n,confirmpassword:i}})};e.resetPassword=s;var c=function(t){return(0,a.request)({url:"common/agreement ",method:"post",data:{type:t}})};e.getAgreement=c},"40c0":function(t,e,n){"use strict";n.r(e);var a=n("a933"),i=n.n(a);for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);e["default"]=i.a},6356:function(t,e,n){var a=n("24fb");e=a(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.login[data-v-2280b4ed]{padding:0 %?48?%;box-sizing:border-box}.login .icon .bgimg[data-v-2280b4ed]{margin-top:%?100?%;margin-left:50%;-webkit-transform:translate(-50%);transform:translate(-50%);margin-bottom:%?24?%;width:%?184?%;height:%?184?%}.login .icon .bar[data-v-2280b4ed]{border-bottom:1px solid #f0f0f0;padding:%?40?% 0;color:#000;font-size:%?32?%;font-weight:500;font-family:PingFang SC}.login .icon .bar .name[data-v-2280b4ed]{width:%?180?%}.login .icon .bar .lastname[data-v-2280b4ed]{flex:1;position:relative}.login .icon .bar .lastname uni-input[data-v-2280b4ed]{width:100%}.login .icon .bar .lastname .code[data-v-2280b4ed]{position:absolute;right:0;top:50%;-webkit-transform:translate(-10%,-50%);transform:translate(-10%,-50%);color:rgba(0,0,0,.26);font-size:%?32?%;font-weight:400;font-family:PingFang SC}.login .icon .loginbtn[data-v-2280b4ed]{margin-top:%?100?%;height:%?88?%;border-radius:%?28?%;opacity:1;color:rgba(0,0,0,.9);font-size:%?32?%;font-weight:600;font-family:PingFang SC;text-align:center;line-height:%?88?%;background:#fed000}.login .icon .passway[data-v-2280b4ed]{text-align:right;margin-top:%?16?%}.login .icon .passway uni-text[data-v-2280b4ed]{color:#fed000;font-size:%?26?%;font-weight:400;font-family:PingFang SC}.login .icon .user[data-v-2280b4ed]{position:fixed;bottom:%?78?%;left:50%;width:100%;text-align:center;-webkit-transform:translate(-50%);transform:translate(-50%);display:flex;align-items:center;justify-content:center;color:#646566;font-size:%?24?%;font-weight:400;font-family:PingFang SC}.login .icon .user uni-image[data-v-2280b4ed]{margin-right:%?22?%;width:%?36?%;height:%?36?%}.login .icon .user uni-text[data-v-2280b4ed]{margin-right:%?24?%;color:#576b95;font-size:%?24?%;font-weight:400;font-family:PingFang SC}',""]),t.exports=e},"68a6":function(t,e,n){"use strict";n.r(e);var a=n("e454"),i=n("40c0");for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("0a2b");var r,s=n("f0c5"),c=Object(s["a"])(i["default"],a["b"],a["c"],!1,null,"2280b4ed",null,!1,a["a"],r);e["default"]=c.exports},"71a1":function(t,e,n){t.exports=n.p+"static/img/ic_logo.1321f14a.png"},a933:function(t,e,n){"use strict";var a=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("96cf");var i=a(n("1da1")),o=n("1a9f"),r=n("bbe3"),s={data:function(){return{username:"",password:"",mobile:"",code:"",clearId:"",num:0,isSelect:!1}},methods:{goLogin:function(){uni.navigateBack({})},toRegister:function(){return this.username?this.password?this.mobile?this.code?this.isSelect?void this.register():r.toa.toast("请先同意用户协议和隐私政策"):r.toa.toast("请输入验证码"):r.toa.toast("请输入手机号"):r.toa.toast("请输入密码"):r.toa.toast("请输入用户名")},register:function(){var t=this;return(0,i.default)(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,o.register)(t.username,t.password,t.mobile,t.code);case 3:n=e.sent,console.log("register",n),r.toa.success("注册成功"),e.next=12;break;case 8:e.prev=8,e.t0=e["catch"](0),uni.showToast({title:e.t0,icon:"none"}),console.log("register",e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,8]])})))()},getCode:function(){if(!(this.num>0))return this.mobile?/^1[34578]\d{9}$/.test(this.mobile)?void this.sendCode():r.toa.toast("请输入正确手机号"):r.toa.toast("请先输入手机号")},sendCode:function(){var t=this;return(0,i.default)(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,o.sendCode)(t.mobile,"register");case 3:n=e.sent,r.toa.success("发送成功"),t.setInter(),console.log("sendCode",n),e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](0),uni.showToast({title:e.t0,icon:"none"}),console.log("sendCode",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))()},setInter:function(){var t=this;this.num=60,this.clearId=setInterval((function(){t.num--}),1e3)},toAgree:function(t){uni.navigateTo({url:"/pages/login/agreement?type="+t})}},onHide:function(){this.num=0,clearInterval(this.clearId)},watch:{num:function(t,e){0==t&&(this.num=0,clearInterval(this.clearId))}}};e.default=s},ae81:function(t,e,n){var a=n("6356");"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=n("4f06").default;i("9846d566",a,!0,{sourceMap:!1,shadowMode:!1})},bbe3:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.router=e.toa=e.hideLoading=e.loading=e.success=e.toast=void 0;var a=function(t){return uni.showToast({title:t,icon:"none"})};e.toast=a;var i=function(t){return uni.showToast({title:t})};e.success=i;var o=function(t){return uni.showLoading({title:"加载中"})};e.loading=o;var r=function(){return uni.hideLoading()};e.hideLoading=r;var s={toast:function(t){return uni.showToast({title:t,icon:"none"})},success:function(t){return uni.showToast({title:t})},loading:function(t){return uni.showLoading({title:t||"加载中",mask:!0})},hideLoading:function(){return uni.hideLoading()}};e.toa=s;var c={back:function(t){return uni.navigateBack({delta:t||1})}};e.router=c},e454:function(t,e,n){"use strict";var a;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"login"},[a("v-uni-view",{staticClass:"icon"},[a("v-uni-image",{staticClass:"bgimg",attrs:{src:n("71a1"),mode:""}}),a("v-uni-view",{staticClass:"bar flexwrap"},[a("v-uni-view",{staticClass:"name"},[t._v("用户名:")]),a("v-uni-view",{staticClass:"lastname"},[a("v-uni-input",{attrs:{maxlength:"16",type:"text",value:"",placeholder:"请输入用户名"},model:{value:t.username,callback:function(e){t.username=e},expression:"username"}})],1)],1),a("v-uni-view",{staticClass:"bar flexwrap"},[a("v-uni-view",{staticClass:"name"},[t._v("密码:")]),a("v-uni-view",{staticClass:"lastname"},[a("v-uni-input",{attrs:{maxlength:"16",type:"text",value:"",placeholder:"请输入密码"},model:{value:t.password,callback:function(e){t.password=e},expression:"password"}})],1)],1),a("v-uni-view",{staticClass:"bar flexwrap"},[a("v-uni-view",{staticClass:"name"},[t._v("手机号:")]),a("v-uni-view",{staticClass:"lastname"},[a("v-uni-input",{attrs:{maxlength:"11",type:"number",value:"",placeholder:"请输入手机号"},model:{value:t.mobile,callback:function(e){t.mobile=e},expression:"mobile"}})],1)],1),a("v-uni-view",{staticClass:"bar flexwrap"},[a("v-uni-view",{staticClass:"name"},[t._v("验证码:")]),a("v-uni-view",{staticClass:"lastname"},[a("v-uni-input",{attrs:{maxlength:"6",type:"text",value:"",placeholder:"请输入验证码"},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}}),a("v-uni-view",{staticClass:"code",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.getCode.apply(void 0,arguments)}}},[t._v(t._s(0==t.num?"获取验证码":t.num+"秒重新发送"))])],1)],1),a("v-uni-view",{staticClass:"loginbtn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toRegister.apply(void 0,arguments)}}},[t._v("注册")]),a("v-uni-view",{staticClass:"passway",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goLogin.apply(void 0,arguments)}}},[a("v-uni-text",[t._v("已有账号,直接登录")])],1),a("v-uni-view",{staticClass:"user"},[t.isSelect?a("v-uni-image",{attrs:{src:"/static/icon25.png",mode:""},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.isSelect=!t.isSelect}}}):a("v-uni-image",{attrs:{src:"/static/icon24.png",mode:""},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.isSelect=!t.isSelect}}}),t._v("我已阅读并同意"),a("v-uni-text",{staticStyle:{"margin-left":"10rpx"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toAgree(1)}}},[t._v("用户协议、")]),a("v-uni-text",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toAgree(2)}}},[t._v("隐私政策")])],1)],1)],1)},o=[]}}]);