|
@@ -25,10 +25,10 @@ Component({
|
|
|
value:"",
|
|
|
type:String
|
|
|
},
|
|
|
- // "serieslist":{
|
|
|
- // value:"",
|
|
|
- // type:String
|
|
|
- // }
|
|
|
+ "getseries":{
|
|
|
+ value:"",
|
|
|
+ type:String
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -53,14 +53,15 @@ Component({
|
|
|
methods: {
|
|
|
getBrands:function(){
|
|
|
var _self=this;
|
|
|
- get(pathmap.getbrand, {}, function (json) {
|
|
|
+ get(this.data.getbrand||pathmap.getbrand, {}, function (json) {
|
|
|
|
|
|
var initiallist = {};
|
|
|
- var brandlist = []
|
|
|
+ var brandlist = [];
|
|
|
+ var list = Object.prototype.toString.call(json.data)=="[object Array]"?json.data:json.data.brand;
|
|
|
for(var i = 65; i < 91; i++){
|
|
|
initiallist[String.fromCharCode(i)] = [];
|
|
|
}
|
|
|
- json.data.brand.forEach(function(item){
|
|
|
+ list.forEach(function(item){
|
|
|
if(Object.prototype.toString.call(initiallist[item.initial])=="[object Array]"){
|
|
|
initiallist[item.initial].push(item);
|
|
|
}
|
|
@@ -87,8 +88,9 @@ Component({
|
|
|
var _self = this;
|
|
|
var brandinfo = e.currentTarget.dataset;
|
|
|
var series = [];
|
|
|
- get(pathmap.serieslist, {brand_id:brandinfo.id}, function (json) {
|
|
|
- series = json.data.car_series;
|
|
|
+ get(this.data.getseries||pathmap.serieslist, {brand_id:brandinfo.id}, function (json) {
|
|
|
+
|
|
|
+ series = Object.prototype.toString.call(json.data)=="[object Array]"?json.data:json.data.car_series;
|
|
|
_self.setData({
|
|
|
serieslist:{
|
|
|
belong:brandinfo,
|