login.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="login">
  3. <statusBar :item='navBarData'></statusBar>
  4. <view class="img">
  5. <image src="http://43.139.158.220:5007/img/static/yym/image7.png" mode="aspectFill"></image>
  6. </view>
  7. <view class="mid">
  8. <!-- <radio value="r1" @click="radioCheck" size="10" :checked="isOK" /> -->
  9. <view class="" style="position: relative;padding-left:30rpx;">
  10. 我已阅读并同意<text>《教育小程序服务条款》</text>和 <text>《 隐私协议》</text>新用户自动注册
  11. <view class="quan" @click="isDui">
  12. <image v-if="isShow" class="dui" src="http://43.139.158.220:5007/img/static/yym/dui.png" mode="aspectFill"></image>
  13. </view>
  14. </view>
  15. </view>
  16. <button class="btn" @click="gotoIndex">一键登录</button>
  17. <!-- <button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">一键登录</button> -->
  18. <view class="footer" @click="goto">
  19. <text>手机号登录/账号密码登录</text>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. isOK: false,
  28. navBarData: {
  29. title: '首页',
  30. btn: 1 //判断是否显示返回按钮
  31. },
  32. isMsg:0,
  33. isShow:false
  34. };
  35. },
  36. methods: {
  37. getPhoneNumber (e) {
  38. console.log(e.detail.code) // 动态令牌
  39. console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
  40. console.log(e.detail.errno) // 错误码(失败时返回)
  41. },
  42. gotoIndex() {
  43. const value = uni.setStorageSync('login', '1');
  44. uni.switchTab({
  45. url: '/pages/index/index'
  46. })
  47. // if(this.isMsg==1){
  48. // uni.setStorageSync('msgLogin', '1');
  49. // uni.switchTab({
  50. // url: '/pages/message/message'
  51. // })
  52. // }else{
  53. // const value = uni.setStorageSync('login', '1');
  54. // uni.switchTab({
  55. // url: '/pages/index/index'
  56. // })
  57. // }
  58. },
  59. goto() {
  60. uni.navigateTo({
  61. url: "/pages/login_two/login_two"
  62. })
  63. },
  64. radioCheck() {
  65. this.isOK = !this.isOK
  66. },
  67. isDui(){
  68. this.isShow=!this.isShow
  69. }
  70. },
  71. onLoad(opt) {
  72. console.log(opt);
  73. this.isMsg=opt.id
  74. }
  75. }
  76. </script>
  77. <style lang="scss">
  78. .login {
  79. background-color: #ffffff;
  80. height: 100vh;
  81. .img {
  82. // padding: 10vh 0;
  83. padding-top: 10vh;
  84. margin-bottom: 10vh;
  85. width: 750rpx;
  86. display: flex;
  87. justify-content: center;
  88. image {
  89. width: 200rpx;
  90. height: 200rpx;
  91. border-radius: 50%;
  92. }
  93. }
  94. .mid {
  95. display: flex;
  96. justify-content: flex-start;
  97. width: 750rpx;
  98. padding: 0rpx 50rpx;
  99. font-size: 13px;
  100. .quan {
  101. position: absolute;
  102. flex-shrink: 0;
  103. top: 0;
  104. left: -10rpx;
  105. width: 32rpx;
  106. height: 32rpx;
  107. border-radius: 50%;
  108. margin-top: 5rpx;
  109. margin-right: 10rpx;
  110. border: 1px #bdbdbd solid;
  111. display: flex;
  112. justify-content: center;
  113. align-items: center;
  114. .dui {
  115. width: 32rpx;
  116. height: 32rpx;
  117. }
  118. }
  119. text {
  120. color: #4a97f2;
  121. }
  122. }
  123. .btn {
  124. background-color: #0056a8;
  125. color: #ffffff;
  126. border-radius: 30px;
  127. margin: 30rpx 55rpx;
  128. // padding: 0rpx 10rpx;
  129. font-size: 16px;
  130. }
  131. .footer {
  132. display: flex;
  133. justify-content: center;
  134. font-size: 14px;
  135. margin: auto;
  136. color: #666666;
  137. }
  138. }
  139. </style>