wxLogin.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="container">
  3. <view class="text-normal">
  4. <text class=" text-one">会员中心系统小程序申请使用</text>
  5. </view>
  6. <view class="text-normal">
  7. <text class="text-two">以下微信账号的权限</text>
  8. </view>
  9. <view class="text-normal">
  10. <text class="text-three">用于为你提供相关服务</text>
  11. </view>
  12. <view class="container-solid"></view>
  13. <u-radio-group v-model="value">
  14. <u-radio v-for="(item, index) in list" :key="index" :name="item.name">
  15. <view style="display: flex;flex-direction: column;">
  16. <text class="text-black">{{item.text}}</text>
  17. <text class="text-grey">{{maskedNumber(item.value)}}</text>
  18. </view>
  19. </u-radio>
  20. </u-radio-group>
  21. <view class="form-button" style="margin-top: 100rpx;" @click="toWxLigin">
  22. 允许
  23. </view>
  24. <view class="form-button form-button-grey" @click="rejectWxLogin">
  25. 拒绝
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. shoujihao: '15312341234',
  34. list: [{
  35. name: 'shoujihao',
  36. text: '微信绑定的手机号',
  37. value: '15312341234'
  38. }],
  39. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  40. value: 'shoujihao',
  41. };
  42. },
  43. methods: {
  44. toWxLigin() {
  45. console.log("微信登录")
  46. },
  47. rejectWxLogin() {
  48. uni.navigateBack({
  49. delta: 1,
  50. animationType: 'pop-out',
  51. animationDuration: 200
  52. })
  53. },
  54. maskedNumber(fullNumber) {
  55. if (fullNumber && fullNumber.length === 11) {
  56. return `${fullNumber.slice(0, 3)}****${fullNumber.slice(7)}`;
  57. }
  58. return fullNumber; // 若号码不符合格式则直接返回
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .container {
  65. height: 100vh;
  66. width: 100vw;
  67. background-color: #ffffff;
  68. padding: 30rpx 50rpx;
  69. }
  70. .text-one {
  71. font-size: 30rpx;
  72. }
  73. .text-two {
  74. font-weight: bold;
  75. font-size: 38rpx;
  76. }
  77. .text-three {
  78. // font-size: rpx;
  79. }
  80. .text-normal {
  81. letter-spacing: 1rpx;
  82. margin: 30rpx 0;
  83. }
  84. .container-solid {
  85. width: 100%;
  86. height: 1rpx;
  87. background-color: #676565;
  88. margin: 30rpx 0;
  89. }
  90. .text-black {
  91. color: #000;
  92. }
  93. .text-grey {
  94. color: #b3b3b3;
  95. }
  96. .form-button {
  97. background: linear-gradient(90deg, #006af5, #21b0fc);
  98. border-radius: 20rpx;
  99. line-height: 80rpx;
  100. text-align: center;
  101. color: #fff;
  102. margin-bottom: 50rpx;
  103. }
  104. .form-button-grey {
  105. background: #e5e5e5;
  106. color: #006af5;
  107. }
  108. </style>