login.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="wrap">
  3. <view class="login">
  4. <view class="login-title">
  5. <h3>手机号登录/注册</h3>
  6. <p>欢迎来到荆易充</p>
  7. </view>
  8. <view class="login-form">
  9. <view class="login-form-item">
  10. <view class="title">手机号</view>
  11. <view class="input">
  12. <u-input v-model="tel" type="number" placeholder="请输入手机号" placeholder-style="font-size:16px;color:#ccc;"/>
  13. </view>
  14. <view class="tips">未注册的手机号验证后将自动注册</view>
  15. </view>
  16. <view class="login-form-item">
  17. <view class="title">验证码</view>
  18. <view class="input">
  19. <view class="code">获取验证码</view>
  20. <u-input v-model="tel" type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
  21. </view>
  22. <u-checkbox-group>
  23. <u-checkbox class="tips" v-model="value" shape="circle" @change="checkboxChange()">
  24. <view v-if="!value">我已阅读并同意<span>《会员协议》</span>和<span>《隐私协议》</span></view>
  25. <view v-else>我已阅读并同意<span style="color: #000000;">《会员协议》</span>和<span style="color: #000000;">《隐私协议》</span></view>
  26. </u-checkbox>
  27. </u-checkbox-group>
  28. </view>
  29. </view>
  30. <u-button :style="[inputStyle]" class="login-btn" type="success" shape="circle">登录</u-button>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. tel: '',
  39. value: false,
  40. }
  41. },
  42. computed: {
  43. inputStyle() {
  44. let style = {};
  45. if(this.tel) {
  46. style.color = "#fff";
  47. style.backgroundColor = this.$u.color['success'];
  48. }
  49. return style;
  50. }
  51. },
  52. methods: {
  53. checkboxChange() {
  54. this.value = !this.value;
  55. },
  56. }
  57. };
  58. </script>
  59. <style>
  60. page{
  61. background-color: #fff;
  62. }
  63. </style>
  64. <style lang="scss" scoped>
  65. .wrap {
  66. font-size: 28rpx;
  67. .login {
  68. width: 600rpx;
  69. padding-top: 80rpx;
  70. margin: 0 auto;
  71. .login-title {
  72. text-align: left;
  73. h3{
  74. font-size: 48rpx;
  75. font-weight: normal;
  76. }
  77. p{
  78. margin-top: 4px;
  79. color:#777
  80. }
  81. }
  82. .login-form-item{
  83. margin-top: 40px;
  84. .title{
  85. margin-bottom: 8px;
  86. }
  87. .input {
  88. border-bottom: 1px solid #f7f7f7;
  89. position: relative;
  90. }
  91. .code{
  92. position: absolute;
  93. right: 0;
  94. top:7px;
  95. color:#1677FF;
  96. }
  97. .tips {
  98. color: $u-type-info;
  99. margin-top: 12px;
  100. font-size: 12px;
  101. span{
  102. color:#3fbd70;
  103. }
  104. }
  105. }
  106. .login-btn {
  107. margin-top: 40px;
  108. background-color: #a7dbc2;
  109. }
  110. .alternative {
  111. color: $u-tips-color;
  112. display: flex;
  113. justify-content: space-between;
  114. margin-top: 30rpx;
  115. }
  116. }
  117. }
  118. </style>