1 line
7.8 KiB
JavaScript
1 line
7.8 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/login/openlogin"],{2429:function(e,o,t){"use strict";(function(e,o){var i=t("47a9");t("7d57");i(t("3240"));var n=i(t("db4f"));e.__webpack_require_UNI_MP_PLUGIN__=t,o(n.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},"26f4":function(e,o,t){},"6a8c":function(e,o,t){"use strict";t.d(o,"b",(function(){return i})),t.d(o,"c",(function(){return n})),t.d(o,"a",(function(){}));var i=function(){var e=this,o=e.$createElement,t=(e._self._c,e.theme()||""),i=e.theme();e._isMounted||(e.e0=function(o){e.is_login=1},e.e1=function(o){e.is_login=2},e.e2=function(o){e.is_login=1},e.e3=function(o){e.is_login=0},e.e4=function(o){e.isRead=!e.isRead}),e.$mp.data=Object.assign({},{$root:{m0:t,m1:i}})},n=[]},"71f4":function(e,o,t){"use strict";var i=t("26f4"),n=t.n(i);n.a},acd0:function(e,o,t){"use strict";(function(e){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var t={data:function(){return{formData:{mobile:"",code:""},loging_password:"",register:{mobile:"",password:"",repassword:"",code:""},resetpassword:{mobile:"",password:"",repassword:"",code:""},is_send:!1,send_btn_txt:"获取验证码",second:60,ip:"",isShow:!0,is_login:1,is_code:!1,phoneHeight:0,isRead:!1,showWeixin:!1,showApple:!1}},onShow:function(){this.init()},onLoad:function(){this.getData()},methods:{init:function(){var o=this;e.getSystemInfo({success:function(e){o.phoneHeight=e.windowHeight}}),plus.runtime.isApplicationExist({pname:"com.tencent.mm",action:"weixin://"})&&(o.showWeixin=!0),e.getSystemInfo({success:function(e){e.system.replace(/iOS /,"");"ios"==e.platform&&(o.showApple=!0)}})},getData:function(){var e=this;e._get("user.userapple/policy",{},(function(o){console.log(o),e.service=o.data.service,e.privacy=o.data.privacy}))},formSubmit:function(){var o=this,t={mobile:o.formData.mobile},i="";if(o.isRead){if(!/^1(3|4|5|6|7|8|9)\d{9}$/.test(o.formData.mobile))return console.log(o.formData.mobile),void e.showToast({title:"手机有误,请重填!",duration:2e3,icon:"none"});if(o.is_code){if(console.log(o.is_code),""==o.formData.code)return void e.showToast({title:"验证码不能为空!",duration:2e3,icon:"none"});t.code=o.formData.code,i="user.useropen/smslogin"}else{if(""==o.loging_password)return void e.showToast({title:"密码不能为空!",duration:2e3,icon:"none"});t.password=o.loging_password,i="user.useropen/phonelogin"}e.showLoading({title:"正在提交"}),o._post(i,t,(function(t){e.setStorageSync("token",t.data.token),e.setStorageSync("user_id",t.data.user_id);var i=e.getStorageSync("currentPage"),n=e.getStorageSync("currentPageOptions");if(Object.keys(n).length>0){for(var s in i+="?",n)i+=s+"="+n[s]+"&";i=i.substring(0,i.length-1)}o.gotoPage(i)}),!1,(function(){e.hideLoading()}))}else e.showToast({title:"请同意并勾选协议内容",duration:2e3,icon:"none"})},registerSub:function(){var o=this;if(!/^1(3|4|5|6|7|8|9)\d{9}$/.test(o.register.mobile))return console.log(o.register.mobile),void e.showToast({title:"手机有误,请重填!",duration:2e3,icon:"none"});""!=o.register.code?o.register.password.length<6?e.showToast({title:"密码至少6位数!",duration:2e3,icon:"none"}):o.register.password===o.register.repassword?o.isRead?(o.register.invitation_id=e.getStorageSync("invitation_id")?e.getStorageSync("invitation_id"):0,o.register.reg_source="app",o.register.referee_id=e.getStorageSync("referee_id"),e.showLoading({title:"正在提交"}),o._post("user.useropen/register",o.register,(function(t){e.showToast({title:"注册成功",duration:3e3}),o.formData.mobile=o.register.mobile,o.register={mobile:"",password:"",repassword:"",code:""},o.second=0,o.changeMsg(),o.is_login=1}),!1,(function(){e.hideLoading()}))):e.showToast({title:"请同意并勾选协议内容",duration:2e3,icon:"none"}):e.showToast({title:"两次密码输入不一致!",duration:2e3,icon:"none"}):e.showToast({title:"验证码不能为空!",duration:2e3,icon:"none"})},resetpasswordSub:function(){var o=this;/^1(3|4|5|6|7|8|9)\d{9}$/.test(o.resetpassword.mobile)?""!=o.resetpassword.code?o.resetpassword.password.length<6?e.showToast({title:"密码至少6位数!",duration:2e3,icon:"none"}):o.resetpassword.password===o.resetpassword.repassword?(e.showLoading({title:"正在提交"}),o._post("user.useropen/resetpassword",o.resetpassword,(function(t){e.showToast({title:"重置成功",duration:3e3}),o.formData.mobile=o.resetpassword.mobile,o.resetpassword={mobile:"",password:"",repassword:"",code:""},o.second=0,o.changeMsg(),o.is_login=1}),!1,(function(){e.hideLoading()}))):e.showToast({title:"两次密码输入不一致!",duration:2e3,icon:"none"}):e.showToast({title:"验证码不能为空!",duration:2e3,icon:"none"}):e.showToast({title:"手机有误,请重填!",duration:2e3,icon:"none"})},isCode:function(){this.is_code?this.$set(this,"is_code",!1):this.$set(this,"is_code",!0),console.log(this.is_code)},sendCode:function(){var o=this;if(1==o.is_login){if(!/^1(3|4|5|6|7|8|9)\d{9}$/.test(o.formData.mobile))return void e.showToast({title:"手机有误,请重填!",duration:2e3,icon:"none"})}else if(2==o.is_login){if(!/^1(3|4|5|6|7|8|9)\d{9}$/.test(o.register.mobile))return void e.showToast({title:"手机有误,请重填!",duration:2e3,icon:"none"})}else if(0==o.is_login&&!/^1(3|4|5|6|7|8|9)\d{9}$/.test(o.resetpassword.mobile))return void e.showToast({title:"手机有误,请重填!",duration:2e3,icon:"none"});var t="register",i=o.register.mobile;1==o.is_login?(t="login",i=o.formData.mobile):0==o.is_login&&(t="login",i=o.resetpassword.mobile),o._post("user.useropen/sendCode",{mobile:i,type:t},(function(t){1==t.code&&(e.showToast({title:"发送成功"}),o.is_send=!0,o.changeMsg())}))},login:function(){var o=this;plus.oauth.getServices((function(t){var i=t[0];i.authResult?console.log("已经登陆认证"):i.authorize((function(t){e.showLoading({title:"登录中",mask:!0}),o._post("user.useropen/login",{code:t.code,source:"app"},(function(t){e.setStorageSync("token",t.data.token),e.setStorageSync("user_id",t.data.user_id);var i=e.getStorageSync("currentPage"),n=e.getStorageSync("currentPageOptions");if(Object.keys(n).length>0){for(var s in i+="?",n)i+=s+"="+n[s]+"&";i=i.substring(0,i.length-1)}o.gotoPage(i)}),!1,(function(){e.hideLoading()}))}),(function(o){console.log("登陆认证失败!"),e.showModal({title:"认证失败1",content:JSON.stringify(o)})}))}),(function(e){console.log("获取服务列表失败:"+JSON.stringify(e))}))},changeMsg:function(){this.second>0?(this.send_btn_txt=this.second+"秒",this.second--,setTimeout(this.changeMsg,1e3)):(this.send_btn_txt="获取验证码",this.second=60,this.is_send=!1)},xieyi:function(o){var t="";t="service"==o?this.service:this.privacy,e.navigateTo({url:"/pages/webview/webview?url="+t})},appleLogin:function(){var o=this;e.login({provider:"apple",success:function(t){e.getUserInfo({provider:"apple",success:function(t){if("getUserInfo:ok"!==t.errMsg)return!1;e.showLoading({title:"正在登录",mask:!0}),o._post("user.userapple/login",{invitation_id:o.invitation_id,openId:t.userInfo.openId,nickName:t.userInfo.fullName.giveName?t.userInfo.fullName.giveName:"",referee_id:e.getStorageSync("referee_id"),source:"apple"},(function(o){e.setStorageSync("token",o.data.token),e.setStorageSync("user_id",o.data.user_id),e.navigateBack()}),!1,(function(){e.hideLoading()}))}})},fail:function(e){console.log("登录失败"),console.log(e)}})}}};o.default=t}).call(this,t("df3c")["default"])},db4f:function(e,o,t){"use strict";t.r(o);var i=t("6a8c"),n=t("e96c");for(var s in n)["default"].indexOf(s)<0&&function(e){t.d(o,e,(function(){return n[e]}))}(s);t("71f4");var r=t("828b"),a=Object(r["a"])(n["default"],i["b"],i["c"],!1,null,"283f4222",null,!1,i["a"],void 0);o["default"]=a.exports},e96c:function(e,o,t){"use strict";t.r(o);var i=t("acd0"),n=t.n(i);for(var s in i)["default"].indexOf(s)<0&&function(e){t.d(o,e,(function(){return i[e]}))}(s);o["default"]=n.a}},[["2429","common/runtime","common/vendor"]]]); |