diff --git a/app/Http/Controllers/Weixin/GoodsController.php b/app/Http/Controllers/Weixin/GoodsController.php index ffebf5f..347192f 100644 --- a/app/Http/Controllers/Weixin/GoodsController.php +++ b/app/Http/Controllers/Weixin/GoodsController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Weixin; use App\Http\Controllers\Weixin\CommonController; use Illuminate\Http\Request; +use App\Common\ReturnCode; class GoodsController extends CommonController { @@ -22,6 +23,8 @@ class GoodsController extends CommonController $res = curl_request($url,$postdata,'GET'); $data['post'] = $res['data']; + if(!$data['post']){$this->error_jump(ReturnCode::NO_FOUND,route('weixin'),3);} + return view('weixin.goods.goodsDetail', $data); } diff --git a/app/Http/Model/Comment.php b/app/Http/Model/Comment.php index d76d858..d22cf95 100644 --- a/app/Http/Model/Comment.php +++ b/app/Http/Model/Comment.php @@ -17,7 +17,10 @@ class Comment extends BaseModel */ protected $guarded = []; - const SHOW_COMMENT = 1; //评论已审核 + const UNSHOW_COMMENT = 0; //评论未批准显示 + const SHOW_COMMENT = 1; //评论批准显示 + const GOODS_COMMENT_TYPE = 0; //商品评论 + const ARTICLE_COMMENT_TYPE = 1; //文章评论 //获取列表 public static function getList(array $param) diff --git a/app/Http/Model/Goods.php b/app/Http/Model/Goods.php index 6c642b3..e27c08f 100644 --- a/app/Http/Model/Goods.php +++ b/app/Http/Model/Goods.php @@ -250,6 +250,14 @@ class Goods extends BaseModel $res = $model->first(); + if($res) + { + $where2['comment_type'] = Comment::GOODS_COMMENT_TYPE; + $where2['status'] = Comment::SHOW_COMMENT; + $where2['id_value'] = $id; + $res->goods_comments_num = Comment::where($where2)->count(); + } + return $res; } } \ No newline at end of file diff --git a/public/css/weixin/style.css b/public/css/weixin/style.css index ac114e3..2e33840 100644 --- a/public/css/weixin/style.css +++ b/public/css/weixin/style.css @@ -809,8 +809,6 @@ h1.arc_tit, h2.arc_tit{font-weight: normal;font-size: 1.4em;padding: 10px;} } .goods-header .wish-add { position: relative; - height: 12px; - line-height: 12px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -818,12 +816,11 @@ h1.arc_tit, h2.arc_tit{font-weight: normal;font-size: 1.4em;padding: 10px;} color:#ea6f5a; background-color: transparent; border: 1px solid #ea6f5a; - border-radius: 3px; - font-size: 16px; - padding:4px 6px; + border-radius:2px; + font-size:14px; + padding:0 3px; display: inline-block; - text-align: center; - margin:3px 10px 0 0; + margin-right:10px; } .goods-header .wish-add-activate{color:#fff;background-color:#ea6f5a;} .goods-header .goods-price { @@ -915,7 +912,7 @@ display: block; position: absolute; top: 0; } -.goods_info_pop{ background-color:#fff; display:block; position:fixed; z-index:100; bottom:0px; left:0; padding-bottom:20px; /*box-shadow:0 -2px 3px #a0a0a0;*/ border-top:2px solid #dcdcdc; width:100%;} +.goods_info_pop{background-color:#fff; display:block; position:fixed; z-index:100; bottom:0px; left:0; padding-bottom:20px; /*box-shadow:0 -2px 3px #a0a0a0;*/ border-top:1px solid #f1f1f1; width:100%;} .goods_info_pop ul{ padding:0px 0 35px; display:inline-block;} diff --git a/resources/views/weixin/goods/goodsDetail.blade.php b/resources/views/weixin/goods/goodsDetail.blade.php index e2db14c..63e157c 100644 --- a/resources/views/weixin/goods/goodsDetail.blade.php +++ b/resources/views/weixin/goods/goodsDetail.blade.php @@ -83,7 +83,7 @@ var swiper = new Swiper('.swiper-container', { -
¥1.00
-库存10件
+¥
+库存件