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

206 lines
4.2 KiB

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