zlisen hace 4 años
padre
commit
b8d1ee7de0
Se han modificado 4 ficheros con 186 adiciones y 115 borrados
  1. 19
    6
      src/store/models/room.js
  2. 1
    1
      src/utils/request/index.js
  3. 165
    108
      src/view/secondhand/detail/index.vue
  4. 1
    0
      vue.config.js

+ 19
- 6
src/store/models/room.js Ver fichero

@@ -41,7 +41,6 @@ export default () => {
41 41
   }
42 42
 
43 43
   const getDetail = data => {
44
-    // loading.value = true
45 44
     request({
46 45
       loadingId: 'room.view',
47 46
       url: '/room/detail',
@@ -53,16 +52,29 @@ export default () => {
53 52
       console.log(res, 'res')
54 53
 
55 54
     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
55
+   
60 56
     }).catch(e => {
61 57
       console.error(e)
62
-      // loading.value = false
63 58
     })
64 59
   }
65 60
 
61
+  const getSecurity = id => {
62
+  return  request({
63
+      loadingId: 'room.security',
64
+      url: '/room/security',
65
+      params: {
66
+
67
+        roomId:id,
68
+      }
69
+    }).then(res => {
70
+      console.log(res, 'res')
71
+   return res
72
+    }).catch(e => {
73
+      console.error(e)
74
+    })
75
+  }
76
+
77
+
66 78
 
67 79
 
68 80
   return {
@@ -71,6 +83,7 @@ export default () => {
71 83
     getList,
72 84
     detail,
73 85
     getDetail,
86
+    getSecurity,
74 87
     loading
75 88
   }
76 89
 }

+ 1
- 1
src/utils/request/index.js Ver fichero

@@ -35,7 +35,7 @@ const responseInterceptor = response => {
35 35
       return data.data
36 36
     } else if ('1' === data.code) {
37 37
     
38
-      return Promise.reject('账号未登录或没有权限')
38
+      return Promise.reject('账号未登录或没有权限1')
39 39
     } else if ('-1' === data.code) {
40 40
       console.log(router,'router')
41 41
       router.push('/login')

+ 165
- 108
src/view/secondhand/detail/index.vue Ver fichero

@@ -1,13 +1,13 @@
1 1
 <template>
2 2
   <div class="secondhanddetail">
3 3
     <!-- xId='room.view' -->
4
-    <XLoading  tip='正在加载详情'>
4
+    <XLoading tip="正在加载详情">
5 5
       <div>
6 6
         <Swiper></Swiper>
7 7
       </div>
8 8
 
9 9
       <div class="title">
10
-        <p>{{detail.roomInfo?.title}}</p>
10
+        <p>{{ detail.roomInfo?.title }}</p>
11 11
       </div>
12 12
 
13 13
       <div class="detailcard">
@@ -133,7 +133,7 @@ import Contextc from "../../../components/contextC";
133 133
 import Stepc from "../../../components/stepC";
134 134
 // import { router } from "../../../router";
135 135
 
136
-import  XLoading  from "../../../components/XLoading";
136
+import XLoading from "../../../components/XLoading";
137 137
 
138 138
 export default {
139 139
   name: "secondhanddetail",
@@ -165,13 +165,90 @@ export default {
165 165
     const showShare = ref(false);
166 166
     const phoneShow = ref(false);
167 167
     const phone = ref("");
168
-    const { detail, getDetail } = useModel("room");
169
-    // const { detail,  getDetail } = detail;
168
+    const showInfo = ref(false);
169
+    const { detail, getDetail, getSecurity } = useModel("room");
170
+    const { dicts, getDict } = useModel("dicts");
170 171
 
171 172
     onMounted(() => {
172 173
       getDetail(roomId);
173 174
     });
174 175
 
176
+    // 字典
177
+    // 朝向
178
+    const aspectOptions = computed(() => {
179
+      const aspectDict = dicts.aspect || [];
180
+      if (!aspectDict.length) {
181
+        getDict("aspect");
182
+      }
183
+      console.log(aspectDict, "aspectDict");
184
+      return aspectDict;
185
+    });
186
+    // 装修
187
+    const decorationOptions = computed(() => {
188
+      const decorationDict = dicts.decoration || [];
189
+      if (!decorationDict.length) {
190
+        getDict("decoration");
191
+      }
192
+
193
+      return decorationDict;
194
+    });
195
+    //房屋用途
196
+    const purposeOptions = computed(() => {
197
+      const purposeDict = dicts.purpose || [];
198
+      if (!purposeDict.length) {
199
+        getDict("purpose");
200
+      }
201
+
202
+      return purposeDict;
203
+    });
204
+    //建筑类型
205
+    const buildTypeOptions = computed(() => {
206
+      const buildTypeDict = dicts.buildType || [];
207
+      if (!buildTypeDict.length) {
208
+        getDict("build_type");
209
+      }
210
+
211
+      return buildTypeDict;
212
+    });
213
+
214
+    //配备电梯
215
+    const elevatorOptions = computed(() => {
216
+      const elevatorDict = dicts.elevator || [];
217
+      if (!elevatorDict.length) {
218
+        getDict("elevator");
219
+      }
220
+
221
+      return elevatorDict;
222
+    });
223
+    // 抵押信息
224
+    const mortgageOptions = computed(() => {
225
+      const mortgageDict = dicts.mortgage || [];
226
+      if (!mortgageDict.length) {
227
+        getDict("mortgage");
228
+      }
229
+
230
+      return mortgageDict;
231
+    });
232
+    // 税费
233
+    const buildTimeOptions = computed(() => {
234
+      const buildTimeDict = dicts.buildTime || [];
235
+      if (!buildTimeDict.length) {
236
+        getDict("build_time");
237
+      }
238
+
239
+      return buildTimeDict;
240
+    });
241
+
242
+    // 来源
243
+    const sourceFromOptions = computed(() => {
244
+      const sourceFromDict = dicts.sourceFrom || [];
245
+      if (!sourceFromDict.length) {
246
+        getDict("sourceFrom");
247
+      }
248
+
249
+      return sourceFromDict;
250
+    });
251
+
175 252
     // 通过 actions 属性来定义菜单选项
176 253
     const actions = [
177 254
       { text: "设置房源保护", value: "1" },
@@ -218,12 +295,17 @@ export default {
218 295
     };
219 296
     const onLookClick = () => {
220 297
       console.log("onLookClick");
298
+      if (showInfo.value) return;
299
+
300
+      getSecurity(roomId).then((res) => {
301
+        console.log(res, "getSecurity");
302
+        showInfo.value = true;
303
+      });
221 304
     };
222 305
     const getRoomFloor = (data) => {
223
-     
224
-const [a,b,c] = (data||'').split(',')
225
- console.log(a,b,c,`${a}/${b}(${c})`,"data");
226
-      return `${a||''}/${b||''}(${c||''})`
306
+      const [a, b, c] = (data || "").split(",");
307
+
308
+      return `${a || ""}/${b || ""}(${c || ""})`;
227 309
     };
228 310
 
229 311
     // 房源信息
@@ -235,7 +317,7 @@ const [a,b,c] = (data||'').split(',')
235 317
       },
236 318
       {
237 319
         name: "房源id",
238
-        value: `${detail.roomInfo?.roomCode||''}${detail.roomInfo?.id||''}`,
320
+        value: `${detail.roomInfo?.roomCode || ""}${detail.roomInfo?.id || ""}`,
239 321
       },
240 322
       {
241 323
         name: "楼层",
@@ -247,186 +329,161 @@ const [a,b,c] = (data||'').split(',')
247 329
       },
248 330
       {
249 331
         name: "面积",
250
-        value: detail.roomInfo?.acreage + '㎡',
332
+        value: detail.roomInfo?.acreage + "㎡",
251 333
       },
252 334
       {
253 335
         name: "所属商圈",
254
-        value: detail.roomBusi?.areaName,
336
+        value: detail.roomBusiness?.areaName,
255 337
       },
256 338
       {
257 339
         name: "价格",
258
-        value: detail.building?.buildingName,
340
+        value: `${detail.roomInfo?.totalPrice}万元/${(
341
+          (detail.roomInfo?.totalPrice * 1000) /
342
+          detail.roomInfo?.acreage
343
+        ).toFixed(2)}元/㎡`,
259 344
       },
260 345
       {
261 346
         name: "楼房号",
262
-        value: detail.building?.buildingName,
347
+        value: showInfo.value ? detail.roomInfo?.roomNum : "敏感信息",
263 348
       },
264 349
       {
265 350
         name: "单元",
266
-        value: detail.building?.buildingName,
351
+        value: showInfo.value ? detail.roomInfo?.roomUnit : "敏感信息",
267 352
       },
268 353
       {
269 354
         name: "业主姓名",
270
-        value: detail.building?.buildingName,
355
+        value: showInfo.value ? detail.roomInfo?.ownerName : "敏感信息",
271 356
       },
272 357
       {
273 358
         name: "楼栋",
274
-        value: detail.building?.buildingName,
359
+        value: showInfo.value ? detail.roomInfo?.roomBuild : "敏感信息",
275 360
       },
276 361
       {
277 362
         name: "业主电话",
278
-        value: detail.building?.buildingName,
363
+        value: showInfo.value
364
+          ? (detail.roomInfo?.ownerTel || "").split(",")[0]
365
+          : "敏感信息",
279 366
       },
280 367
       {
281
-        name: "查看敏感信息",
368
+        name: `查看敏感信息(${detail.leftSecurityNum})`,
282 369
         value: "123",
283 370
         type: "BUTTOM",
284 371
         click: () => onLookClick(),
285 372
       },
286 373
     ]);
287 374
 
288
-    // const housingInformationOptions = [
289
-    //   {
290
-    //     name: "所属楼盘",
291
-    //     value: detail.building?.buildingName,
292
-    //     span: 24,
293
-    //   },
294
-    //   {
295
-    //     name: "房源id",
296
-    //     value: "123",
297
-    //   },
298
-    //   {
299
-    //     name: "楼层",
300
-    //     value: "123",
301
-    //   },
302
-    //   {
303
-    //     name: "所属区县",
304
-    //     value: "123",
305
-    //   },
306
-    //   {
307
-    //     name: "面积",
308
-    //     value: "123",
309
-    //   },
310
-    //   {
311
-    //     name: "所属商圈",
312
-    //     value: "123",
313
-    //   },
314
-    //   {
315
-    //     name: "价格",
316
-    //     value: "123",
317
-    //   },
318
-    //   {
319
-    //     name: "楼房号",
320
-    //     value: "123",
321
-    //   },
322
-    //   {
323
-    //     name: "单元",
324
-    //     value: "123",
325
-    //   },
326
-    //   {
327
-    //     name: "业主姓名",
328
-    //     value: "123",
329
-    //   },
330
-    //   {
331
-    //     name: "楼栋",
332
-    //     value: "123",
333
-    //   },
334
-    //   {
335
-    //     name: "业主电话",
336
-    //     value: "123",
337
-    //   },
338
-    //   {
339
-    //     name: "查看敏感信息",
340
-    //     value: "123",
341
-    //     type: "BUTTOM",
342
-    //     click: () => onLookClick(),
343
-    //   },
344
-    // ];
345
-    console.log(housingInformationOptions, "housingInformationOption s");
375
+    const getRoomType = (data) => {
376
+      const [a, b, c, d] = (data || "").split(",");
377
+
378
+      return `${a || ""}室 ${b || ""}厅 ${c || ""}厨 ${d || ""}卫`;
379
+    };
346 380
     // 基本信息
347
-    const baseInformationOptions = [
381
+    const baseInformationOptions = computed(() => [
348 382
       {
349 383
         name: "户型",
350
-        value: "123",
384
+        value: getRoomType(detail.roomInfo?.roomType),
351 385
       },
352 386
       {
353 387
         name: "朝向",
354
-        value: "123",
388
+        value: aspectOptions.value.filter(
389
+          (x) => x.value == detail.roomInfo?.aspect
390
+        )[0]?.text,
355 391
       },
356 392
       {
357 393
         name: "装修",
358
-        value: "123",
394
+        value: decorationOptions.value.filter(
395
+          (x) => x.value == detail.roomInfo?.decoration
396
+        )[0]?.text,
359 397
       },
360 398
       {
361 399
         name: "房屋用途",
362
-        value: "123",
400
+        value: purposeOptions.value.filter(
401
+          (x) => x.value == detail.roomInfo?.purpose
402
+        )[0]?.text,
363 403
       },
364 404
       {
365 405
         name: "建筑类型",
366
-        value: "123",
406
+        value: buildTypeOptions.value.filter(
407
+          (x) => x.value == detail.roomInfo?.buildType
408
+        )[0]?.text,
367 409
       },
368 410
       {
369 411
         name: "配备电梯",
370
-        value: "123",
412
+        value: elevatorOptions.value.filter(
413
+          (x) => x.value == detail.roomInfo?.elevator
414
+        )[0]?.text,
371 415
       },
372 416
       {
373 417
         name: "抵押信息",
374
-        value: "123",
418
+        value:
419
+          mortgageOptions.value.filter(
420
+            (x) => x.value == detail.roomInfo?.isMortgage
421
+          )[0]?.text || "暂无",
375 422
       },
376 423
       {
377 424
         name: "税费",
378
-        value: "123",
425
+        value:
426
+          buildTimeOptions.value.filter(
427
+            (x) => x.value == detail.roomInfo?.buildTime
428
+          )[0]?.text || "未知",
379 429
       },
430
+
380 431
       {
381 432
         name: "来源",
382
-        value: "123",
433
+        value: sourceFromOptions.value.filter(
434
+          (x) => x.value == detail.roomInfo?.sourceFrom
435
+        )[0]?.text,
436
+
383 437
         span: 24,
384 438
       },
385
-    ];
439
+    ]);
386 440
     // 物业信息
387
-    const propertyInformationOptions = [
441
+    const propertyInformationOptions = computed(() =>[
388 442
       {
389 443
         name: "物业费",
390
-        value: "123",
444
+        value: `${(detail.building?.propertyPrice||0).toFixed(2)}元/m²/月`
391 445
       },
392 446
       {
393 447
         name: "建筑年代",
394
-        value: "123",
448
+        value:  detail.building?.buildYear
395 449
       },
396 450
       {
397 451
         name: "均价",
398
-        value: "123",
452
+        value: `${(detail.building?.averagePrice||0).toFixed(2)}元/m²` 
399 453
       },
400 454
       {
401 455
         name: "开发商",
402
-        value: "123",
456
+        value:  detail.building?.developer
403 457
       },
404 458
       {
405 459
         name: "物业公司",
406
-        value: "123",
460
+        value: detail.building?.propertyCompany
407 461
       },
408
-    ];
462
+    ]);
463
+
464
+   const getNameFormat=(name,id)=>(name||'') + (name?`(ID:${id})`:'')
465
+   
409 466
     // 角色人
410
-    const roleInformationOptions = [
467
+    const roleInformationOptions =computed(() => [
411 468
       {
412 469
         name: "首次录入人",
413
-        value: "123",
470
+        value: getNameFormat(detail.roomRole?.createName,detail.roomRole?.createId),
414 471
       },
415 472
       {
416 473
         name: "时间",
417
-        value: "123",
474
+        value:detail.roomRole?.createTime
418 475
       },
419 476
       {
420 477
         name: "录入人",
421
-        value: "123",
478
+        value: getNameFormat(detail.roomRole?.recordName,detail.roomRole?.recordId), 
422 479
       },
423 480
       {
424 481
         name: "时间",
425
-        value: "123",
482
+        value: detail.roomRole?.recordTime
426 483
       },
427 484
       {
428 485
         name: "维护人",
429
-        value: "123",
486
+        value:  getNameFormat(detail.roomRole?.belongName,detail.roomRole?.belongId), 
430 487
       },
431 488
       {
432 489
         name: "查看电话",
@@ -436,34 +493,34 @@ const [a,b,c] = (data||'').split(',')
436 493
       },
437 494
       {
438 495
         name: "实勘人",
439
-        value: "123",
496
+        value:   getNameFormat(detail.roomRole?.rescName,detail.roomRole?.rescId),  
440 497
       },
441 498
       {
442 499
         name: "时间",
443
-        value: "123",
500
+        value: detail.roomRole?.rescTime,
444 501
       },
445 502
       {
446 503
         name: "钥匙人",
447
-        value: "123",
504
+        value:  getNameFormat(detail.roomRole?.keyName,detail.roomRole?.keyId),  
448 505
         span: 24,
449 506
       },
450 507
       {
451 508
         name: "委托人",
452
-        value: "123",
509
+        value: getNameFormat(detail.roomRole?.authName,detail.roomRole?.authId), 
453 510
       },
454 511
       {
455 512
         name: "时间",
456
-        value: "123",
513
+        value:  detail.roomRole?.authTime,
457 514
       },
458 515
       {
459 516
         name: "最后修改人",
460
-        value: "123",
517
+        value:  getNameFormat(detail.roomRole?.updateName,detail.roomRole?.updateId),  
461 518
       },
462 519
       {
463 520
         name: "时间",
464 521
         value: "123",
465 522
       },
466
-    ];
523
+    ]);
467 524
 
468 525
     // 委托书
469 526
     const entrustOptions = [

+ 1
- 0
vue.config.js Ver fichero

@@ -12,6 +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 16
         ws: true,
16 17
         changeOrigin: true,
17 18
         // pathRewrite: {'^/mp': ''}