radio-group class="radio-group" bindchange="radioChange" label class="radio" wx:for="{{classes_array}}" wx:key="{{index}}" {{item.name}}radio value="{{item.name}}" checked="{{item.checked}}" color="#fff"/ /label/radio-group* radio未选中时样式 */ radio .wx-radio-input{ /* 自定义样式.... */ height: 40rpx; width: 40rpx; margin-top: -4rpx; border-radius: 50%; border: 2rpx solid #999; background: transparent; }/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */radio .wx-radio-input.wx-radio-input-checked{ border: none; background: red;}/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */radio .wx-radio-input.wx-radio-input-checked::before{ border-radius: 50%;/* 圆角 */ width: 40rpx; /* 选中后对勾大小,不要超过背景的尺寸 */ height: 40rpx; /* 选中后对勾大小,不要超过背景的尺寸 */ line-height: 40rpx; text-align: center; font-size:30rpx; /* 对勾大小 30rpx */ color:#fff; /* 对勾颜色 白色 */ background: #f00; transform:translate(-50%, -50%) scale(1); -webkit-transform:translate(-50%, -50%) scale(1);}data{ classes_array: [{ name: '全部', checked: false }, { name: '阅读', checked: false }, { name: '外语', checked: false }, { name: '亲子', checked: false }, { name: '技能', checked: false }, { name: '习惯', checked: false }, { name: '运动', checked: false }, { name: '艺术', checked: false }] }, //点击radio-group中的列表项事件 radioChange: function (res) { console.log("选中的标签:" + res.detail.value); var arrs = this.data.classes_array; var that = this; for (const x in arrs) { if (arrs[x].name == res.detail.value) { arrs[x].checked = true; } else { arrs[x].checked = false; } } that.setData({ classes_array: arrs }) },