service = $service; } public function filterConfig() { return $this->ok([ [ "id" => 1, "name" => "类目示例", "type" => "category", "child" => [ [ "id" => 1, "name" => "名称", ], ], ], [ "id" => 1, "name" => "属性示例", "type" => "attr", "child" => [ [ "id" => 1, "name" => "名称", ], ], ], ]); } public function home() { return $this->ok([ "banner" => $this->service->banner(), "categoryTree" => [ [ "id" => 1, "name" => "一级分类", "child" => [ [ "id" => 1, "name" => "二级分类", ], ], ], ], "hot_goods" => [ [ "id" => 1, "name" => "商品名称", "thumb" => Image::imageUrl(), ], ], "recommend_goods" => [ [ "id" => 1, "name" => "商品名称", "thumb" => Image::imageUrl(), ], ], ]); } public function categoryGoods() { return $this->ok([ "total" => 1, "page_total" => 1, "list" => [ [ "id" => 1, "name" => "商品名称", "thumb" => Image::imageUrl(), ], ], ]); } public function categoryTree() { return $this->ok([ "categoryTree" => [ [ "id" => 1, "name" => "一级分类", "child" => [ [ "id" => 1, "name" => "二级分类", "child" => [ [ "id" => 1, "name" => "二级分类", ], ], ], ], ], ], ]); } public function search() { return $this->ok([ "total" => 1, "page_total" => 1, "list" => [ [ "id" => 1, "name" => "商品名称", "thumb" => Image::imageUrl(), ], ], "category" => [ [ "id" => 1, "thumb" => Image::imageUrl(), "name" => "分类名称", ], ], ]); } }