Browse Source

区域筛选对接口

sunjuan 3 năm trước cách đây
mục cha
commit
34c0bc7b59
1 tập tin đã thay đổi với 70 bổ sung174 xóa
  1. 70 174
      src/main/resources/static/main/mobilepage/js/tranding.js

+ 70 - 174
src/main/resources/static/main/mobilepage/js/tranding.js

@@ -9,196 +9,33 @@ Vue.component('cqu-check', {
 				id: 'core',
 				title: '中心城区',
 				active: true
-			}, {
+				}, {
 				id: 'new',
 				title: '都市新区',
 				active: false
-			}, {
+				}, {
 				id: 'eastnorth',
 				title: '渝东北',
 				active: false
-			}, {
+				}, {
 				id: 'eastsouth',
 				title: '渝东南',
 				active: false
 			}],
 			// 中心城区
-			coreList: [{
-				id: 'yz',
-				title: '渝中',
-				active: false
-			}, {
-				id: 'jb',
-				title: '江北',
-				active: false
-			}, {
-				id: 'yb',
-				title: '渝北',
-				active: false
-			}, {
-				id: 'na',
-				title: '南岸',
-				active: false
-			}, {
-				id: 'bb',
-				title: '北碚',
-				active: false
-			}, {
-				id: 'bn',
-				title: '巴南',
-				active: false
-			}, {
-				id: 'ddk',
-				title: '大渡口',
-				active: false
-			}, {
-				id: 'spb',
-				title: '沙坪坝',
-				active: false
-			}, {
-				id: 'jlp',
-				title: '九龙坡',
-				active: false
-			}, {
-				id: 'wsjk',
-				title: '万盛经开区',
-				active: false
-			}, {
-				id: 'ljxq',
-				title: '两江新区',
-				active: false
-			}, {
-				id: 'gxq',
-				title: '高新区',
-				active: false
-			},],
+			coreList: [],
 			// 渝东北
-			northeastList: [{
-				id: 'fd',
-				title: '丰都',
-				active: false
-			}, {
-				id: 'dj',
-				title: '垫江',
-				active: false
-			}, {
-				id: 'wz',
-				title: '万州',
-				active: false
-			}, {
-				id: 'ws',
-				title: '巫山',
-				active: false
-			}, {
-				id: 'wx',
-				title: '巫溪',
-				active: false
-			}, {
-				id: 'yy',
-				title: '云阳',
-				active: false
-			}, {
-				id: 'fj',
-				title: '奉节',
-				active: false
-			}, {
-				id: 'ck',
-				title: '城口',
-				active: false
-			}, {
-				id: 'kz',
-				title: '开州',
-				active: false
-			}, {
-				id: 'zx',
-				title: '忠县',
-				active: false
-			}, {
-				id: 'lp',
-				title: '梁平',
-				active: false
-			},],
+			northeastList: [],
 			// 渝东南
-			southeastList: [{
-				id: 'qj',
-				title: '黔江',
-				active: false
-			}, {
-				id: 'sz',
-				title: '石柱',
-				active: false
-			}, {
-				id: 'wl',
-				title: '武隆',
-				active: false
-			}, {
-				id: 'xs',
-				title: '秀山',
-				active: false
-			}, {
-				id: 'qy',
-				title: '酉阳',
-				active: false
-			}, {
-				id: 'ps',
-				title: '彭水',
-				active: false
-			}],
+			southeastList: [],
 			// 都市新区
-			newList: [{
-				id: 'jj',
-				title: '江津',
-				active: false
-			}, {
-				id: 'hc',
-				title: '合川',
-				active: false
-			}, {
-				id: 'yc',
-				title: '永川',
-				active: false
-			}, {
-				id: 'dz',
-				title: '大足',
-				active: false
-			}, {
-				id: 'bs',
-				title: '璧山',
-				active: false
-			}, {
-				id: 'tl',
-				title: '铜梁',
-				active: false
-			}, {
-				id: 'tn',
-				title: '潼南',
-				active: false
-			}, {
-				id: 'rc',
-				title: '荣昌',
-				active: false
-			}, {
-				id: 'nc',
-				title: '南川',
-				active: false
-			}, {
-				id: 'cqj',
-				title: '綦江',
-				active: false
-			}, {
-				id: 'pl',
-				title: '涪陵',
-				active: false
-			}, {
-				id: 'cs',
-				title: '长寿',
-				active: false
-			}],
+			newList: [],
 			curIndex: 0,
 		}
 	},
 	created() {
-		this.regAllList = [this.coreList, this.newList, this.northeastList, this.southeastList]
+		this.regAllList = [this.coreList, this.newList, this.northeastList, this.southeastList];
+		this.getSearchCondition();
 	},
 	watch: {
 		tabQuList: {
@@ -236,7 +73,66 @@ Vue.component('cqu-check', {
 				item.active = this.buxQ
 			})
 			this.buxQ = !this.buxQ
-		}
+		},
+		getSearchCondition() {
+			var _this = this;
+			$.ajax({
+				type: 'GET',
+				url: PATH + '/front/getSearchCondition',
+				success: function (json) {
+					console.log(json)
+					var index = 1;
+					var Area = json.data.area;
+					console.log(Area)
+					// 区域 中心城区
+					for (var i = 0; i < Area.zxcq.length; i++) {
+						_this.coreList.push({
+							id: index++,
+							title: Area.zxcq[i].areaName,
+							active: false,
+							dis: false,
+							value: Area.zxcq[i].code
+						})
+					}
+		
+					// 区域 都市新区
+					for (var i = 0; i < Area.dsxq.length; i++) {
+						_this.newList.push({
+							id: index++,
+							title: Area.dsxq[i].areaName,
+							active: false,
+							dis: false,
+							value: Area.dsxq[i].code
+						})
+					}
+		
+					// 区域 渝东北
+					for (var i = 0; i < Area.ydbq.length; i++) {
+						_this.northeastList.push({
+							id: index++,
+							title: Area.ydbq[i].areaName,
+							active: false,
+							dis: false,
+							value: Area.ydbq[i].code
+						})
+					}
+		
+					// 区域 渝东南
+					for (var i = 0; i < Area.ydnq.length; i++) {
+						_this.southeastList.push({
+							id: index++,
+							title: Area.ydnq[i].areaName,
+							active: false,
+							dis: false,
+							value: Area.ydnq[i].code
+						})
+					}
+				},
+				error: function (err) {
+					layer.msg('网络错误!');
+				}
+			})
+		},
 	},
 	template: `
         <div style="display:flex;width:100%;">
@@ -285,7 +181,7 @@ const retoot = new Vue({
 		},
 		hideCheck(){
 			this.show = false
-		}
+		},
 	}
 })