推广小程序前端代码
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.

151 lines
2.6 KiB

1 year ago
  1. <template>
  2. <view class="login">
  3. <view class="logo">
  4. <image :src="configList.logo_image" mode=""></image>
  5. </view>
  6. <view class="title">
  7. 欢迎使用{{ configList.logo_name }}
  8. </view>
  9. <view class="btn mt"
  10. @click="wxLogin">
  11. <view class="icon">
  12. <image src="../static/auth/wx.png" mode=""></image>
  13. </view>
  14. <view class="">
  15. 微信授权登录
  16. </view>
  17. </view>
  18. <!-- <view class="btn b2">
  19. 使用短信验证登录
  20. </view> -->
  21. <view class="config">
  22. <uv-checkbox-group
  23. v-model="checkboxValue"
  24. shape="circle">
  25. <view class="content">
  26. <view
  27. style="display: flex;">
  28. <uv-checkbox
  29. size="40rpx"
  30. icon-size="30rpx"
  31. activeColor="#A3D250"
  32. :name="1"
  33. ></uv-checkbox>
  34. 阅读并同意我们的<text @click="$refs.popup.open('user_xy')">用户协议</text>
  35. </view>
  36. <view class="">
  37. 以及<text @click="$refs.popup.open('user_ys')">隐私政策</text>
  38. </view>
  39. </view>
  40. </uv-checkbox-group>
  41. </view>
  42. <configPopup ref="popup"></configPopup>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. name : 'Login',
  48. data() {
  49. return {
  50. checkboxValue : []
  51. }
  52. },
  53. methods: {
  54. wxLogin(){
  55. if(!this.checkboxValue.length){
  56. return uni.showToast({
  57. title: '请先同意隐私协议',
  58. icon:'none'
  59. })
  60. }
  61. this.$store.commit('login')
  62. },
  63. //打开应用配置
  64. openConfigDetail(key){
  65. this.$refs.popup.open(key)
  66. }
  67. }
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .login{
  72. display: flex;
  73. justify-content: center;
  74. align-items: center;
  75. height: 80vh;
  76. flex-direction: column;
  77. position: relative;
  78. .logo{
  79. height: 140rpx;
  80. width: 140rpx;
  81. image{
  82. height: 140rpx;
  83. width: 140rpx;
  84. border-radius: 30rpx;
  85. }
  86. margin-bottom: 20rpx;
  87. }
  88. .title{
  89. position: relative;
  90. font-weight: 900;
  91. font-size: 45rpx;
  92. &::after{
  93. content: '';
  94. position: absolute;
  95. left: 0;
  96. top: 100%;
  97. display: block;
  98. height: 8rpx;
  99. width: 210rpx;
  100. background: linear-gradient(to right,$uni-color, #fff);
  101. }
  102. }
  103. .btn{
  104. width: 80%;
  105. height: 100rpx;
  106. background-color: $uni-color;
  107. color: #fff;
  108. display: flex;
  109. justify-content: center;
  110. align-items: center;
  111. margin: 20rpx 0;
  112. border-radius: 20rpx;
  113. .icon{
  114. margin-right: 10rpx;
  115. image{
  116. width: 40rpx;
  117. height: 35rpx;
  118. }
  119. }
  120. }
  121. .b2{
  122. background-color: rgba($uni-color, 0.2);
  123. color: $uni-color;
  124. }
  125. .mt{
  126. margin-top: 200rpx;
  127. }
  128. .config{
  129. position: absolute;
  130. bottom: 0;
  131. font-size: 24rpx;
  132. text-align: center;
  133. line-height: 40rpx;
  134. text{
  135. color: $uni-color;
  136. }
  137. }
  138. }
  139. </style>