Vue学习之Vue模拟后台数据

前后端项目的开发,需要前端和后端同时进行开发,有时后端开发人员还未完成API接口可以提供给前端调用,因此就需要模拟前端请求后端接口,后端返回数据。一般开发中都是返回json数据格式来完成前后端的交互。

1. 首先下载一个vue-cli的项目模板

vue init webpack myProject

  

2. 在项目根目录下创建一个data.json的模拟后台返回数据,名字可以随便写不一定非得是data.json哈,但是格式必须是json格式哈

 

 

   1 {
   2   "seller": {
   3     "name": "粥品香坊(回龙观)",
   4     "description": "蜂鸟专送",
   5     "deliveryTime": 38,
   6     "score": 4.2,
   7     "serviceScore": 4.1,
   8     "foodScore": 4.3,
   9     "rankRate": 69.2,
  10     "minPrice": 20,
  11     "deliveryPrice": 4,
  12     "ratingCount": 24,
  13     "sellCount": 90,
  14     "bulletin": "粥品香坊其烹饪粥料的秘方源于中国千年古法,在融和现代制作工艺,由世界烹饪大师屈浩先生领衔研发。坚守纯天然、0添加的良心品质深得消费者青睐,发展至今成为粥类的引领品牌。是2008年奥运会和2013年园博会指定餐饮服务商。",
  15     "supports": [
  16       {
  17         "type": 0,
  18         "description": "在线支付满28减5"
  19       },
  20       {
  21         "type": 1,
  22         "description": "VC无限橙果汁全场8折"
  23       },
  24       {
  25         "type": 2,
  26         "description": "单人精彩套餐"
  27       },
  28       {
  29         "type": 3,
  30         "description": "该商家支持发票,请下单写好发票抬头"
  31       },
  32       {
  33         "type": 4,
  34         "description": "已加入“外卖保”计划,食品安全保障"
  35       }
  36     ],
  37     "avatar": "http://static.galileo.xiaojukeji.com/static/tms/seller_avatar_256px.jpg",
  38     "pics": [
  39       "http://fuss10.elemecdn.com/8/71/c5cf5715740998d5040dda6e66abfjpeg.jpeg?imageView2/1/w/180/h/180",
  40       "http://fuss10.elemecdn.com/b/6c/75bd250e5ba69868f3b1178afbda3jpeg.jpeg?imageView2/1/w/180/h/180",
  41       "http://fuss10.elemecdn.com/f/96/3d608c5811bc2d902fc9ab9a5baa7jpeg.jpeg?imageView2/1/w/180/h/180",
  42       "http://fuss10.elemecdn.com/6/ad/779f8620ff49f701cd4c58f6448b6jpeg.jpeg?imageView2/1/w/180/h/180"
  43     ],
  44     "infos": [
  45       "该商家支持发票,请下单写好发票抬头",
  46       "品类:其他菜系,包子粥店",
  47       "北京市昌平区回龙观西大街龙观置业大厦底商B座102单元1340",
  48       "营业时间:10:00-20:30"
  49     ]
  50   },
  51   "goods": [
  52     {
  53       "name": "热销榜",
  54       "type": -1,
  55       "foods": [
  56         {
  57           "name": "皮蛋瘦肉粥",
  58           "price": 10,
  59           "oldPrice": "",
  60           "description": "咸粥",
  61           "sellCount": 229,
  62           "rating": 100,
  63           "info": "一碗皮蛋瘦肉粥,总是我到粥店时的不二之选。香浓软滑,饱腹暖心,皮蛋的Q弹与瘦肉的滑嫩伴着粥香溢于满口,让人喝这样的一碗粥也觉得心满意足",
  64           "ratings": [
  65             {
  66               "username": "3******c",
  67               "rateTime": 1469281964000,
  68               "rateType": 0,
  69               "text": "很喜欢的粥",
  70               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
  71             },
  72             {
  73               "username": "2******3",
  74               "rateTime": 1469271264000,
  75               "rateType": 0,
  76               "text": "",
  77               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
  78             },
  79             {
  80               "username": "3******b",
  81               "rateTime": 1469261964000,
  82               "rateType": 1,
  83               "text": "",
  84               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
  85             }
  86           ],
  87           "icon": "http://fuss10.elemecdn.com/c/cd/c12745ed8a5171e13b427dbc39401jpeg.jpeg?imageView2/1/w/114/h/114",
  88           "image": "http://fuss10.elemecdn.com/c/cd/c12745ed8a5171e13b427dbc39401jpeg.jpeg?imageView2/1/w/750/h/750"
  89         },
  90         {
  91           "name": "扁豆焖面",
  92           "price": 14,
  93           "oldPrice": "",
  94           "description": "",
  95           "sellCount": 188,
  96           "rating": 96,
  97           "ratings": [
  98             {
  99               "username": "3******c",
 100               "rateTime": 1469281964000,
 101               "rateType": 0,
 102               "text": "",
 103               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 104             },
 105             {
 106               "username": "2******3",
 107               "rateTime": 1469271264000,
 108               "rateType": 0,
 109               "text": "",
 110               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 111             },
 112             {
 113               "username": "3******b",
 114               "rateTime": 1469261964000,
 115               "rateType": 1,
 116               "text": "",
 117               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 118             }
 119           ],
 120           "info": "",
 121           "icon": "http://fuss10.elemecdn.com/c/6b/29e3d29b0db63d36f7c500bca31d8jpeg.jpeg?imageView2/1/w/114/h/114",
 122           "image": "http://fuss10.elemecdn.com/c/6b/29e3d29b0db63d36f7c500bca31d8jpeg.jpeg?imageView2/1/w/750/h/750"
 123         },
 124         {
 125           "name": "葱花饼",
 126           "price": 10,
 127           "oldPrice": "",
 128           "description": "",
 129           "sellCount": 124,
 130           "rating": 85,
 131           "info": "",
 132           "ratings": [
 133             {
 134               "username": "3******c",
 135               "rateTime": 1469281964000,
 136               "rateType": 1,
 137               "text": "没啥味道",
 138               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 139             },
 140             {
 141               "username": "2******3",
 142               "rateTime": 1469271264000,
 143               "rateType": 1,
 144               "text": "很一般啊",
 145               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 146             },
 147             {
 148               "username": "3******b",
 149               "rateTime": 1469261964000,
 150               "rateType": 0,
 151               "text": "",
 152               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 153             }
 154           ],
 155           "icon": "http://fuss10.elemecdn.com/f/28/a51e7b18751bcdf871648a23fd3b4jpeg.jpeg?imageView2/1/w/114/h/114",
 156           "image": "http://fuss10.elemecdn.com/f/28/a51e7b18751bcdf871648a23fd3b4jpeg.jpeg?imageView2/1/w/750/h/750"
 157         },
 158         {
 159           "name": "牛肉馅饼",
 160           "price": 14,
 161           "oldPrice": "",
 162           "description": "",
 163           "sellCount": 114,
 164           "rating": 91,
 165           "info": "",
 166           "ratings": [
 167             {
 168               "username": "3******c",
 169               "rateTime": 1469281964000,
 170               "rateType": 1,
 171               "text": "难吃不推荐",
 172               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 173             },
 174             {
 175               "username": "2******3",
 176               "rateTime": 1469271264000,
 177               "rateType": 0,
 178               "text": "",
 179               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 180             },
 181             {
 182               "username": "3******b",
 183               "rateTime": 1469261964000,
 184               "rateType": 0,
 185               "text": "",
 186               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 187             }
 188           ],
 189           "icon": "http://fuss10.elemecdn.com/d/b9/bcab0e8ad97758e65ae5a62b2664ejpeg.jpeg?imageView2/1/w/114/h/114",
 190           "image": "http://fuss10.elemecdn.com/d/b9/bcab0e8ad97758e65ae5a62b2664ejpeg.jpeg?imageView2/1/w/750/h/750"
 191         },
 192         {
 193           "name": "招牌猪肉白菜锅贴/10个",
 194           "price": 17,
 195           "oldPrice": "",
 196           "description": "",
 197           "sellCount": 101,
 198           "rating": 78,
 199           "info": "",
 200           "ratings": [
 201             {
 202               "username": "3******c",
 203               "rateTime": 1469281964000,
 204               "rateType": 1,
 205               "text": "不脆,不好吃",
 206               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 207             },
 208             {
 209               "username": "2******3",
 210               "rateTime": 1469271264000,
 211               "rateType": 0,
 212               "text": "",
 213               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 214             },
 215             {
 216               "username": "3******b",
 217               "rateTime": 1469261964000,
 218               "rateType": 0,
 219               "text": "",
 220               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 221             }
 222           ],
 223           "icon": "http://fuss10.elemecdn.com/7/72/9a580c1462ca1e4d3c07e112bc035jpeg.jpeg?imageView2/1/w/114/h/114",
 224           "image": "http://fuss10.elemecdn.com/7/72/9a580c1462ca1e4d3c07e112bc035jpeg.jpeg?imageView2/1/w/750/h/750"
 225         },
 226         {
 227           "name": "南瓜粥",
 228           "price": 9,
 229           "oldPrice": "",
 230           "description": "甜粥",
 231           "sellCount": 91,
 232           "rating": 100,
 233           "ratings": [
 234             {
 235               "username": "3******c",
 236               "rateTime": 1469281964000,
 237               "rateType": 0,
 238               "text": "",
 239               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 240             },
 241             {
 242               "username": "2******3",
 243               "rateTime": 1469271264000,
 244               "rateType": 0,
 245               "text": "",
 246               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 247             },
 248             {
 249               "username": "3******b",
 250               "rateTime": 1469261964000,
 251               "rateType": 0,
 252               "text": "",
 253               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 254             }
 255           ],
 256           "icon": "http://fuss10.elemecdn.com/8/a6/453f65f16b1391942af11511b7a90jpeg.jpeg?imageView2/1/w/114/h/114",
 257           "image": "http://fuss10.elemecdn.com/8/a6/453f65f16b1391942af11511b7a90jpeg.jpeg?imageView2/1/w/750/h/750"
 258         },
 259         {
 260           "name": "红豆薏米美肤粥",
 261           "price": 12,
 262           "oldPrice": "",
 263           "description": "甜粥",
 264           "sellCount": 86,
 265           "rating": 100,
 266           "info": "",
 267           "ratings": [
 268             {
 269               "username": "3******c",
 270               "rateTime": 1469281964000,
 271               "rateType": 0,
 272               "text": "",
 273               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 274             },
 275             {
 276               "username": "2******3",
 277               "rateTime": 1469271264000,
 278               "rateType": 0,
 279               "text": "",
 280               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 281             },
 282             {
 283               "username": "3******b",
 284               "rateTime": 1469261964000,
 285               "rateType": 0,
 286               "text": "",
 287               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 288             }
 289           ],
 290           "icon": "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/114/h/114",
 291           "image": "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/750/h/750"
 292         },
 293         {
 294           "name": "八宝酱菜",
 295           "price": 4,
 296           "oldPrice": "",
 297           "description": "",
 298           "sellCount": 84,
 299           "rating": 100,
 300           "info": "",
 301           "ratings": [
 302             {
 303               "username": "3******c",
 304               "rateTime": 1469281964000,
 305               "rateType": 0,
 306               "text": "",
 307               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 308             },
 309             {
 310               "username": "2******3",
 311               "rateTime": 1469271264000,
 312               "rateType": 0,
 313               "text": "",
 314               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 315             },
 316             {
 317               "username": "3******b",
 318               "rateTime": 1469261964000,
 319               "rateType": 0,
 320               "text": "",
 321               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 322             }
 323           ],
 324           "icon": "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/114/h/114",
 325           "image": "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/750/h/750"
 326         },
 327         {
 328           "name": "红枣山药糙米粥",
 329           "price": 10,
 330           "oldPrice": "",
 331           "description": "",
 332           "sellCount": 81,
 333           "rating": 91,
 334           "info": "",
 335           "ratings": [
 336             {
 337               "username": "3******c",
 338               "rateTime": 1469281964000,
 339               "rateType": 0,
 340               "text": "",
 341               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 342             },
 343             {
 344               "username": "2******3",
 345               "rateTime": 1469271264000,
 346               "rateType": 0,
 347               "text": "",
 348               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 349             },
 350             {
 351               "username": "3******b",
 352               "rateTime": 1469261964000,
 353               "rateType": 0,
 354               "text": "",
 355               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 356             }
 357           ],
 358           "icon": "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/114/h/114",
 359           "image": "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/750/h/750"
 360         },
 361         {
 362           "name": "糊塌子",
 363           "price": 10,
 364           "oldPrice": "",
 365           "description": "",
 366           "sellCount": 80,
 367           "rating": 93,
 368           "info": "",
 369           "ratings": [
 370             {
 371               "username": "3******c",
 372               "rateTime": 1469281964000,
 373               "rateType": 0,
 374               "text": "",
 375               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 376             },
 377             {
 378               "username": "2******3",
 379               "rateTime": 1469271264000,
 380               "rateType": 0,
 381               "text": "",
 382               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 383             },
 384             {
 385               "username": "3******b",
 386               "rateTime": 1469261964000,
 387               "rateType": 0,
 388               "text": "",
 389               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 390             }
 391           ],
 392           "icon": "http://fuss10.elemecdn.com/0/05/097a2a59fd2a2292d08067e16380cjpeg.jpeg?imageView2/1/w/114/h/114",
 393           "image": "http://fuss10.elemecdn.com/0/05/097a2a59fd2a2292d08067e16380cjpeg.jpeg?imageView2/1/w/750/h/750"
 394         }
 395       ]
 396     },
 397     {
 398       "name": "单人精彩套餐",
 399       "type": 2,
 400       "foods": [
 401         {
 402           "name": "红枣山药粥套餐",
 403           "price": 29,
 404           "oldPrice": 36,
 405           "description": "红枣山药糙米粥,素材包,爽口莴笋丝,四川泡菜或八宝酱菜,配菜可备注",
 406           "sellCount": 17,
 407           "rating": 100,
 408           "info": "",
 409           "ratings": [
 410             {
 411               "username": "2******3",
 412               "rateTime": 1469271264000,
 413               "rateType": 0,
 414               "text": "",
 415               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 416             }
 417           ],
 418           "icon": "http://fuss10.elemecdn.com/6/72/cb844f0bb60c502c6d5c05e0bddf5jpeg.jpeg?imageView2/1/w/114/h/114",
 419           "image": "http://fuss10.elemecdn.com/6/72/cb844f0bb60c502c6d5c05e0bddf5jpeg.jpeg?imageView2/1/w/750/h/750"
 420         }
 421       ]
 422     },
 423     {
 424       "name": "冰爽饮品限时特惠",
 425       "type": 1,
 426       "foods": [
 427         {
 428           "name": "VC无限橙果汁",
 429           "price": 8,
 430           "oldPrice": 10,
 431           "description": "",
 432           "sellCount": 15,
 433           "rating": 100,
 434           "info": "",
 435           "ratings": [
 436             {
 437               "username": "3******c",
 438               "rateTime": 1469281964000,
 439               "rateType": 0,
 440               "text": "还可以",
 441               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 442             },
 443             {
 444               "username": "2******3",
 445               "rateTime": 1469271264000,
 446               "rateType": 0,
 447               "text": "",
 448               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 449             }
 450           ],
 451           "icon": "http://fuss10.elemecdn.com/e/c6/f348e811772016ae24e968238bcbfjpeg.jpeg?imageView2/1/w/114/h/114",
 452           "image": "http://fuss10.elemecdn.com/e/c6/f348e811772016ae24e968238bcbfjpeg.jpeg?imageView2/1/w/750/h/750"
 453         }
 454       ]
 455     },
 456     {
 457       "name": "精选热菜",
 458       "type": -1,
 459       "foods": [
 460         {
 461           "name": "娃娃菜炖豆腐",
 462           "price": 17,
 463           "oldPrice": "",
 464           "description": "",
 465           "sellCount": 43,
 466           "rating": 92,
 467           "info": "",
 468           "ratings": [
 469             {
 470               "username": "3******c",
 471               "rateTime": 1469281964000,
 472               "rateType": 0,
 473               "text": "菜量还可以,味道还可以",
 474               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 475             },
 476             {
 477               "username": "2******3",
 478               "rateTime": 1469271264000,
 479               "rateType": 0,
 480               "text": "",
 481               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 482             }
 483           ],
 484           "icon": "http://fuss10.elemecdn.com/d/2d/b1eb45b305635d9dd04ddf157165fjpeg.jpeg?imageView2/1/w/114/h/114",
 485           "image": "http://fuss10.elemecdn.com/d/2d/b1eb45b305635d9dd04ddf157165fjpeg.jpeg?imageView2/1/w/750/h/750"
 486         },
 487         {
 488           "name": "手撕包菜",
 489           "price": 16,
 490           "oldPrice": "",
 491           "description": "",
 492           "sellCount": 29,
 493           "rating": 100,
 494           "info": "",
 495           "ratings": [
 496             {
 497               "username": "3******c",
 498               "rateTime": 1469281964000,
 499               "rateType": 0,
 500               "text": "",
 501               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 502             },
 503             {
 504               "username": "2******3",
 505               "rateTime": 1469271264000,
 506               "rateType": 0,
 507               "text": "",
 508               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 509             }
 510           ],
 511           "icon": "http://fuss10.elemecdn.com/9/c6/f3bc84468820121112e79583c24efjpeg.jpeg?imageView2/1/w/114/h/114",
 512           "image": "http://fuss10.elemecdn.com/9/c6/f3bc84468820121112e79583c24efjpeg.jpeg?imageView2/1/w/750/h/750"
 513         },
 514         {
 515           "name": "香酥黄金鱼/3条",
 516           "price": 11,
 517           "oldPrice": "",
 518           "description": "",
 519           "sellCount": 15,
 520           "rating": 100,
 521           "info": "",
 522           "ratings": [
 523             {
 524               "username": "3******c",
 525               "rateTime": 1469281964000,
 526               "rateType": 0,
 527               "text": "",
 528               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 529             },
 530             {
 531               "username": "2******3",
 532               "rateTime": 1469271264000,
 533               "rateType": 0,
 534               "text": "",
 535               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 536             }
 537           ],
 538           "icon": "http://fuss10.elemecdn.com/4/e7/8277a6a2ea0a2e97710290499fc41jpeg.jpeg?imageView2/1/w/114/h/114",
 539           "image": "http://fuss10.elemecdn.com/4/e7/8277a6a2ea0a2e97710290499fc41jpeg.jpeg?imageView2/1/w/750/h/750"
 540         }
 541       ]
 542     },
 543     {
 544       "name": "爽口凉菜",
 545       "type": -1,
 546       "foods": [
 547         {
 548           "name": "八宝酱菜",
 549           "price": 4,
 550           "oldPrice": "",
 551           "description": "",
 552           "sellCount": 84,
 553           "rating": 100,
 554           "info": "",
 555           "ratings": [
 556             {
 557               "username": "3******c",
 558               "rateTime": 1469281964000,
 559               "rateType": 0,
 560               "text": "",
 561               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 562             },
 563             {
 564               "username": "2******3",
 565               "rateTime": 1469271264000,
 566               "rateType": 0,
 567               "text": "",
 568               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 569             },
 570             {
 571               "username": "3******b",
 572               "rateTime": 1469261964000,
 573               "rateType": 0,
 574               "text": "",
 575               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 576             }
 577           ],
 578           "icon": "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/114/h/114",
 579           "image": "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/750/h/750"
 580         },
 581         {
 582           "name": "拍黄瓜",
 583           "price": 9,
 584           "oldPrice": "",
 585           "description": "",
 586           "sellCount": 28,
 587           "rating": 100,
 588           "info": "",
 589           "ratings": [
 590             {
 591               "username": "3******c",
 592               "rateTime": 1469281964000,
 593               "rateType": 0,
 594               "text": "",
 595               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 596             },
 597             {
 598               "username": "2******3",
 599               "rateTime": 1469271264000,
 600               "rateType": 0,
 601               "text": "",
 602               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 603             },
 604             {
 605               "username": "3******b",
 606               "rateTime": 1469261964000,
 607               "rateType": 0,
 608               "text": "",
 609               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 610             }
 611           ],
 612           "icon": "http://fuss10.elemecdn.com/6/54/f654985b4e185f06eb07f8fa2b2e8jpeg.jpeg?imageView2/1/w/114/h/114",
 613           "image": "http://fuss10.elemecdn.com/6/54/f654985b4e185f06eb07f8fa2b2e8jpeg.jpeg?imageView2/1/w/750/h/750"
 614         }
 615       ]
 616     },
 617     {
 618       "name": "精选套餐",
 619       "type": -1,
 620       "foods": [
 621         {
 622           "name": "红豆薏米粥套餐",
 623           "price": 37,
 624           "oldPrice": "",
 625           "description": "红豆薏米粥,三鲜干蒸烧卖,拍黄瓜",
 626           "sellCount": 3,
 627           "rating": 100,
 628           "info": "",
 629           "ratings": [
 630             {
 631               "username": "2******3",
 632               "rateTime": 1469271264000,
 633               "rateType": 0,
 634               "text": "",
 635               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 636             }
 637           ],
 638           "icon": "http://fuss10.elemecdn.com/f/49/27f26ed00c025b2200a9ccbb7e67ejpeg.jpeg?imageView2/1/w/114/h/114",
 639           "image": "http://fuss10.elemecdn.com/f/49/27f26ed00c025b2200a9ccbb7e67ejpeg.jpeg?imageView2/1/w/750/h/750"
 640         },
 641         {
 642           "name": "皮蛋瘦肉粥套餐",
 643           "price": 31,
 644           "oldPrice": "",
 645           "description": "",
 646           "sellCount": 12,
 647           "rating": 100,
 648           "info": "",
 649           "ratings": [
 650             {
 651               "username": "2******3",
 652               "rateTime": 1469271264000,
 653               "rateType": 0,
 654               "text": "",
 655               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 656             }
 657           ],
 658           "icon": "http://fuss10.elemecdn.com/8/96/f444a8087f0e940ef264617f9d98ajpeg.jpeg?imageView2/1/w/114/h/114",
 659           "image": "http://fuss10.elemecdn.com/8/96/f444a8087f0e940ef264617f9d98ajpeg.jpeg?imageView2/1/w/750/h/750"
 660         }
 661       ]
 662     },
 663     {
 664       "name": "果拼果汁",
 665       "type": -1,
 666       "foods": [
 667         {
 668           "name": "蜜瓜圣女萝莉杯",
 669           "price": 6,
 670           "oldPrice": "",
 671           "description": "",
 672           "sellCount": 1,
 673           "rating": "",
 674           "info": "",
 675           "ratings": [],
 676           "icon": "http://fuss10.elemecdn.com/b/5f/b3b04c259d5ec9fa52e1856ee50dajpeg.jpeg?imageView2/1/w/114/h/114",
 677           "image": "http://fuss10.elemecdn.com/b/5f/b3b04c259d5ec9fa52e1856ee50dajpeg.jpeg?imageView2/1/w/750/h/750"
 678         },
 679         {
 680           "name": "加多宝",
 681           "price": 6,
 682           "oldPrice": "",
 683           "description": "",
 684           "sellCount": 7,
 685           "rating": 100,
 686           "info": "",
 687           "ratings": [
 688             {
 689               "username": "3******c",
 690               "rateTime": 1469281964000,
 691               "rateType": 0,
 692               "text": "",
 693               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 694             },
 695             {
 696               "username": "2******3",
 697               "rateTime": 1469271264000,
 698               "rateType": 0,
 699               "text": "",
 700               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 701             },
 702             {
 703               "username": "3******b",
 704               "rateTime": 1469261964000,
 705               "rateType": 0,
 706               "text": "",
 707               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 708             }
 709           ],
 710           "icon": "http://fuss10.elemecdn.com/b/9f/5e6c99c593cf65229225c5661bcdejpeg.jpeg?imageView2/1/w/114/h/114",
 711           "image": "http://fuss10.elemecdn.com/b/9f/5e6c99c593cf65229225c5661bcdejpeg.jpeg?imageView2/1/w/750/h/750"
 712         },
 713         {
 714           "name": "VC无限橙果汁",
 715           "price": 8,
 716           "oldPrice": 10,
 717           "description": "",
 718           "sellCount": 15,
 719           "rating": 100,
 720           "info": "",
 721           "ratings": [
 722             {
 723               "username": "3******c",
 724               "rateTime": 1469281964000,
 725               "rateType": 0,
 726               "text": "还可以",
 727               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 728             },
 729             {
 730               "username": "2******3",
 731               "rateTime": 1469271264000,
 732               "rateType": 0,
 733               "text": "",
 734               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 735             }
 736           ],
 737           "icon": "http://fuss10.elemecdn.com/e/c6/f348e811772016ae24e968238bcbfjpeg.jpeg?imageView2/1/w/114/h/114",
 738           "image": "http://fuss10.elemecdn.com/e/c6/f348e811772016ae24e968238bcbfjpeg.jpeg?imageView2/1/w/750/h/750"
 739         }
 740       ]
 741     },
 742     {
 743       "name": "小吃主食",
 744       "type": -1,
 745       "foods": [
 746         {
 747           "name": "扁豆焖面",
 748           "price": 14,
 749           "oldPrice": "",
 750           "description": "",
 751           "sellCount": 188,
 752           "rating": 96,
 753           "info": "",
 754           "ratings": [
 755             {
 756               "username": "3******c",
 757               "rateTime": 1469281964000,
 758               "rateType": 0,
 759               "text": "",
 760               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 761             },
 762             {
 763               "username": "2******3",
 764               "rateTime": 1469271264000,
 765               "rateType": 0,
 766               "text": "",
 767               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 768             },
 769             {
 770               "username": "3******b",
 771               "rateTime": 1469261964000,
 772               "rateType": 1,
 773               "text": "",
 774               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 775             }
 776           ],
 777           "icon": "http://fuss10.elemecdn.com/c/6b/29e3d29b0db63d36f7c500bca31d8jpeg.jpeg?imageView2/1/w/114/h/114",
 778           "image": "http://fuss10.elemecdn.com/c/6b/29e3d29b0db63d36f7c500bca31d8jpeg.jpeg?imageView2/1/w/750/h/750"
 779         },
 780         {
 781           "name": "葱花饼",
 782           "price": 10,
 783           "oldPrice": "",
 784           "description": "",
 785           "sellCount": 124,
 786           "rating": 85,
 787           "info": "",
 788           "ratings": [
 789             {
 790               "username": "3******c",
 791               "rateTime": 1469281964000,
 792               "rateType": 1,
 793               "text": "没啥味道",
 794               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 795             },
 796             {
 797               "username": "2******3",
 798               "rateTime": 1469271264000,
 799               "rateType": 1,
 800               "text": "很一般啊",
 801               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 802             },
 803             {
 804               "username": "3******b",
 805               "rateTime": 1469261964000,
 806               "rateType": 0,
 807               "text": "",
 808               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 809             }
 810           ],
 811           "icon": "http://fuss10.elemecdn.com/f/28/a51e7b18751bcdf871648a23fd3b4jpeg.jpeg?imageView2/1/w/114/h/114",
 812           "image": "http://fuss10.elemecdn.com/f/28/a51e7b18751bcdf871648a23fd3b4jpeg.jpeg?imageView2/1/w/750/h/750"
 813         },
 814         {
 815           "name": "牛肉馅饼",
 816           "price": 14,
 817           "oldPrice": "",
 818           "description": "",
 819           "sellCount": 114,
 820           "rating": 91,
 821           "info": "",
 822           "ratings": [
 823             {
 824               "username": "3******c",
 825               "rateTime": 1469281964000,
 826               "rateType": 1,
 827               "text": "难吃不推荐",
 828               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 829             },
 830             {
 831               "username": "2******3",
 832               "rateTime": 1469271264000,
 833               "rateType": 0,
 834               "text": "",
 835               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 836             },
 837             {
 838               "username": "3******b",
 839               "rateTime": 1469261964000,
 840               "rateType": 0,
 841               "text": "",
 842               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 843             }
 844           ],
 845           "icon": "http://fuss10.elemecdn.com/d/b9/bcab0e8ad97758e65ae5a62b2664ejpeg.jpeg?imageView2/1/w/114/h/114",
 846           "image": "http://fuss10.elemecdn.com/d/b9/bcab0e8ad97758e65ae5a62b2664ejpeg.jpeg?imageView2/1/w/750/h/750"
 847         },
 848         {
 849           "name": "招牌猪肉白菜锅贴/10个",
 850           "price": 17,
 851           "oldPrice": "",
 852           "description": "",
 853           "sellCount": 101,
 854           "rating": 78,
 855           "info": "",
 856           "ratings": [
 857             {
 858               "username": "3******c",
 859               "rateTime": 1469281964000,
 860               "rateType": 1,
 861               "text": "不脆,不好吃",
 862               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 863             },
 864             {
 865               "username": "2******3",
 866               "rateTime": 1469271264000,
 867               "rateType": 0,
 868               "text": "",
 869               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 870             },
 871             {
 872               "username": "3******b",
 873               "rateTime": 1469261964000,
 874               "rateType": 0,
 875               "text": "",
 876               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 877             }
 878           ],
 879           "icon": "http://fuss10.elemecdn.com/7/72/9a580c1462ca1e4d3c07e112bc035jpeg.jpeg?imageView2/1/w/114/h/114",
 880           "image": "http://fuss10.elemecdn.com/7/72/9a580c1462ca1e4d3c07e112bc035jpeg.jpeg?imageView2/1/w/750/h/750"
 881         },
 882         {
 883           "name": "糊塌子",
 884           "price": 10,
 885           "oldPrice": "",
 886           "description": "",
 887           "sellCount": 80,
 888           "rating": 93,
 889           "info": "",
 890           "ratings": [
 891             {
 892               "username": "3******c",
 893               "rateTime": 1469281964000,
 894               "rateType": 0,
 895               "text": "",
 896               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 897             },
 898             {
 899               "username": "2******3",
 900               "rateTime": 1469271264000,
 901               "rateType": 0,
 902               "text": "",
 903               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 904             },
 905             {
 906               "username": "3******b",
 907               "rateTime": 1469261964000,
 908               "rateType": 0,
 909               "text": "",
 910               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 911             }
 912           ],
 913           "icon": "http://fuss10.elemecdn.com/0/05/097a2a59fd2a2292d08067e16380cjpeg.jpeg?imageView2/1/w/114/h/114",
 914           "image": "http://fuss10.elemecdn.com/0/05/097a2a59fd2a2292d08067e16380cjpeg.jpeg?imageView2/1/w/750/h/750"
 915         }
 916       ]
 917     },
 918     {
 919       "name": "特色粥品",
 920       "type": -1,
 921       "foods": [
 922         {
 923           "name": "皮蛋瘦肉粥",
 924           "price": 10,
 925           "oldPrice": "",
 926           "description": "咸粥",
 927           "sellCount": 229,
 928           "rating": 100,
 929           "ratings": [
 930             {
 931               "username": "3******c",
 932               "rateTime": 1469281964000,
 933               "rateType": 0,
 934               "text": "很喜欢的粥",
 935               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 936             },
 937             {
 938               "username": "2******3",
 939               "rateTime": 1469271264000,
 940               "rateType": 0,
 941               "text": "",
 942               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 943             },
 944             {
 945               "username": "3******b",
 946               "rateTime": 1469261964000,
 947               "rateType": 1,
 948               "text": "",
 949               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 950             }
 951           ],
 952           "icon": "http://fuss10.elemecdn.com/c/cd/c12745ed8a5171e13b427dbc39401jpeg.jpeg?imageView2/1/w/114/h/114",
 953           "image": "http://fuss10.elemecdn.com/c/cd/c12745ed8a5171e13b427dbc39401jpeg.jpeg?imageView2/1/w/750/h/750"
 954         },
 955         {
 956           "name": "南瓜粥",
 957           "price": 9,
 958           "oldPrice": "",
 959           "description": "甜粥",
 960           "sellCount": 91,
 961           "rating": 100,
 962           "info": "",
 963           "ratings": [
 964             {
 965               "username": "3******c",
 966               "rateTime": 1469281964000,
 967               "rateType": 0,
 968               "text": "",
 969               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 970             },
 971             {
 972               "username": "2******3",
 973               "rateTime": 1469271264000,
 974               "rateType": 0,
 975               "text": "",
 976               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 977             },
 978             {
 979               "username": "3******b",
 980               "rateTime": 1469261964000,
 981               "rateType": 0,
 982               "text": "",
 983               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
 984             }
 985           ],
 986           "icon": "http://fuss10.elemecdn.com/8/a6/453f65f16b1391942af11511b7a90jpeg.jpeg?imageView2/1/w/114/h/114",
 987           "image": "http://fuss10.elemecdn.com/8/a6/453f65f16b1391942af11511b7a90jpeg.jpeg?imageView2/1/w/750/h/750"
 988         },
 989         {
 990           "name": "红豆薏米美肤粥",
 991           "price": 12,
 992           "oldPrice": "",
 993           "description": "甜粥",
 994           "sellCount": 86,
 995           "rating": 100,
 996           "info": "",
 997           "ratings": [
 998             {
 999               "username": "3******c",
1000               "rateTime": 1469281964000,
1001               "rateType": 0,
1002               "text": "",
1003               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1004             },
1005             {
1006               "username": "2******3",
1007               "rateTime": 1469271264000,
1008               "rateType": 0,
1009               "text": "",
1010               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1011             },
1012             {
1013               "username": "3******b",
1014               "rateTime": 1469261964000,
1015               "rateType": 0,
1016               "text": "",
1017               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1018             }
1019           ],
1020           "icon": "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/114/h/114",
1021           "image": "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/750/h/750"
1022         },
1023         {
1024           "name": "红枣山药糙米粥",
1025           "price": 10,
1026           "oldPrice": "",
1027           "description": "",
1028           "sellCount": 81,
1029           "rating": 91,
1030           "info": "",
1031           "ratings": [
1032             {
1033               "username": "3******c",
1034               "rateTime": 1469281964000,
1035               "rateType": 0,
1036               "text": "",
1037               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1038             },
1039             {
1040               "username": "2******3",
1041               "rateTime": 1469271264000,
1042               "rateType": 0,
1043               "text": "",
1044               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1045             },
1046             {
1047               "username": "3******b",
1048               "rateTime": 1469261964000,
1049               "rateType": 0,
1050               "text": "",
1051               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1052             }
1053           ],
1054           "icon": "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/114/h/114",
1055           "image": "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/750/h/750"
1056         },
1057         {
1058           "name": "鲜蔬菌菇粥",
1059           "price": 11,
1060           "oldPrice": "",
1061           "description": "咸粥",
1062           "sellCount": 56,
1063           "rating": 100,
1064           "info": "",
1065           "ratings": [
1066             {
1067               "username": "3******c",
1068               "rateTime": 1469281964000,
1069               "rateType": 0,
1070               "text": "",
1071               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1072             },
1073             {
1074               "username": "2******3",
1075               "rateTime": 1469271264000,
1076               "rateType": 0,
1077               "text": ""
1078             },
1079             {
1080               "username": "3******b",
1081               "rateTime": 1469261964000,
1082               "rateType": 0,
1083               "text": "",
1084               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1085             }
1086           ],
1087           "icon": "http://fuss10.elemecdn.com/e/a3/5317c68dd618929b6ac05804e429ajpeg.jpeg?imageView2/1/w/114/h/114",
1088           "image": "http://fuss10.elemecdn.com/e/a3/5317c68dd618929b6ac05804e429ajpeg.jpeg?imageView2/1/w/750/h/750"
1089         },
1090         {
1091           "name": "田园蔬菜粥",
1092           "price": 10,
1093           "oldPrice": "",
1094           "description": "咸粥",
1095           "sellCount": 33,
1096           "rating": 100,
1097           "info": "",
1098           "ratings": [
1099             {
1100               "username": "3******c",
1101               "rateTime": 1469281964000,
1102               "rateType": 0,
1103               "text": "",
1104               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1105             },
1106             {
1107               "username": "2******3",
1108               "rateTime": 1469271264000,
1109               "rateType": 0,
1110               "text": "",
1111               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1112             },
1113             {
1114               "username": "3******b",
1115               "rateTime": 1469261964000,
1116               "rateType": 0,
1117               "text": "",
1118               "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png"
1119             }
1120           ],
1121           "icon": "http://fuss10.elemecdn.com/a/94/7371083792c19df00e546b29e344cjpeg.jpeg?imageView2/1/w/114/h/114",
1122           "image": "http://fuss10.elemecdn.com/a/94/7371083792c19df00e546b29e344cjpeg.jpeg?imageView2/1/w/750/h/750"
1123         }
1124       ]
1125     }
1126   ],
1127   "ratings": [
1128     {
1129       "username": "3******c",
1130       "rateTime": 1469281964000,
1131       "deliveryTime": 30,
1132       "score": 5,
1133       "rateType": 0,
1134       "text": "不错,粥很好喝,我经常吃这一家,非常赞,以后也会常来吃,强烈推荐.",
1135       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1136       "recommend": [
1137         "南瓜粥",
1138         "皮蛋瘦肉粥",
1139         "扁豆焖面",
1140         "娃娃菜炖豆腐",
1141         "牛肉馅饼"
1142       ]
1143     },
1144     {
1145       "username": "2******3",
1146       "rateTime": 1469271264000,
1147       "deliveryTime": "",
1148       "score": 4,
1149       "rateType": 0,
1150       "deliveryTime": "",
1151       "text": "服务态度不错",
1152       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1153       "recommend": [
1154         "扁豆焖面"
1155       ]
1156     },
1157     {
1158       "username": "3******b",
1159       "rateTime": 1469261964000,
1160       "score": 3,
1161       "rateType": 1,
1162       "text": "",
1163       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1164       "recommend": []
1165     },
1166     {
1167       "username": "1******c",
1168       "rateTime": 1469261864000,
1169       "deliveryTime": 20,
1170       "score": 5,
1171       "rateType": 0,
1172       "text": "良心店铺",
1173       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1174       "recommend": []
1175     },
1176     {
1177       "username": "2******d",
1178       "rateTime": 1469251264000,
1179       "deliveryTime": 10,
1180       "score": 4,
1181       "rateType": 0,
1182       "text": "",
1183       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1184       "recommend": []
1185     },
1186     {
1187       "username": "9******0",
1188       "rateTime": 1469241964000,
1189       "deliveryTime": 70,
1190       "score": 1,
1191       "rateType": 1,
1192       "text": "送货速度蜗牛一样",
1193       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1194       "recommend": []
1195     },
1196     {
1197       "username": "d******c",
1198       "rateTime": 1469231964000,
1199       "deliveryTime": 30,
1200       "score": 5,
1201       "rateType": 0,
1202       "text": "很喜欢的粥店",
1203       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1204       "recommend": []
1205     },
1206     {
1207       "username": "2******3",
1208       "rateTime": 1469221264000,
1209       "deliveryTime": "",
1210       "score": 4,
1211       "rateType": 0,
1212       "text": "量给的还可以",
1213       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1214       "recommend": []
1215     },
1216     {
1217       "username": "3******8",
1218       "rateTime": 1469211964000,
1219       "deliveryTime": "",
1220       "score": 3,
1221       "rateType": 1,
1222       "text": "",
1223       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1224       "recommend": []
1225     },
1226     {
1227       "username": "a******a",
1228       "rateTime": 1469201964000,
1229       "deliveryTime": "",
1230       "score": 4,
1231       "rateType": 0,
1232       "text": "孩子喜欢吃这家",
1233       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1234       "recommend": [
1235         "南瓜粥"
1236       ]
1237     },
1238     {
1239       "username": "3******3",
1240       "rateTime": 1469191264000,
1241       "deliveryTime": "",
1242       "score": 4,
1243       "rateType": 0,
1244       "text": "粥挺好吃的",
1245       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1246       "recommend": []
1247     },
1248     {
1249       "username": "t******b",
1250       "rateTime": 1469181964000,
1251       "deliveryTime": "",
1252       "score": 3,
1253       "rateType": 1,
1254       "text": "",
1255       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1256       "recommend": []
1257     },
1258     {
1259       "username": "f******c",
1260       "rateTime": 1469171964000,
1261       "deliveryTime": 15,
1262       "score": 5,
1263       "rateType": 0,
1264       "text": "送货速度很快",
1265       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1266       "recommend": []
1267     },
1268     {
1269       "username": "k******3",
1270       "rateTime": 1469161264000,
1271       "deliveryTime": "",
1272       "score": 4,
1273       "rateType": 0,
1274       "text": "",
1275       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1276       "recommend": []
1277     },
1278     {
1279       "username": "u******b",
1280       "rateTime": 1469151964000,
1281       "deliveryTime": "",
1282       "score": 4,
1283       "rateType": 0,
1284       "text": "下雨天给快递小哥点个赞",
1285       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1286       "recommend": []
1287     },
1288     {
1289       "username": "s******c",
1290       "rateTime": 1469141964000,
1291       "deliveryTime": "",
1292       "score": 4,
1293       "rateType": 0,
1294       "text": "好",
1295       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1296       "recommend": []
1297     },
1298     {
1299       "username": "z******3",
1300       "rateTime": 1469131264000,
1301       "deliveryTime": "",
1302       "score": 5,
1303       "rateType": 0,
1304       "text": "吃了还想再吃",
1305       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1306       "recommend": []
1307     },
1308     {
1309       "username": "n******b",
1310       "rateTime": 1469121964000,
1311       "deliveryTime": "",
1312       "score": 3,
1313       "rateType": 1,
1314       "text": "发票开的不对",
1315       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1316       "recommend": []
1317     },
1318     {
1319       "username": "m******c",
1320       "rateTime": 1469111964000,
1321       "deliveryTime": 30,
1322       "score": 5,
1323       "rateType": 0,
1324       "text": "好吃",
1325       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1326       "recommend": []
1327     },
1328     {
1329       "username": "l******3",
1330       "rateTime": 1469101264000,
1331       "deliveryTime": 40,
1332       "score": 5,
1333       "rateType": 0,
1334       "text": "还不错吧",
1335       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1336       "recommend": []
1337     },
1338     {
1339       "username": "3******o",
1340       "rateTime": 1469091964000,
1341       "deliveryTime": "",
1342       "score": 2,
1343       "rateType": 1,
1344       "text": "",
1345       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1346       "recommend": []
1347     },
1348     {
1349       "username": "3******p",
1350       "rateTime": 1469081964000,
1351       "deliveryTime": "",
1352       "score": 4,
1353       "rateType": 0,
1354       "text": "很喜欢的粥",
1355       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1356       "recommend": []
1357     },
1358     {
1359       "username": "o******k",
1360       "rateTime": 1469071264000,
1361       "deliveryTime": "",
1362       "score": 5,
1363       "rateType": 0,
1364       "text": "",
1365       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1366       "recommend": []
1367     },
1368     {
1369       "username": "k******b",
1370       "rateTime": 1469061964000,
1371       "deliveryTime": "",
1372       "score": 4,
1373       "rateType": 0,
1374       "text": "",
1375       "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
1376       "recommend": []
1377     }
1378   ]
1379 }
View Code

3. 最重要的一步来了,由于vue-cli版本的不同,会造成误解,一种就版本是在build文件夹下有dev-server.js和dev-client.js的这两个文件,另外一个新版本就build文件夹下没有dev-server.js和dev-client.js这俩个文件,而是webpack.dev.conf.js代替,我这里使用的就是新版本的作为演示

 

 4.在webpack.dev.conf.js文件中const portfinder = require('portfinder')后添加在如下代码

1 const express = require('express')
2 const app = express()
3 var appData = require('../data.json')//加载本地数据文件
4 var seller = appData.seller//获取对应的本地数据
5 var goods = appData.goods
6 var ratings = appData.ratings
7 var apiRoutes = express.Router()
View Code

 

 5. 然后继续在webpack.dev.conf.js文件中继续添加如下代码,找到devServer

 1  before(app) {
 2       app.get('/api/seller', (req, res) => {
 3         res.json({
 4           errno: 0,
 5           data: seller
 6         })//接口返回json数据,上面配置的数据seller就赋值给data请求后调用
 7       }),
 8       app.get('/api/goods', (req, res) => {
 9         res.json({
10           errno: 0,
11           data: goods
12         })
13       }),
14       app.get('/api/ratings', (req, res) => {
15         res.json({
16           errno: 0,
17           data: ratings
18         })
19       })
20     }
21   },
View Code

 

 

 

 6. 最后一步就是npm run dev,然后在浏览器中输入localhost:8080/api/goods

 

 

 

 

大功告成!

posted @ 2019-11-23 21:45  肖恩雷  阅读(755)  评论(0编辑  收藏  举报