瀏覽代碼

激活切换清空表单

master
cetc 1 周之前
父節點
當前提交
5e470208e8
共有 1 個文件被更改,包括 32 次插入2 次删除
  1. 32
    2
      subpackage/personal-center/etc-activation.vue

+ 32
- 2
subpackage/personal-center/etc-activation.vue 查看文件

@@ -10,13 +10,13 @@
<view class="activation-type">
<view
:class="['type-item', { active: activationType === 'self' }]"
@click="activationType = 'self'"
@click="changeActivationType('self')"
>
本人激活
</view>
<view
:class="['type-item', { active: activationType === 'other' }]"
@click="activationType = 'other'"
@click="changeActivationType('other')"
>
非本人激活
</view>
@@ -262,6 +262,36 @@ const formData = reactive({
activeType: ''
})

const reset = () => {
Object.assign(formData, {
carNumber: '',
vehicleIndex: '',
vehiclePlate: '',
colorCode: '',
colorIndex: '',
colorName: '',
carColor: '',
phoneNumber: '',
vehPosImgUrl: '',
vehPosImgUrlName: '',
vehNegImgUrl: '',
vehNegImgUrlName: '',
vehBodyUrl: '',
vehBodyUrlName: '',
deviceImageUrl: '',
deviceImageName: '',
smsCode: '',
activeType: ''
})
}

const changeActivationType = (type:string) => {
if(activationType.value != type) {
activationType.value = type;
}
reset();
}

// 页面加载
onLoad(() => {
getSystemInfo()

Loading…
取消
儲存