login_two.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="login_two">
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="top">
  5. <view class="left" @click="phoneLogin" :class="current==0?info1:info2">
  6. <text>手机号登录</text>
  7. <view :class="current==0?yun:info2"></view>
  8. </view>
  9. <view class="right" @click="accountLogin" :class="current==1?info1:info2">
  10. <text>账号密码登录</text>
  11. <view :class="current==1?yun:info2"></view>
  12. </view>
  13. </view>
  14. <swiper class="scroll-view-height" @change="swipeIndex" :current="current" :duration="300">
  15. <swiper-item>
  16. <view class="inputBox">
  17. <input type="text" class="inp" placeholder="手机号">
  18. <input type="text" class="inp" placeholder="请输入验证码">
  19. <button class="yzm">获取验证码</button>
  20. </view>
  21. <view class="inpTip">
  22. 验证码已发送到您的手机
  23. <text>17739460336</text>
  24. </view>
  25. <view class="mid">
  26. <!-- <view class="quan"></view> -->
  27. <radio value="r1" @click="radioCheck" :checked="isOK" />
  28. <view class="">
  29. 我已阅读并同意<text>《教育小程序服务条款》</text>和 <text>《 隐私协议》</text>新用户自动注册
  30. </view>
  31. </view>
  32. <button class="btn">登录</button>
  33. </swiper-item>
  34. <swiper-item>
  35. <view class="inputBox">
  36. <input type="text" class="inp inp2" placeholder="用户名/绑定手机/绑定邮箱">
  37. <input type="text" class="inp" placeholder="登录密码">
  38. <button class="yzm">获取验证码</button>
  39. </view>
  40. <text @click="goto" style="font-size: 14px;float: right;padding: 20rpx;padding-right: 30rpx;">忘记密码</text>
  41. <view class="mid">
  42. <!-- <view class="quan"></view> -->
  43. <radio value="r1" @click="radioCheck" :checked="isOK" />
  44. <view class="">
  45. 我已阅读并同意<text>《教育小程序服务条款》</text>和 <text>《 隐私协议》</text>新用户自动注册
  46. </view>
  47. </view>
  48. <button class="btn">登录</button>
  49. </swiper-item>
  50. </swiper>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. current:0,//登录方式切换
  58. info1:'info1', //类名
  59. info2:'info2',
  60. yun:'yun',
  61. isOK:false, //用户协议是否勾选
  62. navBarData:{
  63. title:'手机号登录',
  64. btn:1 //判断是否显示返回按钮
  65. },
  66. }
  67. },
  68. methods: {
  69. // 登录方式切换
  70. swipeIndex(index){
  71. this.current=index.detail.current;
  72. console.log(this.current);
  73. if (index.detail.current==0) {
  74. this.navBarData.title="手机号登录"
  75. }else{
  76. this.navBarData.title='账号密码登录'
  77. }
  78. },
  79. phoneLogin(){
  80. this.current=0
  81. },
  82. accountLogin(){
  83. this.current=1
  84. },
  85. // 是否同意条约
  86. radioCheck(){
  87. this.isOK=!this.isOK
  88. },
  89. // 忘记密码
  90. goto(){
  91. uni.navigateTo({
  92. url:"/pages/login_three/login_three"
  93. })
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. .login_two{
  100. background-color: #ffffff;
  101. height: 100vh;
  102. .top{
  103. width: 500rpx;
  104. display: flex;
  105. justify-content: space-between;
  106. margin: auto;
  107. margin-top: 80px;
  108. margin-bottom: 40px;
  109. .info1{
  110. font-weight: bold;
  111. position: relative;
  112. .yun{
  113. width: 80rpx;
  114. height: 0rpx;
  115. position: absolute;
  116. left: 50%;
  117. transform: translate(-50%,-50%);
  118. box-shadow: 0px 0px 10px 2px #4a97f2;
  119. }
  120. }
  121. .info2{
  122. color: #666666;
  123. }
  124. }
  125. .inputBox{
  126. padding: 0 30rpx;
  127. position: relative;
  128. .yzm{
  129. position: absolute;
  130. bottom: 10rpx;
  131. right: 20rpx;
  132. font-size: 12px;
  133. background-color: #7eb5f6;
  134. color: #fff;
  135. }
  136. .inp{
  137. padding: 10rpx 15rpx;
  138. // margin-top: 50rpx;
  139. border-bottom: 1px #ccc solid;
  140. }
  141. .inp:nth-child(1){
  142. margin-bottom: 50rpx;
  143. }
  144. }
  145. .inpTip{
  146. font-size: 14px;
  147. width: 750rpx;
  148. padding: 0 15rpx;
  149. color: #666666;
  150. margin: 10px;
  151. margin-bottom: 30px;
  152. text{
  153. color: #73aff4;
  154. }
  155. }
  156. .scroll-view-height{
  157. height: 60vh;
  158. }
  159. .mid{
  160. display: flex;
  161. justify-content: flex-start;
  162. width: 750rpx;
  163. padding: 0rpx 20rpx;
  164. font-size: 13px;
  165. margin-top: 10px;
  166. /deep/ .uni-radio-input{
  167. width: 15px;
  168. height: 15px;
  169. }
  170. text{
  171. color: #4a97f2;
  172. }
  173. }
  174. .btn{
  175. background-color: #0056a8;
  176. color: #ffffff;
  177. border-radius: 30px;
  178. margin: 30rpx 55rpx;
  179. // padding: 0rpx 10rpx;
  180. font-size: 16px;
  181. }
  182. }
  183. </style>