index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <!-- <view class="one">
  5. <text>{{type==0?'短信验证码登录':'手机号密码登录'}}</text>
  6. </view>
  7. <view class="two">
  8. <uni-forms ref="form" :model="form" :rules="rules" label-width="auto">
  9. <uni-forms-item label="手机号" name="phone">
  10. <uni-easyinput type="number" v-model="form.phone" />
  11. </uni-forms-item>
  12. <uni-forms-item label="验证码" name="code" v-if="type==0">
  13. <view class="yzm">
  14. <view class="l">
  15. <uni-easyinput type="number" v-model="form.code" placeholder="请输入验证码" />
  16. </view>
  17. <view class="r">
  18. <button type="default" size="mini" @tap="oneSms">{{sms_1==0?'验证码':sms_1}}</button>
  19. </view>
  20. </view>
  21. </uni-forms-item>
  22. <uni-forms-item label="登录密码" name="password" v-if="type==1">
  23. <uni-easyinput type="text" v-model="form.password" placeholder="请输入登录密码" />
  24. </uni-forms-item>
  25. <view class="type">
  26. <button type="default" size="mini" @tap="passLogin">{{type==0?'密码登录':'短信登录'}}</button>
  27. </view>
  28. <view class="agree">
  29. <checkbox-group @change="changeAgree">
  30. <label>
  31. <checkbox :checked="agree" />
  32. <text @tap.stop="toAgree()">我已阅读并同意“用户协议”和“隐私政策”</text>
  33. </label>
  34. </checkbox-group>
  35. </view>
  36. <view class="btn">
  37. <button type="default" size="mini" @click="onSubmit('form')">登录</button>
  38. </view>
  39. </uni-forms>
  40. </view>
  41. <view class="thr">
  42. <view class="thr_1">
  43. <text>其他登录方式</text>
  44. </view>
  45. <view class="thr_2">
  46. <view class="thr_2_1" @tap="otherLogin('wx')">
  47. <text class="iconfont icon-weixin"></text>
  48. </view>
  49. </view>
  50. </view> -->
  51. <view class="wx">
  52. <view class="wx_1">
  53. <text class="iconfont icon-weixin"></text>
  54. </view>
  55. <view class="wx_2">
  56. <button size="mini" @tap="otherLogin('wx')">微信信任登录</button>
  57. </view>
  58. <view class="wx_3">
  59. <checkbox-group @change="changeAgree">
  60. <label>
  61. <checkbox :checked="agree" />
  62. <text @tap.stop="toAgree()">我已阅读并同意“用户协议”和“隐私政策”</text>
  63. </label>
  64. </checkbox-group>
  65. </view>
  66. </view>
  67. </view>
  68. <uni-popup ref="dialogShow" type="center" :mask-click="false" background-color="#ffffff">
  69. <view class="popup">
  70. <view class="title">
  71. <text>绑定手机号</text>
  72. </view>
  73. <view class="wx_1">
  74. <text>确定获取微信绑定手机号吗?</text>
  75. </view>
  76. <view class="wx_2">
  77. <button size="mini" @tap="diaClose">取消</button>
  78. <button size="mini" open-type="getPhoneNumber" @getphonenumber="getUserPhone">确定</button>
  79. </view>
  80. </view>
  81. </uni-popup>
  82. <!-- <uni-popup ref="dialogShow" type="dialog">
  83. <uni-popup-dialog :title="dialog.title" mode="base" :before-close="true" @confirm="diaSubmit(dialog)" @close="diaReset(dialog)">
  84. <view class="dialog dialog_1" v-if="dialog.type=='1'">
  85. <uni-forms ref="phoneForm" :model="phoneForm" label-width="auto">
  86. <uni-forms-item label="方式">
  87. <uni-data-checkbox v-model="phoneForm.type" :localdata="typeList" />
  88. </uni-forms-item>
  89. <uni-forms-item label="微信" v-if="phoneForm.type==0">
  90. <button type="default" size="mini" open-type="getPhoneNumber" @getphonenumber="getUserPhone">获取微信绑定手机</button>
  91. </uni-forms-item>
  92. <uni-forms-item label="手机号" v-if="phoneForm.type==0">
  93. <uni-easyinput type="number" v-model="phoneForm.phone" disabled />
  94. </uni-forms-item>
  95. <uni-forms-item label="手机号" v-if="phoneForm.type==1">
  96. <view class="yzm">
  97. <view class="l">
  98. <uni-easyinput type="number" v-model="phoneForm.phone" placeholder="请输入手机号" />
  99. </view>
  100. <view class="r">
  101. <button type="default" size="mini" @tap="twoSms">{{sms_1==0?'验证码':sms_1}}</button>
  102. </view>
  103. </view>
  104. </uni-forms-item>
  105. <uni-forms-item label="验证码" v-if="phoneForm.type==1">
  106. <uni-easyinput type="number" v-model="phoneForm.code" placeholder="请输入验证码" />
  107. </uni-forms-item>
  108. </uni-forms>
  109. </view>
  110. </uni-popup-dialog>
  111. </uni-popup> -->
  112. </mobile-frame>
  113. </template>
  114. <script>
  115. export default {
  116. data() {
  117. return {
  118. // 平台信息
  119. system: {},
  120. openid: '',
  121. // 登录类型
  122. type: 0,
  123. form: {},
  124. rules: {
  125. phone: {
  126. rules: [ //
  127. {
  128. required: true,
  129. errorMessage: '请输入手机号',
  130. },
  131. {
  132. minLength: 11,
  133. maxLength: 11,
  134. errorMessage: '账号长度在{maxLength}个字符',
  135. }
  136. ]
  137. }
  138. },
  139. sms_1: 0,
  140. // 用戶协议
  141. agree: true,
  142. // 注册账号信息
  143. user: {},
  144. // 弹框
  145. dialog: {
  146. title: '绑定手机号',
  147. type: '1'
  148. },
  149. // 绑定手机号
  150. phoneForm: {
  151. type: 0,
  152. },
  153. typeList: [ //
  154. {
  155. limit: 10, text: '微信',
  156. value: 0
  157. },
  158. {
  159. text: '短信验证',
  160. value: 1
  161. }
  162. ],
  163. };
  164. },
  165. onShow: function() {
  166. const that = this;
  167. // 查询平台信息
  168. that.searchSystem();
  169. },
  170. methods: {
  171. // 查询平台信息
  172. searchSystem() {
  173. const that = this;
  174. let system = that.$config.system;
  175. if (system) {
  176. that.$set(that, `system`, system);
  177. that.searchOpenid();
  178. }
  179. },
  180. // 查询openid
  181. searchOpenid() {
  182. const that = this;
  183. let system = that.system;
  184. if (system.uniPlatform == "mp-weixin") {
  185. uni.login({
  186. provider: 'weixin',
  187. success: async function(res) {
  188. const aee = await that.$api(`/wechat/api/login/app`, 'GET', {
  189. config: that.$config.wx_projectkey,
  190. js_code: res.code
  191. })
  192. if (aee.errcode == '0') {
  193. that.$set(that, `openid`, aee.data.openid);
  194. }
  195. }
  196. })
  197. } else if (system.uniPlatform == "app") {
  198. console.log('app');
  199. }
  200. },
  201. // 选择登录类型
  202. typeChange(e) {
  203. const that = this;
  204. that.$set(that, `type`, e.detail.value);
  205. },
  206. // 短信登录/密码登录
  207. passLogin() {
  208. const that = this;
  209. let type = 0;
  210. if (that.type == 0) type = 1;
  211. that.$set(that, `type`, type)
  212. },
  213. // 短信登录-发送验证码
  214. async oneSms() {
  215. const that = this;
  216. let form = that.form;
  217. if (form && form.phone) {
  218. let res = await that.$api(`/user/toLoginByCode`, 'POST', {
  219. phone: form.phone
  220. })
  221. if (res.errcode == '0') {
  222. uni.showToast({
  223. title: '发送成功',
  224. icon: 'none'
  225. })
  226. that.$set(that, `sms_1`, 60);
  227. that.timeDown();
  228. } else {
  229. uni.showToast({
  230. title: res.errmsg,
  231. icon: 'none'
  232. })
  233. }
  234. } else {
  235. uni.showToast({
  236. title: '输入错误,请重新输入!',
  237. icon: 'none'
  238. })
  239. }
  240. },
  241. // 登录
  242. onSubmit(ref) {
  243. const that = this;
  244. let agree = that.agree;
  245. let system = that.system;
  246. let type = that.type;
  247. that.$refs[ref].validate().then(async params => {
  248. if (agree) {
  249. if (type == 0 && system.uniPlatform == 'app') {
  250. // app,短信验证码登录
  251. that.appSmsLogin(params);
  252. } else if (type == 1 && system.uniPlatform == 'app') {
  253. // app,密码登录
  254. that.appPassLogin(params);
  255. } else if (type == 0 && system.uniPlatform == 'mp-weixin') {
  256. // wx,短信验证码登录
  257. that.wxSmsLogin(params)
  258. } else if (type == 1 && system.uniPlatform == 'mp-weixin') {
  259. // wx,密码登录
  260. that.wxPassLogin(params)
  261. }
  262. } else {
  263. uni.showToast({
  264. title: '请阅读并同意用户协议和隐私政策',
  265. icon: 'none'
  266. })
  267. }
  268. }).catch(err => {
  269. console.log(err);
  270. })
  271. },
  272. // app,短信验证码登录
  273. async appSmsLogin(e) {
  274. const that = this;
  275. if (e.code) {
  276. const res = await that.$api(`/user/checkLoginCode`, 'POST', e);
  277. if (res.errcode == '0') {
  278. uni.setStorage({
  279. key: 'token',
  280. data: res.data,
  281. success: function() {
  282. uni.navigateBack({
  283. delta: 1
  284. })
  285. }
  286. });
  287. } else {
  288. if (res.errcode == '-5') {
  289. uni.showToast({
  290. title: '用户不存在',
  291. icon: 'none'
  292. })
  293. // todo:验证码登录用户不存在可自动注册账号,并跳转
  294. } else {
  295. uni.showToast({
  296. title: res.errmsg || '信息错误',
  297. icon: 'none'
  298. })
  299. }
  300. }
  301. } else {
  302. uni.showToast({
  303. title: '请输入验证码',
  304. icon: 'none'
  305. })
  306. }
  307. },
  308. // app,密码登录
  309. async appPassLogin(e) {
  310. const that = this;
  311. if (e.password) {
  312. const res = await that.$api(`/user/login`, 'POST', e);
  313. if (res.errcode == '0') {
  314. uni.setStorage({
  315. key: 'token',
  316. data: res.data,
  317. success: function() {
  318. uni.navigateBack({
  319. delta: 1
  320. })
  321. }
  322. });
  323. } else {
  324. uni.showToast({
  325. title: res.errmsg || '信息错误',
  326. icon: 'none'
  327. })
  328. }
  329. } else {
  330. uni.showToast({
  331. title: '请输入登录密码',
  332. icon: 'none'
  333. })
  334. }
  335. },
  336. // wx,短信验证码登录
  337. async wxSmsLogin(e) {
  338. const that = this;
  339. if (e.code) {
  340. const res = await that.$api(`/user/checkLoginCode`, 'POST', e);
  341. if (res.errcode == '0') {
  342. uni.setStorage({
  343. key: 'token',
  344. data: res.data,
  345. success: function() {
  346. uni.navigateBack({
  347. delta: 1
  348. })
  349. }
  350. });
  351. } else {
  352. if (res.errcode == '-5') {
  353. uni.showModal({
  354. title: '提示',
  355. content: '用户不存在,是否注册新账号?',
  356. success: function(res) {
  357. if (res.confirm) {
  358. // 无账号,注册账号
  359. that.wxCreate();
  360. }
  361. }
  362. });
  363. } else {
  364. uni.showToast({
  365. title: res.errmsg || '信息错误',
  366. icon: 'none'
  367. })
  368. }
  369. }
  370. } else {
  371. uni.showToast({
  372. title: '请输入验证码',
  373. icon: 'none'
  374. })
  375. }
  376. },
  377. // wx,密码登录
  378. async wxPassLogin(e) {
  379. const that = this;
  380. if (e.password) {
  381. const res = await that.$api(`/user/login`, 'POST', e);
  382. if (res.errcode == '0') {
  383. uni.setStorage({
  384. key: 'token',
  385. data: res.data,
  386. success: function() {
  387. uni.navigateBack({
  388. delta: 1
  389. })
  390. }
  391. });
  392. } else {
  393. if (res.errcode == '-5') {
  394. uni.showModal({
  395. title: '提示',
  396. content: '用户不存在,是否注册新账号?',
  397. success: function(res) {
  398. if (res.confirm) {
  399. // 无账号,注册账号
  400. that.wxCreate();
  401. }
  402. }
  403. });
  404. } else {
  405. uni.showToast({
  406. title: res.errmsg || '信息错误',
  407. icon: 'none'
  408. })
  409. }
  410. }
  411. } else {
  412. uni.showToast({
  413. title: '请输入登录密码',
  414. icon: 'none'
  415. })
  416. }
  417. },
  418. // 其他登录方式
  419. async otherLogin(e) {
  420. const that = this;
  421. let system = that.system;
  422. let agree = that.agree;
  423. let openid = that.openid;
  424. if (agree) {
  425. if (system.uniPlatform == 'app') {
  426. uni.showToast({
  427. title: '暂无开通',
  428. icon: 'none'
  429. })
  430. // todo:app端,微信一键登录
  431. } else if (system.uniPlatform == 'mp-weixin') {
  432. if (e == 'wx') {
  433. if (openid) {
  434. const res = await that.$api(`/user/wxLogin`, 'POST', {
  435. openid: openid
  436. })
  437. if (res.errcode == '0') {
  438. uni.setStorage({
  439. key: 'token',
  440. data: res.data,
  441. success: function() {
  442. let pages = getCurrentPages();
  443. let prePage = pages[pages.length - 2];
  444. if (prePage) {
  445. let url = `/${prePage.route}`;
  446. uni.reLaunch({
  447. url
  448. })
  449. }
  450. }
  451. });
  452. } else {
  453. if (res.errcode == '-5') {
  454. uni.showModal({
  455. title: '提示',
  456. content: '用户不存在,是否注册新账号?',
  457. success: function(res) {
  458. if (res.confirm) {
  459. // 无账号,注册账号
  460. that.wxCreate();
  461. }
  462. }
  463. });
  464. } else {
  465. uni.showToast({
  466. title: res.errmsg || '信息错误',
  467. icon: 'none'
  468. })
  469. }
  470. }
  471. } else {
  472. uni.showToast({
  473. title: '系统更新中,请稍后再试!',
  474. icon: 'none'
  475. })
  476. }
  477. }
  478. }
  479. } else {
  480. uni.showToast({
  481. title: '请阅读并同意用户协议和隐私政策',
  482. icon: 'none'
  483. })
  484. }
  485. },
  486. // wx,注册账号
  487. wxCreate() {
  488. const that = this;
  489. uni.getUserProfile({
  490. desc: '用于展示',
  491. success: async function(res) {
  492. let parmas = {
  493. openid: that.openid,
  494. icon: [{
  495. url: res.userInfo.avatarUrl
  496. }],
  497. name: res.userInfo.nickName,
  498. }
  499. const arr = await that.$api(`/user`, 'POST', parmas);
  500. if (arr.errcode == '0') {
  501. that.$set(that, `user`, arr.data);
  502. // 打开弹框
  503. that.diaShow();
  504. } else {
  505. uni.showToast({
  506. title: arr.errmsg,
  507. icon: 'none'
  508. });
  509. }
  510. },
  511. fail: function(err) {
  512. console.log(err);
  513. }
  514. })
  515. },
  516. // 打开弹框,绑定手机号
  517. diaShow() {
  518. const that = this;
  519. that.$refs.dialogShow.open();
  520. },
  521. // 获取手机号
  522. async getUserPhone(e) {
  523. const that = this;
  524. let user = that.user;
  525. let detail = e.detail;
  526. let res = await that.$api(`/wechat/api/login/getPhone`, 'GET', {
  527. config: that.$config.wx_projectkey,
  528. code: detail.code
  529. })
  530. if (res.errcode == '0') {
  531. let phone = res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber || '';
  532. that.updatePhone(phone, 'wx')
  533. } else {
  534. uni.showToast({
  535. title: res.errmsg,
  536. icon: 'none'
  537. })
  538. }
  539. },
  540. // 弹框关闭
  541. diaClose() {
  542. const that = this;
  543. that.$refs.dialogShow.close();
  544. that.otherLogin('wx');
  545. },
  546. async twoSms() {
  547. const that = this;
  548. let user = this.user;
  549. let form = that.phoneForm;
  550. if (form && form.phone) {
  551. let res = await that.$api(`/user/toBindPhone`, 'POST', {
  552. id: user._id,
  553. phone: form.phone
  554. })
  555. if (res.errcode == '0') {
  556. uni.showToast({
  557. title: '发送成功',
  558. icon: 'none'
  559. })
  560. that.$set(that, `sms_1`, 60);
  561. that.timeDown();
  562. } else {
  563. uni.showToast({
  564. title: res.errmsg,
  565. icon: 'none'
  566. })
  567. }
  568. } else {
  569. uni.showToast({
  570. title: '请输入手机号!',
  571. icon: 'none'
  572. })
  573. }
  574. },
  575. // 弹框确定
  576. async diaSubmit(e) {
  577. const that = this;
  578. let user = this.user;
  579. let form = that.phoneForm;
  580. if (e.type == '1') {
  581. if (form.type == 0) {
  582. if (form && form.phone) that.updatePhone(form.phone, 'wx');
  583. } else if (form.type == 1) {
  584. const res = await that.$api(`/user/checkBindPhone`, 'POST', {
  585. id: user._id,
  586. code: form.code,
  587. phone: form.phone
  588. });
  589. if (res.errcode == '0') {
  590. that.updatePhone(form.phone, 'wx');
  591. } else {
  592. uni.showToast({
  593. title: arr.errmsg,
  594. icon: 'none'
  595. })
  596. }
  597. } else {
  598. uni.showToast({
  599. title: res.errmsg,
  600. icon: 'none'
  601. })
  602. }
  603. }
  604. },
  605. // 弹框取消(关闭)
  606. diaReset(e) {
  607. const that = this;
  608. if (e.type == '1') {
  609. that.otherLogin('wx');
  610. }
  611. },
  612. async updatePhone(e, type) {
  613. const that = this;
  614. let user = that.user;
  615. let arr = await that.$api(`/user/${user._id}`, 'POST', {
  616. phone: e
  617. })
  618. if (arr.errcode == '0') {
  619. that.otherLogin(type);
  620. } else {
  621. uni.showToast({
  622. title: res.errmsg,
  623. icon: 'none'
  624. })
  625. }
  626. },
  627. // 倒计时
  628. timeDown() {
  629. const that = this;
  630. var times = setInterval(() => {
  631. that.sms_1--;
  632. if (that.sms_1 <= 0) {
  633. clearInterval(times);
  634. }
  635. }, 1000);
  636. },
  637. // 同意隐私协议
  638. changeAgree() {
  639. const that = this;
  640. let agree = true;
  641. if (that.agree) agree = false;
  642. that.$set(that, `agree`, agree);
  643. },
  644. // 查看隐私协议
  645. toAgree() {
  646. const that = this;
  647. uni.navigateTo({
  648. url: `/pages/other/agree`
  649. })
  650. },
  651. },
  652. }
  653. </script>
  654. <style lang="scss">
  655. .main {
  656. display: flex;
  657. flex-direction: column;
  658. width: 100vw;
  659. height: 100vh;
  660. .one {
  661. position: relative;
  662. flex-grow: 0.01;
  663. padding: 0 5vw;
  664. margin: 10vw 0;
  665. text {
  666. font-size: 30px;
  667. font-family: cursive;
  668. font-weight: bold;
  669. }
  670. }
  671. .two {
  672. position: relative;
  673. flex-grow: 0.3;
  674. padding: 0 5vw;
  675. .type {
  676. text-align: center;
  677. margin: 0 0 2vw 0;
  678. }
  679. .agree {
  680. text-align: center;
  681. font-size: 12px;
  682. margin: 0 0 2vw 0;
  683. }
  684. .btn {
  685. text-align: center;
  686. button {
  687. width: 80%;
  688. border-radius: 25px;
  689. font-size: 16px;
  690. color: #fff;
  691. background-color: green;
  692. }
  693. }
  694. }
  695. .thr {
  696. padding: 0 2vw;
  697. text-align: center;
  698. .thr_1 {
  699. font-size: 14px;
  700. margin: 0 0 2vw 0;
  701. color: #858585;
  702. }
  703. .thr_2 {
  704. display: flex;
  705. justify-content: center;
  706. .thr_2_1 {
  707. margin: 0 2vw;
  708. text {
  709. font-size: 40px;
  710. }
  711. }
  712. }
  713. }
  714. .wx {
  715. text-align: center;
  716. margin: 25vw 0 0 0;
  717. .wx_1 {
  718. margin: 0 0 5vw 0;
  719. text {
  720. font-size: 50px;
  721. }
  722. }
  723. .wx_2 {
  724. button {
  725. background: var(--f35BColor);
  726. color: var(--fffColor);
  727. font-size: var(--font16Size);
  728. }
  729. }
  730. .wx_3 {
  731. position: absolute;
  732. bottom: 10vw;
  733. width: 100vw;
  734. text-align: center;
  735. font-size: 12px;
  736. }
  737. }
  738. }
  739. .yzm {
  740. display: flex;
  741. flex-direction: row;
  742. justify-content: space-between;
  743. .l {
  744. flex-grow: 1;
  745. }
  746. .r {
  747. width: 18vw;
  748. button {
  749. width: 100%;
  750. line-height: 2.8;
  751. padding: 0 1vw;
  752. }
  753. }
  754. }
  755. .dialog {
  756. width: 100vw;
  757. }
  758. .dialog_1 {
  759. .uni-forms {
  760. display: flex;
  761. form {
  762. width: 100%;
  763. }
  764. }
  765. .uni-data-checklist {
  766. border: 1px solid #E5E5E5;
  767. padding: 1vw;
  768. border-radius: 5px;
  769. }
  770. .uni-forms-item {
  771. margin-bottom: 2vw !important;
  772. }
  773. }
  774. .uni-popup__wrapper {
  775. border-radius: 5px;
  776. }
  777. .popup {
  778. width: 86vw;
  779. padding: 2vw;
  780. .title {
  781. text-align: center;
  782. margin: 0 0 2vw 0;
  783. text {
  784. color: var(--ff0Color);
  785. font-size: var(--font16Size);
  786. }
  787. }
  788. .wx_1 {
  789. text-align: center;
  790. margin: 9vw 0;
  791. text {
  792. font-size: var(--font18Size);
  793. }
  794. }
  795. .wx_2 {
  796. text-align: center;
  797. button {
  798. margin: 0 2vw;
  799. font-size: var(--font16Size);
  800. padding: 0 10vw;
  801. color: var(--fffColor);
  802. background-color: var(--f35BColor);
  803. }
  804. button:nth-child(1) {
  805. background-color: var(--ff0Color);
  806. }
  807. }
  808. }
  809. </style>