裂变星小程序-25.03.04
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.

171 lines
3.1 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="page">
  3. <navbar title="登录" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="flex flex-column" style="justify-content: flex-start;">
  5. <!-- todo: 换回接口提供的 -->
  6. <image class="logo" src="../static/auth/logo.png" mode=""></image>
  7. <view class="title">
  8. <!-- todo: 换回接口提供的 -->
  9. 裂变星小程序
  10. </view>
  11. <view class="operation">
  12. <button
  13. :plain="true" :hairline="false"
  14. class="btn"
  15. open-type="getPhoneNumber"
  16. @getphonenumber="getPhoneNumber"
  17. >
  18. 授权手机号登录
  19. </button>
  20. <view class="agreement">
  21. <uv-checkbox-group
  22. v-model="checkboxValue"
  23. shape="circle">
  24. <view>
  25. <uv-checkbox
  26. size="32rpx"
  27. icon-size="32rpx"
  28. activeColor="#07C160"
  29. :name="1"
  30. :customStyle="{
  31. display: 'inline-block',
  32. marginRight: '20rpx',
  33. }"
  34. ></uv-checkbox>
  35. <text style="vertical-align: super;">
  36. 我已阅读<text class="highlight" @click="openModal">XXX小程序用户注册协议XXX小程序隐私保护协议</text>
  37. </text>
  38. </view>
  39. </uv-checkbox-group>
  40. </view>
  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. components: {
  51. agreementModal
  52. },
  53. data() {
  54. return {
  55. checkboxValue : []
  56. }
  57. },
  58. methods: {
  59. getPhoneNumber(e){
  60. console.log(e, e.detail.code);
  61. // check
  62. // this.$api('bindPhone', {
  63. // phoneCode : e.detail.code
  64. // }, res => {
  65. // if(res.code == 200){
  66. // let phoneObj = JSON.parse(res.result)
  67. // if(phoneObj.errmsg == 'ok'){
  68. // this.userInfoForm.phone = phoneObj.phone_info.phoneNumber
  69. // }else{
  70. // uni.showModal({
  71. // title: phoneObj.errmsg
  72. // })
  73. // }
  74. // console.log(phoneObj);
  75. // }
  76. // })
  77. this.wxLogin(phoneCode)
  78. },
  79. wxLogin(){
  80. if(!this.checkboxValue.length){
  81. return uni.showToast({
  82. title: '请先同意隐私协议',
  83. icon:'none'
  84. })
  85. }
  86. this.$store.commit('login')
  87. },
  88. openModal() {
  89. this.$refs.modal.open()
  90. },
  91. onConfirmAggrement(confirm) {
  92. if (confirm) {
  93. this.checkboxValue = [1]
  94. } else {
  95. this.checkboxValue = []
  96. }
  97. },
  98. }
  99. }
  100. </script>
  101. <style scoped lang="scss">
  102. .page {
  103. background-color: $uni-fg-color;
  104. position: relative;
  105. width: 100vw;
  106. height: 100vh;
  107. }
  108. .logo {
  109. width: 148rpx;
  110. height: 148rpx;
  111. margin-top: 96rpx;
  112. }
  113. .title {
  114. color: #333333;
  115. font-size: 32rpx;
  116. font-weight: 900;
  117. margin-top: 20rpx;
  118. }
  119. .operation {
  120. position: absolute;
  121. bottom: 452rpx;
  122. left: 0;
  123. width: 100vw;
  124. padding: 0 60rpx;
  125. box-sizing: border-box;
  126. }
  127. .btn {
  128. width: 100%;
  129. height: auto;
  130. border-radius: 45rpx;
  131. background-color: #07C160;
  132. color: #FFFFFF;
  133. border: none;
  134. padding: 25rpx 0;
  135. box-sizing: border-box;
  136. font-size: 28rpx;
  137. line-height: 1;
  138. margin: 0;
  139. }
  140. .agreement {
  141. margin-top: 41rpx;
  142. color: #474747;
  143. font-size: 24rpx;
  144. line-height: 32rpx;
  145. .highlight {
  146. color: #05D9A2;
  147. }
  148. }
  149. </style>