裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
3.0 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="page">
  3. <navbar title="登录" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="flex flex-column" style="justify-content: flex-start;">
  5. <image class="logo" :src="configList.logo_image" mode=""></image>
  6. <view class="title">
  7. {{ configList.logo_name }}
  8. </view>
  9. <view class="operation">
  10. <button
  11. :plain="true" :hairline="false"
  12. class="btn"
  13. @click="wxLogin"
  14. >
  15. 微信登录
  16. </button>
  17. <button class="btn btn-cancel" :plain="true" :hairline="false" @click="onCancel">
  18. 暂不登录
  19. </button>
  20. <view class="agreement">
  21. <uv-checkbox-group
  22. v-model="checkboxValue"
  23. shape="circle">
  24. <view>
  25. <uv-checkbox
  26. size="32rpx"
  27. icon-size="32rpx"
  28. activeColor="#07C160"
  29. :name="1"
  30. :customStyle="{
  31. display: 'inline-block',
  32. marginRight: '20rpx',
  33. }"
  34. ></uv-checkbox>
  35. <text style="vertical-align: super;">
  36. 我已阅读<text class="highlight" @click="openModal">裂变星小程序用户注册协议裂变星小程序隐私保护协议</text>
  37. </text>
  38. </view>
  39. </uv-checkbox-group>
  40. </view>
  41. </view>
  42. </view>
  43. <agreementModal ref="modal" @confirm="onConfirmAggrement"></agreementModal>
  44. </view>
  45. </template>
  46. <script>
  47. import { mapState } from 'vuex'
  48. import agreementModal from './agreementModal.vue'
  49. export default {
  50. name : 'Login',
  51. components: {
  52. agreementModal
  53. },
  54. data() {
  55. return {
  56. checkboxValue : []
  57. }
  58. },
  59. computed: {
  60. ...mapState(['configList'])
  61. },
  62. methods: {
  63. wxLogin(){
  64. if(!this.checkboxValue.length){
  65. return uni.showToast({
  66. title: '请先同意隐私协议',
  67. icon:'none'
  68. })
  69. }
  70. this.$store.commit('login')
  71. },
  72. openModal() {
  73. this.$refs.modal.open()
  74. },
  75. onConfirmAggrement(confirm) {
  76. if (confirm) {
  77. this.checkboxValue = [1]
  78. } else {
  79. this.checkboxValue = []
  80. }
  81. },
  82. onCancel() {
  83. uni.navigateBack({
  84. delta: 1,
  85. fail: () => {
  86. uni.reLaunch({
  87. url: '/pages/index/index'
  88. })
  89. }
  90. });
  91. },
  92. }
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. .page {
  97. background-color: $uni-fg-color;
  98. position: relative;
  99. width: 100vw;
  100. height: 100vh;
  101. }
  102. .logo {
  103. width: 148rpx;
  104. height: 148rpx;
  105. margin-top: 96rpx;
  106. }
  107. .title {
  108. color: #333333;
  109. font-size: 32rpx;
  110. font-weight: 900;
  111. margin-top: 20rpx;
  112. }
  113. .operation {
  114. position: absolute;
  115. bottom: 452rpx;
  116. left: 0;
  117. width: 100vw;
  118. padding: 0 60rpx;
  119. box-sizing: border-box;
  120. }
  121. .btn {
  122. width: 100%;
  123. height: auto;
  124. border-radius: 45rpx;
  125. background-color: #07C160;
  126. color: #FFFFFF;
  127. border: none;
  128. padding: 25rpx 0;
  129. box-sizing: border-box;
  130. font-size: 28rpx;
  131. line-height: 1;
  132. margin: 0;
  133. &-cancel {
  134. color: #c7c7c7;
  135. background-color: transparent;
  136. border: 1rpx solid #c7c7c7;
  137. margin-top: 60rpx;
  138. }
  139. }
  140. .agreement {
  141. margin-top: 41rpx;
  142. color: #474747;
  143. font-size: 24rpx;
  144. line-height: 32rpx;
  145. .highlight {
  146. color: #05D9A2;
  147. }
  148. }
  149. </style>