前后端开发合作过程中,有时后端逻辑没有写好,前端可以制造假数据,把前端功能写好。该篇主要介绍模拟页面获取的php数据,php格式,第二种写法。
<?php 
return [
  "aData" => [//通勤方式
    "trafficType" => [
      0 => [
        "typeId" => 1,
        "iconFont" => "e7d9",
        "title" => "公共交通"
      ],
      1 => [
        "typeId" => 2,
        "iconFont" => "e7d8",
        "title" => "骑行"
      ],
      2 => [
        "typeId" => 3,
        "iconFont" => "e7da",
        "title" => "步行"
      ],
      3 => [
        "typeId" => 4,
        "iconFont" => "e7d7",
        "title" => "驾车"
      ]
    ],
    "trafficTime" => [//时间区间
      "min" => 15,
      "max" => 60,
      "unit" => "分钟",
      "granularity" => 15,
      "defaultValue" => 15
    ],
    "expirePrice" => [//价格区间
      "min" => 0,
      "max" => 10000,
      "unit" => "元",
      "granularity" => 500,//颗粒度
      "defaultMinValue" => 0,
      "defaultMaxValue" => 10500
    ],
    "listUrl" =>  "http://xxx.com.cn/sh/commuting/list" //通勤找房列表页地址
  ]
];

 

博客签名:敬畏生命,珍惜时间,热爱生活。