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

173 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
  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="#E3441A"
  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. height: 80vh;
  95. flex-direction: column;
  96. position: relative;
  97. .logo{
  98. height: 140rpx;
  99. width: 140rpx;
  100. image{
  101. height: 140rpx;
  102. width: 140rpx;
  103. border-radius: 30rpx;
  104. }
  105. margin-bottom: 20rpx;
  106. }
  107. .title{
  108. position: relative;
  109. font-weight: 900;
  110. font-size: 45rpx;
  111. &::after{
  112. content: '';
  113. position: absolute;
  114. left: 0;
  115. top: 100%;
  116. display: block;
  117. height: 8rpx;
  118. width: 210rpx;
  119. background: linear-gradient(to right,$uni-color, #fff);
  120. }
  121. }
  122. .btn{
  123. all: unset;
  124. width: 80%;
  125. height: 100rpx;
  126. background-color: $uni-color;
  127. color: #fff;
  128. display: flex;
  129. justify-content: center;
  130. align-items: center;
  131. margin: 20rpx 0;
  132. border-radius: 20rpx;
  133. border: none;
  134. &::after{
  135. }
  136. .icon{
  137. margin-right: 10rpx;
  138. image{
  139. width: 40rpx;
  140. height: 35rpx;
  141. }
  142. }
  143. }
  144. .b2{
  145. background-color: rgba($uni-color, 0.2);
  146. color: $uni-color;
  147. }
  148. .mt{
  149. margin-top: 200rpx;
  150. }
  151. .config{
  152. position: absolute;
  153. bottom: 0;
  154. font-size: 24rpx;
  155. text-align: center;
  156. line-height: 40rpx;
  157. text{
  158. color: $uni-color;
  159. }
  160. }
  161. }
  162. </style>