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

182 lines
3.2 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="login">
  3. <view class="logo">
  4. <image :src="configList.config_app_logo" mode=""></image>
  5. <view class="text">
  6. {{ configList.config_app_name }}
  7. </view>
  8. </view>
  9. <button class="btn btn-login mt"
  10. @click="wxLogin">
  11. <view class="icon">
  12. <uv-icon name="weixin-fill" color="#ffffff" size="36rpx"></uv-icon>
  13. </view>
  14. <view class="">
  15. 授权登录
  16. </view>
  17. </button>
  18. <button class="btn btn-cancel" :plain="true" :hairline="false" @click="onCancel">
  19. 暂不登录
  20. </button>
  21. <view class="config mt">
  22. <view style="flex: 1;">
  23. <uv-checkbox-group
  24. v-model="checkboxValue"
  25. shape="circle"
  26. >
  27. <view class="content">
  28. <uv-checkbox
  29. size="28rpx"
  30. icon-size="28rpx"
  31. activeColor="#07C261"
  32. :name="1"
  33. ></uv-checkbox>
  34. 已同意
  35. <text @click="openModal">注册协议隐私协议</text>
  36. </view>
  37. </uv-checkbox-group>
  38. </view>
  39. <view class="flex">
  40. <uv-icon name="info-circle" color="#07C261" size="28rpx"></uv-icon>
  41. </view>
  42. </view>
  43. <agreementModal ref="modal" @confirm="onConfirmAggrement"></agreementModal>
  44. </view>
  45. </template>
  46. <script>
  47. import agreementModal from './agreementModal.vue'
  48. export default {
  49. name : 'Login',
  50. data() {
  51. return {
  52. checkboxValue : []
  53. }
  54. },
  55. components: {
  56. agreementModal
  57. },
  58. methods: {
  59. wxLogin(){
  60. if(!this.checkboxValue.length){
  61. return uni.showToast({
  62. title: '请先同意隐私协议',
  63. icon:'none'
  64. })
  65. }
  66. this.$store.commit('login')
  67. },
  68. openModal() {
  69. this.$refs.modal.open()
  70. },
  71. onConfirmAggrement(confirm) {
  72. if (confirm) {
  73. this.checkboxValue = [1]
  74. } else {
  75. this.checkboxValue = []
  76. }
  77. },
  78. onCancel() {
  79. console.log('--onCancel')
  80. uni.reLaunch({
  81. url: '/pages/index/index'
  82. })
  83. },
  84. }
  85. }
  86. </script>
  87. <style scoped lang="scss">
  88. .login{
  89. display: flex;
  90. justify-content: flex-start;
  91. align-items: center;
  92. height: 100vh;
  93. flex-direction: column;
  94. position: relative;
  95. background: $uni-fg-color;
  96. .logo{
  97. margin-top: 334rpx;
  98. width: 320rpx;
  99. image{
  100. height: 150rpx;
  101. width: 320rpx;
  102. }
  103. .text{
  104. margin-top: 90rpx;
  105. font-size: 38rpx;
  106. font-family: PingFang SC, PingFang SC-Bold;
  107. font-weight: 700;
  108. text-align: center;
  109. color: #000000;
  110. }
  111. }
  112. .btn{
  113. width: 80%;
  114. height: 100rpx;
  115. font-size: 15px;
  116. font-family: PingFang SC, PingFang SC-Regular;
  117. font-weight: 400;
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. border-radius: 50rpx;
  122. &-login {
  123. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  124. color: #fff;
  125. border: none;
  126. .icon{
  127. margin-right: 10rpx;
  128. image{
  129. width: 40rpx;
  130. height: 35rpx;
  131. }
  132. }
  133. }
  134. &-cancel {
  135. height: calc(100rpx - 1rpx * 2);
  136. color: #c7c7c7;
  137. background-color: transparent;
  138. border: 1rpx solid #c7c7c7;
  139. margin-top: 60rpx;
  140. }
  141. }
  142. .mt{
  143. margin-top: 200rpx;
  144. }
  145. .config{
  146. width: 80%;
  147. line-height: 40rpx;
  148. // margin-top: 27rpx;
  149. color: #C7C7C7;
  150. text-align: left;
  151. display: flex;
  152. .content {
  153. font-size: 22rpx;
  154. display: flex;
  155. align-items: center;
  156. }
  157. text{
  158. color: #07C261;
  159. }
  160. }
  161. }
  162. .flex {
  163. display: flex;
  164. align-items: center;
  165. }
  166. </style>