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.

86 lines
1.7 KiB

  1. <template>
  2. <view class="main">
  3. <view :style="{height:iSMT+'px'}"></view>
  4. <view class="top">
  5. <view class="top-list">
  6. <text>自动选择</text>
  7. <radio value="0" class="radio-btn" activeBackgroundColor="red"
  8. :checked="selectedIndex === 0" @click="selectFont(0)" />
  9. </view>
  10. <view class="top-list">
  11. <text>新加坡服务器</text>
  12. <radio value="1" class="radio-btn" activeBackgroundColor="red"
  13. :checked="selectedIndex === 1" @click="selectFont(1)" />
  14. </view>
  15. <view class="top-list">
  16. <text>香港服务器</text>
  17. <radio value="2" class="radio-btn" activeBackgroundColor="red"
  18. :checked="selectedIndex === 2" @click="selectFont(2)" />
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script setup>
  24. import {
  25. ref,
  26. onMounted
  27. } from 'vue'
  28. const iSMT = ref(0)
  29. const selectedIndex = ref(0)
  30. const selectFont = (index) => {
  31. selectedIndex.value = index
  32. console.log('看看选中状态',selectedIndex.value)
  33. }
  34. onMounted(() => {
  35. // 状态栏高度
  36. iSMT.value = uni.getSystemInfoSync().statusBarHeight;
  37. console.log('看看高度', iSMT.value)
  38. })
  39. </script>
  40. <style>
  41. .top {
  42. margin-top: 1.5vh;
  43. height: 21vh;
  44. background-color: white;
  45. }
  46. .top-list {
  47. width: 630rpx;
  48. height: 7vh;
  49. display: flex;
  50. align-items: center;
  51. justify-content: center;
  52. margin: 0 40rpx;
  53. padding: 0 10rpx;
  54. border-bottom: 1rpx solid #eee;
  55. }
  56. .top-list:last-child {
  57. border-bottom: none;
  58. }
  59. .switch-btn {
  60. width: 100rpx;
  61. transform: scale(0.6);
  62. transform-origin: center right;
  63. }
  64. .public {
  65. width: 450rpx;
  66. margin-left: auto;
  67. font-size: 10px;
  68. color: rgb(203, 203, 203);
  69. }
  70. .arrow {
  71. margin-left: auto;
  72. }
  73. .radio-btn {
  74. margin-left: auto;
  75. transform: scale(0.6);
  76. }
  77. </style>