<view>
<radio-group class="radioBox" @change="radioChange" v-if="hackReset" >
<label class="itemRadio uni-list-cell uni-list-cell-pd" >
<view>
<radio :value="1" :checked="select_one==='1'" />
</view>
<view>testone</view>
</label>
<label class="itemRadio uni-list-cell uni-list-cell-pd" >
<view>
<radio :value="2" :checked="select_one==='2'" />
</view>
<view>testtwo</view>
</label>
</radio-group>
</view>
radioChange: function(evt) {
var that = this
if(evt.detail.value == 1){
if(that.select_one == '1'){
return false;
}
}else{
if(that.select_one == '2'){
return false;
}
}
uni.showModal({
title: '提示',
content: '确认切换吗?',
success: function(res) {
if (res.confirm) {
that.submit(evt.detail.value)
}else {
that.refresh()
}
}
})
},
refresh() {
let that = this
this.hackReset = false
setTimeout(function() {
that.hackReset = true
}, 1)
},