login.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="login_page">
  3. <view class="login_cont">
  4. <view class="login_wrap">
  5. <!-- 1. 账号密码登录 accountLogin -->
  6. <account-login
  7. v-if="loginType === 'accountLogin'"
  8. :agreeStatus="state.protocol"
  9. @onConfirm="onConfirm"
  10. />
  11. <!-- 2. 短信登录 smsLogin -->
  12. <sms-login
  13. v-if="loginType === 'smsLogin'"
  14. :agreeStatus="state.protocol"
  15. @onConfirm="onConfirm"
  16. />
  17. <!-- 3. 账号注册 accountReg -->
  18. <account-reg
  19. v-if="loginType === 'accountReg'"
  20. :agreeStatus="state.protocol"
  21. @onConfirm="onConfirm"
  22. />
  23. <view class="login_tips">
  24. <view v-if="loginType === 'accountReg'" class="login" @tap="showLoginPage('accountLogin')">已有帐号,去登录</view>
  25. <view v-if="loginType === 'accountLogin'||loginType === 'smsLogin'" class="reg" @tap="showLoginPage('accountReg')">注册新账号</view>
  26. </view>
  27. </view>
  28. <!-- 同意选项 -->
  29. <!-- <view class="agreement-option ss-m-b-20">
  30. <label class="radio ss-flex ss-col-center" @tap="onAgree">
  31. <view class="check_box" @tap.stop="onAgree">
  32. <image v-if="state.protocol" class="check_icon" src="/static/check_icon.png"></image>
  33. <image v-else class="check_icon" src="/static/check_icon1.png"></image>
  34. </view>
  35. <view class="agreement-text ss-flex ss-col-center ss-m-l-8">
  36. 我已阅读并同意遵守
  37. <view class="tcp-text" @tap.stop="onProtocol('用户协议')"> 《用户协议》 </view>
  38. <view class="agreement-text">与</view>
  39. <view class="tcp-text" @tap.stop="onProtocol('隐私协议')"> 《隐私协议》 </view>
  40. </view>
  41. </label>
  42. </view> -->
  43. </view>
  44. </view>
  45. </template>
  46. <script setup>
  47. import sheep from '@/common'
  48. import { computed, reactive } from 'vue'
  49. import { onLoad } from '@dcloudio/uni-app'
  50. import accountLogin from '../../common/components/s-auth-modal/components/account-login.vue'
  51. import smsLogin from '../../common/components/s-auth-modal/components/sms-login.vue'
  52. import accountReg from '../../common/components/s-auth-modal/components/account-reg.vue'
  53. import { closeLoginPage, showLoginPage } from '@/common/hooks/useModal';
  54. const modalStore = sheep.$store('modal');
  55. // 授权弹窗类型
  56. const loginType = computed(() => modalStore.loginType);
  57. const state = reactive({
  58. navigationBar: {},
  59. page: {
  60. backgroundColor: '#FAFAFA',
  61. backgroundImage: '/static/homeTopBg.png'
  62. },
  63. protocol: true, // false表示未选择,true表示同意
  64. })
  65. onLoad(async (options) => {
  66. })
  67. // 同意协议
  68. function onAgree(e) {
  69. state.protocol = !state.protocol;
  70. }
  71. // 查看协议
  72. function onProtocol(title) {
  73. sheep.$router.go('/pages/public/richtext', {
  74. title,
  75. });
  76. }
  77. // 点击登录 / 注册事件
  78. function onConfirm(e) {
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .login_page{
  83. background: url(/static/homeTopBg.png) center top -44px / 100% no-repeat #fafafa;
  84. height: 100vh;
  85. width: 750rpx;
  86. margin: 0 auto;
  87. .login_cont{
  88. padding: 228rpx 30rpx 108rpx;
  89. display: flex;
  90. flex-direction: column;
  91. justify-content: space-between;
  92. box-sizing: border-box;
  93. }
  94. }
  95. .login_wrap{
  96. .login_tips{
  97. display: flex;
  98. justify-content: center;
  99. .reg,
  100. .login{
  101. margin-top: 40rpx;
  102. font-weight: 400;
  103. font-size: 28rpx;
  104. color: #222222;
  105. line-height: 40rpx;
  106. }
  107. .login{
  108. color: rgba(34, 34, 34, 0.5);
  109. }
  110. }
  111. }
  112. .agreement-option {
  113. width: 100%;
  114. display: flex;
  115. justify-content: center;
  116. margin-top: 120rpx;
  117. .check_box{
  118. padding-right: 10rpx;
  119. .check_icon{
  120. width: 24rpx;
  121. height: 24rpx;
  122. }
  123. }
  124. .agreement-text {
  125. font-weight: 400;
  126. font-size: 24rpx;
  127. color: #222222;
  128. .tcp-text {
  129. color: #24D688;
  130. }
  131. }
  132. }
  133. </style>