zlisen před 4 roky
rodič
revize
b2f08120ea

+ 21
- 21
src/store/models/dicts.js Zobrazit soubor

4
 // 户型
4
 // 户型
5
 const roomType = [
5
 const roomType = [
6
   {
6
   {
7
-    label: '一室',
7
+    text: '一室',
8
     value: '1',
8
     value: '1',
9
   },
9
   },
10
   {
10
   {
11
-    label: '两室',
11
+    text: '两室',
12
     value: '2',
12
     value: '2',
13
   },
13
   },
14
   {
14
   {
15
-    label: '三室',
15
+    text: '三室',
16
     value: '3',
16
     value: '3',
17
   },
17
   },
18
   {
18
   {
19
-    label: '三室以上',
19
+    text: '三室以上',
20
     value: '4',
20
     value: '4',
21
   },
21
   },
22
 ]
22
 ]
24
 // 实勘状态
24
 // 实勘状态
25
 const rescStatus = [
25
 const rescStatus = [
26
   {
26
   {
27
-    label: '已实勘',
27
+    text: '已实勘',
28
     value: '0',
28
     value: '0',
29
   },
29
   },
30
   {
30
   {
31
-    label: '待审核',
31
+    text: '待审核',
32
     value: '1',
32
     value: '1',
33
   },
33
   },
34
   {
34
   {
35
-    label: '未实勘',
35
+    text: '未实勘',
36
     value: '9',
36
     value: '9',
37
   },
37
   },
38
 ]
38
 ]
40
 // 钥匙状态
40
 // 钥匙状态
41
 const keyStatus = [
41
 const keyStatus = [
42
   {
42
   {
43
-    label: '有钥匙',
43
+    text: '有钥匙',
44
     value: '0',
44
     value: '0',
45
   },
45
   },
46
   {
46
   {
47
-    label: '待审核',
47
+    text: '待审核',
48
     value: '1',
48
     value: '1',
49
   },
49
   },
50
   {
50
   {
51
-    label: '无钥匙',
51
+    text: '无钥匙',
52
     value: '9',
52
     value: '9',
53
   },
53
   },
54
 ]
54
 ]
56
 // 业主委托
56
 // 业主委托
57
 const authStatus = [
57
 const authStatus = [
58
   {
58
   {
59
-    label: '有委托',
59
+    text: '有委托',
60
     value: '0',
60
     value: '0',
61
   },
61
   },
62
   {
62
   {
63
-    label: '待审核',
63
+    text: '待审核',
64
     value: '1',
64
     value: '1',
65
   },
65
   },
66
   {
66
   {
67
-    label: '无委托',
67
+    text: '无委托',
68
     value: '9',
68
     value: '9',
69
   },
69
   },
70
 ]
70
 ]
72
 // 电梯
72
 // 电梯
73
 const elevator = [
73
 const elevator = [
74
   {
74
   {
75
-    label: '有',
75
+    text: '有',
76
     value: '0',
76
     value: '0',
77
   },
77
   },
78
   {
78
   {
79
-    label: '无',
79
+    text: '无',
80
     value: '1',
80
     value: '1',
81
   },
81
   },
82
 ]
82
 ]
84
 // 带看
84
 // 带看
85
 const lookTimes = [
85
 const lookTimes = [
86
   {
86
   {
87
-    label: '有',
87
+    text: '有',
88
     value: '1',
88
     value: '1',
89
   },
89
   },
90
   {
90
   {
91
-    label: '无',
91
+    text: '无',
92
     value: '0',
92
     value: '0',
93
   },
93
   },
94
 ]
94
 ]
96
 // 锁盘
96
 // 锁盘
97
 const lockRoom = [
97
 const lockRoom = [
98
   {
98
   {
99
-    label: '未锁盘',
99
+    text: '未锁盘',
100
     value: '0',
100
     value: '0',
101
   },
101
   },
102
   {
102
   {
103
-    label: '锁盘已关联',
103
+    text: '锁盘已关联',
104
     value: '1',
104
     value: '1',
105
   },
105
   },
106
   {
106
   {
107
-    label: '锁盘未关联',
107
+    text: '锁盘未关联',
108
     value: '2',
108
     value: '2',
109
   },
109
   },
110
 ]
110
 ]
