login_two.vue 4.5 KB

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