小说小程序前端代码仓库(小程序)
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.

174 lines
3.0 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months 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. @click="qux">
  20. 取消登录
  21. </view>
  22. <view class="config">
  23. <uv-checkbox-group
  24. v-model="checkboxValue"
  25. shape="circle">
  26. <view class="content">
  27. <view
  28. style="display: flex;">
  29. <uv-checkbox
  30. size="40rpx"
  31. icon-size="30rpx"
  32. activeColor="#0A2463"
  33. :name="1"
  34. ></uv-checkbox>
  35. 阅读并同意我们的<text @click="$refs.popup.open('user_xy')">用户协议</text>
  36. </view>
  37. <view class="">
  38. 以及<text @click="$refs.popup.open('user_ys')">隐私政策</text>
  39. </view>
  40. </view>
  41. </uv-checkbox-group>
  42. </view>
  43. <configPopup ref="popup"></configPopup>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. name : 'Login',
  49. data() {
  50. return {
  51. checkboxValue : [],
  52. config : {},
  53. }
  54. },
  55. onLoad(query) {
  56. if (query.shareId) {
  57. uni.setStorageSync('shareId', query.shareId)
  58. }
  59. if(query.path){
  60. this.config = query
  61. }
  62. },
  63. methods: {
  64. getPhoneNumber(e){
  65. console.log(e, e.detail.code);
  66. this.wxLogin(phoneCode)
  67. },
  68. wxLogin(phoneCode){
  69. if(!this.checkboxValue.length){
  70. return uni.showToast({
  71. title: '请先同意隐私协议',
  72. icon:'none'
  73. })
  74. }
  75. this.$store.commit('login', this.config)
  76. },
  77. //打开应用配置
  78. openConfigDetail(key){
  79. this.$refs.popup.open(key)
  80. },
  81. qux(){
  82. uni.reLaunch({
  83. url: '/pages/index/index'
  84. })
  85. },
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .login{
  91. display: flex;
  92. justify-content: center;
  93. align-items: center;
  94. flex-direction: column;
  95. position: relative;
  96. background-color: #e5eaf9;
  97. min-height: 100vh;
  98. .logo{
  99. margin-top: 120rpx;
  100. height: 140rpx;
  101. width: 140rpx;
  102. image{
  103. height: 140rpx;
  104. width: 140rpx;
  105. border-radius: 30rpx;
  106. }
  107. margin-bottom: 20rpx;
  108. }
  109. .title{
  110. position: relative;
  111. font-weight: 900;
  112. font-size: 45rpx;
  113. &::after{
  114. content: '';
  115. position: absolute;
  116. left: 0;
  117. top: 100%;
  118. display: block;
  119. height: 8rpx;
  120. width: 210rpx;
  121. background: linear-gradient(to right,$uni-color, #fff);
  122. }
  123. }
  124. .btn{
  125. all: unset;
  126. width: 80%;
  127. height: 100rpx;
  128. background-color: $uni-color;
  129. color: #fff;
  130. display: flex;
  131. justify-content: center;
  132. align-items: center;
  133. margin: 20rpx 0;
  134. border-radius: 60rpx;
  135. border: none;
  136. &::after{
  137. }
  138. .icon{
  139. margin-right: 10rpx;
  140. image{
  141. width: 40rpx;
  142. height: 35rpx;
  143. }
  144. }
  145. }
  146. .b2{
  147. background-color: rgba($uni-color, 0.2);
  148. color: $uni-color;
  149. }
  150. .mt{
  151. margin-top: 200rpx;
  152. }
  153. .config{
  154. margin-top: 30rpx;
  155. font-size: 24rpx;
  156. text-align: center;
  157. line-height: 40rpx;
  158. text{
  159. color: $uni-color;
  160. }
  161. }
  162. }
  163. </style>