index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="login-main">
  3. <view class="login-main-content">
  4. <image class="img" src="../../static/images/logo.png" mode=""></image>
  5. </view>
  6. <view class="login-contont">
  7. <view class="login-contont-info">
  8. <h5>请确认以下信息并授权登录</h5>
  9. <view class="text">获取您的信息(你的头像、信息等)</view>
  10. </view>
  11. <view class="login-contont-button">
  12. <button class="btn" @click="login">授权登录</button>
  13. </view>
  14. <view class="radio">
  15. <u-radio-group v-model="radiovalue">
  16. <u-radio value="1" size="30" name="1" iconSize="25">
  17. <text class="radioText"
  18. >授权同意《用户服务协议》 和《隐私协议》</text
  19. ></u-radio
  20. >
  21. </u-radio-group>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { requestConfig } from "@/app.config.js";
  28. export default {
  29. data() {
  30. return {
  31. radiovalue: 0,
  32. };
  33. },
  34. onLoad() {},
  35. methods: {
  36. login() {
  37. console.log(this.radiovalue);
  38. if(this.radiovalue==1){
  39. // ne.sxdirectpurchase.com
  40. let url = `https://open.weixin.qq.com/connect/oauth2/authorize?
  41. appid=${requestConfig.appid}
  42. &redirect_uri=${requestConfig.redirect_uri}
  43. &response_type=code
  44. &scope=snsapi_userinfo
  45. &state=STATE
  46. #wechat_redirect`;
  47. window.location = url;
  48. }else{
  49. uni.$u.toast('请先同意用户授权!');
  50. }
  51. },
  52. },
  53. };
  54. </script>
  55. <style scoped lang="scss">
  56. .u-radio-group--row {
  57. justify-content: center;
  58. }
  59. .radioText {
  60. font-weight: 500;
  61. font-size: 24rpx;
  62. color: #999999;
  63. line-height: 34rpx;
  64. text-align: left;
  65. font-style: normal;
  66. }
  67. .login-main {
  68. background: url("../../static/images/back.png") no-repeat;
  69. background-size: 100% 100%;
  70. width: 100%;
  71. display: flex;
  72. flex-direction: column;
  73. justify-content: space-between;
  74. align-items: center;
  75. height: 100vh;
  76. }
  77. .login-contont-button {
  78. .btn {
  79. margin-top: 20px;
  80. width: 90%;
  81. height: 90rpx;
  82. background: linear-gradient(275deg, #01cf6c 0%, #07e278 100%);
  83. border-radius: 44rpx;
  84. color: #fff;
  85. }
  86. }
  87. .login-contont {
  88. width: 100%;
  89. height: 50%;
  90. .login-contont-info {
  91. text-align: center;
  92. .text {
  93. margin-top: 10px;
  94. font-weight: 500;
  95. font-size: 28rpx;
  96. color: #999999;
  97. line-height: 40rpx;
  98. font-style: normal;
  99. }
  100. }
  101. }
  102. .radio {
  103. text-align: center;
  104. margin-top: 10px;
  105. }
  106. .login-main-content {
  107. text-align: center;
  108. padding-top: 100px;
  109. width: 100%;
  110. height: 50%;
  111. .img {
  112. width: 100px;
  113. height: 130px;
  114. }
  115. }
  116. </style>