123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <template>
- <view class="container">
- <!--内容部分-->
- <tui-list-view>
- <tui-list-cell v-for="(item, index) in items" :key="item.value">
- <radio-group @change="radioChange">
- <view class="tui-item-box">
- <view class="tui-list-cell_name">{{item.name}}</view>
- <view class="tui-right"><radio :value="item.value" :checked="index === current" /></view>
- </view>
- </radio-group>
- </tui-list-cell>
- </tui-list-view>
- <!--内容部分-->
- </view>
- </template>
- <script>
- import tuiButton from "@/components/thorui/tui-button/tui-button"
- import tuiListView from '@/components/thorui/tui-list-view/tui-list-view';
- import tuiListCell from '@/components/thorui/tui-list-cell/tui-list-cell';
- import tuiIcon from '@/components/thorui/tui-icon/tui-icon';
- import tuiTag from '@/components/thorui/tui-tag/tui-tag';
- import tuiBadge from '@/components/thorui/tui-badge/tui-badge';
-
- export default {
- components: {
- tuiListView,
- tuiListCell,
- tuiIcon,
- tuiTag,
- tuiButton,
- tuiBadge
- },
- data() {
- return {
- items: [{
- value: 'USA',
- name: '男',
- },
- {
- value: 'CHN',
- name: '女',
- },
- ],
- current: 0 //控制勾选
- }
- },
- methods: {
- radioChange: function(evt) {
- for (let i = 0; i < this.items.length; i++) {
- if (this.items[i].value === evt.target.value) {
- this.current = i;
- break;
- }
- }
- }
- }
- }
- </script>
- <style>
- .container {
- padding-bottom: env(safe-area-inset-bottom);
- width: 100%;
- }
-
- .tui-item-box {
- width: 100%;
- display: flex;
- align-items: center;
- }
-
- .tui-list-cell_name {
- padding-left: 20rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .tui-ml-auto {
- margin-left: auto;
- }
-
- .tui-right {
- margin-left: auto;
- font-size: 26rpx;
- color: #999;
- }
-
- .tui-logo {
- height: 52rpx;
- width: 52rpx;
- flex-shrink: 0;
- }
-
- .tui-flex {
- display: flex;
- align-items: center;
- }
-
- .tui-msg-box {
- display: flex;
- align-items: center;
- }
-
- .tui-msg-pic {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- display: block;
- margin-right: 24rpx;
- flex-shrink: 0;
- }
-
- .tui-msg-item {
- max-width: 500rpx;
- min-height: 80rpx;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
-
- .tui-msg-name {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-size: 34rpx;
- line-height: 1;
- color: #262b3a;
- }
-
- .tui-msg-content {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-size: 26rpx;
- line-height: 1;
- color: #9397a4;
- }
-
- .tui-msg-right {
- max-width: 120rpx;
- height: 88rpx;
- margin-left: auto;
- text-align: right;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: flex-end;
- }
-
- .tui-right-dot {
- height: 76rpx !important;
- padding-bottom: 10rpx !important;
-
- }
-
- .tui-msg-time {
- width: 100%;
- font-size: 24rpx;
- line-height: 24rpx;
- color: #9397a4;
- }
- </style>
|