sex.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="container">
  3. <!--内容部分-->
  4. <tui-list-view>
  5. <tui-list-cell v-for="(item, index) in items" :key="item.value">
  6. <radio-group @change="radioChange">
  7. <view class="tui-item-box">
  8. <view class="tui-list-cell_name">{{item.name}}</view>
  9. <view class="tui-right"><radio :value="item.value" :checked="index === current" /></view>
  10. </view>
  11. </radio-group>
  12. </tui-list-cell>
  13. </tui-list-view>
  14. <!--内容部分-->
  15. </view>
  16. </template>
  17. <script>
  18. import tuiButton from "@/components/thorui/tui-button/tui-button"
  19. import tuiListView from '@/components/thorui/tui-list-view/tui-list-view';
  20. import tuiListCell from '@/components/thorui/tui-list-cell/tui-list-cell';
  21. import tuiIcon from '@/components/thorui/tui-icon/tui-icon';
  22. import tuiTag from '@/components/thorui/tui-tag/tui-tag';
  23. import tuiBadge from '@/components/thorui/tui-badge/tui-badge';
  24. export default {
  25. components: {
  26. tuiListView,
  27. tuiListCell,
  28. tuiIcon,
  29. tuiTag,
  30. tuiButton,
  31. tuiBadge
  32. },
  33. data() {
  34. return {
  35. items: [{
  36. value: 'USA',
  37. name: '男',
  38. },
  39. {
  40. value: 'CHN',
  41. name: '女',
  42. },
  43. ],
  44. current: 0 //控制勾选
  45. }
  46. },
  47. methods: {
  48. radioChange: function(evt) {
  49. for (let i = 0; i < this.items.length; i++) {
  50. if (this.items[i].value === evt.target.value) {
  51. this.current = i;
  52. break;
  53. }
  54. }
  55. }
  56. }
  57. }
  58. </script>
  59. <style>
  60. .container {
  61. padding-bottom: env(safe-area-inset-bottom);
  62. width: 100%;
  63. }
  64. .tui-item-box {
  65. width: 100%;
  66. display: flex;
  67. align-items: center;
  68. }
  69. .tui-list-cell_name {
  70. padding-left: 20rpx;
  71. display: flex;
  72. align-items: center;
  73. justify-content: center;
  74. }
  75. .tui-ml-auto {
  76. margin-left: auto;
  77. }
  78. .tui-right {
  79. margin-left: auto;
  80. font-size: 26rpx;
  81. color: #999;
  82. }
  83. .tui-logo {
  84. height: 52rpx;
  85. width: 52rpx;
  86. flex-shrink: 0;
  87. }
  88. .tui-flex {
  89. display: flex;
  90. align-items: center;
  91. }
  92. .tui-msg-box {
  93. display: flex;
  94. align-items: center;
  95. }
  96. .tui-msg-pic {
  97. width: 100rpx;
  98. height: 100rpx;
  99. border-radius: 50%;
  100. display: block;
  101. margin-right: 24rpx;
  102. flex-shrink: 0;
  103. }
  104. .tui-msg-item {
  105. max-width: 500rpx;
  106. min-height: 80rpx;
  107. overflow: hidden;
  108. display: flex;
  109. flex-direction: column;
  110. justify-content: space-between;
  111. }
  112. .tui-msg-name {
  113. overflow: hidden;
  114. white-space: nowrap;
  115. text-overflow: ellipsis;
  116. font-size: 34rpx;
  117. line-height: 1;
  118. color: #262b3a;
  119. }
  120. .tui-msg-content {
  121. overflow: hidden;
  122. white-space: nowrap;
  123. text-overflow: ellipsis;
  124. font-size: 26rpx;
  125. line-height: 1;
  126. color: #9397a4;
  127. }
  128. .tui-msg-right {
  129. max-width: 120rpx;
  130. height: 88rpx;
  131. margin-left: auto;
  132. text-align: right;
  133. display: flex;
  134. flex-direction: column;
  135. justify-content: space-between;
  136. align-items: flex-end;
  137. }
  138. .tui-right-dot {
  139. height: 76rpx !important;
  140. padding-bottom: 10rpx !important;
  141. }
  142. .tui-msg-time {
  143. width: 100%;
  144. font-size: 24rpx;
  145. line-height: 24rpx;
  146. color: #9397a4;
  147. }
  148. </style>