index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="page-box login-box">
  3. <view class="login-form sys-radius-50">
  4. <view class="from-title">
  5. <view class="title-list">
  6. <view class="title-text sys-size-28 text-center sys-weight-600" :class="{'default-text':type===1}" @click="setType(1)">验证码登录</view>
  7. <view class="title-text sys-size-28 text-center sys-weight-600" :class="{'default-text':type===2}" @click="setType(2)">密码登录</view>
  8. </view>
  9. <view class="title-bg one-background-color" :class="{'title-bg-two':type===2}">
  10. <view class="bg-icon dominant-background-color "></view>
  11. </view>
  12. </view>
  13. <view class="from-box one-background-color">
  14. <view class="from-animation" v-if="type===1">
  15. <view class="input-item sys-from-background-color sys-radius-30 ">
  16. <input type="number" class="login-input" placeholder="请输入手机号" maxlength="11"></input>
  17. </view>
  18. <view class="input-item sys-from-background-color sys-radius-30">
  19. <input type="number" class="login-input" placeholder="请输入验证码"></input>
  20. </view>
  21. </view>
  22. <view class="from-animation" v-else>
  23. <view class="input-item sys-from-background-color sys-radius-30 ">
  24. <input type="number" class="login-input" placeholder="请输入手机号" maxlength="11"></input>
  25. </view>
  26. <view class="input-item sys-from-background-color sys-radius-30">
  27. <input type="password" class="login-input" placeholder="请输入密码"></input>
  28. </view>
  29. </view>
  30. <view class="input-agreement" @click="setIsConsent">
  31. <image class="agreement-agree" v-if="isConsent" src="/static/img/login/Checked2@3x.png" mode="aspectFill"></image>
  32. <image class="agreement-agree" v-else src="/static/img/login/Checked1@3x.png" mode="aspectFill"></image>
  33. <view class="agreement-text three-text-color sys-size-24">已阅读并同意</view>
  34. <view class="agreement-text dominant-text-color sys-size-24">《隐私政策》</view>
  35. </view>
  36. <view
  37. class="input-but dominant-background-color one-text-color sys-size-30 sys-radius-100 sys-weight-600"
  38. :class="{'sys-selected-but':isLogin,'sys-unselected-but':!isLogin}"
  39. >登陆</view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. components: {
  47. },
  48. data() {
  49. return {
  50. type:1,
  51. password:'',
  52. code:'',
  53. isConsent:false,
  54. isLogin:false
  55. }
  56. },
  57. mounted() {
  58. },
  59. methods: {
  60. setIsConsent(){
  61. this.isConsent=!this.isConsent
  62. },
  63. setType(type){
  64. if(type!==this.type){
  65. this.type=type
  66. }
  67. },
  68. login() {
  69. uni.redirectTo({
  70. url: '/pages/index/index'
  71. })
  72. },
  73. },
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. @import "/static/css/login.css";
  78. .page-box{
  79. padding-top: 370rpx;
  80. .login-form{
  81. margin: 0 30rpx;
  82. height: 630rpx;
  83. border-radius: 50rpx;
  84. .from-title{
  85. background-color: rgba(255,255,255,0.5);
  86. border-radius: 50rpx 50rpx 0 0;
  87. height: 110rpx;
  88. position: relative;
  89. .title-bg{
  90. position: absolute;
  91. border-radius: 50rpx 50rpx 0 0;
  92. top: 0;
  93. left: 0;
  94. height:110rpx;
  95. width: 50%;
  96. transition: .5s ease;
  97. z-index: 0;
  98. .bg-icon{
  99. margin: 86rpx auto 0 auto;
  100. width: 36rpx;
  101. height: 6rpx;
  102. border-radius: 99rpx;
  103. }
  104. }
  105. .title-bg-two{
  106. left: 50%;
  107. transition: .5s ease;
  108. }
  109. //.title-bg::after {
  110. // content: '';
  111. // position: absolute;
  112. // right: -50rpx;
  113. // bottom: 0;
  114. // width: 50rpx;
  115. // height:50rpx;
  116. // background-color: #fff;
  117. // border-radius: 50rpx 50rpx 50rpx 0;
  118. //}
  119. .title-list{
  120. display: flex;
  121. justify-content: space-between;
  122. z-index: 1;
  123. position: relative;
  124. .title-text{
  125. width: 50%;
  126. height: 102rpx;
  127. line-height: 102rpx;
  128. color: #333333;
  129. }
  130. .default-text{
  131. color: #10B261;
  132. }
  133. }
  134. }
  135. .from-box{
  136. height:520rpx;
  137. box-shadow: 0rpx 4rpx 36rpx 0rpx rgba(196,196,196,0.25);
  138. border-radius: 0 0 50rpx 50rpx;
  139. padding: 50rpx 45rpx;
  140. .input-item{
  141. height: 96rpx;
  142. padding: 28rpx 40rpx;
  143. }
  144. .input-item:last-child{
  145. margin-top: 30rpx;
  146. }
  147. .input-agreement{
  148. margin-top: 25rpx;
  149. display: flex;
  150. justify-content: flex-start;
  151. align-items: center;
  152. .agreement-agree{
  153. width: 32rpx;
  154. height: 32rpx;
  155. transition: .5s ease;
  156. }
  157. .agreement-text{
  158. margin-left: 18rpx;
  159. }
  160. }
  161. .input-but{
  162. margin-top: 40rpx;
  163. width: 100%;
  164. height: 96rpx;
  165. line-height: 96rpx;
  166. text-align: center;
  167. }
  168. }
  169. }
  170. }
  171. </style>