Login.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view :style="{ paddingTop: `${systemInfo.statusBarHeight}px` }">
  3. <view class="login">
  4. <view class="text1" @click="codeFn">{{ flag ? '账号密码登陆' : '验证码登录' }}</view>
  5. <view class="title">{{ flag ? '验证码登录' : '账号密码登陆' }}</view>
  6. <view class="content">
  7. <image src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-09-23-15-00-09YCjgycbL.png" mode="widthFix"></image>
  8. <view class="border"><input class="inputNm" placeholder="请输入手机号" type="number" v-model="form.phone" /></view>
  9. </view>
  10. <view class="content content2" v-if="flag">
  11. <image src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-09-23-15-56-51fUQmIfWc.png" mode="widthFix"></image>
  12. <view class="border code">
  13. <input class="inputNm" placeholder="请输入验证码" type="number" v-model="form.code" />
  14. <view class="code2" @click="send">{{ time === 0 ? '发送验证码' : `重新发送${time}s` }}</view>
  15. </view>
  16. </view>
  17. <view class="content content2" v-if="!flag">
  18. <image src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-09-23-15-00-32OuHmKLtr.png" mode="widthFix"></image>
  19. <view class="border"><input class="inputNm" placeholder="请输入密码" type="number" v-model="form.password" /></view>
  20. </view>
  21. <view class="text1" v-if="!flag" @click="navigateTo('/pages/Register?forget=' + true)">忘记密码?</view>
  22. <u-button type="primary" @click="Jump">登录</u-button>
  23. <view class="btn" @click="navigateTo('/pages/Register')">暂无账号,立即注册</view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import { mapState } from 'vuex';
  29. export default {
  30. computed: {
  31. ...mapState(['systemInfo'])
  32. },
  33. data() {
  34. return {
  35. form: {},
  36. flag: false,
  37. time: 0
  38. };
  39. },
  40. methods: {
  41. codeFn() {
  42. this.flag = !this.flag;
  43. },
  44. Jump() {
  45. uni.switchTab({
  46. url: '/pages/Mine'
  47. });
  48. },
  49. send() {
  50. console.log(this.form);
  51. this.sendCode(this.form.phone);
  52. }
  53. }
  54. };
  55. </script>
  56. <style lang="scss" scoped>
  57. .login {
  58. /deep/ .uni-input-placeholder {
  59. font-size: 14px;
  60. font-weight: 400;
  61. color: #c8c9cc;
  62. line-height: 24px;
  63. }
  64. /deep/ .u-btn {
  65. height: 48px;
  66. font-size: 14px;
  67. margin: 30px 0 12px 0;
  68. }
  69. margin: 54px 45px 0;
  70. .text1 {
  71. font-size: 18px;
  72. font-weight: 400;
  73. color: #c8c9cc;
  74. line-height: 25px;
  75. text-align: right;
  76. }
  77. .title {
  78. font-size: 24px;
  79. font-weight: bold;
  80. color: #000000;
  81. line-height: 33px;
  82. margin: 10px 0 28px 0;
  83. }
  84. .content {
  85. display: flex;
  86. align-items: center;
  87. justify-content: space-between;
  88. .border {
  89. border-bottom: 1px solid #f2f3f5;
  90. width: 100%;
  91. margin-left: 10px;
  92. &.code {
  93. display: flex;
  94. align-items: center;
  95. justify-content: space-between;
  96. }
  97. .inputNm {
  98. height: 44px;
  99. }
  100. .code2 {
  101. font-size: 13px;
  102. font-weight: 400;
  103. color: #214bbe;
  104. line-height: 18px;
  105. }
  106. }
  107. &.content2 {
  108. margin: 20px 0 6px;
  109. }
  110. image {
  111. width: 24px;
  112. height: 24px;
  113. }
  114. }
  115. .btn {
  116. height: 48px;
  117. background: #ffffff;
  118. border-radius: 4px;
  119. border: 1px solid #214bbe;
  120. font-size: 14px;
  121. font-weight: bold;
  122. color: #214bbe;
  123. line-height: 48px;
  124. text-align: center;
  125. }
  126. }
  127. </style>