汽车选择器

对车型、车系、车款进行选择,支持多个选择,append_data支持配置同时传递名称

效果预览

yml配置

- model: car_picker
  need_add: true
  col_class: 'col-sm-8'
  label: 车型车系可添加
  readonly: false
  data: 
    - {brand_id: 2, manufacturer_id: 246, serial_id: 509, model_id: 21856}
    - {brand_id: 3, manufacturer_id: 131, serial_id: 509, model_id: 21856}
  append_data: false
  validate:
    required: required
  template:
    - {name: brand_id,url: '/auto/car/get_brand_list', list: [],placeholder: 请选择品牌,value: '{%brand_id%}'}
    - {name: manufacturer,url: '/auto/car/get_manufacturer_list', placeholder: 请选择车型, request_key: brand_id, list: [],value: '{%manufacturer_id%}'}
    - {name: serial,url: '/auto/car/get_serial_list', placeholder: 请选择系列, request_key: serial_id, list: [],value: '{%serial_id%}'}
    - {name: model,url: '/auto/car/get_model_year_list', request_key: serial_id, list: [],value: '{%model_id%}'}

字段说明

car_picker

字段 类型 含义 默认值
model String 该控件类型为car_picker -
need_add Boolean 是否需要手动添加组件个数 -
label String 控件label名称 -
data Array 控件值,若数组长度大于一则表示该组件有多个 -
placeholder String 占位提示 -
col_class String 控件样式class -
readonly Boolean 是否只读,true为只读 flase
append_data Boolean 是否同时传递选择项名称 flase
validate Object 校验规则,配置参考输入框-validate -
template Array 车型车系等选框 -

car_picker.template

字段 类型 含义 默认值
name String 名称 -
url String 获取当前选框值的url接口 -
list Array 选框值存放字段 -
placeholder String 占位提示 -
value String 选中值 -
request_key String 当前url传递上一个选框所选值的key名 flase

获取品牌url返回值结构示例

{
    "ret": 0,
    "msg": "ok",
    "errorcode": 0,
    "data": {
        "A": [{
            "id": "206",
            "name": "AC Schnitzer",
            "pic": "http://img1.gtimg.com/datalib_img/Brand/20160219/20160219_115911_51744790_thumbnail_100_100.png"
        }, {
            "id": "88",
            "name": "阿尔法罗密欧",
            "pic": "http://img1.gtimg.com/datalib_img/Brand/20141125/20141125_194352_58187020_thumbnail_100_100.png"
        }, {
            "id": "2",
            "name": "奥迪",
            "pic": "http://img1.gtimg.com/datalib_img/Brand/20141125/20141125_212218_70114440_thumbnail_100_100.png"
        }, {
            "id": "3",
            "name": "阿斯顿·马丁",
            "pic": "http://img1.gtimg.com/datalib_img/Brand/20141125/20141125_212150_91309720_thumbnail_100_100.png"
        }]
    }
}

获取车型url返回值结构示例

{
    "ret": 0,
    "msg": "ok",
    "errorcode": 0,
    "data": [{
        "id": "131",
        "name": "一汽-大众奥迪",
        "isAudited": "1",
        "producingArea": "国产",
        "isImport": "0"
    }, {
        "id": "140",
        "name": "奥迪",
        "isAudited": "1",
        "producingArea": "进口",
        "isImport": "1"
    }, {
        "id": "246",
        "name": "奥迪Sport",
        "isAudited": "1",
        "producingArea": "进口",
        "isImport": "0"
    }]
}

获取车系url返回值结构示例

{
    "ret": 0,
    "msg": "ok",
    "errorcode": 0,
    "data": [{
        "menuName": "一汽-大众奥迪",
        "serialList": [{
            "serialId": "1099",
            "serialName": "奥迪A3",
            "level": "紧凑型车",
            "brandId": "2",
            "brandName": "奥迪",
            "manuid": "131",
            "manuName": "一汽-大众奥迪",
            "serialPrice": "18.49-28.10万",
            "serialPic": "http://img1.gtimg.com/datalib_img//16-11-10/0/318519b8db03f3bb629580536e589a6411.jpg",
            "isGold": false
        }, {
            "serialId": "733",
            "serialName": "奥迪Q5",
            "level": "SUV",
            "brandId": "2",
            "brandName": "奥迪",
            "manuid": "131",
            "manuName": "一汽-大众奥迪",
            "serialPrice": "38.34-56.70万",
            "serialPic": "http://img1.gtimg.com/datalib_img//car_serial//pic/lib/2010-03-22/20100322112909257326375011.jpg",
            "isGold": false
        }, {
            "serialId": "184",
            "serialName": "奥迪A6L",
            "level": "中大型车",
            "brandId": "2",
            "brandName": "奥迪",
            "manuid": "131",
            "manuName": "一汽-大众奥迪",
            "serialPrice": "41.53-75.76万",
            "serialPic": "http://img1.gtimg.com/datalib_img//16-11-02/6/f644111f03c6d8d7051c80ce2563f6d311.jpg",
            "isGold": false
        }]
    }]
}

获取车款url返回值结构示例

