张延森 4 år sedan
förälder
incheckning
a0faa2501c

+ 17
- 1
src/router.js Visa fil

@@ -77,7 +77,23 @@ const routes = [
77 77
             title: '关闭房源'
78 78
         }
79 79
     },
80
-
80
+    {
81
+        path: '/followup',
82
+        name: 'followup',
83
+        component: () => import('./view/followup'),
84
+        meta: {
85
+            title: '跟进房源'
86
+        }
87
+    },
88
+    {
89
+        path: '/lookRecord',
90
+        name: 'lookRecord',
91
+        component: () => import('./view/lookRecord'),
92
+        meta: {
93
+            title: '添加空看'
94
+        }
95
+    },
96
+    
81 97
     {
82 98
         path: '/secondhand/edit',
83 99
         name: 'secondhand.edit',

+ 2
- 0
src/store/index.js Visa fil

@@ -4,6 +4,7 @@ import shiro from './models/shiro'
4 4
 import dicts from './models/dicts'
5 5
 import user from './models/user'
6 6
 import room from './models/room'
7
+import renting from './models/renting'
7 8
 
8 9
 const store = createStore({
9 10
   loading,
@@ -11,6 +12,7 @@ const store = createStore({
11 12
   dicts,
12 13
   user,
13 14
   room,
15
+  renting,
14 16
 })
15 17
 
16 18
 export default store

+ 16
- 0
src/store/models/dicts.js Visa fil

@@ -109,6 +109,21 @@ const lockRoom = [
109 109
   },
110 110
 ]
111 111
 
112
+//租房类型
113
+const leaseWay = [
114
+  {
115
+    text: '整租',
116
+    value: '0',
117
+  },
118
+  {
119
+    text: '合租',
120
+    value: '1',
121
+  },
122
+]
123
+
124
+
125
+
126
+
112 127
 
113 128
 export default () => {
114 129
   const dicts = reactive({
@@ -119,6 +134,7 @@ export default () => {
119 134
     elevator,
120 135
     lookTimes,
121 136
     lockRoom,
137
+    leaseWay,
122 138
   })
123 139
 
124 140
   const getDict = key => {

+ 114
- 0
src/view/followup/index.vue Visa fil

@@ -0,0 +1,114 @@
1
+<template>
2
+  <div class="closehouse">
3
+    <van-form @submit="onSubmit">
4
+      <van-field
5
+        v-model="state.id"
6
+        name="id"
7
+        label="房源编号"
8
+        readonly
9
+        placeholder="房源编号"
10
+      />
11
+      <van-field
12
+        v-model="state.building"
13
+        name="building"
14
+        label="所属楼盘"
15
+        readonly
16
+        placeholder="所属楼盘"
17
+       
18
+      />
19
+      <van-field
20
+        v-model="pickerState.value"
21
+        readonly
22
+        clickable
23
+        required
24
+        name="address"
25
+        label="跟进类型"
26
+        placeholder="跟进类型"
27
+        @click="pickerState.showPicker = true"
28
+        :rules="[{ required: true, message: '请选择跟进类型' }]"
29
+      />
30
+      <van-popup v-model:show="pickerState.showPicker" position="bottom">
31
+        <van-picker
32
+          :columns="columns"
33
+          @confirm="onConfirm"
34
+          @cancel="pickerState.showPicker = false"
35
+        />
36
+      </van-popup>
37
+      <!-- <van-field
38
+        v-model="state.building"
39
+        required
40
+        name="type"
41
+        label="关闭类型"
42
+        placeholder="请选择"
43
+        :rules="[{ required: true, message: '请填写密码' }]"
44
+      /> -->
45
+      <van-field
46
+        v-model="state.explain"
47
+        required
48
+        name="explain"
49
+        label="跟进描述"
50
+        placeholder="跟进描述"
51
+        rows="3"
52
+        autosize
53
+        type="textarea"
54
+        :rules="[{ required: true, message: '请填写跟进描述' }]"
55
+      />
56
+      <div style="margin: 16px;">
57
+        <van-button round block type="primary" native-type="submit">
58
+          提交
59
+        </van-button>
60
+      </div>
61
+    </van-form>
62
+  </div>
63
+</template>
64
+
65
+<script>
66
+import { reactive } from "vue";
67
+import { Form, Button, Field, Picker, Popup } from "vant";
68
+
69
+export default {
70
+  name: "closehouse",
71
+  components: {
72
+    [Form.name]: Form,
73
+    [Button.name]: Button,
74
+    [Field.name]: Field,
75
+    [Popup.name]: Popup,
76
+    [Picker.name]: Picker,
77
+    // Secondhand:secondhand,
78
+  },
79
+  data() {
80
+    return {};
81
+  },
82
+  setup() {
83
+    const state = reactive({
84
+      id: "",
85
+      building: "",
86
+    });
87
+    const onSubmit = (values) => {
88
+      console.log("submit", values);
89
+    };
90
+
91
+    const pickerState = reactive({
92
+      value: "",
93
+      showPicker: false,
94
+    });
95
+    const columns = ["杭州", "宁波", "温州", "嘉兴", "湖州"];
96
+
97
+    const onConfirm = (value) => {
98
+      pickerState.value = value;
99
+      pickerState.showPicker = false;
100
+    };
101
+
102
+    return {
103
+      state,
104
+      pickerState,
105
+      columns,
106
+      onConfirm,
107
+      onSubmit,
108
+    };
109
+  },
110
+};
111
+</script>
112
+
113
+<!-- Add "scoped" attribute to limit CSS to this component only -->
114
+<style lang="less" scoped></style>

+ 127
- 0
src/view/lookRecord/index.vue Visa fil

@@ -0,0 +1,127 @@
1
+<template>
2
+  <div class="lookrecord">
3
+    <van-form @submit="onSubmit">
4
+      <van-field
5
+        v-model="state.id"
6
+        name="id"
7
+        label="房源编号"
8
+        readonly
9
+        placeholder="房源编号"
10
+      />
11
+      <van-field
12
+        v-model="state.building"
13
+        name="building"
14
+        label="所属楼盘"
15
+        readonly
16
+        placeholder="所属楼盘"
17
+      />
18
+      <van-field
19
+        v-model="pickerState.value"
20
+        readonly
21
+        clickable
22
+        required
23
+        name="address"
24
+        label="看房时间"
25
+        placeholder=""
26
+        @click="pickerState.showPicker = true"
27
+        :rules="[{ required: true, message: '请选择' }]"
28
+      />
29
+      <van-popup v-model:show="pickerState.showPicker" position="bottom">
30
+        <van-datetime-picker
31
+          type="datetime"
32
+          @confirm="onConfirm"
33
+          @cancel="state.showPicker = false"
34
+        />
35
+      </van-popup>
36
+      <!-- <van-field
37
+        v-model="state.building"
38
+        required
39
+        name="type"
40
+        label="关闭类型"
41
+        placeholder="请选择"
42
+        :rules="[{ required: true, message: '请填写密码' }]"
43
+      /> -->
44
+      <van-field
45
+        v-model="state.explain"
46
+        required
47
+        name="explain"
48
+        label="看房记录"
49
+        placeholder="看房记录"
50
+        rows="3"
51
+        autosize
52
+        type="textarea"
53
+        :rules="[{ required: true, message: '请填写跟进描述' }]"
54
+      />
55
+
56
+      <van-field name="uploader" label="文件上传">
57
+  <template #input>
58
+    <van-uploader v-model="state.image" />
59
+  </template>
60
+</van-field>
61
+      <div style="margin: 16px;">
62
+        <van-button round block type="primary" native-type="submit">
63
+          提交
64
+        </van-button>
65
+      </div>
66
+    </van-form>
67
+  </div>
68
+</template>
69
+
70
+<script>
71
+import { reactive, ref } from "vue";
72
+import { Form, Button, Field, Picker, Popup, DatetimePicker,Uploader } from "vant";
73
+
74
+export default {
75
+  name: "lookrecord",
76
+  components: {
77
+    [Form.name]: Form,
78
+    [Button.name]: Button,
79
+    [Field.name]: Field,
80
+    [Popup.name]: Popup,
81
+    [Picker.name]: Picker,
82
+    [DatetimePicker.name]: DatetimePicker,
83
+    [Uploader.name]: Uploader,
84
+    
85
+    // Secondhand:secondhand,
86
+  },
87
+  data() {
88
+    return {};
89
+  },
90
+  setup() {
91
+    const state = reactive({
92
+      id: "",
93
+      building: "",
94
+      image:[],
95
+    });
96
+
97
+    const currentDate = ref(null);
98
+    const onSubmit = (values) => {
99
+      console.log("submit", values);
100
+    };
101
+
102
+    const pickerState = reactive({
103
+      value: "",
104
+      showPicker: false,
105
+    });
106
+    const columns = ["杭州", "宁波", "温州", "嘉兴", "湖州"];
107
+
108
+    const onConfirm = (value) => {
109
+      console.log(value,'value')
110
+      pickerState.value = value;
111
+      pickerState.showPicker = false;
112
+    };
113
+
114
+    return {
115
+      currentDate,
116
+      state,
117
+      pickerState,
118
+      columns,
119
+      onConfirm,
120
+      onSubmit,
121
+    };
122
+  },
123
+};
124
+</script>
125
+
126
+<!-- Add "scoped" attribute to limit CSS to this component only -->
127
+<style lang="less" scoped></style>

+ 199
- 36
src/view/renting/components/rentingcard/index.vue Visa fil

@@ -1,32 +1,159 @@
1 1
 <template>
2 2
   <div class="secondhandcard">
3
-    <div class="card" >
3
+    <div class="card">
4 4
       <div class="card-left">
5 5
         <van-image
6 6
           width="120"
7 7
           height="96"
8
-          src="https://img.yzcdn.cn/vant/cat.jpeg"
8
+          :src="data.imgUrl || 'https://img.yzcdn.cn/vant/empty-image-default.png'"
9 9
         />
10 10
       </div>
11 11
       <div class="card-right">
12 12
         <p class="card-right-1">
13
-          <span style="font-size:16px;color:#101010;font-weight:500"
14
-            >楼盘名称</span
15
-          ><span style="font-size:12px;color:#AEAEAE;">在租</span>
13
+          <span style="font-size:16px;color:#101010;font-weight:500">{{
14
+            data.title
15
+          }}</span
16
+          ><span style="font-size:12px;color:#AEAEAE;min-width: 25px;">{{
17
+            data.rentingStatus
18
+          }}</span>
16 19
         </p>
17
-        <p class="card-right-2">三室一厅 107.1㎡ 6/6层 南北</p>
18
-        <p class="card-right-2">录入时间:</p>
19
-        <p class="card-right-2">录入人</p>
20
-        <!-- <p class="card-right-2">维护人</p> -->
21
-        <div class="card-right-end" style="margin-top:6px">
22
-          <van-tag class="card-right-end-tag" type="primary">标签</van-tag>
23
-          <van-tag class="card-right-end-tag" type="primary">标签</van-tag>
24
-          <van-tag class="card-right-end-tag" type="primary">标签</van-tag>
20
+        <p class="card-right-2">
21
+          {{ (data.roomType || [])[0] || 0 }}室{{
22
+            data.roomType[1] || [] || 0
23
+          }}厅 {{ data.acreage || 0 }}㎡ {{ data.roomFloor[0] || [] || 0 }}/{{
24
+            data.roomFloor[0] || [] || 0
25
+          }}层 {{ data.aspect }}
26
+        </p>
27
+        <p class="card-right-2">录入时间:{{ data.recordTime }}</p>
28
+        <p class="card-right-2">录入人:{{ data.recordName }}</p>
29
+        <!-- <p class="card-right-2">维护人:{{ data.belongName }}</p> -->
30
+        <div class="card-right-end">
31
+          <van-tag
32
+            v-show="datas.metroNear == '1'"
33
+            class="card-right-end-tag  labelItem0"
34
+            type="primary"
35
+            >铁</van-tag
36
+          >
37
+          <van-tag
38
+            v-show="datas.schoolNear == '1'"
39
+            class="card-right-end-tag  labelItem1"
40
+            type="primary"
41
+            >学</van-tag
42
+          >
43
+          <van-tag
44
+            v-show="datas.keyStatus == '0'"
45
+            class="card-right-end-tag  labelItem2"
46
+            type="primary"
47
+            >钥</van-tag
48
+          >
49
+          <van-tag
50
+            v-show="datas.rescStatus == '0'"
51
+            class="card-right-end-tag  labelItem0"
52
+            type="primary"
53
+            >勘</van-tag
54
+          >
55
+          <van-tag
56
+            v-show="datas.authStatus == '0'"
57
+            class="card-right-end-tag  labelItem1"
58
+            type="primary"
59
+            >委</van-tag
60
+          >
61
+          <van-tag
62
+            v-show="datas.buildTime == '4'"
63
+            class="card-right-end-tag  labelItem2"
64
+            type="primary"
65
+            >满五减一</van-tag
66
+          >
67
+          <van-tag
68
+            v-show="datas.buildTime == '3'"
69
+            class="card-right-end-tag  labelItem2"
70
+            type="primary"
71
+            >满五</van-tag
72
+          >
73
+          <van-tag
74
+            v-show="datas.buildTime == '2'"
75
+            class="card-right-end-tag  labelItem2"
76
+            type="primary"
77
+            >满二</van-tag
78
+          >
79
+          <van-tag
80
+            v-show="datas.status == '7'"
81
+            class="card-right-end-tag  labelItem2"
82
+            type="primary"
83
+            >锁</van-tag
84
+          >
85
+          <van-tag
86
+            v-show="datas.souFangHouseId != null && datas.souFangHouseId != ''"
87
+            class="card-right-end-tag labelItem0"
88
+            type="primary"
89
+            >关</van-tag
90
+          >
91
+          <van-tag
92
+            v-show="data.status == '7'"
93
+            class="card-right-end-tag"
94
+            type="primary"
95
+          >
96
+            <img
97
+              src="~@/assets/favicon.png"
98
+              style="height:16px"
99
+              alt=""
100
+              srcset=""
101
+            />
102
+          </van-tag>
103
+          <van-tag
104
+            v-show="
105
+              datas.fiveEightHouseId != null && datas.fiveEightHouseId != ''
106
+            "
107
+            class="card-right-end-tag"
108
+            type="primary"
109
+          >
110
+            <img src="~@/assets/58.png" style="height:16px" alt="" srcset="" />
111
+          </van-tag>
112
+          <van-tag
113
+            v-show="
114
+              datas.threeSixFiveHouseId != null &&
115
+                datas.threeSixFiveHouseId != ''
116
+            "
117
+            class="card-right-end-tag"
118
+            type="primary"
119
+          >
120
+            <img src="~@/assets/365.png" style="height:16px" alt="" srcset="" />
121
+          </van-tag>
122
+          <van-tag
123
+            v-show="datas.toutiaoHouseId != null && datas.toutiaoHouseId != ''"
124
+            class="card-right-end-tag"
125
+            type="primary"
126
+          >
127
+            <img
128
+              src="~@/assets/toutiao.png"
129
+              style="height:16px"
130
+              alt=""
131
+              srcset=""
132
+            />
133
+          </van-tag>
134
+          <van-tag
135
+            v-show="datas.protectionFlag == '1'"
136
+            class="card-right-end-tag labelItem0"
137
+            type="primary"
138
+            >保</van-tag
139
+          >
140
+          <van-tag
141
+            v-show="datas.collectFlag == '1'"
142
+            class="card-right-end-tag"
143
+            type="primary"
144
+          >
145
+            <img
146
+              src="~@/assets/collect.png"
147
+              style="height:16px"
148
+              alt=""
149
+              srcset=""
150
+            />
151
+          </van-tag>
25 152
         </div>
26 153
 
27 154
         <div class="card-right-price">
28
-          <p>1233万元</p>
29
-          <p>整租</p>
155
+          <p>{{ data.totalPrice }}元/月</p>
156
+          <p>{{ data.leaseWay=='0'?'整租':"合租" }}</p>
30 157
         </div>
31 158
       </div>
32 159
     </div>
@@ -44,23 +171,43 @@ export default {
44 171
     [Tag.name]: Tag,
45 172
   },
46 173
   props: {
47
-    datas: {},
48
-  },
49
-  data() {
50
-    return {};
174
+    datas: {
175
+      type: Object,
176
+      default: () => {},
177
+    },
51 178
   },
52
-  mounted() {},
53 179
 
54
-  setup() {
180
+  setup(props) {
181
+    
182
+    const data = {
183
+      title: props.datas.estateName, //标题
184
+      roomType: props.datas.roomType.split(","), //户型
185
+      acreage: Number(props.datas.acreage || 0).toFixed(2), //面积
186
+      roomFloor: props.datas.roomFloor.split(","), //楼层
187
+      aspect: props.datas.aspect, //方向
188
+      recordTime: props.datas.recordTime, //录入时间
189
+      recordName: props.datas.recordName, //录入人
190
+      belongName: props.datas.belongName, //维护人
191
+      rentingStatus: props.datas.rentingStatus, //状态
192
+      totalPrice: props.datas.totalPrice, //总价
193
+      unitPrice: Number(
194
+        (props.datas.totalPrice * 10000) / props.datas.acreage || 0
195
+      ).toFixed(2),
196
+      leaseWay:props.datas.leaseWay,
197
+    };
198
+
199
+    // const tag = ()=>{
55 200
 
201
+    // }
56 202
 
57
-   const toDetail = ()=>{
58
-console.log('222')
59
-   }
203
+    const toDetail = () => {
204
+      console.log("222");
205
+    };
60 206
 
61
-   return {
62
-     toDetail,
63
-   }
207
+    return {
208
+      data,
209
+      toDetail,
210
+    };
64 211
   },
65 212
 };
66 213
 </script>
@@ -70,7 +217,7 @@ console.log('222')
70 217
 .card {
71 218
   //   height: 200px;
72 219
 
73
-border-bottom:1px solid #DCDCDC;
220
+  border-bottom: 1px solid #dcdcdc;
74 221
 
75 222
   display: flex;
76 223
   padding: 10px;
@@ -78,6 +225,7 @@ border-bottom:1px solid #DCDCDC;
78 225
   &-left {
79 226
     width: 130px;
80 227
     padding: 5px;
228
+    margin: auto;
81 229
   }
82 230
   &-right {
83 231
     flex: 1;
@@ -100,15 +248,30 @@ border-bottom:1px solid #DCDCDC;
100 248
         margin-right: 3px;
101 249
       }
102 250
     }
103
-    &-price{
104
-        position: absolute;
105
-        bottom: 0;
106
-        right: 0;
107
-        color: #ff9800;
108
-        p{
109
-            margin: 0;
110
-        }
251
+    &-price {
252
+      position: absolute;
253
+      bottom: 0;
254
+      right: 0;
255
+      color: #ff9800;
256
+      p {
257
+        margin: 0;
258
+      }
111 259
     }
112 260
   }
261
+
262
+  .labelItem0 {
263
+    background-color: rgba(89, 171, 253, 0.15);
264
+    color: rgb(89, 171, 253);
265
+  }
266
+
267
+  .labelItem1 {
268
+    background-color: rgba(242, 161, 47, 0.15);
269
+    color: rgb(242, 161, 47);
270
+  }
271
+
272
+  .labelItem2 {
273
+    background-color: rgba(51, 190, 133, 0.15);
274
+    color: rgb(51, 190, 133);
275
+  }
113 276
 }
114 277
 </style>

+ 282
- 91
src/view/renting/components/rentingmorescreen/index.vue Visa fil

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="secondhandmorescreen">
3 3
     <van-search
4
-      v-model="serchValue"
4
+      v-model="searchValue"
5 5
       placeholder="请输入搜索关键词"
6 6
       :actions="searchActions"
7 7
       @select="onSearchSelect"
@@ -18,48 +18,109 @@
18 18
         </van-popover>
19 19
       </template>
20 20
       <template #left>
21
-        <van-icon name="revoke" style="margin-right: 20px;" />
21
+        <van-icon name="revoke" @click="onBack" style="margin-right: 20px;" />
22 22
       </template>
23 23
     </van-search>
24 24
 
25 25
     <div>
26 26
       <van-form @submit="onSubmit">
27 27
         <van-cell-group title="区位">
28
-          <AreaQuery name="area.b" label=""></AreaQuery>
28
+        <van-row :gutter="12">
29
+          <van-col span="12">
30
+            <van-field label="区县">
31
+              <template #input>
32
+                <Picker
33
+                  placeholder="选择区县"
34
+                  :options="roomDistrictOptions"
35
+                  v-model="formData.roomDistrict"
36
+                />
37
+              </template>
38
+            </van-field>
39
+          </van-col>
40
+          <van-col span="12">
41
+            <van-field label="商圈">
42
+              <template #input>
43
+                <Picker
44
+                  placeholder="选择商圈"
45
+                  :options="roomBussinesOptions"
46
+                  v-model="formData.roomBussines"
47
+                />
48
+              </template>
49
+            </van-field>
50
+          </van-col>
51
+        </van-row>
29 52
         </van-cell-group>
30 53
         <van-cell-group title="房间要求">
31
-          <van-field name="number">
54
+          <van-field label="楼层" ex>
32 55
             <template #input>
33
-              <DemandQuery></DemandQuery>
56
+              <NumberRange v-model="roomFloors" />
57
+            </template>
58
+          </van-field>
59
+          <van-field label="面积">
60
+            <template #input>
61
+              <NumberRange v-model="roomSQ" />
62
+            </template>
63
+            <template #extra>㎡</template>
64
+          </van-field>
65
+          <van-field label="租金">
66
+            <template #input>
67
+              <NumberRange v-model="roomPrices" />
68
+            </template>
69
+            <template #extra>元</template>
70
+          </van-field>
71
+          <van-field label="户型">
72
+            <template #input>
73
+              <Picker
74
+                placeholder="请选择户型"
75
+                :options="roomTypeOptions"
76
+                v-model="formData.roomType"
77
+              />
78
+            </template>
79
+          </van-field>
80
+          <!-- <van-field label="装修">
81
+            <template #input>
82
+              <Picker
83
+                placeholder="请选择装修类型"
84
+                :options="decorationOptions"
85
+                v-model="formData.decoration"
86
+              />
87
+            </template>
88
+          </van-field> -->
89
+          <van-field label="房源状态">
90
+            <template #input>
91
+              <Picker
92
+                placeholder="请选择房源状态"
93
+                :options="rentingStatusOptions"
94
+                v-model="formData.operateType"
95
+              />
96
+            </template>
97
+          </van-field>
98
+          <van-field label="租房类型">
99
+            <template #input>
100
+              <Picker
101
+                placeholder="请选择实勘状态"
102
+                :options="leaseWayOptions"
103
+                v-model="formData.leaseWay"
104
+              />
34 105
             </template>
35 106
           </van-field>
36
-        </van-cell-group>
37
-        <van-cell-group title="户型">
38
-          <CheeckButtomQuery
39
-            v-model="state.housetype"
40
-            :options="housetypeoptions"
41
-          ></CheeckButtomQuery>
42
-        </van-cell-group>
43
-        <van-cell-group title="装修">
44
-          <CheeckButtomQuery
45
-            v-model="state.renovation"
46
-            :options="housetypeoptions"
47
-          ></CheeckButtomQuery>
48
-        </van-cell-group>
49
-        <van-cell-group title="房源状态">
50
-          <CheeckButtomQuery
51
-            v-model="state.housetype"
52
-            :options="housetypeoptions"
53
-          ></CheeckButtomQuery>
54
-        </van-cell-group>
55
-        <van-cell-group title="实勘状态">
56
-          <CheeckButtomQuery
57
-            v-model="state.housetype"
58
-            :options="housetypeoptions"
59
-          ></CheeckButtomQuery>
60 107
         </van-cell-group>
61 108
         <van-cell-group title="房间位置">
62
-          <PositionQuery></PositionQuery>
109
+          <van-row :gutter="12">
110
+            <van-col span="12">
111
+              <van-field label="楼栋" v-model="formData.roomBuild" placeholder="请输入" />
112
+            </van-col>
113
+            <van-col span="12">
114
+              <van-field label="单元" v-model="formData.roomUnit" placeholder="请输入" />
115
+            </van-col>
116
+          </van-row>
117
+          <van-row :gutter="12">
118
+            <van-col span="12">
119
+              <van-field label="房号" v-model="formData.roomFloor" placeholder="请输入" />
120
+            </van-col>
121
+            <van-col span="12">
122
+            </van-col>
123
+          </van-row>
63 124
         </van-cell-group>
64 125
 
65 126
         <div style="margin-top: 16px;">
@@ -67,7 +128,7 @@
67 128
             <van-action-bar-icon
68 129
               icon="replay"
69 130
               text="重置"
70
-              @click="onClickIcon"
131
+              @click="handleReset"
71 132
             />
72 133
 
73 134
             <van-action-bar-button
@@ -76,18 +137,6 @@
76 137
               native-type="submit"
77 138
             />
78 139
           </van-action-bar>
79
-          <!-- <van-row justify="center">
80
-            <van-col span="6">
81
-              <van-button block icon="replay" type="primary"
82
-                >重置</van-button
83
-              ></van-col
84
-            >
85
-            <van-col span="18">
86
-              <van-button round block type="primary" native-type="submit"
87
-                >确定</van-button
88
-              ></van-col
89
-            >
90
-          </van-row> -->
91 140
         </div>
92 141
       </van-form>
93 142
     </div>
@@ -98,7 +147,7 @@
98 147
 </template>
99 148
 
100 149
 <script>
101
-import { reactive, ref } from "vue";
150
+import { computed, reactive, ref, watch } from "vue";
102 151
 import {
103 152
   Col,
104 153
   Row,
@@ -116,12 +165,10 @@ import {
116 165
   Icon,
117 166
   Popover,
118 167
 } from "vant";
119
-import {
120
-  AreaQuery,
121
-  DemandQuery,
122
-  CheeckButtomQuery,
123
-  PositionQuery,
124
-} from "../../../../components/queryCompents";
168
+import { useModel } from '@zjxpcyc/vue-tiny-store'
169
+
170
+import Picker from "@/components/Picker";
171
+import NumberRange from "@/components/NumberRange";
125 172
 
126 173
 export default {
127 174
   name: "secondhandmorescreen",
@@ -141,11 +188,8 @@ export default {
141 188
     [ActionBarButton.name]: ActionBarButton,
142 189
     [Icon.name]: Icon,
143 190
     [Popover.name]: Popover,
144
-
145
-    AreaQuery,
146
-    DemandQuery,
147
-    CheeckButtomQuery,
148
-    PositionQuery,
191
+    Picker,
192
+    NumberRange,
149 193
   },
150 194
   props: {
151 195
     // options: [],
@@ -153,16 +197,150 @@ export default {
153 197
   data() {
154 198
     return {};
155 199
   },
200
+  emits:["back", 'search'],
201
+  setup(props,{emit}) {
202
+    const formData = reactive({
203
+      // 楼盘
204
+      estateName: undefined,
205
+      // 房源
206
+      roomCodeId: undefined,
207
+      // 业主电话
208
+      ownerTel: undefined,
209
+      // 区县
210
+      roomDistrict: undefined,
211
+      // 商圈
212
+      roomBussines: undefined,
213
+      // 楼层1
214
+      floorMin: undefined,
215
+      // 楼层2
216
+      floorMax: undefined,
217
+      // 面积1
218
+      sqMin: undefined,
219
+      // 面积2
220
+      sqMax: undefined,
221
+      // 总价1 -- 注意单词拼写
222
+      pirceMin: undefined,
223
+      // 总价2 -- 注意单词拼写
224
+      priceMax: undefined,
225
+      // 户型
226
+      roomType: undefined,
227
+      // 装修
228
+      // decoration: undefined,
229
+      // 房源状态
230
+      operateType: undefined,
231
+      // 租房类型
232
+      leaseWay:undefined,
233
+      // 实勘状态
234
+      // rescStatus: undefined,
235
+      // 楼栋
236
+      roomBuild: undefined,
237
+      // 单元
238
+      roomUnit: undefined,
239
+      // 房号
240
+      roomFloor: undefined,
241
+    })
242
+
243
+    const { dicts, getBusinessCity, getDict } = useModel('dicts')
244
+    // 区县
245
+    const roomDistrictOptions = computed(() => {
246
+      const roomDistrictDict = dicts.roomDistrict
247
+      if (!roomDistrictDict) {
248
+        getBusinessCity(1)
249
+      }
250
+      return (roomDistrictDict || []).map(x => ({...x, text: x.label}))
251
+    })
252
+    // 商圈 - 依据区县联动
253
+    const roomBussinesOptions = computed(() => {
254
+      if (!formData.roomDistrict) {
255
+        return []
256
+      }
257
+
258
+      const roomBussinesDict = dicts.roomBussines
259
+      return (roomBussinesDict || []).map(x => ({...x, text: x.label}))
260
+    })
261
+    
262
+    watch(
263
+      () => formData.roomDistrict,
264
+      (nw) => {
265
+        dicts.roomBussines = []
266
+        formData.roomBussines = undefined
267
+        getBusinessCity(2, nw)
268
+      }
269
+    )
270
+
271
+    // 楼层
272
+    const roomFloors = computed({
273
+      get: () => [formData.floorMin, formData.floorMax],
274
+      set: (nw) => {
275
+        formData.floorMin = nw[0]
276
+        formData.floorMax = nw[1]
277
+      }
278
+    })
279
+
280
+    // 面积
281
+    const roomSQ = computed({
282
+      get: () => [formData.sqMin, formData.sqMax],
283
+      set: (nw) => {
284
+        formData.sqMin = nw[0]
285
+        formData.sqMax = nw[1]
286
+      }
287
+    })
288
+
289
+    // 总价
290
+    const roomPrices = computed({
291
+      get: () => [formData.pirceMin, formData.priceMax],
292
+      set: (nw) => {
293
+        formData.pirceMin = nw[0]
294
+        formData.priceMax = nw[1]
295
+      }
296
+    })
297
+
298
+    // 户型
299
+    const roomTypeOptions = computed(() => {
300
+      return dicts.roomType
301
+    })
302
+
303
+// 租房类型
304
+    const leaseWayOptions = computed(() => {
305
+      return dicts.leaseWay
306
+    })
307
+
308
+    
309
+
310
+    // 装修
311
+    const decorationOptions = computed(() => {
312
+      const decorationDict = dicts.decoration || []
313
+      if (!decorationDict.length) {
314
+        getDict('decoration')
315
+      }
156 316
 
157
-  setup() {
317
+      return decorationDict
318
+    })
319
+
320
+    // 房源状态
321
+    const rentingStatusOptions = computed(() => {
322
+      const rentingStatusDict = dicts.rentingStatus || []
323
+      if (!rentingStatusDict.length) {
324
+        getDict('rentingStatus')
325
+      }
326
+
327
+      return rentingStatusDict
328
+    })
329
+
330
+    // 实勘状态
331
+    const rescStatusOptions = computed(() => {
332
+      return dicts.rescStatus
333
+    })
334
+    
158 335
     const state = reactive({
159 336
       housetype: [],
160 337
       renovation: [],
161 338
     });
162
-    const serchValue = ref("");
339
+
340
+    const searchValue = ref("");
163 341
     const searchType = ref("楼盘");
164 342
     const showPopover = ref(false);
165
-     const phoneShow = ref(false);
343
+    const phoneShow = ref(false);
166 344
 
167 345
     // 通过 actions 属性来定义菜单选项
168 346
     const searchActions = [
@@ -170,55 +348,64 @@ export default {
170 348
       { text: "房源", value: "2" },
171 349
       { text: "业主电话", value: "3" },
172 350
     ];
173
-    const onSearchSelect = (action) => {
174
-      console.log("housetypeChange", action);
175 351
 
352
+    const onSearchSelect = (action) => {
176 353
       searchType.value = action.text;
354
+      searchValue.value = undefined
355
+      formData.estateName = undefined
356
+      formData.roomCodeId = undefined
357
+      formData.ownerTel = undefined
177 358
     };
178 359
 
179
-    const onHousetypeChange = (values) => {
180
-      console.log("housetypeChange", values);
360
+    watch(searchValue, (nw) => {
361
+      switch(searchType.value) {
362
+        case '楼盘':
363
+          formData.estateName = nw
364
+          break
365
+        case '房源':
366
+          formData.roomCodeId = nw
367
+          break
368
+        default:
369
+          formData.ownerTel = nw
370
+      }
371
+    })
181 372
 
182
-      state.housetype = values;
183
-    };
184
-    const onSubmit = (values) => {
185
-      console.log(state, "submit", values);
373
+    const onSubmit = () => {
374
+      emit('search', formData)
186 375
     };
187 376
 
188
-    const housetypeoptions = [
189
-      {
190
-        title: "1室",
191
-        value: "a",
192
-      },
193
-      {
194
-        title: "2室",
195
-        value: "b",
196
-      },
197
-      {
198
-        title: "3室",
199
-        value: "c",
200
-      },
201
-      {
202
-        title: "3室及以上",
203
-        value: "d",
204
-      },
205
-      {
206
-        title: "全部",
207
-        value: "all",
208
-      },
209
-    ];
377
+   const onBack = ()=>{
378
+     emit("back");
379
+   }
380
+
381
+   const handleReset = () => {
382
+     Object.keys(formData).forEach(k => {
383
+       formData[k] = undefined
384
+     })
385
+   }
210 386
 
211 387
     return {
388
+      formData,
389
+      roomDistrictOptions,
390
+      roomBussinesOptions,
391
+      roomFloors,
392
+      roomSQ,
393
+      roomPrices,
394
+      roomTypeOptions,
395
+      decorationOptions,
396
+      rentingStatusOptions,
397
+      rescStatusOptions,
398
+      leaseWayOptions,
212 399
       phoneShow,
213
-      serchValue,
400
+      searchValue,
214 401
       searchType,
215 402
       state,
216 403
       onSubmit,
217
-      housetypeoptions,
218
-      onHousetypeChange,
219 404
       showPopover,
220 405
       searchActions,
221 406
       onSearchSelect,
407
+      onBack,
408
+      handleReset,
222 409
     };
223 410
   },
224 411
 };
@@ -230,4 +417,8 @@ export default {
230 417
   text-align: left;
231 418
   background-color: #f4f4f4;
232 419
 }
420
+
421
+:deep(.van-field__label) {
422
+  width: 4.8em;
423
+}
233 424
 </style>

+ 70
- 18
src/view/renting/components/rentingscreen.vue Visa fil

@@ -7,8 +7,9 @@
7 7
             v-for="item in options"
8 8
             :key="item.id"
9 9
             :title="item.title"
10
-            v-model="item.value"
10
+            v-model="state[item.value]"
11 11
             :options="item.option"
12
+            @change="(e) => onChange(e)"
12 13
           />
13 14
         </van-dropdown-menu>
14 15
       </van-col>
@@ -20,18 +21,15 @@
20 21
           @click="onMore"
21 22
       /></van-col>
22 23
     </van-row>
23
-
24
-    
25 24
   </div>
26 25
 </template>
27 26
 
28 27
 <script>
29
-
30
-
28
+import { computed, onMounted, reactive } from "vue";
31 29
 import { DropdownMenu, DropdownItem, row, col, cell } from "vant";
32
-
30
+import { useModel } from "@zjxpcyc/vue-tiny-store";
33 31
 export default {
34
-  name: "secondhandscreen",
32
+  name: "rentingscreen",
35 33
   components: {
36 34
     [cell.name]: cell,
37 35
     // [popup.name]: popup,
@@ -41,7 +39,7 @@ export default {
41 39
     [DropdownItem.name]: DropdownItem,
42 40
   },
43 41
   props: {
44
-    options: [],
42
+    // options: [],
45 43
   },
46 44
   data() {
47 45
     return {
@@ -91,21 +89,75 @@ export default {
91 89
   },
92 90
   mounted() {},
93 91
 
94
-  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;
97
+    const state = reactive({
98
+      districtCode: null,
99
+      price: null,
100
+      roomType: null,
101
+      pirceMin: null,
102
+      priceMax: null,
103
+    });
104
+    onMounted(() => {
105
+      if (!dicts.roomDistrict) {
106
+        getBusinessCity(1);
107
+      }
108
+    });
95 109
 
96
-    const onMore=()=>{
97
-      console.log(props,cex,'3332')
98
-      cex.emit('onShowMore',333)
99
-      
100
-    }
110
+    const options = computed(() => [
111
+      {
112
+        id: 0,
113
+        value: "districtCode",
114
+        title: "区域",
115
+        option: (dicts.roomDistrict || []).map((x) => {
116
+          return {
117
+            text: x.label,
118
+            ...x,
119
+          };
120
+        }),
121
+      },
122
+      {
123
+        id: 2,
124
+        value: "price",
125
+        title: "价格",
126
+        option: [
127
+          { text: "0-1000", value: "0-1000" },
128
+          { text: "1001-2000", value: "1001-2000" },
129
+          { text: "2001-3000", value: "2001-3000" },
130
+          { text: "3001-4000", value: "3001-4000" },
131
+          { text: "4000以上", value: "4000" },
132
+        ],
133
+      },
134
+      {
135
+        id: 3,
136
+        value: "roomType",
137
+        title: "户型",
138
+        option: dicts.roomType,
139
+      },
140
+    ]);
101 141
 
142
+    const onMore = () => {
143
+      console.log(props, cex, "3332");
144
+      cex.emit("onShowMore", 333);
145
+    };
102 146
 
147
+    const onChange = (e) => {
148
+      console.log(state, e, "3ss332333");
149
+      if (state.price) {
150
+        const price = state.price.split("-");
151
+        state.pirceMin = Number(price[0]);
152
+        state.priceMax = Number(price[1]);
153
+      }
154
+      cex.emit("onChange", state);
155
+    };
103 156
     return {
104
-    
105 157
       onMore,
106
-      // options,
107
-      // onConfirm,
108
-      props
158
+      options,
159
+      onChange,
160
+      state,
109 161
     };
110 162
   },
111 163
 };

+ 61
- 87
src/view/renting/index.vue Visa fil

@@ -1,19 +1,25 @@
1 1
 <template>
2 2
   <div class="renting">
3
-    <RentingScreen :options="options" @onShowMore="onShowMore" />
4
-    <div >
3
+    <RentingScreen @onChange="(e) => onSearch(e)" @onShowMore="onShowMore" />
4
+    <div>
5
+      <van-progress
6
+        color="#d75e3a"
7
+        :show-pivot="false"
8
+        :stroke-width="1"
9
+        :percentage="percent"
10
+      />
5 11
       <van-list
6 12
         class="renting-main"
7
-        v-model:loading="state.loading"
8
-        :finished="state.finished"
13
+        v-model:loading="loading"
14
+        :finished="finished"
9 15
         finished-text="没有更多了"
10 16
         @load="onLoad"
11 17
       >
12 18
         <RentingCard
13
-          v-for="item in state.list"
19
+          v-for="item in list"
14 20
           :key="item.id"
15
-          :datas="item.datas"
16
-          @click="toDetail()"
21
+          :datas="item"
22
+          @click="toDetail(item)"
17 23
         ></RentingCard>
18 24
       </van-list>
19 25
     </div>
@@ -21,19 +27,20 @@
21 27
       v-model:show="moreShow"
22 28
       position="right"
23 29
       :style="{ width: '100%', height: '100%' }"
24
-    ><RentingMoreScreen />
30
+      ><RentingMoreScreen @back="moreShow = false" @search="handleMoreSearch" />
25 31
     </van-popup>
26 32
   </div>
27 33
 </template>
28 34
 
29 35
 <script>
30 36
 // import Vue from 'vue';
31
-import { DropdownMenu, DropdownItem, List, Popup } from "vant";
37
+import { useModel } from "@zjxpcyc/vue-tiny-store";
38
+import { DropdownMenu, DropdownItem, List, Popup, Progress } from "vant";
32 39
 import rentingscreen from "./components/rentingscreen";
33 40
 import rentingmorescreen from "./components/rentingmorescreen";
34 41
 import rentingcard from "./components/rentingcard";
35
-import { reactive, ref } from "vue";
36
-import {router} from '../../router'
42
+import { computed, ref } from "vue";
43
+import { router } from "../../router";
37 44
 
38 45
 export default {
39 46
   name: "renting",
@@ -42,106 +49,73 @@ export default {
42 49
     [DropdownItem.name]: DropdownItem,
43 50
     [List.name]: List,
44 51
     [Popup.name]: Popup,
52
+    [Progress.name]: Progress,
45 53
     RentingScreen: rentingscreen,
46 54
     RentingCard: rentingcard,
47 55
     RentingMoreScreen: rentingmorescreen,
48 56
   },
49 57
   data() {
50
-    return {
51
-      options: [
52
-        {
53
-          id: 0,
54
-          value: 0,
55
-          title: "区域",
56
-          option: [],
57
-        },
58
-        {
59
-          id: 2,
60
-          value: "a",
61
-          title: "价格",
62
-          option: [
63
-            { text: "0-100", value: "a" },
64
-            { text: "101-200", value: "b" },
65
-            { text: "201-300", value: "c" },
66
-            { text: "301-400", value: "e" },
67
-            { text: "400以上", value: "f" },
68
-          ],
69
-        },
70
-        {
71
-          id: 3,
72
-          value: "a",
73
-          title: "户型",
74
-          mode: "multiple",
75
-          option: [
76
-            { text: "1室", value: "1" },
77
-            { text: "2室", value: "2" },
78
-            { text: "3室", value: "3" },
79
-            { text: "3室以上", value: "4" },
80
-          ],
81
-        },
82
-        // {
83
-        //   id: 4,
84
-        //   value: "a",
85
-        //   title: "更多",
86
-        //   mode: "multiple",
87
-        //   option: [
88
-        //     { text: "默认排序", value: "a" },
89
-        //     { text: "好评排序", value: "b" },
90
-        //     { text: "销量排序", value: "c" },
91
-        //   ],
92
-        // },
93
-      ],
94
-    };
58
+    return {};
95 59
   },
96 60
 
97
-  setup(props) {
61
+  setup() {
98 62
     const moreShow = ref(false);
99 63
 
64
+    const { list, loading, page, getList } = useModel("renting");
65
+    const rentParams = ref({});
66
+
67
+    const finished = computed(() => page.pageNo && page.pageNo === page.endRow);
68
+    const percent = computed(() =>
69
+      page.pageNo ? (page.pageNo * 100) / page.endRow : 100
70
+    );
71
+
100 72
     const onShowMore = () => {
101
-      console.log("22");
102 73
       moreShow.value = true;
103
-      console.log(moreShow, "22");
104 74
     };
105
-    const state = reactive({
106
-      list: [],
107
-      loading: false,
108
-      finished: false,
109
-    });
110 75
 
111 76
     const onLoad = () => {
112
-      // 异步更新数据
113
-      // setTimeout 仅做示例,真实场景中一般为 ajax 请求
114
-      setTimeout(() => {
115
-        for (let i = 0; i < 10; i++) {
116
-          state.list.push({
117
-            id: state.list.length + 1,
118
-            datas: {
119
-              name: "",
120
-            },
121
-          });
122
-        }
77
+      getList({
78
+        pageNo: page.pageNo + 1,
79
+        ...rentParams.value,
80
+      });
81
+    };
82
+
83
+    const toDetail = (item) => {
84
+      router.push(`/renting/detail?roomId=${item.id}`);
85
+    };
123 86
 
124
-        // 加载状态结束
125
-        state.loading = false;
87
+    const onSearch = (data) => {
88
+      rentParams.value = data;
89
+      list.value = [];
126 90
 
127
-        // 数据全部加载完成
128
-        if (state.list.length >= 40) {
129
-          state.finished = true;
130
-        }
131
-      }, 1000);
91
+      getList({
92
+        pageNo: 1,
93
+        ...data,
94
+      });
132 95
     };
133
-const toDetail = () => {
134
-    console.log(props,router,'333')
135
-    router.push('/renting/detail')
96
+
97
+    const handleMoreSearch = (params) => {
98
+      moreShow.value = false;
99
+      rentParams.value = params;
100
+      list.value = [];
101
+      getList({
102
+        pageNo: 1,
103
+        ...params,
104
+      });
136 105
     };
137
-    
138 106
 
139 107
     return {
140
-      state,
108
+      list,
109
+      loading,
110
+      percent,
111
+      page,
112
+      finished,
141 113
       onLoad,
142 114
       moreShow,
143 115
       onShowMore,
144 116
       toDetail,
117
+      onSearch,
118
+      handleMoreSearch,
145 119
     };
146 120
   },
147 121
 };

+ 2
- 2
src/view/secondhand/components/secondhandmorescreen/index.vue Visa fil

@@ -91,7 +91,7 @@
91 91
               <Picker
92 92
                 placeholder="请选择房源状态"
93 93
                 :options="roomStatusOptions"
94
-                v-model="formData.roomStatus"
94
+                v-model="formData.operateType"
95 95
               />
96 96
             </template>
97 97
           </van-field>
@@ -227,7 +227,7 @@ export default {
227 227
       // 装修
228 228
       decoration: undefined,
229 229
       // 房源状态
230
-      roomStatus: undefined,
230
+      operateType: undefined,
231 231
       // 实勘状态
232 232
       rescStatus: undefined,
233 233
       // 楼栋