zlisen 4 anos atrás
pai
commit
4d9e597e81

+ 7
- 6
src/store/models/renting.js Ver arquivo

@@ -3,6 +3,7 @@ import {
3 3
   ref
4 4
 } from "vue"
5 5
 import request from '@/utils/request'
6
+import { showDanger } from '@/utils'
6 7
 
7 8
 export default () => {
8 9
   const loading = ref(false)
@@ -43,8 +44,8 @@ export default () => {
43 44
   const getDetail = data => {
44 45
     // loading.value = true
45 46
     request({
46
-      loadingId: 'room.view',
47
-      url: '/rent/detail',
47
+      loadingId: 'rent.view',
48
+      url: '/rent/view',
48 49
       params: {
49 50
 
50 51
         id:data,
@@ -53,16 +54,16 @@ export default () => {
53 54
       console.log(res, 'res')
54 55
 
55 56
     Object.assign(detail, res)
56
-      // const { pageNo, pageSize, endRow, result } = res || {}
57
-      // Object.assign(page, {pageNo, pageSize, endRow})
58
-      // list.value = pageNo <= 1 ? result : list.value.concat(list.value)
59
-      // loading.value = false
57
+    
60 58
     }).catch(e => {
61 59
       console.error(e)
62 60
       // loading.value = false
61
+      showDanger('获取详情失败')
63 62
     })
64 63
   }
65 64
 
65
+  
66
+
66 67
 
67 68
 
68 69
   return {

+ 1
- 1
src/utils/plugins/shiro.js Ver arquivo

@@ -3,7 +3,7 @@ import store from '@/store'
3 3
 const shiro = {
4 4
   install: (app) => {
5 5
 
6
-    const removeNode = el => el.parentNode.removeChild(el)
6
+    const removeNode = el => el.parentNode && el.parentNode.removeChild(el)
7 7
 
8 8
     app.directive('shiro', (el, binding) => {      
9 9
       const { permissions, getPermission } = store.getState('shiro')

+ 150
- 37
src/view/renting/detail/components/Base.vue Ver arquivo

@@ -1,112 +1,225 @@
1 1
 <template>
2 2
   <div>
3
-    <x-field label="户型">
4
-      {{roomType}}
3
+    <x-field label="楼层">
4
+      {{ floor }}
5
+    </x-field>
6
+
7
+    <x-field label="居住现状">
8
+      {{ getDictLabel(roomInfo.liveStatus, "liveStatus") }}
5 9
     </x-field>
6 10
 
7 11
     <x-field label="朝向">
8
-      {{getDictLabel(roomInfo.aspect, 'aspect')}}
12
+      {{ getDictLabel(roomInfo.aspect, "aspect") }}
9 13
     </x-field>
10 14
 
11
-    <x-field label="装修">
12
-      {{getDictLabel(roomInfo.decoration, 'decoration')}}
15
+    <x-field label="卧室">
16
+      {{ getDictLabel(roomInfo.livingRoom, "liveRoom") }}
13 17
     </x-field>
14 18
 
15
-    <x-field label="房屋用途">
16
-      {{getDictLabel(roomInfo.purpose, 'purpose')}}
19
+    <x-field label="性别限制">
20
+      {{ getDictLabel(roomInfo.limitSex, "limitSex") }}
21
+    </x-field>
22
+
23
+    <x-field label="房屋特色">
24
+      {{ getDictLabel(roomInfo.roomSpecial, "roomSpecial") }}
25
+    </x-field>
26
+
27
+    <x-field label="梯户比例">
28
+      {{ proportion }}
17 29
     </x-field>
18 30
 
19 31
     <x-field label="建筑类型">
20
-      {{getDictLabel(roomInfo.buildType, 'build_type')}}
32
+      {{ getDictLabel(roomInfo.buildType, "build_type") }}
21 33
     </x-field>
22 34
 
23
-    <x-field label="配备电梯">
24
-      {{getDictLabel(roomInfo.elevator, 'elevator')}}
35
+    <x-field label="房屋用途">
36
+      {{ getDictLabel(roomInfo.purpose, "purpose") }}
25 37
     </x-field>
26 38
 
27 39
     <x-field label="抵押信息">
28
-      {{getDictLabel(roomInfo.isMortgage, 'mortgage') || '无'}}
40
+      {{ getDictLabel(roomInfo.isMortgage, "mortgage") || "无" }}
41
+    </x-field>
42
+
43
+    <x-field label="建成年代">
44
+      {{ roomInfo.buildYear }}
45
+    </x-field>
46
+
47
+    <x-field label="配备电梯">
48
+      {{ getDictLabel(roomInfo.elevator, "elevator") }}
49
+    </x-field>
50
+
51
+    <x-field label="车位">
52
+      {{ getDictLabel(roomInfo.parking, "parking") }}
53
+    </x-field>
54
+
55
+    <x-field label="地下室">
56
+      {{ getDictLabel(roomInfo.buildTime, "build_time") }}
57
+    </x-field>
58
+
59
+ <x-field label="物业费">
60
+      {{building.propertyPrice}} 元/m²/月
29 61
     </x-field>
30 62
 
31
-    <x-field label="税费">
32
-      {{getDictLabel(roomInfo.buildTime, 'build_time') || '未知'}}
63
+    
64
+<x-field label="燃气管道">
65
+      {{ getDictLabel(roomInfo.gas, "gas") }}
33 66
     </x-field>
34 67
 
68
+    <x-field label="家电">
69
+      {{ getDictLabel(roomInfo.electricEquipment, "electricEquipment") }}
70
+    </x-field>
71
+
72
+    <x-field label="隔断">
73
+      {{ getDictLabel(roomInfo.separate, "separate") }}
74
+    </x-field>
75
+    
76
+
77
+
35 78
     <x-field label="来源">
36
-      {{getDictLabel(roomInfo.sourceFrom, 'sourceFrom')}}
79
+      {{ getDictLabel(roomInfo.sourceFrom, "sourceFrom") }}
37 80
     </x-field>
38 81
 
82
+        <x-field label="优势推荐">
83
+      {{ roomInfo.specialDesc }}
84
+    </x-field>
85
+    
39 86
   </div>
40 87
 </template>
41 88
 
42 89
 <script>
43
-import { computed } from 'vue'
44
-import { useModel } from '@zjxpcyc/vue-tiny-store'
90
+import { computed } from "vue";
91
+import { useModel } from "@zjxpcyc/vue-tiny-store";
45 92
 
46 93
 export default {
47 94
   props: {
48 95
     roomInfo: {
49 96
       type: Object,
50
-      default: () => ({})
51
-    }
97
+      default: () => ({}),
98
+    },
99
+    building: {
100
+      type: Object,
101
+      default: () => ({}),
102
+    },
52 103
   },
53 104
   setup(props) {
54
-    const { dicts, getDict } = useModel('dicts')
105
+    const { dicts, getDict } = useModel("dicts");
55 106
 
56 107
     // 朝向
57 108
     if (!dicts.aspect || !dicts.aspect.length) {
58
-      getDict('aspect')
109
+      getDict("aspect");
59 110
     }
60 111
 
61 112
     // 装修
62 113
     if (!dicts.decoration || !dicts.decoration.length) {
63
-      getDict('decoration')
114
+      getDict("decoration");
64 115
     }
65 116
 
66 117
     // 房屋用途
67 118
     if (!dicts.purpose || !dicts.purpose.length) {
68
-      getDict('purpose')
119
+      getDict("purpose");
69 120
     }
70 121
 
71 122
     // 建筑类型
72
-    if (!dicts['build_type'] || !dicts['build_type'].length) {
73
-      getDict('build_type')
123
+    if (!dicts["build_type"] || !dicts["build_type"].length) {
124
+      getDict("build_type");
74 125
     }
75 126
 
76 127
     // 电梯
77 128
     if (!dicts.elevator || !dicts.elevator.length) {
78
-      getDict('elevator')
129
+      getDict("elevator");
79 130
     }
80 131
 
81 132
     // 抵押信息
82 133
     if (!dicts.mortgage || !dicts.mortgage.length) {
83
-      getDict('mortgage')
134
+      getDict("mortgage");
84 135
     }
85 136
 
86 137
     // 税费
87
-    if (!dicts['build_time'] || !dicts['build_time'].length) {
88
-      getDict('build_time')
138
+    if (!dicts["build_time"] || !dicts["build_time"].length) {
139
+      getDict("build_time");
89 140
     }
90 141
 
91 142
     // 来源
92 143
     if (!dicts.sourceFrom || !dicts.sourceFrom.length) {
93
-      getDict('sourceFrom')
144
+      getDict("sourceFrom");
145
+    }
146
+
147
+    //居住现状
148
+    if (!dicts.liveStatus || !dicts.liveStatus.length) {
149
+      getDict("liveStatus");
94 150
     }
95 151
 
152
+    // 性别限制
153
+    if (!dicts.limitSex || !dicts.limitSex.length) {
154
+      getDict("limitSex");
155
+    }
156
+
157
+    //卧室
158
+    if (!dicts.liveRoom || !dicts.liveRoom.length) {
159
+      getDict("liveRoom");
160
+    }
161
+    // 房屋特色
162
+    if (!dicts.roomSpecial || !dicts.roomSpecial.length) {
163
+      getDict("roomSpecial");
164
+    }
165
+
166
+    //车位
167
+    if (!dicts.parking || !dicts.parking.length) {
168
+      getDict("parking");
169
+    }
170
+
171
+// 地下室
172
+     if (!dicts.build_time || !dicts.build_time.length) {
173
+      getDict("build_time");
174
+    }
175
+// 物业费
176
+      if (!dicts.basement || !dicts.basement.length) {
177
+      getDict("basement");
178
+    }
179
+
180
+    // 燃气管道
181
+      if (!dicts.gas || !dicts.gas.length) {
182
+      getDict("gas");
183
+    }
184
+
185
+// 家电
186
+    if (!dicts.electricEquipment || !dicts.electricEquipment.length) {
187
+      getDict("electricEquipment");
188
+    }
189
+
190
+// 隔断
191
+    if (!dicts.separate || !dicts.separate.length) {
192
+      getDict("separate");
193
+    }
194
+    
195
+
96 196
     const roomType = computed(() => {
97
-      const [a, b, c, d] = (props.roomInfo.roomType || '').split(',')
98
-      return `${a || ''}室 ${b || '0'}厅 ${c || '0'}厨 ${d || '0'}卫`
99
-    })
197
+      const [a, b, c, d] = (props.roomInfo.roomType || "").split(",");
198
+      return `${a || ""}室 ${b || "0"}厅 ${c || "0"}厨 ${d || "0"}卫`;
199
+    });
200
+
201
+    const floor = computed(() => {
202
+      const [a, b, c] = (props.roomInfo.roomFloor || "").split(",");
203
+      return `${a || ""}/${b || ""}(${c || ""})`;
204
+    });
205
+
206
+    // 梯户比例
207
+    const proportion = computed(() => {
208
+      const [a, b] = (props.roomInfo.proportion || "").split(",");
209
+      return `${a || ""}梯${b || ""}户`;
210
+    });
100 211
 
101 212
     // 获取字典对应名称
102 213
     const getDictLabel = (val, key) => {
103
-      return dicts[key]?.filter(x => x.code === val)[0]?.name
104
-    }
214
+      return dicts[key]?.filter((x) => x.value === val)[0]?.text;
215
+    };
105 216
 
106 217
     return {
218
+      floor,
107 219
       roomType,
220
+      proportion,
108 221
       getDictLabel,
109
-    }
110
-  }
111
-}
222
+    };
223
+  },
224
+};
112 225
 </script>

+ 6
- 8
src/view/renting/detail/components/Main.vue Ver arquivo

@@ -27,9 +27,7 @@
27 27
       }}
28 28
     </x-field>
29 29
 
30
-    <x-field label="楼层">
31
-      {{ floor }}
32
-    </x-field>
30
+
33 31
 
34 32
     <x-field label="创建方式">
35 33
       {{ roomInfo.createMethod === "1" ? "外部录入" : "荟居录入" }}
@@ -131,10 +129,10 @@ export default {
131 129
     const unfollowRoom = ref();
132 130
     const { dicts, getDict } = useModel("dicts");
133 131
 
134
-    const floor = computed(() => {
135
-      const [a, b, c] = (props.roomInfo.roomFloor || "").split(",");
136
-      return `${a || ""}/${b || ""}(${c || ""})`;
137
-    });
132
+    // const floor = computed(() => {
133
+    //   const [a, b, c] = (props.roomInfo.roomFloor || "").split(",");
134
+    //   return `${a || ""}/${b || ""}(${c || ""})`;
135
+    // });
138 136
 
139 137
     // 居室
140 138
     const roomType = computed(() => {
@@ -206,7 +204,7 @@ export default {
206 204
     };
207 205
 
208 206
     return {
209
-      floor,
207
+      // floor,
210 208
       roomType,
211 209
       avgPrice,
212 210
       leaseWay,

+ 2
- 2
src/view/renting/detail/index.vue Ver arquivo

@@ -33,7 +33,7 @@
33 33
             <template #title>
34 34
               <div>基础信息</div>
35 35
             </template>
36
-            <RoomBase :room-info="detail.roomInfo" />
36
+            <RoomBase :room-info="detail.roomInfo" :building="detail.building" />
37 37
           </van-collapse-item>
38 38
 
39 39
           <van-collapse-item name="2">
@@ -174,7 +174,7 @@ export default {
174 174
     const collapseItem = ref()
175 175
     const phone = ref("")
176 176
 
177
-    const { detail, getDetail } = useModel("room")
177
+    const { detail, getDetail } = useModel("renting")
178 178
 
179 179
     onMounted(() => {
180 180
       getDetail(roomId);

+ 1
- 1
vue.config.js Ver arquivo

@@ -12,7 +12,7 @@ module.exports = {
12 12
     proxy: {
13 13
       '/mp': {
14 14
         target: 'http://10.161.7.66:8080/',
15
-        target: 'http://localhost:8080/',
15
+        // target: 'http://localhost:8080/',
16 16
         ws: true,
17 17
         changeOrigin: true,
18 18
         // pathRewrite: {'^/mp': ''}