1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- namespace App\Modules\Mini\Controllers;
- use App\Base\BaseController;
- use App\Modules\Mini\Services\PageService;
- use Faker\Provider\Image;
- class GoodsController extends BaseController
- {
- protected PageService $service;
- /**
- * @param PageService $service
- */
- public function __construct(PageService $service)
- {
- $this->service = $service;
- }
- public function goods()
- {
- return $this->ok([
- "id" => 1,
- "image_list" => [
- Image::imageUrl(),
- Image::imageUrl(),
- ],
- "spec" => [
- "id" => 1,
- "name" => "颜色",
- "attr" => [
- [
- "id" => 1,
- "name" => "红色",
- ],
- ],
- ],
- "sku" => [
- [
- "id" => 1,
- "sn" => "sn",
- "url_3d" => "",
- "spec_attr" => [
- [
- "id" => 1,
- "name" => "白色",
- ],
- [
- "id" => 3,
- "name" => "大号",
- ],
- ],
- ],
- ],
- "desc_html" => "<h1>desc_html</h1>",
- "spec_attr_html" => "<h1>desc_html</h1>",
- "faq_html" => "<h1>desc_html</h1>",
- ]);
- }
- 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" => "分类名称",
- ],
- ],
- ]);
- }
- public function fav()
- {
- return $this->ok();
- }
- public function ask()
- {
- return $this->ok([
- "id" => 1,
- "thumb" => Image::imageUrl(),
- "name" => "商品名称",
- "url" => "http://baidu.com/xxxx",
- ]);
- }
- }
|