index.js
4.8 KB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"0aa0":function(n,e,t){"use strict";var o=t("1604"),a=t.n(o);a.a},"0c9c":function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t={onLaunch:function(){console.log("App Launch")},onShow:function(){console.log("App Show")},onHide:function(){console.log("App Hide")},post:function(e,t,o){var a=this,s=new Promise((function(s,r){var i=n.getStorageSync("token"),u={token:i||""};n.request({url:a.globalData.baseUrl+e,data:t,method:o,header:u,success:function(n){200==n.statusCode?s(n):r(n.data)},fail:function(n){console.log(n),r("网络出错"),wx.hideNavigationBarLoading()},complete:function(n){}})}));return s},globalData:{userInfo:null,baseUrl:"https://www.bjzha.net/api/"}};e.default=t}).call(this,t("543d")["default"])},1604:function(n,e,t){},"1f18":function(n,e,t){"use strict";t.r(e);var o=t("0c9c"),a=t.n(o);for(var s in o)"default"!==s&&function(n){t.d(e,n,(function(){return o[n]}))}(s);e["default"]=a.a},"30b9":function(n,e,t){"use strict";t.r(e);var o=t("1f18");for(var a in o)"default"!==a&&function(n){t.d(e,n,(function(){return o[n]}))}(a);t("0aa0");var s,r,i,u,c=t("f0c5"),l=Object(c["a"])(o["default"],s,r,!1,null,null,null,!1,i,u);e["default"]=l.exports},"40f8":function(n,e,t){},"813b":function(n,e,t){"use strict";var o,a=function(){var n=this,e=n.$createElement;n._self._c},s=[];t.d(e,"b",(function(){return a})),t.d(e,"c",(function(){return s})),t.d(e,"a",(function(){return o}))},"866a":function(n,e,t){"use strict";var o=t("40f8"),a=t.n(o);a.a},c63a:function(n,e,t){"use strict";t.r(e);var o=t("813b"),a=t("e53b");for(var s in a)"default"!==s&&function(n){t.d(e,n,(function(){return a[n]}))}(s);t("866a");var r,i=t("f0c5"),u=Object(i["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],r);e["default"]=u.exports},e497:function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(t("30b9"));function a(n){return n&&n.__esModule?n:{default:n}}var s={data:function(){return{selshow:!0,phone:"",password:"",rangenum:"",yanzhengcode:"",tanceng:!1,seldeng:0,seldengk:0}},onLoad:function(){var e=("000000"+Math.floor(999999*Math.random())).slice(-6);this.rangenum=e;var t=n.getStorageSync("username"),o=n.getStorageSync("password");console.log("用户名",t),""!=t&&(this.phone=t,this.password=o,this.selshow=!0)},methods:{zhengce:function(e){var t=e.currentTarget.dataset.id;n.navigateTo({url:"../yinsi/yinsi?id="+t})},selectxuan:function(){console.log(888),this.selshow=!this.selshow,1==this.selshow?(n.setStorageSync("username",this.phone),n.setStorageSync("password",this.password)):n.setStorageSync("username","")},changenum:function(){var n=("000000"+Math.floor(999999*Math.random())).slice(-6);this.rangenum=n},enteryanzheng:function(n){this.yanzhengcode=n.target.value},onKeyInput:function(n){console.log(n),this.phone=n.target.value},enterpass:function(n){this.password=n.target.value},login:function(){var e=this,t=this;if(t.seldeng=1,console.log(666),console.log(this.phone),console.log(this.password),""==this.phone)return n.showToast({title:"请输入登录账号",icon:"none"}),t.seldeng=0,!1;if(""==this.password)return n.showToast({title:"请输入密码",icon:"none"}),t.seldeng=0,!1;if(""==this.yanzhengcode)return n.showToast({title:"请输入验证码",icon:"none"}),t.seldeng=0,!1;if(""!=this.yanzhengcode&&this.yanzhengcode!=this.rangenum)return n.showToast({title:"验证码输入错误",icon:"none"}),t.seldeng=0,!1;var a="project/Login",s={username:t.phone,password:t.password};console.log("8877665544",s),o.default.post(a,s,"post").then((function(o){t.seldengk=1,console.log("1234567890",o);var a=o.data;if(1==o.data[0].status)null==o.data[0].username?t.seldengk=0:t.seldengk=1,n.showToast({title:o.data[0].message,icon:"none"});else{n.setStorageSync("username",e.phone),n.setStorageSync("password",e.password);var s=a[0].role,r=a[0].userid,i=a[0].username;n.setStorageSync("role",s),n.setStorageSync("userid",r),n.setStorageSync("name",i),console.log("打印",n.getStorageSync("role")),console.log("打印",n.getStorageSync("name")),n.showToast({title:"登录成功",icon:"none"}),setTimeout((function(){console.log(8800),n.navigateTo({url:"../daiban/daiban"})}),500)}})).catch((function(n){console.log(n),t.seldengk=0,t.tanceng=!0,setTimeout((function(){t.tanceng=!1}),1500)}))}}};e.default=s}).call(this,t("543d")["default"])},e53b:function(n,e,t){"use strict";t.r(e);var o=t("e497"),a=t.n(o);for(var s in o)"default"!==s&&function(n){t.d(e,n,(function(){return o[n]}))}(s);e["default"]=a.a},f063:function(n,e,t){"use strict";(function(n){t("a237"),t("921b");o(t("66fd"));var e=o(t("c63a"));function o(n){return n&&n.__esModule?n:{default:n}}n(e.default)}).call(this,t("543d")["createPage"])}},[["f063","common/runtime","common/vendor"]]]);