export default { data() { return { radioGroupValue: '', //当前 radioGroup 选中的值 radioValue: '', // 当前 radio 的值 num: 0, //用于区分是否是重复选中 } }, methods: { isPrivacyCheck() { if (this.radioValue != "check") { uni.showToast({ title: "请先同意隐私政策", icon: "none", complete: () => { return false } }) } else { return true } }, groupChange(n) { if (n == this.radioValue && this.num == 0) { // 第一次相等即执行以下代码 this.num++ } else { // 第一次后相等即执行以下代码 // 置空 radioGroupValue 即取消选中的值 this.radioGroupValue = '' this.radioValue = '' // 初始化 num this.num = 0 } }, // 当切换其他选项的时候此方法才会执行 radioChange(n) { this.radioValue = n // 切换选项后需要初始化 num this.num = 0 }, } }