{
    "ret": 0,
    "msg": "ok",
    "errorcode": 0,
    "data": {
        "serialInfo": {
            "serialId": "732",
            "serialName": "优劲",
            "serialPic": "http://img1.gtimg.com/datalib_img/CarSerial/20131225/20131225_123231_96653990_thumbnail_280_200.jpg"
        },
        "modelList": {
            "unsell": {
                "2013款": {
                    "1.1L": [{
                        "modelId": "21854",
                        "modelName": "2013款 1.1L MT双排 基本型",
                        "modelPic": "http://img1.gtimg.com/datalib_img/CarModel/20141210/20141210_160533_45973370_thumbnail_280_200.jpg",
                        "serialId": 732,
                        "serialName": "优劲",
                        "brandName": "开瑞",
                        "priceLow": 0,
                        "priceHigh": "3.51",
                        "capacity": "1.1",
                        "gearbox": "MT",
                        "modelYear": 2013,
                        "fuelType": "汽油",
                        "horsepower": "75马力",
                        "inletway": "自然吸气"
                    }],
                    "1.2L": [{
                        "modelId": "21860",
                        "modelName": "2013款 1.2L MT双排 标准型",
                        "modelPic": "http://img1.gtimg.com/datalib_img/CarModel/20141210/20141210_161633_37286020_thumbnail_280_200.jpg",
                        "serialId": 732,
                        "serialName": "优劲",
                        "brandName": "开瑞",
                        "priceLow": 0,
                        "priceHigh": "3.71",
                        "capacity": "1.2",
                        "gearbox": "MT",
                        "modelYear": 2013,
                        "fuelType": "汽油",
                        "horsepower": "80马力",
                        "inletway": "自然吸气"
                    }]
                },
                "2012款": {
                    "1.1L": [{
                        "modelId": "15035",
                        "modelName": "2012款 1.1L MT 双排舒适型",
                        "modelPic": "http://img1.gtimg.com/datalib_img//car_models/pic/info/2012-07-19/20120719150311868809150352.jpg",
                        "serialId": 732,
                        "serialName": "优劲",
                        "brandName": "开瑞",
                        "priceLow": 0,
                        "priceHigh": "4.14",
                        "capacity": "1.1",
                        "gearbox": "MT",
                        "modelYear": 2012,
                        "fuelType": "汽油",
                        "horsepower": "75马力",
                        "inletway": "自然吸气"
                    }]
                },
                "2010款": {
                    "1.0L": [],
                    "1.1L": [{
                        "modelId": "10823",
                        "modelName": "2010款 1.1L 手动标准型",
                        "modelPic": "http://img1.gtimg.com/datalib_img//car_models/pic/info/2010-03-12/20100312153128059713108232.jpg",
                        "serialId": 732,
                        "serialName": "优劲",
                        "brandName": "开瑞",
                        "priceLow": 0,
                        "priceHigh": "3.49",
                        "capacity": "1.1",
                        "gearbox": "MT",
                        "modelYear": 2010,
                        "fuelType": "汽油",
                        "horsepower": "75马力",
                        "inletway": "自然吸气"
                    }]
                }
            },
            "sell": {
                "2016款": {
                    "1.1L": [{
                        "modelId": "26941",
                        "modelName": "2016款 1.1L 单排 基本型ACTECO-SQR472WF",
                        "modelPic": "http://img1.gtimg.com/datalib_img/CarModel/20160518/20160518_162103_94107080_thumbnail_280_200.jpg",
                        "serialId": 732,
                        "serialName": "优劲",
                        "brandName": "开瑞",
                        "priceLow": 0,
                        "priceHigh": "3.20",
                        "capacity": "1.1",
                        "gearbox": "MT",
                        "modelYear": 2016,
                        "fuelType": "汽油",
                        "horsepower": "75马力",
                        "inletway": "自然吸气"
                    }],
                    "1.2L": [{
                        "modelId": "26947",
                        "modelName": "2016款 1.2L 单排加长 标准型ACTECO-SQR472WB",
                        "modelPic": "http://img1.gtimg.com/datalib_img/CarModel/20160518/20160518_163813_32002410_thumbnail_280_200.jpg",
                        "serialId": 732,
                        "serialName": "优劲",
                        "brandName": "开瑞",
                        "priceLow": 0,
                        "priceHigh": "3.63",
                        "capacity": "1.2",
                        "gearbox": "MT",
                        "modelYear": 2016,
                        "fuelType": "汽油",
                        "horsepower": "80马力",
                        "inletway": "自然吸气"
                    }],
                    "1.3L": [{
                        "modelId": "26963",
                        "modelName": "2016款 1.3L 双排加长 标准I型ACTECO-SQR472WD",
                        "modelPic": "http://img1.gtimg.com/datalib_img/CarModel/20160518/20160518_165803_89134730_thumbnail_280_200.jpg",
                        "serialId": 732,
                        "serialName": "优劲",
                        "brandName": "开瑞",
                        "priceLow": 0,
                        "priceHigh": "4.21",
                        "capacity": "1.3",
                        "gearbox": "MT",
                        "modelYear": 2016,
                        "fuelType": "汽油",
                        "horsepower": "82马力",
                        "inletway": "自然吸气"
                    }]
                },
                "2012款": {
                    "1.1L": [{
                        "modelId": "15034",
                        "modelName": "2012款 1.1L MT 双排标准型",
                        "modelPic": "http://img1.gtimg.com/datalib_img//car_models/pic/info/2012-07-19/20120719150304627146150342.jpg",
                        "serialId": 732,
                        "serialName": "优劲",
                        "brandName": "开瑞",
                        "priceLow": 0,
                        "priceHigh": "3.85",
                        "capacity": "1.1",
                        "gearbox": "MT",
                        "modelYear": 2012,
                        "fuelType": "汽油",
                        "horsepower": "75马力",
                        "inletway": "自然吸气"
                    }]
                }
            }
        }
    }
}

results matching ""

    No results matching ""