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

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

View File

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