敢为人鲜小程序前端代码仓库
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.

191 lines
3.5 KiB

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