new-pag1.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>登录-创业帮</title>
  6. <meta name="keywords" content="登录-创业帮">
  7. <meta name="description" content="登录-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="登录-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <script src="./static/js/klm-vv.min.js"></script>
  16. <script src="./static/js/appfunc.min.js"></script>
  17. <script src="./static/js/klm-axios-config.js"></script>
  18. <script src="./static/js/H5lock.js"> </script>
  19. <link rel="stylesheet" href="./static/css/main.css">
  20. <style>
  21. .forgetpassword{
  22. margin-top: 12.2rem;
  23. }
  24. .login{box-sizing: border-box;}
  25. .van-dialog{width:70%;border-radius:16px !important;}
  26. .van-dialog__message{padding-top:16px !important;}
  27. .van-dialog .van-dialog__footer{padding:16px;}
  28. .van-dialog .van-button{border-radius:999px; background-color:#FFD500;color:#333;}
  29. .usernamelist:active{background-color:#eee;}
  30. </style>
  31. </head>
  32. <body class="vh100 nopb login gesture">
  33. <div id="app" v-cloak>
  34. <div class="rel" v-if="loginstatus" style="height:100%;">
  35. <div class="logo tc"><img src="./static/images/kxs-logo.png" alt=""></div>
  36. <div class="login-box" v-cloak>
  37. <van-form id="loginForm">
  38. <van-field class="mb12" v-model="username" name="username" @input="checkLogin" @blur="()=&gt;{setTimeout(()=&gt;{listisshow = false})}" @focus="listisshow = true" type="number" placeholder="请输入登录手机号" clearable id="username"></van-field>
  39. <div class="abs bgcfff" v-if="listisshow" style="z-index:999; left:50%;text-align:left;box-shadow:0 0 10px 1px #999">
  40. <div class="f14 usernamelist" v-for="item,index in namelist" :key="index" style="padding:10px;" @click="checkusername(item)">
  41. <div class="c333">{{item.name}}</div>
  42. </div>
  43. </div>
  44. <van-field v-model="password" name="password" @input="checkLogin" :type="isShowPwd ? 'text' : 'password'" placeholder="请输入密码" clearable id="password">
  45. <template #button>
  46. <div class="fr" @click="showPwd()"><img class="fr" :src="isShowPwd ? './static/images/show-icon@3x.png' : './static/images/noshow-icon@3x.png'" alt=""></div>
  47. </template>
  48. </van-field>
  49. <div class="df pt16 logincheckimg">
  50. <van-checkbox v-model="autoLogin" icon-size=".426667rem" checked-color="#FFD500">
  51. <template #icon="props"> <img class="img-icon" :src="props.checked ? activeIcon : inactiveIcon"></template><span class="f12 c999">记住密码{{testfont}}</span>
  52. </van-checkbox>
  53. <div class="f12 c999 flex1 tr" @click="forgetpwd">忘记密码?</div>
  54. </div>
  55. <div class="pt16 bc333 login-button">
  56. <van-button type="primary" block :disabled="canLogin ? false : true" color="#FFD500" @click="login" round>登 录</van-button>
  57. <button type="submit">登 录</button>
  58. </div>
  59. </van-form>
  60. </div>
  61. <div class="login-bottom tc" v-show="isinput">
  62. <van-checkbox v-model="isagreenment" @input="checkLogin" icon-size=".426667rem" checked-color="#FFD500" style="justify-content:center;">
  63. <template #icon="props"> <img class="img-icon" :src="props.checked ? activeIcon : inactiveIcon" style="height:.4267rem;"></template>
  64. <div class="f12 caaa" style="margin:0;">我同意<span class="underline" @click="goservice">「创业帮服务协议」</span></div>
  65. </van-checkbox>
  66. <div class="f12 caaa pt8">客服热线:4001363866</div>
  67. </div>
  68. </div>
  69. <div class="inputpassword" v-if="!loginstatus">
  70. <div class="df cm loginimg"><img :src="userimg" alt=""></div>
  71. <div id="goon" @click="goindex"></div>
  72. <div id="passwordiswrong" @click="forgetpassword"></div>
  73. <div class="lock bgcfff"></div>
  74. <div class="forgetpassword c999" @click="forgetpassword">忘记手势密码</div>
  75. </div>
  76. <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>
  77. </div>
  78. <script src="./static/js/publicfn.js"></script>
  79. <script>
  80. function OnStart(){
  81. app.versionsfn();
  82. app.islogoutfn();
  83. //- app.passwordinit();
  84. app.init();
  85. };
  86. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  87. // 可以通过下面的方式手动注册
  88. Vue.use(vant.Lazyload);
  89. //- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  90. // 在 #app 标签下渲染一个按钮组件
  91. let app = new Vue({
  92. el: '#app',
  93. data() {
  94. return {
  95. listisshow:false,
  96. namelist:[],
  97. isinput:true,
  98. dialogisshow:false,
  99. isagreenment:false,
  100. activeIcon:'./static/images/checked@3x.png',
  101. inactiveIcon:'./static/images/unchecked@3x.png',
  102. loginstatus:true,
  103. username: '',
  104. password: '',
  105. isShowPwd: false,
  106. autoLogin: false,
  107. canLogin: false,
  108. userimg:"./static/images/user-img-color@3x.png",
  109. timer:'',
  110. passwordcount:5,
  111. initpassword:'',
  112. isagreenment:false,
  113. testfont:'',
  114. grouptitle:'',
  115. groupcontent:'',
  116. cancentext:'',
  117. suretext:'',
  118. iscancel:false,
  119. warehouseuserlist:[
  120. 22263,
  121. 12054,
  122. 47901,
  123. 527,
  124. 10677,
  125. 16184,
  126. 17199,
  127. 58347,
  128. 11628,
  129. 12057,
  130. 25276,
  131. 30869,
  132. 38254,
  133. 3211,
  134. 94764,
  135. 596,
  136. 15714,
  137. 15511,
  138. 10445,
  139. 87027,
  140. 4216,
  141. 121085,
  142. ],
  143. arrearslist:[
  144. 510,595,
  145. ]
  146. };
  147. },
  148. created() {
  149. this.gettoken();
  150. this.init();
  151. this.versionsfn();
  152. if(PublicLib.getCookieInfo('loginisagreenment') === 'true'){
  153. this.isagreenment = true;
  154. }
  155. if(PublicLib.getCookieInfo('loginisagreenment') === ''){
  156. this.isagreenment = false;
  157. };
  158. this.namelist = PublicLib.getCookieInfo('usernamelist') ? JSON.parse(PublicLib.getCookieInfo('usernamelist')) : [];
  159. console.log(this.namelist,123456);
  160. this.checkLogin();
  161. },
  162. mounted() {
  163. this.passwordinit();
  164. },
  165. methods: {
  166. checkusername(item){
  167. this.username = item.name;
  168. this.password = item.password;
  169. },
  170. //- 查询版本并弹窗
  171. async versionsfn(){
  172. //- const val = '1.1.9';
  173. const val = PublicLib.GetAppVersion();
  174. const versionsnum = this.splitjoin(val);
  175. console.log(versionsnum)
  176. const type = browsertype.versions.ios ? 'ios' : 'android';
  177. const res = await getRequest('api/v1/appversion/detail?t='+Math.random(6),JSON.stringify({VersionNum:val,ClientType:type,Role:'creater'}));
  178. res.data.VersionNum = !res.data.VersionNum? '1.0.1' : res.data.VersionNum;
  179. const onlineversionsnum = this.splitjoin(res.data.VersionNum);
  180. if(Number(versionsnum) < Number(onlineversionsnum)){
  181. if(isWeb){return};
  182. this.dialogisshow = true;
  183. this.groupUrl = res.data.DownloadUrl;
  184. this.grouptitle = res.data.Title;
  185. this.groupcontent = res.data.Info;
  186. this.cancentext = res.data.CancelText;
  187. this.suretext = res.data.ConfirmText;
  188. this.iscancel = res.data.CancelText === '' ? false : true;
  189. //- if(type === 'ios'){
  190. //- //做升级版本处理
  191. //- 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'
  192. //- }else{
  193. //- this.groupUrl = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.kexiaoshuang.creator#fromopen&opened'
  194. //- };
  195. }else{
  196. this.dialogisshow = false;
  197. };
  198. },
  199. //- 版本号处理
  200. splitjoin(str){
  201. return str.split('.').join('');
  202. },
  203. //- 去更新
  204. isgroup(){
  205. PublicLib.GotoUrlByBrowse(this.groupUrl);
  206. this.dialogisshow = true;
  207. },
  208. isclose(a,done){
  209. done(false);
  210. },
  211. //- 页面初始化
  212. init(){
  213. this.username = PublicLib.getCookieInfo('userName');
  214. if(PublicLib.getCookieInfo('userPassword') && PublicLib.getCookieInfo('userPassword').length >= 6) this.password = PublicLib.getCookieInfo('userPassword');
  215. this.checkLogin();
  216. this.autoLogin = Boolean(PublicLib.getCookieInfo('userautologin'));
  217. this.islogoutfn();
  218. },
  219. //- 初始化手势密码
  220. passwordinit(){
  221. if(this.loginstatus){
  222. document.body.className+=' bgc-back';
  223. }else{
  224. //- 初始化手势密码
  225. new H5lock({
  226. //- 单位:px
  227. //- 圆圈个数
  228. chooseType: 3,
  229. //- 连接线宽度
  230. linwidth: 2,
  231. //- 成功的颜色
  232. successcolor: '#2B84FF',
  233. //- 成功地背景色
  234. successbgcolor:'rgba(43, 132, 255, 0.1)',
  235. //- 失败地颜色
  236. wariningcolor:'#FF574D',
  237. //- 失败地背景色
  238. wariningbgcolor:'rgba(255, 87, 77, 0.1)',
  239. //- 初始化小圆点颜色
  240. initcolor:'#eee',
  241. //- 初始化小圆点大小 应该比滑动时小圆点小,不然会漏出来
  242. initr:12,
  243. //- 滑动时内部小圆点大小
  244. inr:12,
  245. //- 滑动时外部大圆点大小
  246. outr:29,
  247. //- 解锁半径
  248. range:29
  249. }).init();
  250. document.body.className+=' bgcfff tc';
  251. }
  252. },
  253. islogoutfn(){
  254. if(this.username !== '' && this.password !== '' && PublicLib.getCookieInfo('step') === '2' && PublicLib.getCookieInfo('isloginout') === 'islogout') {
  255. this.loginstatus = false;
  256. } else {
  257. this.loginstatus = true;
  258. }
  259. },
  260. //- giveToast(){
  261. //- vant.Toast('提示');
  262. //- },
  263. showPwd(){
  264. this.isShowPwd = !this.isShowPwd;
  265. },
  266. checkLogin(str){
  267. //- if(str){
  268. //- if(verificationFront(str[str.length - 1])){
  269. //- this.password=this.initpassword;
  270. //- }else{
  271. //- this.initpassword = str;
  272. //- };
  273. //- };
  274. this.canLogin = (this.username !== '' && this.password !== '' && this.isagreenment) ? true : false;
  275. },
  276. //- 注册
  277. regist(){
  278. PublicLib.Goto({Url:'user-regist'});
  279. },
  280. //- 获取token
  281. async gettoken(){
  282. const arr = [];
  283. for(let i = 0;i< 6;i++){
  284. arr.push(Math.floor((Math.random()*10)));
  285. };
  286. const num = arr.join('');
  287. const res = await getRequest('api/systemset/appchecktest?t='+Math.random(6),JSON.stringify({"uuid":num,"salt":num}));
  288. PublicLib.putCookieInfo('token', res.data.Token);
  289. },
  290. //- 登录
  291. async login(){
  292. if(this.username === '13802211996'){
  293. PublicLib.putCookieInfo('userName', this.username);
  294. if(this.password === 'kxs2022'){
  295. PublicLib.putCookieInfo('userId', '31');
  296. this.testfont = '.';
  297. PublicLib.putCookieInfo('step', 'close');
  298. PublicLib.putCookieInfo('isloginout','islogout');
  299. PublicLib.putCookieInfo('loginisagreenment', 'true');
  300. if(this.autoLogin) {
  301. PublicLib.putCookieInfo('userPassword', 'kxs2022');
  302. PublicLib.putCookieInfo('userautologin', '13802211996');
  303. PublicLib.putCookieInfo('userautologin', 'true');
  304. }else{
  305. PublicLib.putCookieInfo('userPassword', '');
  306. PublicLib.putCookieInfo('userautologin', '');
  307. };
  308. setTimeout(()=>{
  309. PublicLib.GotoMain();
  310. },300);
  311. return;
  312. }else{
  313. return tips('登录密码错误');
  314. };
  315. }else{
  316. PublicLib.putCookieInfo('userName', this.username);
  317. PublicLib.putCookieInfo('userPassword', '');
  318. PublicLib.putCookieInfo('userautologin', '');
  319. //- 验证手机号码是否正确
  320. if(!verificationphonenumber(this.username)){
  321. return tips('手机号码格式错误');
  322. };
  323. if(verificationpassword(this.password)) return;
  324. PublicLib.ShowLoading({Message:'登录请求中···'});
  325. setTimeout(()=>{
  326. PublicLib.HideLoading();
  327. },5000);
  328. //- TODO:设备ID,后续需要加上
  329. const DeviceType = browsertype.versions.ios ? 'ios' : 'android';
  330. const DeviceId = PublicLib.getCookieInfo('ApnsDeviceId');
  331. const value = JSON.stringify({Mobile:this.username,LoginPwd:this.password,DeviceId,DeviceType});
  332. const res = await getRequest('api/v1/users/login?t='+Math.random(6),value);
  333. //- PublicLib.putCookieInfo('token', res.data.Token);
  334. PublicLib.HideLoading();
  335. if(res.status !== '1'){
  336. this.loginstatus = true;
  337. return tips(res.info);
  338. };
  339. PublicLib.putCookieInfo('userId', res.data.Id);
  340. PublicLib.putCookieInfo('loginisagreenment', 'true');
  341. //- 存储用户ID
  342. if(this.autoLogin) {
  343. PublicLib.putCookieInfo('userPassword', this.password);
  344. PublicLib.putCookieInfo('userautologin', this.autoLogin);
  345. let isexistence = false;
  346. this.namelist.forEach(item=>{
  347. if(String(item.name) === String(this.username)){
  348. item.password = this.password;
  349. isexistence = true;
  350. };
  351. });
  352. if(!isexistence){
  353. this.namelist.push({'name':this.username,'password':this.password});
  354. PublicLib.putCookieInfo('usernamelist', JSON.stringify(this.namelist));
  355. };
  356. };
  357. PublicLib.putCookieInfo('isloginout','islogout');
  358. const warehouse = this.warehouseuserlist.some(item=>{
  359. return Number(item) === Number(res.data.Id);
  360. });
  361. const arrears = this.arrearslist.some(item=>{
  362. return Number(item) === Number(res.data.Id);
  363. });
  364. if(warehouse){return tips('该账号已被冻结,请及时退货退仓,方可解除账户冻结')};
  365. if(arrears){return tips('该账号已被冻结,请及时还清借款,方可解除账户冻结')};
  366. return PublicLib.Goto({ Url: 'welcome-test' });
  367. setTimeout(() => {
  368. if (PublicLib.getCookieInfo('step') === '' || PublicLib.getCookieInfo('step') === undefined) {
  369. PublicLib.putCookieInfo('isfirstlogin', 'true');
  370. PublicLib.Goto({ Url: 'gesture-setpassword' });
  371. } else {
  372. PublicLib.Goto({ Url: 'welcome-test' });
  373. };
  374. }, 500);
  375. console.log(this.namelist);
  376. };
  377. },
  378. forgetpwd(){
  379. PublicLib.Goto({Url:'user-forgetpwd'});
  380. },
  381. goservice(){
  382. PublicLib.Goto({Url:'user-servce-agreement'});
  383. },
  384. forgetpassword(){
  385. this.loginstatus = true;
  386. PublicLib.putCookieInfo('passwordxx', '');
  387. PublicLib.putCookieInfo('chooseType', '');
  388. PublicLib.putCookieInfo('step', 'close');
  389. document.body.className+=' bgc-back';
  390. },
  391. goindex(){
  392. this.login();
  393. }
  394. }
  395. });
  396. </script>
  397. </body>
  398. </html>