Commit c9d8f63d authored by ZJG's avatar ZJG

数据处理

parent 3d43da31
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
return { return {
info: {}, info: {},
contentHeight: 0, contentHeight: 0,
navs:[{Name:'城际专车'},{Name:'定制专车'}], navs:[{Name:'司导专车'},{Name:'景区专车'}],
active:0, active:0,
mainColor: '', mainColor: '',
scrollTop: 0, scrollTop: 0,
......
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
} }
this.indexList.push(obj) this.indexList.push(obj)
}) })
this.indexList = this.unique(this.indexList)
this.indexList.forEach(x=>{ this.indexList.forEach(x=>{
x.children=[]; x.children=[];
this.cityList.forEach(j=>{ this.cityList.forEach(j=>{
...@@ -134,12 +135,23 @@ ...@@ -134,12 +135,23 @@
}) })
}) })
uni.hideLoading(); uni.hideLoading();
} }
); );
}, },
unique(arr){//数组去重
var res = [];
var obj = {};
for(var i=0; i<arr.length; i++){
if( !obj[arr[i]] ){
obj[arr[i]] = 1;
res.push(arr[i]);
}
}
return res;
},
onPageScroll(e) { onPageScroll(e) {
this.scrollTop = e.scrollTop; this.scrollTop = e.scrollTop;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment