index.vue 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109
  1. <template>
  2. <view class="login-wrapper" :style="colorStyle">
  3. <view class="login-top"></view>
  4. <view class="shading">
  5. <image :src="logoUrl" v-if="logoUrl" />
  6. <image src="../static/logo2.png" v-else />
  7. </view>
  8. <view class="whiteBg" v-if="formItem === 1">
  9. <view class="tips">
  10. <view class="tips-btn" :class="current == 0 ? 'on' : ''" @click="current = 0">
  11. <view>账号登录</view>
  12. <view :class="current == 0 ? 'line' : 'none'"></view>
  13. </view>
  14. <view class="tips-btn" :class="current == 1 ? 'on' : ''" @click="current = 1">
  15. <view>注册登录</view>
  16. <view :class="current == 1 ? 'line' : 'none'"></view>
  17. </view>
  18. </view>
  19. <view class="list" v-if="current !== 1">
  20. <form @submit.prevent="submit">
  21. <view class="item">
  22. <view class="acea-row row-middle">
  23. <image src="../static/phone_1.png" class="itemImg-add"></image>
  24. <input type="text" placeholder="输入手机号码" v-model="account" maxlength="11" required />
  25. </view>
  26. </view>
  27. <view class="item">
  28. <view class="acea-row row-middle">
  29. <image src="../static/code_1.png" class="item-img"></image>
  30. <input type="password" placeholder="填写登录密码" v-model="password" required />
  31. </view>
  32. </view>
  33. </form>
  34. <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
  35. 忘记密码?
  36. </navigator>
  37. </view>
  38. <view class="list" v-if="current !== 0">
  39. <view class="item">
  40. <view class="acea-row row-middle">
  41. <image src="../static/phone_1.png" class="itemImg-add"></image>
  42. <input type="text" placeholder="输入手机号码" v-model="account" maxlength="11" />
  43. </view>
  44. </view>
  45. <view class="item">
  46. <view class="acea-row row-middle">
  47. <image src="../static/phone_1.png" class="itemImg-add"></image>
  48. <input type="text" placeholder="输入邀请码" v-model="spread_spid" maxlength="11" />
  49. </view>
  50. </view>
  51. <view class="item">
  52. <view class="acea-row row-middle">
  53. <image src="../static/code_2.png" class="item-img"></image>
  54. <input type="text" placeholder="填写验证码" maxlength="6" class="codeIput" v-model="captcha" />
  55. <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
  56. {{ text }}
  57. </button>
  58. </view>
  59. </view>
  60. <!-- <view class="item" v-if="isShowCode">
  61. <view class="acea-row row-middle">
  62. <image src="../static/code_2.png" class="item-img"></image>
  63. <input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
  64. <view class="code" @click="again"><img :src="codeUrl" /></view>
  65. </view>
  66. </view> -->
  67. </view>
  68. <view class="logon" @click="loginMobile" v-if="current !== 0">登录</view>
  69. <view class="logon" @click="submit" v-if="current === 0">登录</view>
  70. <!-- #ifdef H5 -->
  71. <view class="logon" @click="domApp" style="margin-top: 20rpx;">下载APP</view>
  72. <!-- #endif -->
  73. <!-- #ifdef APP-PLUS -->
  74. <!-- <view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">
  75. <view class="hds">
  76. <span class="line"></span>
  77. <p>其他方式登录</p>
  78. <span class="line"></span>
  79. </view>
  80. <view class="btn-wrapper">
  81. <view class="btn wx" @click="wxLogin">
  82. <span class="iconfont icon-s-weixindenglu1"></span>
  83. </view>
  84. <view class="btn pingguo" @click="appleLogin" v-if="appleShow">
  85. <view class="iconfont icon-s-pingguo"></view>
  86. </view>
  87. </view>
  88. </view> -->
  89. <!-- #endif -->
  90. <view class="protocol">
  91. <checkbox-group @change='ChangeIsDefault'>
  92. <checkbox :class="inAnimation?'trembling':''" @animationend='inAnimation=false'
  93. :checked="protocol ? true : false" />已阅读并同意 <text class="main-color"
  94. @click="privacy('user')">《用户协议》</text>
  95. 与<text class="main-color" @click="privacy('privacy ')">《隐私协议》</text>
  96. </checkbox-group>
  97. </view>
  98. </view>
  99. <view class="bottom"></view>
  100. <Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
  101. ref="verify"></Verify>
  102. <view class="copyright" v-if="copyrightContext">{{copyrightContext}}</view>
  103. <!-- <view class="copyright" v-else>Copyright ©2014-2023 <text class="domain" @click="domainTap('https://www.crmeb.com')">www.crmeb.com</text></view> -->
  104. </view>
  105. </template>
  106. <script>
  107. import dayjs from "@/plugin/dayjs/dayjs.min.js";
  108. import sendVerifyCode from "@/mixins/SendVerifyCode";
  109. import {
  110. getAppVersion
  111. } from '@/api/api.js';
  112. import {
  113. loginH5,
  114. loginMobile,
  115. registerVerify,
  116. register,
  117. getCodeApi,
  118. getUserInfo,
  119. appleLogin
  120. } from "@/api/user";
  121. import attrs, {
  122. required,
  123. alpha_num,
  124. chs_phone
  125. } from "@/utils/validate";
  126. import {
  127. validatorDefaultCatch
  128. } from "@/utils/dialog";
  129. import {
  130. getLogo
  131. } from "@/api/public";
  132. // import cookie from "@/utils/store/cookie";
  133. import {
  134. VUE_APP_API_URL
  135. } from "@/utils";
  136. // #ifdef APP-PLUS
  137. import {
  138. wechatAppAuth
  139. } from '@/api/api.js'
  140. // #endif
  141. const BACK_URL = "login_back_url";
  142. import colors from '@/mixins/color.js';
  143. import Verify from '../components/verify/verify.vue';
  144. export default {
  145. name: "Login",
  146. components: {
  147. Verify
  148. },
  149. mixins: [sendVerifyCode, colors],
  150. data: function() {
  151. return {
  152. // #ifdef H5
  153. showDom: true,
  154. // #endif
  155. inAnimation: false,
  156. protocol: false,
  157. navList: [ "账号登录","注册登录"],
  158. current: 0,
  159. account: "",
  160. password: "",
  161. spread_spid:'',
  162. captcha: "",
  163. formItem: 1,
  164. type: "login",
  165. logoUrl: "",
  166. keyCode: "",
  167. codeUrl: "",
  168. codeVal: "",
  169. isShowCode: false,
  170. appLoginStatus: false, // 微信登录强制绑定手机号码状态
  171. appUserInfo: null, // 微信登录保存的用户信息
  172. appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
  173. appleUserInfo: null,
  174. appleShow: false, // 苹果登录版本必须要求ios13以上的
  175. keyLock: true,
  176. copyrightContext:''
  177. };
  178. },
  179. watch: {
  180. formItem: function(nval, oVal) {
  181. if (nval == 1) {
  182. this.type = 'login'
  183. } else {
  184. this.type = 'register'
  185. }
  186. }
  187. },
  188. onLoad(res) {
  189. let self = this
  190. uni.getSystemInfo({
  191. success: (res) => {
  192. if (res.platform.toLowerCase() == 'ios' && this.getSystem(res.system)) {
  193. self.appleShow = true
  194. }
  195. }
  196. });
  197. if(res.spid){
  198. this.spread_spid =res.spid;
  199. }
  200. },
  201. mounted: function() {
  202. // this.getCode();
  203. this.getLogoImage();
  204. this.spread_spid = this.$Cache.get("spid");
  205. if(!this.spid){
  206. this.spread_spid = this.$Cache.get("spid");
  207. }
  208. },
  209. methods: {
  210. // #ifdef H5
  211. domApp() {
  212. const bool = navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger';
  213. if (bool) {
  214. uni.showModal({
  215. title: '提示',
  216. content: '无法在微信中下载,请用浏览器打开下载',
  217. showCancel: false,
  218. });
  219. } else {
  220. window.open('https://www.senyinkj.cn//register/index.html')
  221. // getAppVersion().then((res) => {
  222. // console.log(res,'res');
  223. // window.open(res.data.apk)
  224. // }).catch((err)=>{
  225. // console.log(err,'err');
  226. // })
  227. }
  228. },
  229. // #endif
  230. domainTap(url){
  231. // #ifdef H5
  232. location.href = url
  233. // #endif
  234. // #ifdef MP || APP-PLUS
  235. uni.navigateTo({
  236. url: `/pages/annex/web_view/index?url=${url}`
  237. });
  238. // #endif
  239. },
  240. changeMsg() {
  241. this.inAnimation = true;
  242. },
  243. ChangeIsDefault(e) {
  244. this.$set(this, 'protocol', !this.protocol);
  245. },
  246. // IOS 版本号判断
  247. getSystem(system) {
  248. let str
  249. system.toLowerCase().indexOf('ios') === -1 ? str = system : str = system.split(' ')[1]
  250. if (str.indexOf('.'))
  251. return str.split('.')[0] >= 13
  252. return str >= 13
  253. },
  254. // 苹果登录
  255. appleLogin() {
  256. let self = this
  257. this.account = ''
  258. this.captcha = ''
  259. if (!self.protocol) {
  260. this.inAnimation = true
  261. return self.$util.Tips({
  262. title: '请先阅读并同意协议'
  263. });
  264. }
  265. uni.showLoading({
  266. title: '登录中'
  267. })
  268. uni.login({
  269. provider: 'apple',
  270. timeout: 10000,
  271. success(loginRes) {
  272. uni.getUserInfo({
  273. provider: 'apple',
  274. success: function(infoRes) {
  275. self.appleUserInfo = infoRes.userInfo
  276. self.appleLoginApi()
  277. },
  278. fail() {
  279. uni.showToast({
  280. title: '获取用户信息失败',
  281. icon: 'none',
  282. duration: 2000
  283. })
  284. },
  285. complete() {
  286. uni.hideLoading()
  287. }
  288. });
  289. },
  290. fail(error) {
  291. console.log(error)
  292. }
  293. })
  294. },
  295. // 苹果登录Api
  296. appleLoginApi() {
  297. let self = this
  298. appleLogin({
  299. openId: self.appleUserInfo.openId,
  300. email: self.appleUserInfo.email || '',
  301. phone: this.account,
  302. captcha: this.captcha
  303. }).then(({
  304. data
  305. }) => {
  306. if (data.isbind) {
  307. uni.showModal({
  308. title: '提示',
  309. content: '请绑定手机号后,继续操作',
  310. showCancel: false,
  311. success: function(res) {
  312. if (res.confirm) {
  313. self.current = 1
  314. self.appleLoginStatus = true
  315. }
  316. }
  317. });
  318. } else {
  319. self.$store.commit("LOGIN", {
  320. 'token': data.token,
  321. 'time': data.expires_time - self.$Cache.time()
  322. });
  323. let backUrl = self.$Cache.get(BACK_URL) || "/pages/index/index";
  324. self.$Cache.clear(BACK_URL);
  325. self.$store.commit("SETUID", data.userInfo.uid);
  326. self.$store.commit("UPDATE_USERINFO", data.userInfo);
  327. uni.reLaunch({
  328. url: backUrl
  329. });
  330. }
  331. }).catch(error => {
  332. uni.showModal({
  333. title: '提示',
  334. content: `错误信息${error}`,
  335. success: function(res) {
  336. if (res.confirm) {
  337. console.log('用户点击确定');
  338. } else if (res.cancel) {
  339. console.log('用户点击取消');
  340. }
  341. }
  342. });
  343. })
  344. },
  345. // App微信登录
  346. wxLogin() {
  347. if (!this.protocol) {
  348. this.inAnimation = true
  349. return this.$util.Tips({
  350. title: '请先阅读并同意协议'
  351. });
  352. }
  353. let self = this
  354. this.account = ''
  355. this.captcha = ''
  356. uni.showLoading({
  357. title: '登录中'
  358. })
  359. uni.login({
  360. provider: 'weixin',
  361. success: function(loginRes) {
  362. // 获取用户信息
  363. uni.getUserInfo({
  364. provider: 'weixin',
  365. success: function(infoRes) {
  366. self.appUserInfo = infoRes.userInfo
  367. self.wxLoginApi()
  368. },
  369. fail() {
  370. uni.showToast({
  371. title: '获取用户信息失败',
  372. icon: 'none',
  373. duration: 2000
  374. })
  375. },
  376. complete() {
  377. uni.hideLoading()
  378. }
  379. });
  380. },
  381. fail() {
  382. uni.showToast({
  383. title: '登录失败',
  384. icon: 'none',
  385. duration: 2000
  386. })
  387. }
  388. });
  389. },
  390. wxLoginApi() {
  391. let self = this
  392. wechatAppAuth({
  393. userInfo: self.appUserInfo,
  394. phone: this.account,
  395. code: this.captcha
  396. }).then(({
  397. data
  398. }) => {
  399. if (data.isbind) {
  400. uni.showModal({
  401. title: '提示',
  402. content: '请绑定手机号后,继续操作',
  403. showCancel: false,
  404. success: function(res) {
  405. if (res.confirm) {
  406. self.current = 1
  407. self.appLoginStatus = true
  408. }
  409. }
  410. });
  411. } else {
  412. self.$store.commit("LOGIN", {
  413. 'token': data.token,
  414. 'time': data.expires_time - self.$Cache.time()
  415. });
  416. let backUrl = self.$Cache.get(BACK_URL) || "/pages/index/index";
  417. self.$Cache.clear(BACK_URL);
  418. self.$store.commit("SETUID", data.userInfo.uid);
  419. self.$store.commit("UPDATE_USERINFO", data.userInfo);
  420. uni.reLaunch({
  421. url: backUrl
  422. });
  423. }
  424. }).catch(error => {
  425. uni.showModal({
  426. title: '提示',
  427. content: `错误信息${error}`,
  428. success: function(res) {
  429. if (res.confirm) {
  430. console.log('用户点击确定');
  431. } else if (res.cancel) {
  432. console.log('用户点击取消');
  433. }
  434. }
  435. });
  436. })
  437. },
  438. again() {
  439. this.codeUrl =
  440. VUE_APP_API_URL +
  441. "/sms_captcha?" +
  442. "key=" +
  443. this.keyCode +
  444. Date.parse(new Date());
  445. },
  446. success(data) {
  447. this.$refs.verify.hide()
  448. getCodeApi()
  449. .then(res => {
  450. this.keyCode = res.data.key;
  451. this.getCode(data);
  452. })
  453. .catch(res => {
  454. this.$util.Tips({
  455. title: res
  456. });
  457. });
  458. },
  459. code() {
  460. let that = this
  461. if (!that.protocol) {
  462. this.inAnimation = true
  463. return that.$util.Tips({
  464. title: '请先阅读并同意协议'
  465. });
  466. }
  467. if (!that.account) return that.$util.Tips({
  468. title: '请填写手机号码'
  469. });
  470. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
  471. title: '请输入正确的手机号码'
  472. });
  473. // getCodeApi()
  474. // .then(res => {
  475. // that.keyCode = res.data.key;
  476. // that.getCode();
  477. // })
  478. // .catch(res => {
  479. // that.$util.Tips({
  480. // title: res
  481. // });
  482. // });
  483. this.$refs.verify.show()
  484. },
  485. async getLogoImage() {
  486. let that = this;
  487. getLogo(2).then(res => {
  488. that.logoUrl = res.data.logo_url;
  489. that.copyrightContext = res.data.copyrightContext;
  490. });
  491. },
  492. async loginMobile() {
  493. let that = this;
  494. if (!that.protocol) {
  495. this.inAnimation = true
  496. return that.$util.Tips({
  497. title: '请先阅读并同意协议'
  498. });
  499. }
  500. if (!that.account) return that.$util.Tips({
  501. title: '请填写手机号码'
  502. });
  503. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
  504. title: '请输入正确的手机号码'
  505. });
  506. if (!that.captcha) return that.$util.Tips({
  507. title: '请填写验证码'
  508. });
  509. if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
  510. title: '请输入正确的验证码'
  511. });
  512. if (that.appLoginStatus) {
  513. that.wxLoginApi()
  514. } else if (that.appleLoginStatus) {
  515. that.appleLoginApi()
  516. } else {
  517. if (this.keyLock) {
  518. this.keyLock = !this.keyLock
  519. } else {
  520. return that.$util.Tips({
  521. title: '请勿重复点击'
  522. });
  523. }
  524. loginMobile({
  525. phone: that.account,
  526. captcha: that.captcha,
  527. spread_spid: that.spread_spid
  528. })
  529. .then(res => {
  530. let data = res.data;
  531. that.$store.commit("LOGIN", {
  532. 'token': data.token,
  533. 'time': data.expires_time - this.$Cache.time()
  534. });
  535. let backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
  536. that.$Cache.clear(BACK_URL);
  537. getUserInfo().then(res => {
  538. this.keyLock = true
  539. that.$store.commit("SETUID", res.data.uid);
  540. that.$store.commit("UPDATE_USERINFO", res.data);
  541. if (backUrl.indexOf('/pages/users/login/index') !== -1) {
  542. backUrl = '/pages/index/index';
  543. }
  544. uni.reLaunch({
  545. url: backUrl
  546. });
  547. })
  548. })
  549. .catch(res => {
  550. this.keyLock = true
  551. that.$util.Tips({
  552. title: res
  553. });
  554. });
  555. }
  556. },
  557. async register() {
  558. let that = this;
  559. if (!that.account) return that.$util.Tips({
  560. title: '请填写手机号码'
  561. });
  562. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
  563. title: '请输入正确的手机号码'
  564. });
  565. if (!that.captcha) return that.$util.Tips({
  566. title: '请填写验证码'
  567. });
  568. if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
  569. title: '请输入正确的验证码'
  570. });
  571. if (!that.password) return that.$util.Tips({
  572. title: '请填写密码'
  573. });
  574. if (/^([0-9]|[a-z]|[A-Z]){0,6}$/i.test(that.password)) return that.$util.Tips({
  575. title: '您输入的密码过于简单'
  576. });
  577. register({
  578. account: that.account,
  579. captcha: that.captcha,
  580. password: that.password,
  581. spread_spid: that.$Cache.get("spid")
  582. })
  583. .then(res => {
  584. that.$util.Tips({
  585. title: res
  586. });
  587. that.formItem = 1;
  588. })
  589. .catch(res => {
  590. that.$util.Tips({
  591. title: res
  592. });
  593. });
  594. },
  595. async getCode(data){
  596. console.log('data-------',data);
  597. let that = this;
  598. if (!that.account) return that.$util.Tips({
  599. title: '请填写手机号码'
  600. });
  601. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
  602. title: '请输入正确的手机号码'
  603. });
  604. if (that.formItem == 2) that.type = "register";
  605. await registerVerify({
  606. phone: that.account,
  607. type: that.type,
  608. key: that.keyCode,
  609. captchaType: 'blockPuzzle',
  610. captchaVerification: data.captchaVerification
  611. })
  612. .then(res => {
  613. that.$util.Tips({
  614. title: res.msg
  615. });
  616. that.sendCode();
  617. })
  618. .catch(res => {
  619. that.$util.Tips({
  620. title: res
  621. });
  622. });
  623. },
  624. navTap: function(index) {
  625. this.current = index;
  626. },
  627. async submit() {
  628. let that = this;
  629. if (!that.protocol) {
  630. this.inAnimation = true
  631. return that.$util.Tips({
  632. title: '请先阅读并同意协议'
  633. });
  634. }
  635. if (!that.account) return that.$util.Tips({
  636. title: '请填写账号'
  637. });
  638. if (!/^[\w\d]{5,16}$/i.test(that.account)) return that.$util.Tips({
  639. title: '请输入正确的账号'
  640. });
  641. if (!that.password) return that.$util.Tips({
  642. title: '请填写密码'
  643. });
  644. if (this.keyLock) {
  645. this.keyLock = !this.keyLock
  646. } else {
  647. return that.$util.Tips({
  648. title: '请勿重复点击'
  649. });
  650. }
  651. loginH5({
  652. account: that.account,
  653. password: that.password,
  654. spread_spid: that.$Cache.get("spid")
  655. })
  656. .then(({
  657. data
  658. }) => {
  659. that.$store.commit("LOGIN", {
  660. 'token': data.token,
  661. 'time': data.expires_time - this.$Cache.time()
  662. });
  663. // #ifdef H5
  664. uni.showModal({
  665. title: '提示',
  666. content: '是否下载app',
  667. success: res => {
  668. if(res.confirm){
  669. domApp()
  670. }else if(res.cancel){
  671. let backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
  672. that.$Cache.clear(BACK_URL);
  673. getUserInfo().then(res => {
  674. this.keyLock = true
  675. that.$store.commit("SETUID", res.data.uid);
  676. that.$store.commit("UPDATE_USERINFO", res.data);
  677. uni.reLaunch({
  678. url: backUrl
  679. });
  680. }).catch(error => {
  681. this.keyLock = true
  682. })
  683. }
  684. },
  685. fail: () => {},
  686. complete: () => {}
  687. });
  688. // #endif
  689. // #ifndef H5
  690. let backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
  691. that.$Cache.clear(BACK_URL);
  692. getUserInfo().then(res => {
  693. this.keyLock = true
  694. that.$store.commit("SETUID", res.data.uid);
  695. that.$store.commit("UPDATE_USERINFO", res.data);
  696. uni.reLaunch({
  697. url: backUrl
  698. });
  699. }).catch(error => {
  700. this.keyLock = true
  701. })
  702. // #endif
  703. })
  704. .catch(e => {
  705. this.keyLock = true
  706. that.$util.Tips({
  707. title: e
  708. });
  709. });
  710. },
  711. privacy(type) {
  712. uni.navigateTo({
  713. url: "/pages/users/privacy/index?type=" + type
  714. })
  715. }
  716. }
  717. };
  718. </script>
  719. <style lang="scss">
  720. .copyright{
  721. width: 650rpx;
  722. position: fixed;
  723. bottom: 30rpx;
  724. left:50%;
  725. margin-left: -325rpx;
  726. font-size: 20rpx;
  727. color: #999999;
  728. text-align: center;
  729. .domain{
  730. color: #478BF1;
  731. margin-left: 6rpx;
  732. }
  733. }
  734. .itemImg-add {
  735. width: 24rpx;
  736. height: 34rpx;
  737. }
  738. .item-img {
  739. width: 28rpx;
  740. height: 32rpx;
  741. }
  742. /deep/uni-checkbox .uni-checkbox-input{
  743. margin-top: -6rpx;
  744. }
  745. .appLogin {
  746. margin-top: 60rpx;
  747. .hds {
  748. display: flex;
  749. justify-content: center;
  750. align-items: center;
  751. font-size: 24rpx;
  752. color: #B4B4B4;
  753. .line {
  754. width: 68rpx;
  755. height: 1rpx;
  756. background: #CCCCCC;
  757. }
  758. p {
  759. margin: 0 20rpx;
  760. }
  761. }
  762. .btn-wrapper {
  763. display: flex;
  764. align-items: center;
  765. justify-content: center;
  766. margin-top: 30rpx;
  767. .btn {
  768. display: flex;
  769. align-items: center;
  770. justify-content: center;
  771. width: 68rpx;
  772. height: 68rpx;
  773. border-radius: 50%;
  774. }
  775. .apple-btn {
  776. display: flex;
  777. align-items: center;
  778. justify-content: center;
  779. width: 246rpx;
  780. height: 66rpx;
  781. margin-left: 30rpx;
  782. background: #EAEAEA;
  783. border-radius: 34rpx;
  784. font-size: 24rpx;
  785. .icon-s-pingguo {
  786. color: #333;
  787. margin-right: 10rpx;
  788. font-size: 34rpx;
  789. }
  790. }
  791. .iconfont {
  792. font-size: 40rpx;
  793. color: #fff;
  794. }
  795. .wx {
  796. background-color: #61C64F;
  797. }
  798. .mima {
  799. background-color: #28B3E9;
  800. }
  801. .yanzheng {
  802. background-color: #F89C23;
  803. }
  804. .pingguo {
  805. margin-left: 60rpx;
  806. background-color: #000;
  807. }
  808. }
  809. }
  810. .main-color {
  811. color: var(--view-theme);
  812. }
  813. .code img {
  814. width: 100%;
  815. height: 100%;
  816. }
  817. .acea-row.row-middle {
  818. input {
  819. margin-left: 20rpx;
  820. display: block;
  821. }
  822. }
  823. .login-wrapper {
  824. .login-top {
  825. height: 358rpx;
  826. background-color: var(--view-theme);
  827. background-image: url(../static/login.png);
  828. background-size: cover;
  829. background-repeat: no-repeat;
  830. image {
  831. width: 101%;
  832. height: 100%;
  833. }
  834. }
  835. .shading {
  836. display: flex;
  837. align-items: center;
  838. justify-content: center;
  839. width: 100%;
  840. margin-top: -230rpx;
  841. position: relative;
  842. z-index: 8;
  843. image {
  844. width: 180rpx;
  845. height: 180rpx;
  846. top: 40rpx;
  847. }
  848. }
  849. .whiteBg {
  850. background-color: #fff;
  851. margin: -30rpx 56rpx 0rpx 56rpx;
  852. box-shadow: 0px 2px 14px 0px rgba(0, 0, 0, 0.08);
  853. border-radius: 8px;
  854. padding: 60rpx;
  855. position: relative;
  856. z-index: 6;
  857. .tips {
  858. display: flex;
  859. align-items: center;
  860. justify-content: center;
  861. height: 50rpx;
  862. margin: 40rpx;
  863. color: #999;
  864. .tips-btn {
  865. margin: 0 31rpx 0 48rpx;
  866. color: #999999;
  867. font-weight: bold;
  868. font-size: 32rpx;
  869. /* Safari 与 Chrome */
  870. .line {
  871. width: 80rpx;
  872. height: 6rpx;
  873. background: linear-gradient(135deg, var(--view-minorColor) 0%, var(--view-theme) 100%);
  874. border-radius: 2px;
  875. margin: 10rpx auto 0 auto;
  876. animation: myfirst .3s;
  877. -webkit-animation: myfirst .3s;
  878. }
  879. .none {
  880. width: 80rpx;
  881. background: #fff;
  882. height: 6rpx;
  883. }
  884. }
  885. @keyframes myfirst {
  886. 0% {
  887. width: 0rpx;
  888. }
  889. 100% {
  890. width: 80rpx;
  891. }
  892. }
  893. @-webkit-keyframes myfirst
  894. /* Safari 与 Chrome */
  895. {
  896. 0% {
  897. width: 0rpx;
  898. }
  899. 100% {
  900. width: 80rpx;
  901. }
  902. }
  903. .tips-btn.on {
  904. font-size: 36rpx;
  905. color: var(--view-theme);
  906. }
  907. }
  908. .list {
  909. border-radius: 16rpx;
  910. overflow: hidden;
  911. .forgetPwd {
  912. text-align: right;
  913. margin-top: 10rpx;
  914. color: #666666;
  915. font-size: 24rpx;
  916. }
  917. .item {
  918. border-bottom: 1px solid #F0F0F0;
  919. background: #fff;
  920. .row-middle {
  921. position: relative;
  922. padding: 16rpx 25rpx;
  923. input {
  924. flex: 1;
  925. font-size: 28rpx;
  926. height: 80rpx;
  927. }
  928. .code {
  929. position: absolute;
  930. right: 30rpx;
  931. top: 50%;
  932. color: var(--view-theme);
  933. font-size: 26rpx;
  934. transform: translateY(-50%);
  935. }
  936. }
  937. }
  938. }
  939. .logon {
  940. display: flex;
  941. align-items: center;
  942. justify-content: center;
  943. width: 100%;
  944. height: 86rpx;
  945. margin-top: 48rpx;
  946. background: linear-gradient(135deg, var(--view-minorColor) 0%, var(--view-theme) 100%);
  947. border-radius: 120rpx;
  948. color: #FFFFFF;
  949. font-size: 30rpx;
  950. }
  951. }
  952. .protocol {
  953. margin-top: 40rpx;
  954. color: #999999;
  955. font-size: 24rpx;
  956. }
  957. .trembling {
  958. animation: shake 0.6s;
  959. }
  960. @keyframes shake {
  961. 0%,
  962. 100% {
  963. -webkit-transform: translateX(0);
  964. }
  965. 10%,
  966. 30%,
  967. 50%,
  968. 70%,
  969. 90% {
  970. -webkit-transform: translateX(-5rpx);
  971. }
  972. 20%,
  973. 40%,
  974. 60%,
  975. 80% {
  976. -webkit-transform: translateX(5rpx);
  977. }
  978. }
  979. @-o-keyframes shake {
  980. /* Opera */
  981. 0%,
  982. 100% {
  983. -webkit-transform: translateX(0);
  984. }
  985. 10%,
  986. 30%,
  987. 50%,
  988. 70%,
  989. 90% {
  990. -webkit-transform: translateX(-5rpx);
  991. }
  992. 20%,
  993. 40%,
  994. 60%,
  995. 80% {
  996. -webkit-transform: translateX(5rpx);
  997. }
  998. }
  999. @-webkit-keyframes shake {
  1000. /* Safari 和 Chrome */
  1001. 0%,
  1002. 100% {
  1003. -webkit-transform: translateX(0);
  1004. }
  1005. 10%,
  1006. 30%,
  1007. 50%,
  1008. 70%,
  1009. 90% {
  1010. -webkit-transform: translateX(-5rpx);
  1011. }
  1012. 20%,
  1013. 40%,
  1014. 60%,
  1015. 80% {
  1016. -webkit-transform: translateX(5rpx);
  1017. }
  1018. }
  1019. @-moz-keyframes shake {
  1020. /* Firefox */
  1021. 0%,
  1022. 100% {
  1023. -moz-transform: translateX(0);
  1024. }
  1025. 10%,
  1026. 30%,
  1027. 50%,
  1028. 70%,
  1029. 90% {
  1030. -moz-transform: translateX(-5rpx);
  1031. }
  1032. 20%,
  1033. 40%,
  1034. 60%,
  1035. 80% {
  1036. -moz-transform: translateX(5rpx);
  1037. }
  1038. }
  1039. }
  1040. </style>