<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>
