login.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. <template>
  2. <view>
  3. <!-- 状态栏 -->
  4. <!-- 公共组件-每个页面必须引入 -->
  5. <public-module></public-module>
  6. <app-update ref="app_update"></app-update>
  7. <!-- 欢迎语 -->
  8. <view class="dis j-end a-c">
  9. <image src="../../static/image/login/2.png" mode=""
  10. style="height: 280px;width: calc(100% - 16px);margin-top: 25%;">
  11. </image>
  12. </view>
  13. <view class="" style="margin-top: -120px;">
  14. <u-tabs :list="list" :is-scroll="true" :current="current" @change="change"
  15. style="background: transparent;margin-bottom: 30px;"></u-tabs>
  16. <!-- 登录区域Start -->
  17. <view class="mx-3">
  18. <!-- 账号密码登录 false代表账号密码登录 -->
  19. <template v-if="current==0">
  20. <view class="mt-2 position-relative border-bottom">
  21. <view class="position-absolute d-flex a-center j-center left-0 top-0 font-weight"
  22. style="height: 100%;">
  23. <image src="../../static/image/login/zhanghao.png" mode=""
  24. style="width: 18px;height: 18px;">
  25. </image>
  26. </view>
  27. <input type="text" v-model="username" class="uni-input common-input" maxlength="17"
  28. placeholder="请输入会员号" style="padding-left: 56rpx;background: transparent;" />
  29. </view>
  30. <view class="mt-2 position-relative border-bottom">
  31. <view class="position-absolute d-flex a-center j-center left-0 top-0 font-weight"
  32. style="height: 100%;">
  33. <image src="../../static/image/login/mima.png" mode="" style="width: 18px;height: 18px;">
  34. </image>
  35. </view>
  36. <input type="text" :password="isHidePassword" v-model="password" class="uni-input common-input"
  37. placeholder="请输入密码" style="padding-right: 200rpx;padding-left: 56rpx;" maxlength="15" />
  38. <view class=" position-absolute top-0 right-0 d-flex a-center j-center"
  39. style="width: 200rpx;height: 100%;">
  40. <image
  41. :src="isHidePassword?'../../static/image/login/biyan.png':'../../static/image/login/zhengyan.png'"
  42. @tap="isHidePassword = !isHidePassword" mode="" style="width: 18px;height: 18px;">
  43. </view>
  44. </view>
  45. <view class="mt-2 position-relative border-bottom">
  46. <view class="position-absolute d-flex a-center j-center left-0 top-0 font-weight"
  47. style="height: 100%;">
  48. <image src="../../static/image/login/yanzhengma.png" mode=""
  49. style="width: 18px;height: 18px;">
  50. </image>
  51. </view>
  52. <input type="text" v-model="imgcode" class="uni-input common-input" maxlength="5"
  53. placeholder="请输入验证码" style="padding-right: 200rpx;padding-left: 56rpx;" />
  54. <image style="height: 80%;padding-top: 4rpx;width: 200rpx;" mode="aspectFill"
  55. class="position-absolute top-0 right-0 d-flex a-center j-center text-light-muted"
  56. :src="imgcodesrc" @tap="refreshCaptcha"></image>
  57. </view>
  58. </template>
  59. <!-- 手机验证码登录 true代表手机验证码登录 -->
  60. <template v-else>
  61. <view class="mt-2 position-relative border-bottom">
  62. <view class="position-absolute d-flex a-center j-center left-0 top-0 font-weight"
  63. style="height: 100%;">
  64. <image src="../../static/image/login/shoujihao.png" mode=""
  65. style="width: 18px;height: 18px;">
  66. </image>
  67. </view>
  68. <input type="text" v-model="phone" class="uni-input common-input" style="padding-left: 56rpx;"
  69. placeholder="手机号" />
  70. </view>
  71. <view class="mt-2 position-relative border-bottom">
  72. <view class="position-absolute d-flex a-center j-center left-0 top-0 font-weight"
  73. style="height: 100%;">
  74. <image src="../../static/image/login/yanzhengma.png" mode=""
  75. style="width: 18px;height: 18px;">
  76. </image>
  77. </view>
  78. <input type="text" v-model="checknum" class="uni-input common-input" maxlength="4"
  79. style="padding-right:120px;padding-left: 56rpx;" placeholder="请输入验证码" />
  80. <view class="position-absolute top-0 right-0 d-flex a-center j-center text-light-muted"
  81. style="width: 240rpx;height: 100%;" @tap="getCheckNum">
  82. <view class="d-flex a-center j-center "
  83. :class="!codetime?'yanzhengmaView1 text-color':'yanzhengmaView2'">
  84. {{!codetime?'获取验证码':codetime+' S'+'后重新获取'}}
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <button class="my-3 mt-4 d-flex a-center j-center font-weight bg-color" :loading="loading"
  90. :class="{'bg-hover-color':disabled}" type="primary" @tap="submit" :disabled="disabled"
  91. style="letter-spacing: 20rpx;">登录</button>
  92. <view class=" left-0 right-0 dis a-c j-start text-light-muted" style="bottom:30rpx">
  93. <u-checkbox v-model="checked"></u-checkbox>
  94. 我已确认并同意<view> <text @tap="nav('/pages/login/xieyi')" class="text-color">平台协议</text>及<text
  95. class="text-color" @tap="nav('/pages/login/mimi')">隐私协议</text>政策</view>
  96. </view>
  97. <!-- #ifdef APP -->
  98. <view class="third_party_login_box">
  99. <view class="third_party_title"><text>第三方登录</text></view>
  100. <view class="third_party_content flex-wrap">
  101. <image src="../../static/image/login/wx.png" @click="onWxAppLogin" mode="aspectFit"></image>
  102. <image src="../../static/image/login/zf.png" @click="onzfbAppLogin" mode="aspectFit"></image>
  103. </view>
  104. </view>
  105. <!-- #endif -->
  106. </view>
  107. </view>
  108. <u-toast ref="uToast" />
  109. <u-popup v-model="show" border-radius="14" mode="center" width="70%">
  110. <view class="shu1 shili">
  111. <text>温馨提示</text>
  112. <text>是否更新账号密码?</text>
  113. </view>
  114. <view class="heng shili_btn">
  115. <view class="heng1" @click="quxiao">取消</view>
  116. <view class="heng1" @click="queren" style="background-color: orangered;">确认</view>
  117. </view>
  118. </u-popup>
  119. </view>
  120. </template>
  121. <script>
  122. import appUpdate from "@/components/yzhua006-update/app-update.vue"; //app更新组件
  123. import md5 from '@/plugins/md5';
  124. let clear;
  125. import {
  126. mapState,
  127. mapMutations
  128. } from 'vuex';
  129. import socket from '@/config/socket';
  130. import DB from "@/common/sqlite";
  131. export default {
  132. components: {
  133. appUpdate
  134. },
  135. data() {
  136. return {
  137. checked: false,
  138. list: [{
  139. name: '账号登录'
  140. }, {
  141. name: '短信登录'
  142. }],
  143. current: 0,
  144. isLoading: false,
  145. show: false,
  146. contentSlot: true,
  147. status: false, //false代表账号密码登录,true代表手机验证码登录
  148. disabled: true, //登录按钮是否可用
  149. loading: false, //是否显示按钮加载状态
  150. username: "", //登录用户名
  151. password: "", //登录密码
  152. imgcode: "", //图片验证码0
  153. imgcodesrc: "", //验证码图片
  154. isHidePassword: true, //是否隐藏密码
  155. phone: "", //登录手机号
  156. checknum: "", //登录验证码
  157. captchaId: "",
  158. codetime: 0, //验证码获取倒计时
  159. code: "", //用户code
  160. listData: [],
  161. };
  162. },
  163. onReady() {
  164. this.isLoading = true;
  165. },
  166. beforeCreate() {
  167. setTimeout(() => {
  168. this.$refs.app_update.update(); //调用子组件检查更新方法
  169. setTimeout(() => {
  170. if (this.$refs.app_update.popup_show == true && this.$refs.app_update.force == true) {}
  171. }, 100)
  172. }, 500)
  173. },
  174. //第一次加载
  175. async onLoad(e) {
  176. let pageRequest = {
  177. pageNum: 1,
  178. pageSize: 20,
  179. columnFilters: {
  180. apptype: {
  181. name: "apptype",
  182. value: "apk",
  183. }
  184. }
  185. };
  186. let getquote = await this.$http.post('/sysVersion/findPage', pageRequest);
  187. // #ifdef APP-PLUS
  188. this.openSQL();
  189. this.selectTableData();
  190. // this.deleteTableData();
  191. // #endif
  192. },
  193. watch: {
  194. username(val) {
  195. this.username = this.username.toUpperCase();
  196. this.OnBtnChange();
  197. },
  198. password(val) {
  199. this.OnBtnChange();
  200. },
  201. imgcode(val) {
  202. this.OnBtnChange();
  203. },
  204. phone(val) {
  205. this.OnBtnChange();
  206. },
  207. checknum(val) {
  208. this.OnBtnChange();
  209. }
  210. },
  211. mounted() {
  212. // //取出缓存中的账号、密码
  213. const HBusername = uni.getStorageSync('username');
  214. const HBpassword = uni.getStorageSync('password');
  215. // //有账号、密码就赋值给文本,没有就清空
  216. this.username = HBusername;
  217. this.password = HBpassword;
  218. },
  219. onShow() {
  220. this.refreshCaptcha();
  221. uni.getClipboardData({
  222. success: (res) => {
  223. let id = (res.data.replace(/(^\s*)|(\s*$)/g, "")).toUpperCase();
  224. if ((id.length == 17) && (id.indexOf('99') == 0) && (id.indexOf('D') >
  225. 0) && (id.indexOf(
  226. 'M') > 0) && (id !== this.username)) {
  227. uni.showModal({
  228. content: '是否自动填充会员号',
  229. cancelText: '否',
  230. confirmText: '是',
  231. success: (res1) => {
  232. if (res1.confirm) {
  233. this.username = id;
  234. }
  235. }
  236. });
  237. }
  238. }
  239. })
  240. let args = plus.runtime.arguments;
  241. if (args) {
  242. plus.runtime.arguments = null; //进入之后就把urlscheme清空要不然下一次oushow时还会执行
  243. // 处理args参数,如直达到某新页面等
  244. //通过code请求获取user_id
  245. var authCode = args.split("=")[1];
  246. if (authCode != undefined && authCode != "" && authCode != null) {
  247. this.$login({
  248. url: "/alipay/login",
  249. data: {
  250. code: authCode,
  251. }
  252. }).then(res => {
  253. return uni.showToast({
  254. title: res.msg,
  255. icon: 'none'
  256. });
  257. socket.init();
  258. return;
  259. })
  260. }
  261. }
  262. },
  263. onUnload() {
  264. this.closeSQL();
  265. },
  266. computed: {
  267. ...mapState(["userLoginId", "loginStatus"])
  268. },
  269. //方法
  270. methods: {
  271. ...mapMutations(['setUserInfo']),
  272. // 跳转页面
  273. change(index) {
  274. this.current = index;
  275. },
  276. nav(url) {
  277. uni.navigateTo({
  278. url: url
  279. });
  280. },
  281. // 图片验证码
  282. refreshCaptcha() {
  283. let randnum = Math.floor(Math.random() * (1000000 - 1 + 1)) + 1
  284. this.imgcodesrc = this.$base.baseUrl + "/captchaById?t=" + new Date().getTime() +
  285. '&captchaId=' + randnum;
  286. this.captchaId = randnum;
  287. },
  288. // 切换登录状态
  289. changeStatus() {
  290. uni.hideKeyboard();
  291. this.initInput();
  292. this.status = !this.status;
  293. this.refreshCaptcha();
  294. },
  295. // 初始化表单
  296. initInput() {
  297. this.username = '';
  298. this.password = '';
  299. this.phone = '';
  300. this.checknum = '';
  301. this.imgcode = "";
  302. },
  303. // 改变按钮状态
  304. OnBtnChange() {
  305. if ((this.username && this.password && this.imgcode) || (this.phone && this.checknum)) {
  306. this.disabled = false;
  307. return;
  308. }
  309. this.disabled = true;
  310. },
  311. // 获取验证码
  312. async getCheckNum() {
  313. uni.hideKeyboard();
  314. if (this.codetime > 0) return;
  315. // 验证手机号合法性
  316. if (!this.phone) {
  317. return uni.showToast({
  318. title: '请输入手机号',
  319. icon: 'none'
  320. });
  321. }
  322. if (!this.$base.phoneRegular.test(this.phone)) {
  323. return uni.showToast({
  324. title: '请输入正确的手机号码',
  325. icon: 'none'
  326. });
  327. }
  328. // 请求服务器,发送验证码
  329. let res = await this.$http.get('/sendMsg', {
  330. phone: this.phone,
  331. type: "0"
  332. });
  333. // 请求失败处理
  334. if (res.code != 200) {
  335. return uni.showToast({
  336. title: res.data.msg,
  337. icon: "none"
  338. });
  339. } else {
  340. uni.showToast({
  341. title: "发送成功",
  342. icon: "none"
  343. });
  344. }
  345. // 发送成功,开启倒计时
  346. this.codetime = 60;
  347. let timer = setInterval(() => {
  348. this.codetime--;
  349. if (this.codetime < 1) {
  350. clearInterval(timer);
  351. this.codetime = 0;
  352. }
  353. }, 1000);
  354. },
  355. //#ifdef APP-PLUS
  356. quxiao() {
  357. this.show = false;
  358. this.$login({
  359. url: "/login2",
  360. data: {
  361. account: this.username,
  362. password: this.password,
  363. captcha: this.imgcode.toLowerCase(),
  364. captchaId: this.captchaId,
  365. }
  366. }).then(res => {
  367. if (res) {
  368. return uni.showToast({
  369. title: res.msg,
  370. icon: 'none'
  371. });
  372. } else {
  373. socket.init();
  374. }
  375. })
  376. },
  377. queren() {
  378. this.show = false;
  379. this.$login({
  380. url: "/login2",
  381. data: {
  382. account: this.username,
  383. password: this.password,
  384. captcha: this.imgcode.toLowerCase(),
  385. captchaId: this.captchaId,
  386. }
  387. }).then(async res => {
  388. if (res) {
  389. return uni.showToast({
  390. title: res.msg,
  391. icon: 'none'
  392. });
  393. } else {
  394. this.deleteTableData();
  395. this.openSQL();
  396. this.createTable(); //创建表
  397. this.insertTableData(this.username, this.password); //新增表数据
  398. socket.init();
  399. }
  400. })
  401. },
  402. //#endif
  403. // 提交登录
  404. submit() {
  405. if (!this.checked) {
  406. return this.$refs.uToast.show({
  407. title: '请阅读后勾选并同意《平台协议》及《隐私协议》政策',
  408. type: 'default',
  409. })
  410. }
  411. // // 账号密码登录
  412. uni.hideKeyboard();
  413. if (this.current == 0) {
  414. //#ifdef H5
  415. this.$login({
  416. url: "/login2",
  417. data: {
  418. account: this.username,
  419. password: this.password,
  420. captcha: this.imgcode.toLowerCase(),
  421. captchaId: this.captchaId,
  422. }
  423. }).then(res => {
  424. if (res) {
  425. return uni.showToast({
  426. title: res.msg,
  427. icon: 'none'
  428. });
  429. } else {
  430. socket.init();
  431. }
  432. })
  433. // }
  434. //#endif
  435. //#ifdef APP-PLUS
  436. if (this.listData.length > 0) {
  437. this.listData.map(ele => {
  438. if (this.username == ele.username && this.password == ele.password) {
  439. this.$login({
  440. url: "/login2",
  441. data: {
  442. account: this.username,
  443. password: this.password,
  444. captcha: this.imgcode.toLowerCase(),
  445. captchaId: this.captchaId,
  446. }
  447. }).then(res => {
  448. if (res) {
  449. return uni.showToast({
  450. title: res.msg,
  451. icon: 'none'
  452. });
  453. } else {
  454. socket.init();
  455. }
  456. })
  457. } else {
  458. this.show = true;
  459. }
  460. })
  461. } else {
  462. this.$login({
  463. url: "/login2",
  464. data: {
  465. account: this.username,
  466. password: this.password,
  467. captcha: this.imgcode.toLowerCase(),
  468. captchaId: this.captchaId,
  469. }
  470. }).then(res => {
  471. if (res) {
  472. return uni.showToast({
  473. title: res.msg,
  474. icon: 'none'
  475. });
  476. } else {
  477. this.openSQL(); //打开数据库
  478. this.createTable(); //创建表
  479. this.insertTableData(this.username, this.password); //新增表数据
  480. socket.init();
  481. }
  482. })
  483. }
  484. //#endif
  485. } else {
  486. // 验证码登录
  487. // 验证手机号合法性
  488. if (!this.$base.phoneRegular.test(this.phone)) {
  489. return uni.showToast({
  490. title: '请输入正确的手机号码',
  491. icon: 'none'
  492. });
  493. }
  494. this.$login({
  495. url: "/loginByPhone",
  496. data: {
  497. phone: this.phone,
  498. phoneMsg: this.checknum
  499. }
  500. }).then(res => {
  501. if (res) {
  502. return uni.showToast({
  503. title: res.msg,
  504. icon: 'none'
  505. });
  506. }
  507. // socket.init();
  508. return;
  509. })
  510. }
  511. },
  512. // 微信APP登录
  513. onWxAppLogin() {
  514. var that = this;
  515. uni.login({
  516. provider: 'weixin',
  517. onlyAuthorize: true,
  518. success: function(loginRes) {
  519. that.codeRes(loginRes.code);
  520. },
  521. fail: (err) => {
  522. uni.showToast({
  523. title: '绑定失败',
  524. icon: "none"
  525. });
  526. console.log('login fail:', err);
  527. }
  528. });
  529. },
  530. onzfbAppLogin() {
  531. let urls =
  532. 'https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=2021004153668213&scope=auth_user&redirect_uri=https://test.baoxianzhanggui.com/pay/';
  533. urls = encodeURIComponent(urls); //将地址编码成浏览器访问的格式
  534. plus.runtime.openURL(
  535. 'alipays://platformapi/startapp?appId=20000067&url=' + urls,
  536. res => {
  537. //这里写打开URL地址失败后的处理0
  538. uni.showModal({
  539. content: '本机未检测到对应客户端,是否打开浏览器访问页面?',
  540. success: function(res) {
  541. if (res.confirm) {
  542. //plus.runtime.openURL();
  543. }
  544. }
  545. });
  546. },
  547. 'com.eg.android.AlipayGphone'
  548. );
  549. },
  550. codeRes(code) {
  551. this.$login({
  552. url: "/wechat/login",
  553. data: {
  554. code: code,
  555. }
  556. }).then(res => {
  557. return uni.showToast({
  558. title: res.msg,
  559. icon: 'none'
  560. });
  561. socket.init();
  562. return;
  563. })
  564. },
  565. // 打开数据库
  566. openSQL() {
  567. // 这个是查询有没有打开数据库
  568. let open = DB.isOpen();
  569. DB.openSqlite()
  570. .then(res => {})
  571. .catch(error => {});
  572. },
  573. // 关闭数据库
  574. closeSQL() {
  575. // 这个是查询有没有打开数据库
  576. let open = DB.isOpen();
  577. if (open) {
  578. DB.closeSqlite()
  579. .then(res => {
  580. // this.showToast("数据库已关闭");
  581. })
  582. .catch(error => {
  583. // this.showToast("数据库关闭失败");
  584. });
  585. }
  586. },
  587. // 创建表
  588. createTable() {
  589. let open = DB.isOpen();
  590. if (open) {
  591. this.openSQL();
  592. let sql =
  593. '"id" INTEGER PRIMARY KEY AUTOINCREMENT,"username" text,"password" text,"time" text';
  594. // 创建表 DB.createTable(表名, 表的列)
  595. DB.createTable("chat", sql)
  596. .then(res => {
  597. // this.showToast("创建chat表成功");
  598. })
  599. .catch(error => {});
  600. } else {}
  601. },
  602. // 新增表数据
  603. insertTableData(user, word) {
  604. let open = DB.isOpen();
  605. if (open) {
  606. let arr = [{
  607. username: user,
  608. password: word,
  609. }]
  610. arr.map(item => {
  611. let time = this.formatDate(new Date().getTime());
  612. let sql =
  613. `'${item.username}','${item.password}','${time}'`;
  614. let condition = "'username','password','time'";
  615. // 新增 DB.insertTableData(表名, 对应表头列的数据)
  616. DB.insertTableData("chat", sql, condition)
  617. .then(res => {
  618. this.selectTableData();
  619. })
  620. .catch(error => {});
  621. })
  622. } else {}
  623. },
  624. // 查询表数据
  625. selectTableData() {
  626. let open = DB.isOpen();
  627. if (open) {
  628. // 查询表 DB.selectTableData(表名,查询条件列名,查询条件列值)
  629. DB.selectTableData("chat")
  630. .then(res => {
  631. console.log("contact表数据", res);
  632. this.listData = res;
  633. this.username = res[0].username;
  634. this.password = res[0].password;
  635. })
  636. .catch(error => {});
  637. } else {}
  638. },
  639. // 修改表数据
  640. updateTableData() {
  641. let open = DB.isOpen();
  642. if (open) {
  643. let time = this.formatDate(new Date().getTime());
  644. let data =
  645. `username ='${this.username}',password ='${this.password}'`;
  646. // 修改表数据 DB.updateTableData(表名, 要修改的列名=修改后列值, 修改条件的列名, 修改条件的列值)
  647. DB.updateTableData("chat", data)
  648. .then(res => {
  649. console.log('修改后的数据', res)
  650. this.showToast("保存成功");
  651. this.selectTableData();
  652. })
  653. .catch(error => {
  654. console.log(error)
  655. });
  656. } else {}
  657. },
  658. // 删除表
  659. deleteTableData() {
  660. let open = DB.isOpen();
  661. if (open) {
  662. // 删除表 DB.deleteTableData(表名,查询条件列名,查询条件列值)
  663. DB.dropTable("chat")
  664. .then(res => {})
  665. .catch(error => {});
  666. } else {}
  667. },
  668. // 提示框
  669. showToast: function(str) {
  670. uni.showToast({
  671. icon: "none",
  672. title: str,
  673. mask: true
  674. });
  675. },
  676. // 时间戳转年月日
  677. formatDate(data) {
  678. let now = new Date(data);
  679. var year = now.getFullYear(); //取得4位数的年份
  680. var month =
  681. now.getMonth() + 1 < 10 ?
  682. "0" + (now.getMonth() + 1) :
  683. now.getMonth() + 1;
  684. var date = now.getDate() < 10 ? "0" + now.getDate() : now.getDate();
  685. var hour = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
  686. var minute =
  687. now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
  688. var second =
  689. now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
  690. return (
  691. year +
  692. "-" +
  693. month +
  694. "-" +
  695. date +
  696. " " +
  697. hour +
  698. ":" +
  699. minute +
  700. ":" +
  701. second
  702. );
  703. }
  704. },
  705. //页面隐藏
  706. onHide() {},
  707. //页面卸载
  708. onUnload() {},
  709. //页面下来刷新
  710. onPullDownRefresh() {},
  711. //页面上拉触底
  712. onReachBottom() {},
  713. };
  714. </script>
  715. <style lang="scss" scoped>
  716. /deep/ {
  717. .u-tab-bar {
  718. background: linear-gradient(90deg, #0052FF 0%, rgba(0, 82, 255, 0) 100%) !important;
  719. border-radius: 4px 4px 4px 4px;
  720. }
  721. }
  722. .shu1 {
  723. display: flex;
  724. flex-direction: column;
  725. justify-content: space-between;
  726. align-items: center;
  727. }
  728. .shili_btn {
  729. width: 100%;
  730. height: 90rpx;
  731. border-top: 2rpx solid #F2F2F2;
  732. }
  733. .shili_btn>view {
  734. width: 50%;
  735. height: 100%;
  736. background-color: #ffffff;
  737. cursor: pointer;
  738. }
  739. .shili_btn>view:nth-child(2) {
  740. color: #FFFFFF;
  741. background-color: #007BFF;
  742. }
  743. .shili>text:nth-child(1) {
  744. font-weight: bold;
  745. }
  746. .shili {
  747. padding: 40rpx;
  748. box-sizing: border-box;
  749. }
  750. .heng {
  751. display: flex;
  752. justify-content: space-between;
  753. align-items: center;
  754. }
  755. .heng1 {
  756. display: flex;
  757. justify-content: center;
  758. align-items: center;
  759. }
  760. /* 第三方登录Start */
  761. .third_party_login_box {
  762. position: fixed;
  763. bottom: 50rpx;
  764. left: 0;
  765. right: 0;
  766. height: 170rpx;
  767. padding: 0 30rpx;
  768. }
  769. .third_party_login_box .third_party_title {
  770. display: flex;
  771. align-items: center;
  772. }
  773. .third_party_login_box .third_party_title:before,
  774. .third_party_login_box .third_party_title:after {
  775. content: "";
  776. flex: 1;
  777. height: 2rpx;
  778. background-color: #f5f5f5;
  779. }
  780. .third_party_login_box .third_party_title text {
  781. font-size: 24rpx;
  782. color: #999999;
  783. flex-shrink: 0;
  784. padding: 0 20rpx;
  785. }
  786. .third_party_login_box .third_party_content {
  787. height: 140rpx;
  788. display: flex;
  789. justify-content: center;
  790. align-items: center;
  791. }
  792. .third_party_login_box .third_party_content image {
  793. margin: 0rpx 20rpx;
  794. width: 80rpx;
  795. height: 80rpx;
  796. }
  797. /* 第三方登录End */
  798. .yanzhengmaView1 {
  799. background: #FFFFFF;
  800. border-radius: 10rpx;
  801. width: 150rpx;
  802. padding: 5rpx 0;
  803. }
  804. .yanzhengmaView2 {
  805. background: #FFFFFF;
  806. border-radius: 10rpx;
  807. width: 220rpx;
  808. padding: 5rpx 0;
  809. }
  810. .bg-color {
  811. background-color: #0052FF;
  812. border-radius: 20px;
  813. }
  814. .bg-hover-color {
  815. background-color: #0052FF;
  816. opacity: 0.65;
  817. border-radius: 20px;
  818. }
  819. .text-color {
  820. color: #0052FF;
  821. }
  822. </style>