|
@@ -0,0 +1,158 @@
|
|
|
+<!-- 切换房屋 -->
|
|
|
+<template>
|
|
|
+ <view class="">
|
|
|
+ <view class="item" v-for="(item,index) in data" :key="index">
|
|
|
+ <view class="content">
|
|
|
+ <view class="city">
|
|
|
+ <view style="height: 100%;display: flex;">
|
|
|
+ <image src="../../static/house_icon_location@2x.png" style="width: 40rpx;height:40rpx;margin-right: 18rpx;"></image>
|
|
|
+ <view class="text">{{item.address}}</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="address" v-for="(list,index) in item.ownerBases" :key="index">
|
|
|
+ <image src="../../static/house_icon_house@2x.png" style="width: 40rpx;height:40rpx;margin-right: 18rpx;"></image>
|
|
|
+ <view class="text">{{list}}</view>
|
|
|
+ <view class="delete">
|
|
|
+ <radio-group @change="changeHouse">
|
|
|
+ <radio style="transform:scale(0.8)" :value="list" :checked="address==list" />
|
|
|
+ </radio-group>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ data: [],
|
|
|
+ address:""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ this.address=uni.getStorageSync('homeAdress')
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getHouseData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 删除房屋
|
|
|
+ changeHouse(item) {
|
|
|
+ uni.setStorageSync('homeAdress', item.detail.value)
|
|
|
+ uni.switchTab({
|
|
|
+ url: "./index"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 添加房屋信息
|
|
|
+ addMyHouse() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '../authentication/city'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取房屋数据
|
|
|
+ getHouseData() {
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+ this.http.httpRequest('/wxapplet/ownerbasestruct/list', 'get', {
|
|
|
+ userId: String(uni.getStorageSync('userId'))
|
|
|
+ }, true).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.code == 0) {
|
|
|
+ uni.hideLoading()
|
|
|
+ this.data = res.data
|
|
|
+ } else {
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ "icon": 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+ .btn {
|
|
|
+ width: 702rpx;
|
|
|
+ height: 90rpx;
|
|
|
+ background: rgba(41, 138, 253, 1);
|
|
|
+ opacity: 1;
|
|
|
+ border-radius: 18rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 90rpx;
|
|
|
+ color: rgba(255, 255, 255, 1);
|
|
|
+ text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 56rpx;
|
|
|
+ left: 26rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .address {
|
|
|
+ width: 100%;
|
|
|
+ height: 40rpx;
|
|
|
+ margin-top: 42rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+
|
|
|
+ .delete {
|
|
|
+ width: 60rpx;
|
|
|
+ height: 32rpx;
|
|
|
+ font-size: 22rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ color: rgba(41, 138, 253, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ .item {
|
|
|
+ width: 702rpx;
|
|
|
+ /* height:164rpx; */
|
|
|
+ background: rgba(249, 252, 255, 1);
|
|
|
+ opacity: 1;
|
|
|
+ margin: 0 auto;
|
|
|
+ margin-top: 40rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .content {
|
|
|
+ width: 622rpx;
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .city {
|
|
|
+ width: 100%;
|
|
|
+ height: 40rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 26rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text {
|
|
|
+ width: 400rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 40rpx;
|
|
|
+ color: rgba(41, 138, 253, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ .address .text {
|
|
|
+ width: 550rpx;
|
|
|
+ height: 36rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ color: rgba(51, 51, 51, 1);
|
|
|
+ }
|
|
|
+</style>
|