index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. <template>
  2. <view class="login-wrapper" :style="colorStyle">
  3. <view class="shading">
  4. <!-- <image :src="logoUrl" v-if="logoUrl" /> -->
  5. <image src="@/static/images/logo@2x.png" />
  6. </view>
  7. <view class="whiteBg" v-if="formItem === 1">
  8. <view class="list" v-if="current !== 1">
  9. <form @submit.prevent="submit">
  10. <view class="item">
  11. <view class="acea-row row-middle">
  12. <image src="../static/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
  13. <input type="text" :placeholder="$t(`输入手机号码`)" v-model="account" maxlength="11" required />
  14. </view>
  15. </view>
  16. <view class="item">
  17. <view class="acea-row row-middle">
  18. <image src="../static/code_1.png" style="width: 28rpx; height: 32rpx;"></image>
  19. <input type="password" :placeholder="$t(`填写登录密码`)" v-model="password" required />
  20. </view>
  21. </view>
  22. </form>
  23. <!-- <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
  24. <span class="iconfont icon-wenti"></span>忘记密码
  25. </navigator> -->
  26. </view>
  27. <view class="list" v-if="current !== 0 || appLoginStatus || appleLoginStatus">
  28. <view class="item">
  29. <view class="acea-row row-middle">
  30. <image src="../static/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
  31. <input type="text" :placeholder="$t(`请输入手机号码`)" v-model="account" maxlength="11" />
  32. </view>
  33. </view>
  34. <view class="item">
  35. <view class="acea-row row-middle">
  36. <image src="../static/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
  37. <input type="text" :placeholder="$t(`请输入验证码`)" maxlength="6" class="codeIput"
  38. v-model="captcha" />
  39. <view class="wrap">
  40. <u-toast ref="uToast"></u-toast>
  41. <u-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange">
  42. </u-code>
  43. <u-button class="code" size="small" shape="circle" @click="getCode" plain>{{
  44. tips
  45. }}
  46. </u-button>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="item" v-if="isShowCode">
  51. <view class="acea-row row-middle">
  52. <image src="../static/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
  53. <input type="text" :placeholder="$t(`请输入验证码`)" class="codeIput" v-model="codeVal" />
  54. <view class="code" @click="again"><img :src="codeUrl" /></view>
  55. </view>
  56. </view>
  57. <view class="item">
  58. <view class="acea-row row-middle">
  59. <image src="../static/code_1.png" style="width: 28rpx; height: 32rpx;"></image>
  60. <input type="password" :placeholder="$t(`请输入登录密码`)" v-model="password" required />
  61. </view>
  62. </view>
  63. <view class="item">
  64. <view class="acea-row row-middle">
  65. <image src="../static/code_1.png" style="width: 28rpx; height: 32rpx;"></image>
  66. <input type="password" :placeholder="$t(`请确认登录密码`)" v-model="passwordConfirm" required />
  67. </view>
  68. </view>
  69. <view class="item">
  70. <view class="acea-row row-middle">
  71. <!-- <image src="@/static/images/contact.png" style="width: 28rpx; height: 32rpx;"></image> -->
  72. <u-icon name="share" color="#b7b5b5"></u-icon>
  73. <input type="text" :placeholder="$t(`邀请码(6KYSYX)`)" v-model="codeInvitation" required />
  74. </view>
  75. </view>
  76. </view>
  77. <view class="protocol">
  78. <checkbox-group @change='ChangeIsDefault'>
  79. <checkbox :class="inAnimation ? 'trembling' : ''" @animationend='inAnimation = false'
  80. :checked="protocol ? true : false" />{{ $t(`已同意`) }} <text class="main-color"
  81. @click="privacy('2.html','注册协议')">{{ $t(`《注册协议》`) }}</text>
  82. <text class="main-color"
  83. @click="privacy('3.html','商城须知')">{{ $t(`《商城须知》`) }}</text>
  84. <text class="main-color" @click="privacy('1.html','隐私政策')">{{ $t(`《隐私政策》`) }}</text>
  85. </checkbox-group>
  86. </view>
  87. <view class="logon" @click="loginMobile" v-if="current !== 0">{{ $t(`同意协议注册`) }}</view>
  88. <view class="logon" @click="submit" v-if="current === 0">{{ $t(`同意协议注册`) }}</view>
  89. <!-- #ifndef APP-PLUS -->
  90. <!-- <view class="tips">
  91. <view v-if="current == 0" @click="current = 1">{{ $t(`快速登录`) }}</view>
  92. <view v-if="current == 1" @click="current = 0">{{ $t(`账号登录`) }}</view>
  93. </view> -->
  94. <!-- #endif -->
  95. <!-- #ifdef APP-PLUS -->
  96. <view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">
  97. <view class="hds">
  98. <span class="line"></span>
  99. <p>{{ $t(`其他方式登录`) }}</p>
  100. <span class="line"></span>
  101. </view>
  102. <view class="btn-wrapper">
  103. <view class="btn wx" @click="wxLogin">
  104. <span class="iconfont icon-s-weixindenglu1"></span>
  105. </view>
  106. <view class="btn mima" v-if="current == 1" @click="current = 0">
  107. <span class="iconfont icon-s-mimadenglu1"></span>
  108. </view>
  109. <view class="btn yanzheng" v-if="current == 0" @click="current = 1">
  110. <span class="iconfont icon-s-yanzhengmadenglu1"></span>
  111. </view>
  112. <view class="apple-btn" @click="appleLogin" v-if="appleShow">
  113. <view class="iconfont icon-s-pingguo"></view>
  114. </view>
  115. </view>
  116. </view>
  117. <!-- #endif -->
  118. </view>
  119. <view class="bottom"></view>
  120. </view>
  121. </template>
  122. <script>
  123. import dayjs from "@/plugin/dayjs/dayjs.min.js";
  124. import sendVerifyCode from "@/mixins/SendVerifyCode";
  125. import {
  126. loginH5,
  127. loginMobile,
  128. registerVerify,
  129. register,
  130. getCodeApi,
  131. getUserInfo,
  132. appleLogin
  133. } from "@/api/user";
  134. import attrs, {
  135. required,
  136. alpha_num,
  137. chs_phone
  138. } from "@/utils/validate";
  139. import {
  140. getLogo
  141. } from "@/api/public";
  142. // import cookie from "@/utils/store/cookie";
  143. import {
  144. VUE_APP_API_URL
  145. } from "@/utils";
  146. // #ifdef APP-PLUS
  147. import {
  148. wechatAppAuth
  149. } from '@/api/api.js'
  150. // #endif
  151. const BACK_URL = "login_back_url";
  152. import colors from '@/mixins/color.js';
  153. export default {
  154. name: "Login",
  155. mixins: [sendVerifyCode, colors],
  156. data: function () {
  157. return {
  158. tips: '',
  159. seconds: 60,
  160. inAnimation: false,
  161. protocol: false,
  162. navList: [this.$t(`快速登录`), this.$t(`账号登录`)],
  163. current: 1,
  164. account: "",
  165. password: "",
  166. passwordConfirm: "",
  167. codeInvitation: "",
  168. captcha: "",
  169. formItem: 1,
  170. type: "login",
  171. logoUrl: "",
  172. keyCode: "",
  173. codeUrl: "",
  174. codeVal: "",
  175. isShowCode: false,
  176. appLoginStatus: false, // 微信登录强制绑定手机号码状态
  177. appUserInfo: null, // 微信登录保存的用户信息
  178. appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
  179. appleUserInfo: null,
  180. appleShow: false, // 苹果登录版本必须要求ios13以上的
  181. keyLock: true
  182. };
  183. },
  184. watch: {
  185. formItem: function (nval, oVal) {
  186. if (nval == 1) {
  187. this.type = 'login'
  188. } else {
  189. this.type = 'register'
  190. }
  191. }
  192. },
  193. onLoad() {
  194. let self = this
  195. uni.getSystemInfo({
  196. success: (res) => {
  197. if (res.platform.toLowerCase() == 'ios' && this.getSystem(res.system)) {
  198. self.appleShow = true
  199. }
  200. }
  201. });
  202. },
  203. mounted: function () {
  204. // this.getCode();
  205. // this.getLogoImage();
  206. },
  207. methods: {
  208. codeChange(text) {
  209. this.tips = text;
  210. },
  211. ChangeIsDefault(e) {
  212. this.$set(this, 'protocol', !this.protocol);
  213. },
  214. privacy(type,title) {
  215. uni.navigateTo({
  216. url: "/pages/users/privacy/index?type=" + type+"&title=" + title
  217. })
  218. },
  219. // IOS 版本号判断
  220. getSystem(system) {
  221. let str
  222. system.toLowerCase().indexOf('ios') === -1 ? str = system : str = system.split(' ')[1]
  223. if (str.indexOf('.'))
  224. return str.split('.')[0] >= 13
  225. return str >= 13
  226. },
  227. // 苹果登录
  228. appleLogin() {
  229. let self = this
  230. this.account = ''
  231. this.captcha = ''
  232. if (!self.protocol) {
  233. this.inAnimation = true
  234. return self.$util.Tips({
  235. title: '请先阅读并同意协议'
  236. });
  237. }
  238. uni.showLoading({
  239. title: this.$t(`登录中`)
  240. })
  241. uni.login({
  242. provider: 'apple',
  243. timeout: 10000,
  244. success(loginRes) {
  245. uni.getUserInfo({
  246. provider: 'apple',
  247. success: function (infoRes) {
  248. self.appleUserInfo = infoRes.userInfo
  249. self.appleLoginApi()
  250. },
  251. fail() {
  252. uni.showToast({
  253. title: self.$t(`获取用户信息失败`),
  254. icon: 'none',
  255. duration: 2000
  256. })
  257. },
  258. complete() {
  259. uni.hideLoading()
  260. }
  261. });
  262. },
  263. fail(error) {
  264. console.log(error)
  265. }
  266. })
  267. },
  268. // 苹果登录Api
  269. appleLoginApi() {
  270. let self = this
  271. appleLogin({
  272. openId: self.appleUserInfo.openId,
  273. email: self.appleUserInfo.email || '',
  274. phone: this.account,
  275. captcha: this.captcha
  276. }).then(({
  277. data
  278. }) => {
  279. if (data.isbind) {
  280. uni.showModal({
  281. title: self.$t(`提示`),
  282. content: self.$t(`请绑定手机号后,继续操作`),
  283. showCancel: false,
  284. success: function (res) {
  285. if (res.confirm) {
  286. self.current = 1
  287. self.appleLoginStatus = true
  288. }
  289. }
  290. });
  291. } else {
  292. self.$store.commit("LOGIN", {
  293. 'token': data.token,
  294. 'time': data.expires_time - self.$Cache.time()
  295. });
  296. let backUrl = self.$Cache.get(BACK_URL) || "/pages/index/index";
  297. self.$Cache.clear(BACK_URL);
  298. self.$store.commit("SETUID", data.userInfo.userId);
  299. uni.reLaunch({
  300. url: backUrl
  301. });
  302. }
  303. }).catch(error => {
  304. uni.showModal({
  305. title: self.$t(`提示`),
  306. content: self.$t(`错误信息`) + `${error}`,
  307. success: function (res) {
  308. if (res.confirm) {
  309. console.log(self.$t(`用户点击确定`));
  310. } else if (res.cancel) {
  311. console.log(self.$t(`用户点击取消`));
  312. }
  313. }
  314. });
  315. })
  316. },
  317. // App微信登录
  318. wxLogin() {
  319. let self = this
  320. this.account = ''
  321. this.captcha = ''
  322. if (!self.protocol) {
  323. this.inAnimation = true
  324. return self.$util.Tips({
  325. title: '请先阅读并同意协议'
  326. });
  327. }
  328. uni.showLoading({
  329. title: self.$t(`登录中`)
  330. })
  331. uni.login({
  332. provider: 'weixin',
  333. success: function (loginRes) {
  334. // 获取用户信息
  335. uni.getUserInfo({
  336. provider: 'weixin',
  337. success: function (infoRes) {
  338. self.appUserInfo = infoRes.userInfo
  339. self.wxLoginApi()
  340. },
  341. fail() {
  342. uni.showToast({
  343. title: self.$t(`获取用户信息失败`),
  344. icon: 'none',
  345. duration: 2000
  346. })
  347. },
  348. complete() {
  349. uni.hideLoading()
  350. }
  351. });
  352. },
  353. fail() {
  354. uni.showToast({
  355. title: self.$t(`登录失败`),
  356. icon: 'none',
  357. duration: 2000
  358. })
  359. }
  360. });
  361. },
  362. wxLoginApi() {
  363. let self = this
  364. wechatAppAuth({
  365. userInfo: self.appUserInfo,
  366. phone: this.account,
  367. code: this.captcha
  368. }).then(({
  369. data
  370. }) => {
  371. if (data.isbind) {
  372. uni.showModal({
  373. title: self.$t(`提示`),
  374. content: self.$t(`请绑定手机号后,继续操作`),
  375. showCancel: false,
  376. success: function (res) {
  377. if (res.confirm) {
  378. self.current = 1
  379. self.appLoginStatus = true
  380. }
  381. }
  382. });
  383. } else {
  384. self.$store.commit("LOGIN", {
  385. 'token': data.token,
  386. 'time': data.expires_time - self.$Cache.time()
  387. });
  388. let backUrl = self.$Cache.get(BACK_URL) || "/pages/index/index";
  389. self.$Cache.clear(BACK_URL);
  390. self.$store.commit("SETUID", data.userInfo.userId);
  391. uni.reLaunch({
  392. url: backUrl
  393. });
  394. }
  395. }).catch(error => {
  396. uni.showModal({
  397. title: self.$t(`提示`),
  398. content: self.$t(`错误信息`) + `${error}`,
  399. success: function (res) {
  400. if (res.confirm) {
  401. console.log(self.$t(`用户点击确定`));
  402. } else if (res.cancel) {
  403. console.log(self.$t(`用户点击取消`));
  404. }
  405. }
  406. });
  407. })
  408. },
  409. again() {
  410. this.codeUrl =
  411. VUE_APP_API_URL +
  412. "/sms_captcha?" +
  413. "key=" +
  414. this.keyCode +
  415. Date.parse(new Date());
  416. },
  417. code() {
  418. let that = this
  419. if (!that.protocol) {
  420. this.inAnimation = true
  421. return that.$util.Tips({
  422. title: '请先阅读并同意协议'
  423. });
  424. }
  425. getCodeApi()
  426. .then(res => {
  427. that.keyCode = res.data.key;
  428. that.getCode();
  429. })
  430. .catch(res => {
  431. that.$util.Tips({
  432. title: res
  433. });
  434. });
  435. },
  436. async getLogoImage() {
  437. let that = this;
  438. let logoUrl = "https://demo26.crmeb.net/statics/system_images/login_logo.jpeg"
  439. that.logoUrl = logoUrl;
  440. getLogo(2).then(res => {
  441. that.logoUrl = res.data.logo_url;
  442. });
  443. },
  444. async loginMobile() {
  445. let that = this;
  446. if (!that.account) return that.$util.Tips({
  447. title: that.$t(`请输入手机号码`)
  448. });
  449. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
  450. title: that.$t(`请输入正确的手机号码`)
  451. });
  452. if (!that.captcha) return that.$util.Tips({
  453. title: that.$t(`请输入验证码`)
  454. });
  455. if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
  456. title: that.$t(`请输入正确的验证码`)
  457. });
  458. if (!that.password) return that.$util.Tips({
  459. title: that.$t(`请输入登录密码`)
  460. });
  461. if (/^([0-9]|[a-z]|[A-Z]){0,6}$/i.test(that.password)) return that.$util.Tips({
  462. title: that.$t(`您输入的密码过于简单`)
  463. });
  464. if (!that.passwordConfirm) return that.$util.Tips({
  465. title: that.$t(`请确认登录密码`)
  466. });
  467. if (that.passwordConfirm != that.password) return that.$util.Tips({
  468. title: that.$t(`确认密码与登录密码不一致,请修正后注册`)
  469. });
  470. if (!that.codeInvitation) return that.$util.Tips({
  471. title: that.$t(`请输入邀请码`)
  472. });
  473. if (!that.protocol) {
  474. this.inAnimation = true
  475. return that.$util.Tips({
  476. title: '请先阅读并同意协议'
  477. });
  478. }
  479. if (that.appLoginStatus) {
  480. that.wxLoginApi()
  481. } else if (that.appleLoginStatus) {
  482. that.appleLoginApi()
  483. } else {
  484. if (this.keyLock) {
  485. this.keyLock = !this.keyLock
  486. } else {
  487. return that.$util.Tips({
  488. title: that.$t(`请勿重复点击`)
  489. });
  490. }
  491. loginMobile({
  492. phone: that.account,
  493. captcha: that.captcha,
  494. spread: that.$Cache.get("spread")
  495. })
  496. .then(res => {
  497. let data = res.data;
  498. that.$store.commit("LOGIN", {
  499. 'token': data.token,
  500. 'time': data.expires_time - this.$Cache.time()
  501. });
  502. let backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
  503. that.$Cache.clear(BACK_URL);
  504. getUserInfo().then(res => {
  505. this.keyLock = true
  506. that.$store.commit("SETUID", res.data.userId);
  507. if (backUrl.indexOf('/pages/users/login/index') !== -1) {
  508. backUrl = '/pages/index/index';
  509. }
  510. uni.reLaunch({
  511. url: backUrl
  512. });
  513. })
  514. })
  515. .catch(res => {
  516. this.keyLock = true
  517. that.$util.Tips({
  518. title: res
  519. });
  520. });
  521. }
  522. },
  523. async register() {
  524. let that = this;
  525. if (!that.protocol) {
  526. this.inAnimation = true
  527. return that.$util.Tips({
  528. title: '请先阅读并同意协议'
  529. });
  530. }
  531. if (!that.account) return that.$util.Tips({
  532. title: that.$t(`请填写手机号码`)
  533. });
  534. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
  535. title: that.$t(`请输入正确的手机号码`)
  536. });
  537. if (!that.captcha) return that.$util.Tips({
  538. title: that.$t(`请填写验证码`)
  539. });
  540. if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
  541. title: that.$t(`请输入正确的验证码`)
  542. });
  543. if (!that.password) return that.$util.Tips({
  544. title: that.$t(`请填写密码`)
  545. });
  546. if (/^([0-9]|[a-z]|[A-Z]){0,6}$/i.test(that.password)) return that.$util.Tips({
  547. title: that.$t(`您输入的密码过于简单`)
  548. });
  549. register({
  550. account: that.account,
  551. captcha: that.captcha,
  552. password: that.password,
  553. spread: that.$Cache.get("spread")
  554. })
  555. .then(res => {
  556. that.$util.Tips({
  557. title: res
  558. });
  559. that.formItem = 1;
  560. })
  561. .catch(res => {
  562. that.$util.Tips({
  563. title: res
  564. });
  565. });
  566. },
  567. async getCode() {
  568. let that = this;
  569. if (this.$refs.uCode.canGetCode) {
  570. // 模拟向后端请求验证码
  571. uni.showLoading({
  572. title: '正在获取验证码'
  573. })
  574. setTimeout(() => {
  575. uni.hideLoading();
  576. // 这里此提示会被this.start()方法中的提示覆盖
  577. uni.$u.toast('验证码已发送');
  578. // 通知验证码组件内部开始倒计时
  579. this.$refs.uCode.start();
  580. }, 2000);
  581. } else {
  582. uni.$u.toast('倒计时结束后再发送');
  583. }
  584. // if (!that.protocol) {
  585. // this.inAnimation = true
  586. // return that.$util.Tips({
  587. // title: '请先阅读并同意协议'
  588. // });
  589. // }
  590. // if (!that.account) return that.$util.Tips({
  591. // title: that.$t(`请填写手机号码`)
  592. // });
  593. // if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
  594. // title: that.$t(`请输入正确的手机号码`)
  595. // });
  596. // if (that.formItem == 2) that.type = "register";
  597. // await registerVerify({
  598. // phone: that.account,
  599. // type: that.type,
  600. // key: that.keyCode,
  601. // code: that.codeVal
  602. // })
  603. // .then(res => {
  604. // that.$util.Tips({
  605. // title: res.msg
  606. // });
  607. // that.sendCode();
  608. // })
  609. // .catch(res => {
  610. // that.$util.Tips({
  611. // title: res
  612. // });
  613. // });
  614. },
  615. navTap: function (index) {
  616. this.current = index;
  617. },
  618. async submit() {
  619. let that = this;
  620. if (!that.protocol) {
  621. this.inAnimation = true
  622. return that.$util.Tips({
  623. title: '请先阅读并同意协议'
  624. });
  625. }
  626. if (!that.account) return that.$util.Tips({
  627. title: that.$t(`请填写账号`)
  628. });
  629. if (!/^[\w\d]{5,16}$/i.test(that.account)) return that.$util.Tips({
  630. title: that.$t(`请输入正确的账号`)
  631. });
  632. if (!that.password) return that.$util.Tips({
  633. title: that.$t(`请填写密码`)
  634. });
  635. if (this.keyLock) {
  636. this.keyLock = !this.keyLock
  637. } else {
  638. return that.$util.Tips({
  639. title: that.$t(`请勿重复点击`)
  640. });
  641. }
  642. loginH5({
  643. account: that.account,
  644. password: that.password,
  645. spread: that.$Cache.get("spread")
  646. })
  647. .then(({
  648. data
  649. }) => {
  650. that.$store.commit("LOGIN", {
  651. 'token': data.token,
  652. 'time': data.expires_time - this.$Cache.time()
  653. });
  654. let backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
  655. that.$Cache.clear(BACK_URL);
  656. getUserInfo().then(res => {
  657. this.keyLock = true
  658. that.$store.commit("SETUID", res.data.userId);
  659. uni.reLaunch({
  660. url: backUrl
  661. });
  662. }).catch(error => {
  663. this.keyLock = true
  664. })
  665. })
  666. .catch(e => {
  667. this.keyLock = true
  668. that.$util.Tips({
  669. title: e
  670. });
  671. });
  672. }
  673. }
  674. };
  675. </script>
  676. <style>
  677. page {
  678. background: #fff;
  679. }
  680. </style>
  681. <style lang="scss">
  682. .appLogin {
  683. margin-top: 60rpx;
  684. .hds {
  685. display: flex;
  686. justify-content: center;
  687. align-items: center;
  688. font-size: 24rpx;
  689. color: #B4B4B4;
  690. .line {
  691. width: 68rpx;
  692. height: 1rpx;
  693. background: #CCCCCC;
  694. }
  695. p {
  696. margin: 0 20rpx;
  697. }
  698. }
  699. .btn-wrapper {
  700. display: flex;
  701. align-items: center;
  702. justify-content: center;
  703. margin-top: 30rpx;
  704. .btn {
  705. display: flex;
  706. align-items: center;
  707. justify-content: center;
  708. width: 68rpx;
  709. height: 68rpx;
  710. border-radius: 50%;
  711. }
  712. .apple-btn {
  713. display: flex;
  714. align-items: center;
  715. justify-content: center;
  716. width: 68rpx;
  717. height: 68rpx;
  718. border-radius: 50%;
  719. background: #000;
  720. .icon-s-pingguo {
  721. color: #fff;
  722. font-size: 44rpx;
  723. }
  724. }
  725. .iconfont {
  726. font-size: 40rpx;
  727. color: #fff;
  728. }
  729. .wx {
  730. margin-right: 30rpx;
  731. background-color: #61C64F;
  732. }
  733. .mima {
  734. margin-right: 30rpx;
  735. background-color: #28B3E9;
  736. }
  737. .yanzheng {
  738. margin-right: 30rpx;
  739. background-color: #F89C23;
  740. }
  741. }
  742. }
  743. .code img {
  744. width: 100%;
  745. height: 100%;
  746. }
  747. .acea-row.row-middle {
  748. input {
  749. margin-left: 20rpx;
  750. display: block;
  751. }
  752. }
  753. .login-wrapper {
  754. padding: 30rpx;
  755. .shading {
  756. display: flex;
  757. align-items: center;
  758. justify-content: center;
  759. width: 100%;
  760. /* #ifdef APP-VUE */
  761. margin-top: 50rpx;
  762. /* #endif */
  763. /* #ifndef APP-VUE */
  764. margin-top: 20rpx;
  765. /* #endif */
  766. image {
  767. width: 240rpx;
  768. height: 120rpx;
  769. }
  770. }
  771. .whiteBg {
  772. margin-top: 100rpx;
  773. .list {
  774. border-radius: 16rpx;
  775. overflow: hidden;
  776. .item {
  777. border-bottom: 1px solid #F0F0F0;
  778. background: #fff;
  779. .row-middle {
  780. position: relative;
  781. padding: 16rpx 45rpx;
  782. input {
  783. flex: 1;
  784. font-size: 28rpx;
  785. height: 80rpx;
  786. }
  787. .code {
  788. position: absolute;
  789. right: 30rpx;
  790. top: 50%;
  791. color: var(--view-theme);
  792. font-size: 26rpx;
  793. transform: translateY(-50%);
  794. }
  795. }
  796. }
  797. }
  798. .logon {
  799. display: flex;
  800. align-items: center;
  801. justify-content: center;
  802. width: 100%;
  803. height: 86rpx;
  804. margin-top: 80rpx;
  805. background-color: var(--view-theme);
  806. border-radius: 120rpx;
  807. color: #FFFFFF;
  808. font-size: 30rpx;
  809. }
  810. .tips {
  811. margin: 30rpx;
  812. text-align: center;
  813. color: #999;
  814. }
  815. }
  816. }
  817. .protocol {
  818. margin-top: 40rpx;
  819. color: #999999;
  820. font-size: 24rpx;
  821. text-align: center;
  822. bottom: 20rpx;
  823. }
  824. .trembling {
  825. animation: shake 0.6s;
  826. }
  827. .main-color {
  828. color: var(--view-theme);
  829. }
  830. </style>