140
       url: '/comm/dict/business-city',
140
       url: '/comm/dict/business-city',
141
       params: { areaType, pcode }
141
       params: { areaType, pcode }
142
     }).then(res => {
142
     }).then(res => {
143
-      if (1 === type) {
143
+      if (1 === areaType) {
144
         // 区县
144
         // 区县
145
         dicts['roomDistrict'] = res
145
         dicts['roomDistrict'] = res
146
       } else {
146
       } else {

+ 30
- 26
src/view/secondhand/components/secondhandscreen.vue Zobrazit soubor

9
             :title="item.title"
9
             :title="item.title"
10
             v-model="item.value"
10
             v-model="item.value"
11
             :options="item.option"
11
             :options="item.option"
12
-            @change='onChange()'
12
+            @change="onChange()"
13
           />
13
           />
14
         </van-dropdown-menu>
14
         </van-dropdown-menu>
15
       </van-col>
15
       </van-col>
21
           @click="onMore"
21
           @click="onMore"
22
       /></van-col>
22
       /></van-col>
23
     </van-row>
23
     </van-row>
24
-
25
-    
26
   </div>
24
   </div>
27
 </template>
25
 </template>
28
 
26
 
29
 <script>
27
 <script>
30
-
31
-
28
+import { computed, onMounted } from "vue";
32
 import { DropdownMenu, DropdownItem, row, col, cell } from "vant";
29
 import { DropdownMenu, DropdownItem, row, col, cell } from "vant";
33
-
30
+import { useModel } from "@zjxpcyc/vue-tiny-store";
34
 export default {
31
 export default {
35
   name: "secondhandscreen",
32
   name: "secondhandscreen",
36
   components: {
33
   components: {
92
   },
89
   },
93
   mounted() {},
90
   mounted() {},
94
 
91
 
95
-  setup(props,cex) {
92
+  setup(props, cex) {
93
+    const { dicts, getDict, getBusinessCity } = useModel("dicts");
94
+    console.log(dicts.roomType, getDict, getBusinessCity);
95
+
96
+    // const roomDistrict = dicts.roomDistrict;
96
 
97
 
97
-    const options = [
98
+    onMounted(() => {
99
+      if (!dicts.roomDistrict) {
100
+        getBusinessCity(1);
101
+      }
102
+    });
103
+
104
+    const options = computed(() => [
98
       {
105
       {
99
         id: 0,
106
         id: 0,
100
         value: 0,
107
         value: 0,
101
         title: "区域",
108
         title: "区域",
102
-        option: [],
109
+        option: (dicts.roomDistrict || []).map((x) => {
110
+          return {
111
+            text: x.label,
112
+            ...x,
113
+          };
114
+        }),
103
       },
115
       },
104
       {
116
       {
105
         id: 2,
117
         id: 2,
117
         id: 3,
129
         id: 3,
118
         value: "a",
130
         value: "a",
119
         title: "户型",
131
         title: "户型",
120
-        option: [
121
-          { text: "1室", value: "1" },
122
-          { text: "2室", value: "2" },
123
-          { text: "3室", value: "3" },
124
-          { text: "3室以上", value: "4" },
125
-        ],
132
+        option: dicts.roomType,
126
       },
133
       },
127
-    ];
134
+    ]);
128
 
135
 
129
-    const onMore=()=>{
130
-      console.log(props,cex,'3332')
131
-      cex.emit('onShowMore',333)
132
-      
133
-    }
136
+    const onMore = () => {
137
+      console.log(props, cex, "3332");
138
+      cex.emit("onShowMore", 333);
139
+    };
134
 
140
 
135
- const onChange=()=>{
136
-      console.log(props,cex,'3332')
141
+    const onChange = () => {
142
+      console.log(props, cex, "3ss332");
137
       // cex.emit('onShowMore',333)
143
       // cex.emit('onShowMore',333)
138
-      
139
-    }
144
+    };
140
     return {
145
     return {
141
-    
142
       onMore,
146
       onMore,
143
       options,
147
       options,
144
       onChange,
148
       onChange,