Browse Source

商品详情优化

master
Lemon 5 years ago
parent
commit
909e8c0ce2
  1. 2
      app/Controller/v3/ShopCartController.php
  2. 43
      app/Service/v3/Implementations/GoodsService.php
  3. 2
      app/Service/v3/Implementations/ShopCartService.php
  4. 2
      app/Service/v3/Interfaces/ShopCartServiceInterface.php

2
app/Controller/v3/ShopCartController.php

@ -24,7 +24,7 @@ class ShopCartController extends BaseController
return $this->success($res);
}
public function check()
public function getGoodsNum()
{
}

43
app/Service/v3/Implementations/GoodsService.php

@ -19,9 +19,37 @@ class GoodsService implements GoodsServiceInterface
* 限时抢购
* 为你推荐
* */
$goods['detail'] = Db::table('lanzu_goods')->where('id',170)->get();
$goods['detail'] = [
"id" => 170,
"market_id" => 2,
"store_id" => 39,
"goods_type_id" => 39,
"on_sale" => 1,
"sort" => 0,
"is_infinite" => 2,
"start_num" => 0,
"restrict_num" => 0,
"inventory" => 1000,
"name" => "冬菜",
"cover_img" => "https => //store.lanzu.vip/attachment/images/2/2020/06/en2nQYncqN4f44qnA7CwnNOG2WqQ2q.jpg",
"price" => "2.50",
"original_price" => "2.50",
"vip_price" => "0.00",
"sales" => 0,
"good_unit" => "",
"tags" => null,
"details_imgs" => null,
"spec" => null,
"content" => "",
"details" => "<p><img src=\"https => //store.lanzu.vip/attachment/images/2/2020/06/J1Z5N818NqCt581LF1V1Tqd88151fV.jpg\" _src=\"https => //store.lanzu.vip/attachment/images/2/2020/06/J1Z5N818NqCt581LF1V1Tqd88151fV.jpg\" alt=\"冬菜.jpg\" style=\"max-width => 100%\"></p><p>​<br></p>",
"created_at" => null,
"updated_at" => 1598769782,
"deleted_at" => null,
'净含量' => '约500G',
'保存条件' => '常温',
'保质期' => '10天'
];
$goods['banner'] = $this->getBanner();
$goods['spec'] = $this->getSpec();
return $goods;
}
@ -42,15 +70,4 @@ class GoodsService implements GoodsServiceInterface
return $banner;
}
public function getSpec()
{
$spec = [
[
'净含量' => '约500G',
'保存条件' => '常温',
'保质期' => '10天'
]
];
return $spec;
}
}

2
app/Service/v3/Implementations/ShopCartService.php

@ -55,7 +55,7 @@ class ShopCartService implements ShopCartServiceInterface
return $res;
}
public function check()
public function getGoodsNum()
{
// TODO: Implement check() method.
}

2
app/Service/v3/Interfaces/ShopCartServiceInterface.php

@ -6,7 +6,7 @@ interface ShopCartServiceInterface
{
public function detail();
public function check();
public function getGoodsNum();
public function undo();
}
Loading…
Cancel
Save