login.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  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" active-color="#FF852D"
  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" active-color="#FF852D "></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. appid: {
  185. name: "appid",
  186. value: "__UNI__3FA05C4",
  187. }
  188. }
  189. };
  190. let getquote = await this.$http.post('/sysVersion/findPage', pageRequest);
  191. // #ifdef APP-PLUS
  192. this.openSQL();
  193. this.selectTableData();
  194. // this.deleteTableData();
  195. // #endif
  196. },
  197. watch: {
  198. username(val) {
  199. this.username = this.username.toUpperCase();
  200. this.OnBtnChange();
  201. },
  202. password(val) {
  203. this.OnBtnChange();
  204. },
  205. imgcode(val) {
  206. this.OnBtnChange();
  207. },
  208. phone(val) {
  209. this.OnBtnChange();
  210. },
  211. checknum(val) {
  212. this.OnBtnChange();
  213. }
  214. },
  215. mounted() {
  216. // //取出缓存中的账号、密码
  217. const HBusername = uni.getStorageSync('username');
  218. const HBpassword = uni.getStorageSync('password');
  219. // //有账号、密码就赋值给文本,没有就清空
  220. this.username = HBusername;
  221. this.password = HBpassword;
  222. },
  223. onShow() {
  224. this.refreshCaptcha();
  225. uni.getClipboardData({
  226. success: (res) => {
  227. let id = (res.data.replace(/(^\s*)|(\s*$)/g, "")).toUpperCase();
  228. if ((id.length == 17) && (id.indexOf('99') == 0) && (id.indexOf('D') >
  229. 0) && (id.indexOf(
  230. 'M') > 0) && (id !== this.username)) {
  231. uni.showModal({
  232. content: '是否自动填充会员号',
  233. cancelText: '否',
  234. confirmText: '是',
  235. success: (res1) => {
  236. if (res1.confirm) {
  237. this.username = id;
  238. }
  239. }
  240. });
  241. }
  242. }
  243. })
  244. //#ifdef APP-PLUS
  245. let args = plus.runtime.arguments;
  246. if (args) {
  247. plus.runtime.arguments = null; //进入之后就把urlscheme清空要不然下一次oushow时还会执行
  248. // 处理args参数,如直达到某新页面等
  249. //通过code请求获取user_id
  250. var authCode = args.split("=")[1];
  251. if (authCode != undefined && authCode != "" && authCode != null) {
  252. this.$login({
  253. url: "/APPPartner/loginAlipay",
  254. data: {
  255. code: authCode,
  256. }
  257. }).then(res => {
  258. return uni.showToast({
  259. title: res.msg,
  260. icon: 'none'
  261. });
  262. socket.init();
  263. return;
  264. })
  265. }
  266. }
  267. //#endif
  268. },
  269. onUnload() {
  270. this.closeSQL();
  271. },
  272. computed: {
  273. ...mapState(["userLoginId", "loginStatus"])
  274. },
  275. //方法
  276. methods: {
  277. ...mapMutations(['setUserInfo']),
  278. // 跳转页面
  279. change(index) {
  280. this.current = index;
  281. },
  282. nav(url) {
  283. uni.navigateTo({
  284. url: url
  285. });
  286. },
  287. // 图片验证码
  288. refreshCaptcha() {
  289. let randnum = Math.floor(Math.random() * (1000000 - 1 + 1)) + 1
  290. this.imgcodesrc = this.$base.baseUrl + "/captchaById?t=" + new Date().getTime() +
  291. '&captchaId=' + randnum;
  292. this.captchaId = randnum;
  293. },
  294. // 切换登录状态
  295. changeStatus() {
  296. uni.hideKeyboard();
  297. this.initInput();
  298. this.status = !this.status;
  299. this.refreshCaptcha();
  300. },
  301. // 初始化表单
  302. initInput() {
  303. this.username = '';
  304. this.password = '';
  305. this.phone = '';
  306. this.checknum = '';
  307. this.imgcode = "";
  308. },
  309. // 改变按钮状态
  310. OnBtnChange() {
  311. if ((this.username && this.password && this.imgcode) || (this.phone && this.checknum)) {
  312. this.disabled = false;
  313. return;
  314. }
  315. this.disabled = true;
  316. },
  317. // 获取验证码
  318. async getCheckNum() {
  319. uni.hideKeyboard();
  320. if (this.codetime > 0) return;
  321. // 验证手机号合法性
  322. if (!this.phone) {
  323. return uni.showToast({
  324. title: '请输入手机号',
  325. icon: 'none'
  326. });
  327. }
  328. if (!this.$base.phoneRegular.test(this.phone)) {
  329. return uni.showToast({
  330. title: '请输入正确的手机号码',
  331. icon: 'none'
  332. });
  333. }
  334. // 请求服务器,发送验证码
  335. let res = await this.$http.get('/sendMsg', {
  336. phone: this.phone,
  337. type: "0"
  338. });
  339. // 请求失败处理
  340. if (res.code != 200) {
  341. return uni.showToast({
  342. title: res.data.msg,
  343. icon: "none"
  344. });
  345. } else {
  346. uni.showToast({
  347. title: "发送成功",
  348. icon: "none"
  349. });
  350. }
  351. // 发送成功,开启倒计时
  352. this.codetime = 60;
  353. let timer = setInterval(() => {
  354. this.codetime--;
  355. if (this.codetime < 1) {
  356. clearInterval(timer);
  357. this.codetime = 0;
  358. }
  359. }, 1000);
  360. },
  361. //#ifdef APP-PLUS
  362. quxiao() {
  363. this.show = false;
  364. this.$login({
  365. url: "/aapLogin",
  366. data: {
  367. account: this.username,
  368. password: this.password,
  369. captcha: this.imgcode.toLowerCase(),
  370. captchaId: this.captchaId,
  371. }
  372. }).then(res => {
  373. if (res) {
  374. return uni.showToast({
  375. title: res.msg,
  376. icon: 'none'
  377. });
  378. } else {
  379. socket.init();
  380. }
  381. })
  382. },
  383. queren() {
  384. this.show = false;
  385. this.$login({
  386. url: "/aapLogin",
  387. data: {
  388. account: this.username,
  389. password: this.password,
  390. captcha: this.imgcode.toLowerCase(),
  391. captchaId: this.captchaId,
  392. }
  393. }).then(async res => {
  394. if (res) {
  395. return uni.showToast({
  396. title: res.msg,
  397. icon: 'none'
  398. });
  399. } else {
  400. this.deleteTableData();
  401. this.openSQL();
  402. this.createTable(); //创建表
  403. this.insertTableData(this.username, this.password); //新增表数据
  404. socket.init();
  405. }
  406. })
  407. },
  408. //#endif
  409. // 提交登录
  410. submit() {
  411. if (!this.checked) {
  412. return this.$refs.uToast.show({
  413. title: '请阅读后勾选并同意《平台协议》及《隐私协议》政策',
  414. type: 'default',
  415. })
  416. }
  417. // // 账号密码登录
  418. uni.hideKeyboard();
  419. if (this.current == 0) {
  420. //#ifdef H5
  421. this.$login({
  422. url: "/aapLogin",
  423. data: {
  424. account: this.username,
  425. password: this.password,
  426. captcha: this.imgcode.toLowerCase(),
  427. captchaId: this.captchaId,
  428. }
  429. }).then(res => {
  430. if (res) {
  431. return uni.showToast({
  432. title: res.msg,
  433. icon: 'none'
  434. });
  435. } else {
  436. socket.init();
  437. }
  438. })
  439. // }
  440. //#endif
  441. //#ifdef APP-PLUS
  442. if (this.listData.length > 0) {
  443. this.listData.map(ele => {
  444. if (this.username == ele.username && this.password == ele.password) {
  445. this.$login({
  446. url: "/aapLogin",
  447. data: {
  448. account: this.username,
  449. password: this.password,
  450. captcha: this.imgcode.toLowerCase(),
  451. captchaId: this.captchaId,
  452. }
  453. }).then(res => {
  454. if (res) {
  455. return uni.showToast({
  456. title: res.msg,
  457. icon: 'none'
  458. });
  459. } else {
  460. socket.init();
  461. }
  462. })
  463. } else {
  464. this.show = true;
  465. }
  466. })
  467. } else {
  468. this.$login({
  469. url: "/aapLogin",
  470. data: {
  471. account: this.username,
  472. password: this.password,
  473. captcha: this.imgcode.toLowerCase(),
  474. captchaId: this.captchaId,
  475. }
  476. }).then(res => {
  477. if (res) {
  478. return uni.showToast({
  479. title: res.msg,
  480. icon: 'none'
  481. });
  482. } else {
  483. this.openSQL(); //打开数据库
  484. this.createTable(); //创建表
  485. this.insertTableData(this.username, this.password); //新增表数据
  486. socket.init();
  487. }
  488. })
  489. }
  490. //#endif
  491. } else {
  492. // 验证码登录
  493. // 验证手机号合法性
  494. if (!this.$base.phoneRegular.test(this.phone)) {
  495. return uni.showToast({
  496. title: '请输入正确的手机号码',
  497. icon: 'none'
  498. });
  499. }
  500. this.$login({
  501. url: "/loginAPPByPhone",
  502. data: {
  503. phone: this.phone,
  504. phoneMsg: this.checknum
  505. }
  506. }).then(res => {
  507. if (res) {
  508. return uni.showToast({
  509. title: res.msg,
  510. icon: 'none'
  511. });
  512. }
  513. // socket.init();
  514. return;
  515. })
  516. }
  517. },
  518. // 微信APP登录
  519. onWxAppLogin() {
  520. var that = this;
  521. uni.login({
  522. provider: 'weixin',
  523. onlyAuthorize: true,
  524. success: function(loginRes) {
  525. that.codeRes(loginRes.code);
  526. },
  527. fail: (err) => {
  528. uni.showToast({
  529. title: '绑定失败',
  530. icon: "none"
  531. });
  532. console.log('login fail:', err);
  533. }
  534. });
  535. },
  536. onzfbAppLogin() {
  537. let urls =
  538. 'https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=2021004193614682&scope=auth_user&redirect_uri=https://test.baoxianzhanggui.com/partnerPay/';
  539. urls = encodeURIComponent(urls); //将地址编码成浏览器访问的格式
  540. plus.runtime.openURL(
  541. 'alipays://platformapi/startapp?appId=20000067&url=' + urls,
  542. res => {
  543. //这里写打开URL地址失败后的处理0
  544. uni.showModal({
  545. content: '本机未检测到对应客户端,是否打开浏览器访问页面?',
  546. success: function(res) {
  547. if (res.confirm) {
  548. //plus.runtime.openURL();
  549. }
  550. }
  551. });
  552. },
  553. 'com.eg.android.AlipayGphone'
  554. );
  555. },
  556. codeRes(code) {
  557. this.$login({
  558. url: "/APPPartner/loginWechat",
  559. data: {
  560. code: code,
  561. }
  562. }).then(res => {
  563. return uni.showToast({
  564. title: res.msg,
  565. icon: 'none'
  566. });
  567. socket.init();
  568. return;
  569. })
  570. },
  571. // 打开数据库
  572. openSQL() {
  573. // 这个是查询有没有打开数据库
  574. let open = DB.isOpen();
  575. DB.openSqlite()
  576. .then(res => {})
  577. .catch(error => {});
  578. },
  579. // 关闭数据库
  580. closeSQL() {
  581. // 这个是查询有没有打开数据库
  582. let open = DB.isOpen();
  583. if (open) {
  584. DB.closeSqlite()
  585. .then(res => {
  586. // this.showToast("数据库已关闭");
  587. })
  588. .catch(error => {
  589. // this.showToast("数据库关闭失败");
  590. });
  591. }
  592. },
  593. // 创建表
  594. createTable() {
  595. let open = DB.isOpen();
  596. if (open) {
  597. this.openSQL();
  598. let sql =
  599. '"id" INTEGER PRIMARY KEY AUTOINCREMENT,"username" text,"password" text,"time" text';
  600. // 创建表 DB.createTable(表名, 表的列)
  601. DB.createTable("chat", sql)
  602. .then(res => {
  603. // this.showToast("创建chat表成功");
  604. })
  605. .catch(error => {});
  606. } else {}
  607. },
  608. // 新增表数据
  609. insertTableData(user, word) {
  610. let open = DB.isOpen();
  611. if (open) {
  612. let arr = [{
  613. username: user,
  614. password: word,
  615. }]
  616. arr.map(item => {
  617. let time = this.formatDate(new Date().getTime());
  618. let sql =
  619. `'${item.username}','${item.password}','${time}'`;
  620. let condition = "'username','password','time'";
  621. // 新增 DB.insertTableData(表名, 对应表头列的数据)
  622. DB.insertTableData("chat", sql, condition)
  623. .then(res => {
  624. this.selectTableData();
  625. })
  626. .catch(error => {});
  627. })
  628. } else {}
  629. },
  630. // 查询表数据
  631. selectTableData() {
  632. let open = DB.isOpen();
  633. if (open) {
  634. // 查询表 DB.selectTableData(表名,查询条件列名,查询条件列值)
  635. DB.selectTableData("chat")
  636. .then(res => {
  637. console.log("contact表数据", res);
  638. this.listData = res;
  639. this.username = res[0].username;
  640. this.password = res[0].password;
  641. })
  642. .catch(error => {});
  643. } else {}
  644. },
  645. // 修改表数据
  646. updateTableData() {
  647. let open = DB.isOpen();
  648. if (open) {
  649. let time = this.formatDate(new Date().getTime());
  650. let data =
  651. `username ='${this.username}',password ='${this.password}'`;
  652. // 修改表数据 DB.updateTableData(表名, 要修改的列名=修改后列值, 修改条件的列名, 修改条件的列值)
  653. DB.updateTableData("chat", data)
  654. .then(res => {
  655. console.log('修改后的数据', res)
  656. this.showToast("保存成功");
  657. this.selectTableData();
  658. })
  659. .catch(error => {
  660. console.log(error)
  661. });
  662. } else {}
  663. },
  664. // 删除表
  665. deleteTableData() {
  666. let open = DB.isOpen();
  667. if (open) {
  668. // 删除表 DB.deleteTableData(表名,查询条件列名,查询条件列值)
  669. DB.dropTable("chat")
  670. .then(res => {})
  671. .catch(error => {});
  672. } else {}
  673. },
  674. // 提示框
  675. showToast: function(str) {
  676. uni.showToast({
  677. icon: "none",
  678. title: str,
  679. mask: true
  680. });
  681. },
  682. // 时间戳转年月日
  683. formatDate(data) {
  684. let now = new Date(data);
  685. var year = now.getFullYear(); //取得4位数的年份
  686. var month =
  687. now.getMonth() + 1 < 10 ?
  688. "0" + (now.getMonth() + 1) :
  689. now.getMonth() + 1;
  690. var date = now.getDate() < 10 ? "0" + now.getDate() : now.getDate();
  691. var hour = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
  692. var minute =
  693. now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
  694. var second =
  695. now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
  696. return (
  697. year +
  698. "-" +
  699. month +
  700. "-" +
  701. date +
  702. " " +
  703. hour +
  704. ":" +
  705. minute +
  706. ":" +
  707. second
  708. );
  709. }
  710. },
  711. //页面隐藏
  712. onHide() {},
  713. //页面卸载
  714. onUnload() {},
  715. //页面下来刷新
  716. onPullDownRefresh() {},
  717. //页面上拉触底
  718. onReachBottom() {},
  719. };
  720. </script>
  721. <style lang="scss" scoped>
  722. /deep/ {
  723. .u-tab-bar {
  724. background: linear-gradient(90deg, #FF9E2D 0%, rgba(0, 82, 255, 0) 100%) !important;
  725. border-radius: 4px 4px 4px 4px;
  726. }
  727. }
  728. .shu1 {
  729. display: flex;
  730. flex-direction: column;
  731. justify-content: space-between;
  732. align-items: center;
  733. }
  734. .shili_btn {
  735. width: 100%;
  736. height: 90rpx;
  737. border-top: 2rpx solid #F2F2F2;
  738. }
  739. .shili_btn>view {
  740. width: 50%;
  741. height: 100%;
  742. background-color: #ffffff;
  743. cursor: pointer;
  744. }
  745. .shili_btn>view:nth-child(2) {
  746. color: #FFFFFF;
  747. background-color: #FF9E2D;
  748. }
  749. .shili>text:nth-child(1) {
  750. font-weight: bold;
  751. }
  752. .shili {
  753. padding: 40rpx;
  754. box-sizing: border-box;
  755. }
  756. .heng {
  757. display: flex;
  758. justify-content: space-between;
  759. align-items: center;
  760. }
  761. .heng1 {
  762. display: flex;
  763. justify-content: center;
  764. align-items: center;
  765. }
  766. /* 第三方登录Start */
  767. .third_party_login_box {
  768. position: fixed;
  769. bottom: 50rpx;
  770. left: 0;
  771. right: 0;
  772. height: 170rpx;
  773. padding: 0 30rpx;
  774. }
  775. .third_party_login_box .third_party_title {
  776. display: flex;
  777. align-items: center;
  778. }
  779. .third_party_login_box .third_party_title:before,
  780. .third_party_login_box .third_party_title:after {
  781. content: "";
  782. flex: 1;
  783. height: 2rpx;
  784. background-color: #f5f5f5;
  785. }
  786. .third_party_login_box .third_party_title text {
  787. font-size: 24rpx;
  788. color: #999999;
  789. flex-shrink: 0;
  790. padding: 0 20rpx;
  791. }
  792. .third_party_login_box .third_party_content {
  793. height: 140rpx;
  794. display: flex;
  795. justify-content: center;
  796. align-items: center;
  797. }
  798. .third_party_login_box .third_party_content image {
  799. margin: 0rpx 20rpx;
  800. width: 80rpx;
  801. height: 80rpx;
  802. }
  803. /* 第三方登录End */
  804. .yanzhengmaView1 {
  805. background: #FFFFFF;
  806. border-radius: 10rpx;
  807. width: 150rpx;
  808. padding: 5rpx 0;
  809. }
  810. .yanzhengmaView2 {
  811. background: #FFFFFF;
  812. border-radius: 10rpx;
  813. width: 220rpx;
  814. padding: 5rpx 0;
  815. }
  816. .bg-color {
  817. background-color: #FF9E2D;
  818. border-radius: 20px;
  819. }
  820. .bg-hover-color {
  821. background-color: #FF9E2D !important;
  822. opacity: 0.65;
  823. border-radius: 20px;
  824. }
  825. .text-color {
  826. color: #FF9E2D;
  827. }
  828. // .u-checkbox>.u-checkbox__icon-wrap--checked{
  829. // background-color: #FF9E2D !important;
  830. // border-color: #FF9E2D !important;
  831. // }
  832. </style>