我的小区-添加房产-添加成功之后添加提示信息

This commit is contained in:
赵毅 2025-07-31 10:57:15 +08:00
parent a89e4290b6
commit 33916336ab

View File

@ -5,26 +5,35 @@
<view class="table"> <view class="table">
<view class="label">房产</view> <view class="label">房产</view>
<view class="flexBox" @click="choseCommunity"> <view class="flexBox" @click="choseCommunity">
<input type="text" v-model="changeComm" disabled placeholder="请选择房产"> <input
type="text"
v-model="changeComm"
disabled
placeholder="请选择房产"
/>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
</view> </view>
<view class="table"> <view class="table">
<view class="label">姓名</view> <view class="label">姓名</view>
<input type="text" v-model="nameVal" placeholder="请输入姓名"> <input type="text" v-model="nameVal" placeholder="请输入姓名" />
</view> </view>
<view class="table"> <view class="table">
<view class="label">手机</view> <view class="label">手机</view>
<input type="text" v-model="phoneVal" placeholder="请输入手机号"> <input type="text" v-model="phoneVal" placeholder="请输入手机号" />
</view> </view>
<view class="table"> <view class="table">
<view class="label">身份</view> <view class="label">身份</view>
<view class="flexBox" @click="chooseIdentity"> <view class="flexBox" @click="chooseIdentity">
<input type="number" v-model="selectedLabel" disabled placeholder="请选择身份"> <input
type="number"
v-model="selectedLabel"
disabled
placeholder="请选择身份"
/>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
</view> </view>
<!-- <view class="tip"> <!-- <view class="tip">
注意业主为在物业登记在册的人员需经过物业审 核确认后即可成为该房产的业主如需帮助可与物 业或平台联系 注意业主为在物业登记在册的人员需经过物业审 核确认后即可成为该房产的业主如需帮助可与物 业或平台联系
@ -32,122 +41,129 @@
</view> </view>
<view class="btn" @click="headerSubmitClick">确定</view> <view class="btn" @click="headerSubmitClick">确定</view>
<u-popup :show="show" @close="close" mode="bottom" customStyle="width: 500rpx;" round="20rpx"> <u-popup
<u-picker :show="show" :columns="columns" keyName="label" @cancel="close" @confirm="confirm"></u-picker> :show="show"
@close="close"
mode="bottom"
customStyle="width: 500rpx;"
round="20rpx"
>
<u-picker
:show="show"
:columns="columns"
keyName="label"
@cancel="close"
@confirm="confirm"
></u-picker>
</u-popup> </u-popup>
</view> </view>
</template> </template>
<script> <script>
import { import { request, NavgateTo, isPhone } from "../../../utils";
request, import { apiArr } from "../../../api/community";
NavgateTo, export default {
isPhone
} from '../../../utils';
import {
apiArr
} from '../../../api/community';
export default {
onBackPress(options) { onBackPress(options) {
console.log('from:' + options.from) console.log("from:" + options.from);
}, },
data() { data() {
return { return {
communityId: '', communityId: "",
roomId: '', roomId: "",
managementMobile: '', managementMobile: "",
show: false, show: false,
changeComm: '', changeComm: "",
columns: [ columns: [
[{ [
{
label: "业主", label: "业主",
value: "1" value: "1",
}, },
{ {
label: "家属", label: "家属",
value: "2" value: "2",
}, },
{ {
label: "租客", label: "租客",
value: "3" value: "3",
}, },
{ {
label: "访客", label: "访客",
value: "4" value: "4",
}, },
]
], ],
selectedValue: '', ],
selectedLabel: '', selectedValue: "",
nameVal: '', selectedLabel: "",
phoneVal: '', nameVal: "",
} phoneVal: "",
};
}, },
methods: { methods: {
close() { close() {
this.show = false this.show = false;
}, },
chooseIdentity() { chooseIdentity() {
this.show = true this.show = true;
console.log() console.log();
}, },
confirm(selected) { confirm(selected) {
console.log(selected.value[0].value) console.log(selected.value[0].value);
this.selectedValue = selected.value[0].value this.selectedValue = selected.value[0].value;
this.selectedLabel = selected.value[0].label this.selectedLabel = selected.value[0].label;
this.show = false this.show = false;
}, },
headerCloseClick() { headerCloseClick() {
this.show = false; this.show = false;
}, },
headerInputClick(e) { headerInputClick(e) {
const { const { name } = e.currentTarget.dataset;
name const { value } = e.detail;
} = e.currentTarget.dataset;
const {
value
} = e.detail;
this[name] = value; this[name] = value;
}, },
async headerSubmitClick() { async headerSubmitClick() {
await request(apiArr.create, "POST", { await request(apiArr.create, "POST", {
community_id: parseInt(this.communityId), community_id: parseInt(this.communityId),
room_id: parseInt(this.roomId), room_id: parseInt(this.roomId),
user_id: uni.getStorageSync('userId'), user_id: uni.getStorageSync("userId"),
name: this.nameVal, // name: this.nameVal, //
mobile: this.phoneVal, // mobile: this.phoneVal, //
type: parseInt(this.selectedValue), // type: parseInt(this.selectedValue), //
id_type: 1 id_type: 1,
}).then(res => { }).then((res) => {
console.log(res) console.log(res);
uni.showToast({ uni.showToast({
title: '创建成功', title: "提交成功请等待物业审核!",
icon: "none", icon: "none",
duration: 2000 duration: 1500,
});
//
setTimeout(() => {
NavgateTo("/packages/community/myCommunity/index");
}, 1500);
}); });
NavgateTo("/packages/community/myCommunity/index")
})
}, },
choseCommunity() { choseCommunity() {
NavgateTo("/packages/community/choseCommunity/index") NavgateTo("/packages/community/choseCommunity/index");
}, },
}, },
onLoad(options) { onLoad(options) {
console.log("接收到的参数:", options); console.log("接收到的参数:", options);
this.communityId = options.community_id ? decodeURIComponent(options.community_id) : '' this.communityId = options.community_id
this.roomId = options.room_id ? decodeURIComponent(options.room_id) : '' ? decodeURIComponent(options.community_id)
this.changeComm = options.changeVal ? decodeURIComponent(options.changeVal) : '' : "";
this.roomId = options.room_id ? decodeURIComponent(options.room_id) : "";
this.changeComm = options.changeVal
? decodeURIComponent(options.changeVal)
: "";
}, },
onReachBottom() { onReachBottom() {},
};
},
}
</script> </script>
<style> <style>
@import url("./index.css"); @import url("./index.css");
</style> </style>