|
@@ -9,7 +9,7 @@
|
9
|
9
|
<div class="form-group row"></div>
|
10
|
10
|
<div class="row" style="text-align:left">
|
11
|
11
|
<div class="col-md-6" style="margin-bottom: 1em">
|
12
|
|
- <label>Street Number</label>
|
|
12
|
+ <label>Street Number *</label>
|
13
|
13
|
<div class="input-group-prepend">
|
14
|
14
|
<span class="input-group-text">
|
15
|
15
|
<eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
|
|
@@ -23,7 +23,7 @@
|
23
|
23
|
</div>
|
24
|
24
|
</div>
|
25
|
25
|
<div class="col-md-6" style="margin-bottom: 1em">
|
26
|
|
- <label>Street Name</label>
|
|
26
|
+ <label>Street Name *</label>
|
27
|
27
|
<div class="input-group-prepend">
|
28
|
28
|
<span class="input-group-text">
|
29
|
29
|
<eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
|
|
@@ -32,36 +32,70 @@
|
32
|
32
|
</div>
|
33
|
33
|
</div>
|
34
|
34
|
<div class="col-md-6" style="margin-bottom: 1em">
|
35
|
|
- <label>Suburb</label>
|
|
35
|
+ <label>Province *</label>
|
36
|
36
|
<div class="input-group-prepend">
|
37
|
37
|
<span class="input-group-text">
|
38
|
38
|
<eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
|
39
|
39
|
</span>
|
40
|
|
- <input class="form-control" type="text" name="suburb" v-model="address.suburb" />
|
|
40
|
+ <select
|
|
41
|
+ class="form-control"
|
|
42
|
+ name="propertyType"
|
|
43
|
+ id="propertyType"
|
|
44
|
+ @change="ProvinceSelected"
|
|
45
|
+ v-model="address.provinceId"
|
|
46
|
+ >
|
|
47
|
+ <option value="0">Please select province</option>
|
|
48
|
+ <option
|
|
49
|
+ v-for="province in provinces"
|
|
50
|
+ :value="province.id"
|
|
51
|
+ :key="province.id"
|
|
52
|
+ >{{ province.description }}</option>
|
|
53
|
+ </select>
|
41
|
54
|
</div>
|
42
|
55
|
</div>
|
|
56
|
+
|
43
|
57
|
<div class="col-md-6" style="margin-bottom: 1em">
|
44
|
|
- <label>City</label>
|
|
58
|
+ <label>City *</label>
|
45
|
59
|
<div class="input-group-prepend">
|
46
|
60
|
<span class="input-group-text">
|
47
|
61
|
<eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
|
48
|
62
|
</span>
|
49
|
|
- <input class="form-control" type="text" name="city" v-model="address.city" />
|
|
63
|
+ <select
|
|
64
|
+ class="form-control"
|
|
65
|
+ name="propertyType"
|
|
66
|
+ id="propertyType"
|
|
67
|
+ @change="CitySelected"
|
|
68
|
+ v-model="address.cityId"
|
|
69
|
+ >
|
|
70
|
+ <option value="0">Please select city</option>
|
|
71
|
+ <option v-for="city in cities" :value="city.id" :key="city.id">{{ city.description }}</option>
|
|
72
|
+ </select>
|
50
|
73
|
</div>
|
51
|
74
|
</div>
|
52
|
75
|
<div class="col-md-6" style="margin-bottom: 1em">
|
53
|
|
- <label>Province</label>
|
|
76
|
+ <label>Suburb *</label>
|
54
|
77
|
<div class="input-group-prepend">
|
55
|
78
|
<span class="input-group-text">
|
56
|
79
|
<eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
|
57
|
80
|
</span>
|
58
|
|
- <select class="form-control" name="region" id="region" v-model="address.province">
|
59
|
|
- <option v-for="(region, r) in regions" :key="r">{{region.regionName}}</option>
|
|
81
|
+ <select
|
|
82
|
+ class="form-control"
|
|
83
|
+ name="propertyType"
|
|
84
|
+ id="suburbselector"
|
|
85
|
+ v-model="address.suburbId"
|
|
86
|
+ @change="getPostalCode"
|
|
87
|
+ >
|
|
88
|
+ <option value="0">Please select suburb</option>
|
|
89
|
+ <option
|
|
90
|
+ v-for="suburb in suburbs"
|
|
91
|
+ :value="suburb.id"
|
|
92
|
+ :key="suburb.id"
|
|
93
|
+ >{{ suburb.description }}</option>
|
60
|
94
|
</select>
|
61
|
95
|
</div>
|
62
|
96
|
</div>
|
63
|
97
|
<div class="col-md-6" style="margin-bottom: 1em">
|
64
|
|
- <label>Postal Code</label>
|
|
98
|
+ <label>Postal Code *</label>
|
65
|
99
|
<div class="input-group-prepend">
|
66
|
100
|
<span class="input-group-text">
|
67
|
101
|
<eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
|
|
@@ -75,14 +109,51 @@
|
75
|
109
|
</template>
|
76
|
110
|
|
77
|
111
|
<script>
|
78
|
|
-import { mapState } from 'vuex';
|
|
112
|
+import { mapState, mapActions } from 'vuex';
|
79
|
113
|
|
80
|
114
|
export default {
|
|
115
|
+ data() {
|
|
116
|
+ return {
|
|
117
|
+ propertyType: 'Residential',
|
|
118
|
+ };
|
|
119
|
+ },
|
81
|
120
|
props: {
|
82
|
121
|
address: {},
|
83
|
122
|
},
|
84
|
123
|
computed: {
|
85
|
|
- ...mapState('timeshare', ['regions']),
|
|
124
|
+ ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
|
|
125
|
+ },
|
|
126
|
+ methods: {
|
|
127
|
+ ...mapActions('searchTab', ['getProvince', 'getCities', 'getSuburbs']),
|
|
128
|
+ ProvinceSelected(item) {
|
|
129
|
+ if (item.target.options.selectedIndex > 0) {
|
|
130
|
+ this.selectedProvince = this.provinces[
|
|
131
|
+ item.target.options.selectedIndex - 1
|
|
132
|
+ ].description;
|
|
133
|
+ this.getCities(Object.assign({}, { province: this.selectedProvince }));
|
|
134
|
+ }
|
|
135
|
+ },
|
|
136
|
+ CitySelected(item) {
|
|
137
|
+ if (item.target.options.selectedIndex > 0) {
|
|
138
|
+ this.selectedCity = this.cities[
|
|
139
|
+ item.target.options.selectedIndex - 1
|
|
140
|
+ ].description;
|
|
141
|
+ this.getSuburbs(
|
|
142
|
+ Object.assign(
|
|
143
|
+ {},
|
|
144
|
+ { province: this.selectedProvince, city: this.selectedCity },
|
|
145
|
+ ),
|
|
146
|
+ );
|
|
147
|
+ }
|
|
148
|
+ },
|
|
149
|
+ getPostalCode(item) {
|
|
150
|
+ this.address.postalCode = this.suburbs[
|
|
151
|
+ item.target.options.selectedIndex - 1
|
|
152
|
+ ].postalCode;
|
|
153
|
+ },
|
|
154
|
+ },
|
|
155
|
+ mounted() {
|
|
156
|
+ this.getProvince();
|
86
|
157
|
},
|
87
|
158
|
};
|
88
|
159
|
</script>
|