123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>登录-创业帮</title>
- <meta name="keywords" content="登录-创业帮">
- <meta name="description" content="登录-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="登录-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/H5lock.js"> </script>
- <link rel="stylesheet" href="./static/css/main.css">
- <style>
- .forgetpassword{
- margin-top: 12.2rem;
- }
- .login{box-sizing: border-box;}
- .van-dialog{width:70%;border-radius:16px !important;}
- .van-dialog__message{padding-top:16px !important;}
- .van-dialog .van-dialog__footer{padding:16px;}
- .van-dialog .van-button{border-radius:999px; background-color:#FFD500;color:#333;}
- .usernamelist:active{background-color:#eee;}
- </style>
- </head>
- <body class="vh100 nopb login gesture">
- <div id="app" v-cloak>
- <div class="rel" v-if="loginstatus" style="height:100%;">
- <div class="logo tc"><img src="./static/images/kxs-logo.png" alt=""></div>
- <div class="login-box" v-cloak>
- <van-form id="loginForm">
- <van-field class="mb12" v-model="username" name="username" @input="checkLogin" @blur="()=>{setTimeout(()=>{listisshow = false})}" @focus="listisshow = true" type="number" placeholder="请输入登录手机号" clearable id="username"></van-field>
- <div class="abs bgcfff" v-if="listisshow" style="z-index:999; left:50%;text-align:left;box-shadow:0 0 10px 1px #999">
- <div class="f14 usernamelist" v-for="item,index in namelist" :key="index" style="padding:10px;" @click="checkusername(item)">
- <div class="c333">{{item.name}}</div>
- </div>
- </div>
- <van-field v-model="password" name="password" @input="checkLogin" :type="isShowPwd ? 'text' : 'password'" placeholder="请输入密码" clearable id="password">
- <template #button>
- <div class="fr" @click="showPwd()"><img class="fr" :src="isShowPwd ? './static/images/show-icon@3x.png' : './static/images/noshow-icon@3x.png'" alt=""></div>
- </template>
- </van-field>
- <div class="df pt16 logincheckimg">
- <van-checkbox v-model="autoLogin" icon-size=".426667rem" checked-color="#FFD500">
- <template #icon="props"> <img class="img-icon" :src="props.checked ? activeIcon : inactiveIcon"></template><span class="f12 c999">记住密码{{testfont}}</span>
- </van-checkbox>
- <div class="f12 c999 flex1 tr" @click="forgetpwd">忘记密码?</div>
- </div>
- <div class="pt16 bc333 login-button">
- <van-button type="primary" block :disabled="canLogin ? false : true" color="#FFD500" @click="login" round>登 录</van-button>
- <button type="submit">登 录</button>
- </div>
- </van-form>
- </div>
- <div class="login-bottom tc" v-show="isinput">
- <van-checkbox v-model="isagreenment" @input="checkLogin" icon-size=".426667rem" checked-color="#FFD500" style="justify-content:center;">
- <template #icon="props"> <img class="img-icon" :src="props.checked ? activeIcon : inactiveIcon" style="height:.4267rem;"></template>
- <div class="f12 caaa" style="margin:0;">我同意<span class="underline" @click="goservice">「创业帮服务协议」</span></div>
- </van-checkbox>
- <div class="f12 caaa pt8">客服热线:4001363866</div>
- </div>
- </div>
- <div class="inputpassword" v-if="!loginstatus">
- <div class="df cm loginimg"><img :src="userimg" alt=""></div>
- <div id="goon" @click="goindex"></div>
- <div id="passwordiswrong" @click="forgetpassword"></div>
- <div class="lock bgcfff"></div>
- <div class="forgetpassword c999" @click="forgetpassword">忘记手势密码</div>
- </div>
- <van-dialog style="border-radius:4px;" v-model="dialogisshow" :show-cancel-button="iscancel" :before-close="isclose" :confirm-button-text="suretext" :cancel-button-text="cancentext" :title="grouptitle" confirm-button-color="#00000" :message="groupcontent" @cancel="dialogisshow = false" @confirm="isgroup"></van-dialog>
- </div>
- <script src="./static/js/publicfn.js"></script>
- <script>
- function OnStart(){
- app.versionsfn();
- app.islogoutfn();
- //- app.passwordinit();
- app.init();
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- //- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- listisshow:false,
- namelist:[],
- isinput:true,
- dialogisshow:false,
- isagreenment:false,
- activeIcon:'./static/images/checked@3x.png',
- inactiveIcon:'./static/images/unchecked@3x.png',
- loginstatus:true,
- username: '',
- password: '',
- isShowPwd: false,
- autoLogin: false,
- canLogin: false,
- userimg:"./static/images/user-img-color@3x.png",
- timer:'',
- passwordcount:5,
- initpassword:'',
- isagreenment:false,
- testfont:'',
- grouptitle:'',
- groupcontent:'',
- cancentext:'',
- suretext:'',
- iscancel:false,
- warehouseuserlist:[
- 22263,
- 12054,
- 47901,
- 527,
- 10677,
- 16184,
- 17199,
- 58347,
- 11628,
- 12057,
- 25276,
- 30869,
- 38254,
- 3211,
- 94764,
- 596,
- 15714,
- 15511,
- 10445,
- 87027,
- 4216,
- 121085,
- ],
- arrearslist:[
- 510,595,
- ]
- };
- },
- created() {
- this.gettoken();
- this.init();
- this.versionsfn();
- if(PublicLib.getCookieInfo('loginisagreenment') === 'true'){
- this.isagreenment = true;
- }
- if(PublicLib.getCookieInfo('loginisagreenment') === ''){
- this.isagreenment = false;
- };
- this.namelist = PublicLib.getCookieInfo('usernamelist') ? JSON.parse(PublicLib.getCookieInfo('usernamelist')) : [];
- console.log(this.namelist,123456);
- this.checkLogin();
- },
- mounted() {
- this.passwordinit();
- },
- methods: {
- checkusername(item){
- this.username = item.name;
- this.password = item.password;
- },
- //- 查询版本并弹窗
- async versionsfn(){
- //- const val = '1.1.9';
- const val = PublicLib.GetAppVersion();
- const versionsnum = this.splitjoin(val);
- console.log(versionsnum)
- const type = browsertype.versions.ios ? 'ios' : 'android';
- const res = await getRequest('api/v1/appversion/detail?t='+Math.random(6),JSON.stringify({VersionNum:val,ClientType:type,Role:'creater'}));
- res.data.VersionNum = !res.data.VersionNum? '1.0.1' : res.data.VersionNum;
- const onlineversionsnum = this.splitjoin(res.data.VersionNum);
- if(Number(versionsnum) < Number(onlineversionsnum)){
- if(isWeb){return};
- this.dialogisshow = true;
- this.groupUrl = res.data.DownloadUrl;
- this.grouptitle = res.data.Title;
- this.groupcontent = res.data.Info;
- this.cancentext = res.data.CancelText;
- this.suretext = res.data.ConfirmText;
- this.iscancel = res.data.CancelText === '' ? false : true;
- //- if(type === 'ios'){
- //- //做升级版本处理
- //- this.groupUrl = 'https://apps.apple.com/cn/app/%E5%AE%A2%E5%B0%8F%E7%88%BD%E5%88%9B%E5%AE%A2%E7%89%88/id1606114555'
- //- }else{
- //- this.groupUrl = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.kexiaoshuang.creator#fromopen&opened'
- //- };
- }else{
- this.dialogisshow = false;
- };
- },
- //- 版本号处理
- splitjoin(str){
- return str.split('.').join('');
- },
- //- 去更新
- isgroup(){
- PublicLib.GotoUrlByBrowse(this.groupUrl);
- this.dialogisshow = true;
- },
- isclose(a,done){
- done(false);
- },
- //- 页面初始化
- init(){
- this.username = PublicLib.getCookieInfo('userName');
- if(PublicLib.getCookieInfo('userPassword') && PublicLib.getCookieInfo('userPassword').length >= 6) this.password = PublicLib.getCookieInfo('userPassword');
- this.checkLogin();
- this.autoLogin = Boolean(PublicLib.getCookieInfo('userautologin'));
- this.islogoutfn();
- },
- //- 初始化手势密码
- passwordinit(){
- if(this.loginstatus){
- document.body.className+=' bgc-back';
- }else{
- //- 初始化手势密码
- new H5lock({
- //- 单位:px
- //- 圆圈个数
- chooseType: 3,
- //- 连接线宽度
- linwidth: 2,
- //- 成功的颜色
- successcolor: '#2B84FF',
- //- 成功地背景色
- successbgcolor:'rgba(43, 132, 255, 0.1)',
- //- 失败地颜色
- wariningcolor:'#FF574D',
- //- 失败地背景色
- wariningbgcolor:'rgba(255, 87, 77, 0.1)',
- //- 初始化小圆点颜色
- initcolor:'#eee',
- //- 初始化小圆点大小 应该比滑动时小圆点小,不然会漏出来
- initr:12,
- //- 滑动时内部小圆点大小
- inr:12,
- //- 滑动时外部大圆点大小
- outr:29,
- //- 解锁半径
- range:29
- }).init();
- document.body.className+=' bgcfff tc';
- }
- },
- islogoutfn(){
- if(this.username !== '' && this.password !== '' && PublicLib.getCookieInfo('step') === '2' && PublicLib.getCookieInfo('isloginout') === 'islogout') {
- this.loginstatus = false;
- } else {
- this.loginstatus = true;
- }
- },
- //- giveToast(){
- //- vant.Toast('提示');
- //- },
- showPwd(){
- this.isShowPwd = !this.isShowPwd;
- },
- checkLogin(str){
- //- if(str){
- //- if(verificationFront(str[str.length - 1])){
- //- this.password=this.initpassword;
- //- }else{
- //- this.initpassword = str;
- //- };
- //- };
- this.canLogin = (this.username !== '' && this.password !== '' && this.isagreenment) ? true : false;
- },
- //- 注册
- regist(){
- PublicLib.Goto({Url:'user-regist'});
- },
- //- 获取token
- async gettoken(){
- const arr = [];
- for(let i = 0;i< 6;i++){
- arr.push(Math.floor((Math.random()*10)));
- };
- const num = arr.join('');
- const res = await getRequest('api/systemset/appchecktest?t='+Math.random(6),JSON.stringify({"uuid":num,"salt":num}));
- PublicLib.putCookieInfo('token', res.data.Token);
- },
- //- 登录
- async login(){
- if(this.username === '13802211996'){
- PublicLib.putCookieInfo('userName', this.username);
- if(this.password === 'kxs2022'){
- PublicLib.putCookieInfo('userId', '31');
- this.testfont = '.';
- PublicLib.putCookieInfo('step', 'close');
- PublicLib.putCookieInfo('isloginout','islogout');
- PublicLib.putCookieInfo('loginisagreenment', 'true');
- if(this.autoLogin) {
- PublicLib.putCookieInfo('userPassword', 'kxs2022');
- PublicLib.putCookieInfo('userautologin', '13802211996');
- PublicLib.putCookieInfo('userautologin', 'true');
- }else{
- PublicLib.putCookieInfo('userPassword', '');
- PublicLib.putCookieInfo('userautologin', '');
- };
- setTimeout(()=>{
- PublicLib.GotoMain();
- },300);
- return;
- }else{
- return tips('登录密码错误');
- };
- }else{
- PublicLib.putCookieInfo('userName', this.username);
- PublicLib.putCookieInfo('userPassword', '');
- PublicLib.putCookieInfo('userautologin', '');
- //- 验证手机号码是否正确
- if(!verificationphonenumber(this.username)){
- return tips('手机号码格式错误');
- };
- if(verificationpassword(this.password)) return;
- PublicLib.ShowLoading({Message:'登录请求中···'});
- setTimeout(()=>{
- PublicLib.HideLoading();
- },5000);
- //- TODO:设备ID,后续需要加上
- const DeviceType = browsertype.versions.ios ? 'ios' : 'android';
- const DeviceId = PublicLib.getCookieInfo('ApnsDeviceId');
- const value = JSON.stringify({Mobile:this.username,LoginPwd:this.password,DeviceId,DeviceType});
- const res = await getRequest('api/v1/users/login?t='+Math.random(6),value);
- //- PublicLib.putCookieInfo('token', res.data.Token);
- PublicLib.HideLoading();
- if(res.status !== '1'){
- this.loginstatus = true;
- return tips(res.info);
- };
- PublicLib.putCookieInfo('userId', res.data.Id);
- PublicLib.putCookieInfo('loginisagreenment', 'true');
- //- 存储用户ID
- if(this.autoLogin) {
- PublicLib.putCookieInfo('userPassword', this.password);
- PublicLib.putCookieInfo('userautologin', this.autoLogin);
- let isexistence = false;
- this.namelist.forEach(item=>{
- if(String(item.name) === String(this.username)){
- item.password = this.password;
- isexistence = true;
- };
- });
- if(!isexistence){
- this.namelist.push({'name':this.username,'password':this.password});
- PublicLib.putCookieInfo('usernamelist', JSON.stringify(this.namelist));
- };
- };
- PublicLib.putCookieInfo('isloginout','islogout');
- const warehouse = this.warehouseuserlist.some(item=>{
- return Number(item) === Number(res.data.Id);
- });
- const arrears = this.arrearslist.some(item=>{
- return Number(item) === Number(res.data.Id);
- });
- if(warehouse){return tips('该账号已被冻结,请及时退货退仓,方可解除账户冻结')};
- if(arrears){return tips('该账号已被冻结,请及时还清借款,方可解除账户冻结')};
- return PublicLib.Goto({ Url: 'welcome-test' });
- setTimeout(() => {
- if (PublicLib.getCookieInfo('step') === '' || PublicLib.getCookieInfo('step') === undefined) {
- PublicLib.putCookieInfo('isfirstlogin', 'true');
- PublicLib.Goto({ Url: 'gesture-setpassword' });
- } else {
- PublicLib.Goto({ Url: 'welcome-test' });
- };
- }, 500);
- console.log(this.namelist);
- };
- },
- forgetpwd(){
- PublicLib.Goto({Url:'user-forgetpwd'});
- },
- goservice(){
- PublicLib.Goto({Url:'user-servce-agreement'});
- },
- forgetpassword(){
- this.loginstatus = true;
- PublicLib.putCookieInfo('passwordxx', '');
- PublicLib.putCookieInfo('chooseType', '');
- PublicLib.putCookieInfo('step', 'close');
- document.body.className+=' bgc-back';
- },
- goindex(){
- this.login();
- }
- }
- });
- </script>
- </body>
- </html>
|