添加我的房产

This commit is contained in:
赵毅 2025-07-07 15:15:10 +08:00
parent 2b148c85e8
commit 41b0781ad7
3 changed files with 133 additions and 65 deletions

View File

@ -34,5 +34,5 @@ export const apiArr = {
commRoomSelect:"/api/v2/wechat/community-room/comm-room-select",//房源筛选器 commRoomSelect:"/api/v2/wechat/community-room/comm-room-select",//房源筛选器
commInfo:"/api/v2/wechat/mpuser-crud/community-owner/info",//我的房产信息小区列表 commInfo:"/api/v2/wechat/mpuser-crud/community-owner/info",//我的房产信息小区列表
create:"/api/v2/wechat/community-owners/create",//创建新的业主信息
}; };

View File

@ -5,23 +5,23 @@
<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" 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" 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" 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" 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>
@ -39,15 +39,27 @@
</template> </template>
<script> <script>
import { request, NavgateTo, isPhone } from '../../../utils'; import {
import { apiArr } from '../../../api/community'; request,
NavgateTo,
isPhone
} from '../../../utils';
import {
apiArr
} from '../../../api/community';
export default { export default {
onBackPress(options) {
console.log('from:' + options.from)
},
data() { data() {
return { return {
communityId: '',
roomId: '',
managementMobile: '', managementMobile: '',
show: false, show: false,
columns: [[ changeComm: '',
{ columns: [
[{
label: "业主", label: "业主",
value: "1" value: "1"
}, },
@ -62,8 +74,13 @@ export default {
{ {
label: "访客", label: "访客",
value: "4" value: "4"
},] },
] ]
],
selectedValue: '',
selectedLabel: '',
nameVal: '',
phoneVal: '',
} }
}, },
methods: { methods: {
@ -72,8 +89,12 @@ export default {
}, },
chooseIdentity() { chooseIdentity() {
this.show = true this.show = true
console.log()
}, },
confirm() { confirm(selected) {
console.log(selected.value[0].value)
this.selectedValue = selected.value[0].value
this.selectedLabel = selected.value[0].label
this.show = false this.show = false
}, },
headerCloseClick() { headerCloseClick() {
@ -81,12 +102,33 @@ export default {
}, },
headerInputClick(e) { headerInputClick(e) {
const { name } = e.currentTarget.dataset; const {
const { value } = e.detail; name
} = e.currentTarget.dataset;
const {
value
} = e.detail;
this[name] = value; this[name] = value;
}, },
async headerSubmitClick() {
await request(apiArr.create, "POST", {
community_id: parseInt(this.communityId),
room_id: parseInt(this.roomId),
user_id: uni.getStorageSync('userId'),
name: this.nameVal, //
mobile: this.phoneVal, //
type: parseInt(this.selectedValue), //
id_type: 1
}).then(res => {
console.log(res)
uni.showToast({
title: '创建成功',
icon: "none",
duration: 2000
});
NavgateTo("packages/community/myCommunity/index")
})
},
choseCommunity() { choseCommunity() {
NavgateTo("/packages/community/choseCommunity/index") NavgateTo("/packages/community/choseCommunity/index")
}, },
@ -94,7 +136,10 @@ export default {
}, },
onLoad(options) { 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) : ''
}, },
onReachBottom() { onReachBottom() {

View File

@ -21,8 +21,7 @@
<div class="communityItem_address">{{item.addr}}</div> <div class="communityItem_address">{{item.addr}}</div>
</div> </div>
<div class="communityItem_right"> <div class="communityItem_right">
<image @click="nextStep(item)" <image @click="nextStep(item)" src="http://192.168.0.172:5500/com_communityMore.png"></image>
src="http://192.168.0.172:5500/com_communityMore.png"></image>
</div> </div>
</div> </div>
</div> </div>
@ -117,7 +116,7 @@
<div class="dialogBoxCon3">{{facilityName + fName + rName}}</div> <div class="dialogBoxCon3">{{facilityName + fName + rName}}</div>
<div class="dialogBoxConBtnList"> <div class="dialogBoxConBtnList">
<div class="dialogBoxConBtnItem1" @click="dialogBoxShow = false">取消</div> <div class="dialogBoxConBtnItem1" @click="dialogBoxShow = false">取消</div>
<div class="dialogBoxConBtnItem2">确定</div> <div class="dialogBoxConBtnItem2" @click="confirmComm">确定</div>
</div> </div>
</div> </div>
</div> </div>
@ -150,6 +149,7 @@
// foloorList: [], // foloorList: [],
// floorsList: [], // floorsList: [],
rName: '', rName: '',
roomId: '',
// roomList: [], // roomList: [],
page_num: 1, page_num: 1,
page_size: 10, page_size: 10,
@ -212,6 +212,7 @@
} else { } else {
this.dialogBoxShow = true; this.dialogBoxShow = true;
this.rName = item.label this.rName = item.label
this.romId = item.value
} }
}) })
}, },
@ -221,6 +222,28 @@
item.label.includes(this.searchQuery) item.label.includes(this.searchQuery)
); );
}, },
confirmComm() {
const params = {
changeVal: `${this.cName}${this.facilityName}${this.fName}${this.rName}`,
community_id: this.communityId,
room_id: this.romId
};
console.log(params)
//
function createQueryString(params) {
return Object.keys(params)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
.join('&');
}
//
const targetPath = "/packages/community/addCommunity/index";
const queryString = createQueryString(params);
const fullPath = `${targetPath}?${queryString}`;
//
NavgateTo(fullPath);
}
}, },
onLoad(options) { onLoad(options) {