暂存账号管理

This commit is contained in:
2025-02-21 08:41:46 +08:00
parent 16a03fbb4b
commit b078bbf26a
11 changed files with 168 additions and 33 deletions

View File

@@ -16,12 +16,28 @@ Component({
park: String,
tenement: String,
},
observers: {
"name": function(newValue) {
const newData = this.data;
newData.name = newValue
this.setData({ data: newData })
},
"id": function(newValue) {
const newData = this.data;
newData.id = newValue
this.setData({ data: newData })
},
"phone": function(newValue) {
const newData = this.data;
newData.phone = newValue
this.setData({ data: newData })
}
},
/**
* 组件的初始数据
*/
data: {
data: { name: "", phone: "" }
data: { name: "", phone: "", id: "" }
},
/**
@@ -42,6 +58,7 @@ Component({
const { code, message } = await createTenementWxUser({ ...data, tenement, park })
if (code !== OK) {
alertInfo(message)
this.triggerEvent("cancel")
return;
}
alertSuccess("操作成功")
@@ -55,6 +72,9 @@ Component({
this.setData({
data: newData,
})
},
onCancel() {
this.triggerEvent("cancel")
}
}
})

View File

@@ -5,6 +5,7 @@
show="{{ visible }}"
show-cancel-button
bind:confirm="onSubmit"
bind:cancel="onCancel"
>
<view class="modalContentWrapper">
<van-field