halfScreen.vue 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view>
  3. <uni-popup ref="loginPop" type="bottom" border-radius="10px 10px 0 0" background-color="#ffffff" :mask-click="false">
  4. <view class="login-popup">
  5. <view class="login-title">
  6. <view class="login-logo">
  7. <view class="logo"><image src="/static/rank/avatar.jpeg" mode="widthFix"></image></view>
  8. <view class="name">蓝微Star</view>
  9. </view>
  10. <view class="login-close" @click="closeLogin"><text class="cuIcon-close"></text></view>
  11. </view>
  12. <view class="login-desc">为了更好的为您提供服务,本次操作需要您关联手机号码</view>
  13. <view class="login-footer">
  14. <view :class="checkTrueState?'checkBox active':'checkBox'" @click="checkTrue">
  15. <text class="cuIcon-check"></text>
  16. </view>
  17. <view @click="checkTrue">我已阅读并同意</view>
  18. <text @click="toWeb('privacy')">用户协议、</text><text @click="toWeb('privacy')">隐私协议</text>
  19. </view>
  20. <view class="logi-btn">
  21. <button class="u-button full" open-type="getPhoneNumber" @getphonenumber="getPhoneNumberData" v-if="checkTrueState">快捷一键登录</button>
  22. <button class="u-button full" @click="toLoginCheck" v-else>快捷登录</button>
  23. <button class="u-button" @click="closeLogin">暂不登录</button>
  24. </view>
  25. </view>
  26. </uni-popup>
  27. </view>
  28. </template>
  29. <script>
  30. import * as Api from "@/api/auth.js";
  31. export default {
  32. data() {
  33. return {
  34. checkTrueState:true
  35. }
  36. },
  37. methods: {
  38. closeLogin(){
  39. uni.showTabBar()
  40. this.$refs.loginPop.close()
  41. },
  42. checkTrue(){
  43. this.checkTrueState = !this.checkTrueState;
  44. },
  45. toWeb(type){
  46. },
  47. toLoginCheck(){
  48. if (!this.checkTrueState) {
  49. uni.showToast({
  50. title: "请先阅读同意用户协议",
  51. icon:"none"
  52. })
  53. return ;
  54. }
  55. },
  56. getPhoneNumberData(event){
  57. uni.login({
  58. success(resp) {
  59. var detail = event.detail
  60. var resp = Api.login({"login":resp.code,"code":detail.code}).then((res)=>{
  61. })
  62. }
  63. })
  64. },
  65. open() {
  66. uni.hideTabBar();
  67. this.$nextTick(()=>{
  68. this.$refs.loginPop.open()
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style>
  75. .login-popup{padding: 20rpx;min-height: 30vh;}
  76. .login-popup .login-title{display: flex;align-items: center;justify-content: space-between;}
  77. .login-popup .login-title .login-logo{display: flex;align-items: center;gap: 15rpx;}
  78. .login-popup .login-title .login-logo image{width: 50rpx;height: 50rpx;border-radius: 100%;}
  79. .login-popup .login-title .name{font-weight: bold;font-family: "bluevBold";color: #000;font-size: 28rpx;}
  80. .login-desc{line-height: 2;color: #666;font-size: 24rpx;margin: 20rpx 0;text-align: center;}
  81. .login-footer{font-size: 28rpx;color: #666;height: 20%;display: flex;align-items: center;justify-content: center;}
  82. .login-footer text{color: #85DFFE;}
  83. .checkBox{width: 36upx;height: 36upx;margin-right: 20upx;border: 2upx solid #85DFFE;position: relative;border-radius: 36upx;display: flex;align-items: center;justify-content: center;}
  84. .checkBox text{display: block;color: #fff;}
  85. .checkBox.active{background-color: #85DFFE;}
  86. .checkBox.active text{color: #fff;}
  87. .logi-btn{width: 60%;margin: 20upx auto;height: 40%;}
  88. .logi-btn .u-button{font-size: 28upx;height: 80upx;border-radius: 40upx;line-height: 80upx;margin-top: 40upx;color: #333;border: 2upx solid rgba(33, 34, 38, 1);background-color: #fff;}
  89. .logi-btn .u-button::after{border: 0;}
  90. .logi-btn .u-button.full{background-color: rgba(33, 34, 38, 1);color: #fff;}
  91. </style>