Browse Source

goodsbrand

master
林一峰 7 years ago
parent
commit
3c00d94aea
  1. 39
      app/Http/Controllers/Api/GoodsBrandController.php
  2. 1
      app/Http/Controllers/Api/GoodsController.php
  3. 40
      app/Http/Controllers/Weixin/GoodsBrandController.php
  4. 1
      app/Http/Controllers/Weixin/GoodsController.php
  5. 26
      app/Http/Controllers/Weixin/IndexController.php
  6. 13
      app/Http/Model/Goods.php
  7. 3
      app/Http/Model/GoodsBrand.php
  8. 28
      lqycms.sql
  9. 13
      public/css/weixin/style.css
  10. 2
      resources/views/admin/goods/add.blade.php
  11. 2
      resources/views/admin/goods/edit.blade.php
  12. 2
      resources/views/admin/order/index.blade.php
  13. 2
      resources/views/weixin/goods/categoryGoodsList.blade.php
  14. 2
      resources/views/weixin/goods/goodsDetail.blade.php
  15. 6
      resources/views/weixin/goods/goodslist.blade.php
  16. 295
      resources/views/weixin/goods_brand/brandDetail.blade.php
  17. 29
      resources/views/weixin/goods_brand/brandList.blade.php
  18. 96
      resources/views/weixin/index/index.blade.php
  19. 2
      resources/views/weixin/user/userDistribution.blade.php
  20. 6
      routes/web.php

39
app/Http/Controllers/Api/GoodsBrandController.php

@ -0,0 +1,39 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Api\CommonController;
use Illuminate\Http\Request;
use App\Common\ReturnData;
use App\Common\Token;
use App\Http\Model\GoodsBrand;
class GoodsBrandController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function goodsBrandDetail(Request $request)
{
//参数
$data['id'] = $request->input('id','');
if($data['id']==''){return ReturnData::create(ReturnData::PARAMS_ERROR);}
$res = GoodsBrand::getOne($data);
return ReturnData::create(ReturnData::SUCCESS,$res);
}
public function goodsBrandList(Request $request)
{
//参数
$data['limit'] = $request->input('limit', 10);
$data['offset'] = $request->input('offset', 0);
$data['status'] = GoodsBrand::IS_SHOW;
$res = GoodsBrand::getList($data);
return ReturnData::create(ReturnData::SUCCESS,$res);
}
}

1
app/Http/Controllers/Api/GoodsController.php

@ -42,6 +42,7 @@ class GoodsController extends CommonController
if($request->input('min_price', '') != ''){$data['min_price'] = $request->input('min_price');}
if($request->input('max_price', '') != ''){$data['max_price'] = $request->input('max_price');}
if($request->input('orderby', '') != ''){$data['orderby'] = $request->input('orderby');}
if($request->input('brand_id', '') != ''){$data['brand_id'] = $request->input('brand_id');}
$res = Goods::getList($data);

40
app/Http/Controllers/Weixin/GoodsBrandController.php

@ -0,0 +1,40 @@
<?php
namespace App\Http\Controllers\Weixin;
use App\Http\Controllers\Weixin\CommonController;
use Illuminate\Http\Request;
use App\Common\ReturnCode;
class GoodsBrandController extends CommonController
{
public function __construct()
{
parent::__construct();
}
//商品品牌详情
public function brandDetail($id)
{
$postdata['id'] = $id;
$url = env('APP_API_URL')."/goodsbrand_detail";
$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_brand.brandDetail', $data);
}
//商品品牌列表
public function brandList(Request $request)
{
//商品列表
$postdata['limit'] = 10;
$postdata['offset'] = 0;
$url = env('APP_API_URL')."/goodsbrand_list";
$res = curl_request($url,$postdata,'GET');
$data['list'] = $res['data']['list'];
return view('weixin.goods_brand.brandList', $data);
}
}

1
app/Http/Controllers/Weixin/GoodsController.php

@ -49,6 +49,7 @@ class GoodsController extends CommonController
if($request->input('orderby', '') != ''){$param['orderby'] = $request->input('orderby');}
if($request->input('max_price', '') != ''){$param['max_price'] = $request->input('max_price');}else{$param['max_price'] = 99999;}
if($request->input('min_price', '') != ''){$param['min_price'] = $request->input('min_price');}else{$param['min_price'] = 0;}
if($request->input('brand_id', '') != ''){$param['brand_id'] = $request->input('brand_id');}
//商品列表
$postdata = $param;

26
app/Http/Controllers/Weixin/IndexController.php

@ -45,9 +45,9 @@ class IndexController extends CommonController
$res = curl_request($url,$postdata,'GET');
$data['article_list'] = $res['data']['list'];
//商品列表
//最新商品列表
$postdata = array(
'limit' => 10,
'limit' => 8,
'offset' => 0
);
$url = env('APP_API_URL')."/goods_list";
@ -57,13 +57,33 @@ class IndexController extends CommonController
//商品推荐
$postdata = array(
'tuijian'=> 1,
'limit' => 4,
'limit' => 6,
'offset' => 0
);
$url = env('APP_API_URL')."/goods_list";
$res = curl_request($url,$postdata,'GET');
$data['goods_recommend_list'] = $res['data']['list'];
//畅销商品列表
$postdata = array(
'orderby'=> 1,
'limit' => 6,
'offset' => 0
);
$url = env('APP_API_URL')."/goods_list";
$res = curl_request($url,$postdata,'GET');
$data['goods_sale_list'] = $res['data']['list'];
//促销、优惠商品列表
$postdata = array(
'orderby'=> 5,
'limit' => 4,
'offset' => 0
);
$url = env('APP_API_URL')."/goods_list";
$res = curl_request($url,$postdata,'GET');
$data['goods_promote_list'] = $res['data']['list'];
return view('weixin.index.index',$data);
}

13
app/Http/Model/Goods.php

@ -36,7 +36,7 @@ class Goods extends BaseModel
'id', 'typeid', 'tuijian', 'click', 'title', 'sn', 'price','litpic', 'pubdate', 'add_time', 'market_price', 'goods_number', 'sale', 'comments','promote_start_date','promote_price','promote_end_date','goods_img','spec','point'
);
const STATUS = 0; //商品是否删除,0未删除
const STATUS = 0; //商品状态 0正常 1已删除 2下架 3申请上架
/**
* 获取关联到产品的分类
@ -61,6 +61,7 @@ class Goods extends BaseModel
if(isset($typeid)){$where['typeid'] = $typeid;}
if(isset($tuijian)){$where['tuijian'] = $tuijian;}
if(isset($status)){$where['status'] = $status;}else{$where['status'] = self::STATUS;}
if(isset($brand_id)){$where['brand_id'] = $brand_id;}
if($where !== '')
{
@ -97,6 +98,10 @@ class Goods extends BaseModel
case 4:
$model = $model->orderBy('price','asc'); //价格从低到高
break;
case 5:
$timestamp = time();
$model = $model->where('promote_start_date','<=',$timestamp)->where('promote_end_date','>=',$timestamp); //促销商品
break;
default:
$model = $model->orderBy('pubdate','desc'); //最新
}
@ -111,6 +116,8 @@ class Goods extends BaseModel
foreach($res['list'] as $k=>$v)
{
$res['list'][$k]->goods_detail_url = route('weixin_goods_detail',array('id'=>$v->id));
$res['list'][$k]->price = self::get_final_price($v->id);
$res['list'][$k]->is_promote_goods = self::bargain_price($v->promote_price,$v->promote_start_date,$v->promote_end_date); //is_promote_goods等于0,说明不是促销商品
}
}
}
@ -135,6 +142,7 @@ class Goods extends BaseModel
{
$goods['goods_detail_url'] = route('weixin_goods_detail',array('id'=>$goods->id));
$goods['price'] = self::get_final_price($id);
$goods['is_promote_goods'] = self::bargain_price($goods->promote_price,$goods->promote_start_date,$goods->promote_end_date); //is_promote_goods等于0,说明不是促销商品
}
return $goods;
@ -264,6 +272,9 @@ class Goods extends BaseModel
$where2['status'] = Comment::SHOW_COMMENT;
$where2['id_value'] = $id;
$res->goods_comments_num = Comment::where($where2)->count();
$res->price = self::get_final_price($res->id); //商品最终价格
$res->is_promote_goods = self::bargain_price($res->promote_price,$res->promote_start_date,$res->promote_end_date); //is_promote_goods等于0,说明不是促销商品
}
return $res;

3
app/Http/Model/GoodsBrand.php

@ -21,11 +21,8 @@ class GoodsBrand extends BaseModel
$limit = isset($limit) ? $limit : 10;
$offset = isset($offset) ? $offset : 0;
$where['status'] = self::IS_SHOW;
$model = new self;
if($where){$model = $model->where($where);}
$res['count'] = $model->count();
$res['list'] = array();

28
lqycms.sql
File diff suppressed because it is too large
View File

13
public/css/weixin/style.css

@ -65,14 +65,14 @@ background:none;
.banner_tit img{width:100%;}
.goods_list{overflow:hidden;background-color:#f1f1f1;}.goods_list .goods_info{padding:5px 10px 5px 10px;}
.goods_list li{margin-bottom:4px;width:50%;float:left;overflow:hidden;}
.goods_list li a{display:block;font-size:0.875em;margin-right:2px;background-color:#fff;}.goods_list .goods_tit{overflow:hidden;white-space:nowrap;color:#000}
.goods_list li img{width:100%;height:48vw;}.goods_list li .goods_price{color:#f23030;}.goods_list li .goods_price b{font-size:1rem;font-weight:normal;}
.goods_list li a{display:block;margin-right:2px;background-color:#fff;}.goods_list .goods_tit{overflow:hidden;white-space:nowrap;color:#000}
.goods_list li img{width:100%;height:48vw;}.goods_list li .goods_price{color:#f23030;}.goods_list li .goods_price b{font-size:1rem;font-weight:normal;}.goods_list li .goods_price span{color:#999;font-size:14px;}
.goods_list li:nth-child(even) a{margin-right:0;margin-left:2px;}
.goods_list_small{overflow:hidden;background-color:#f1f1f1;margin-left:4px;}.goods_list_small .goods_info{padding:5px 10px 5px 10px;}
.goods_list_small li{margin-bottom:4px;width:50%;float:left;overflow:hidden;}
.goods_list_small li a{display:block;font-size:0.875em;margin-right:2px;background-color:#fff;}.goods_list_small .goods_tit{overflow:hidden;white-space:nowrap;color:#000}
.goods_list_small li img{width:100%;height:auto;}.goods_list_small li .goods_price{color:#f23030;}.goods_list_small li .goods_price b{font-size:1rem;font-weight:normal;}
.goods_list_small li a{display:block;margin-right:2px;background-color:#fff;}.goods_list_small .goods_tit{overflow:hidden;white-space:nowrap;color:#000}
.goods_list_small li img{width:100%;height:auto;}.goods_list_small li .goods_price{color:#f23030;}.goods_list_small li .goods_price b{font-size:1rem;font-weight:normal;}.goods_list_small li .goods_price span{color:#999;font-size:14px;}
.goods_list_small li:nth-child(even) a{margin-right:0;margin-left:2px;}
.goods_list_s li{color:#333;border-bottom:1px solid #eee;overflow:hidden;margin-left:10px;margin-right:10px;padding:15px 5px 15px 5px;}
@ -925,6 +925,9 @@ top: 0;
font-size: 16px;
}
.banner_headline{height:30px;overflow:hidden;background-color:#f1f1f1;padding-bottom:20px;}
.banner_headline .tit{border-top:1px dashed #dedede;text-align:center;margin:25px 0;}
.banner_headline .tit h4{color:#666;background-color:#f1f1f1;font-size:18px;font-weight:normal;position:relative;top:-14px;display:inline;padding:0 20px;}
.badge_comm{padding:0 3px;border-radius:2px;color:#fff;background-color:#f74c31;display:inline-block;text-align:center;font-size:12px;background-clip:padding-box;-webkit-appearance:none;}

2
resources/views/admin/goods/add.blade.php

@ -24,7 +24,7 @@
<td align="right">上架:</td>
<td>
<input type="radio" value='0' name="status" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="status" />&nbsp;
<input type="radio" value='2' name="status" />&nbsp;
</td>
</tr>
<tr>

2
resources/views/admin/goods/edit.blade.php

@ -24,7 +24,7 @@
<td align="right">上架:</td>
<td>
<input type="radio" value='0' name="status" <?php if($post['status']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
<input type="radio" value='1' name="status" <?php if($post['status']==1){echo 'checked';} ?> />&nbsp;否
<input type="radio" value='2' name="status" <?php if($post['status']==2){echo 'checked';} ?> />&nbsp;否
</td>
</tr>
<tr>

2
resources/views/admin/order/index.blade.php

@ -24,7 +24,7 @@ function output_excel()
{
layer.open({
title: '导出EXCEL',
area: ['400px', '360px'],
area: ['460px', '360px'],
shadeClose: true, //开启遮罩关闭
content: '<form id="output-excel" action="<?php echo route('admin_order_output_excel'); ?>" method="get"><div class="form-inline"><div class="form-group"><label for="min_addtime">时 间:</label><input size="18" onclick="WdatePicker({el:this,dateFmt:\'yyyy-MM-dd HH:mm:ss\'})" type="text" class="form-control" id="min_addtime" name="min_addtime" placeholder="开始时间"></div> - <div class="form-group"><input size="18" onclick="WdatePicker({el:this,dateFmt:\'yyyy-MM-dd HH:mm:ss\'})" type="text" class="form-control" id="max_addtime" name="max_addtime" placeholder="结束时间"></div></div><div class="form-inline mt10"><div class="form-group"><label for="num">数 量:</label><input size="4" type="text" class="form-control" id="num" name="num" value="100" placeholder=""></div></div><div class="form-inline mt10"><div class="form-group"><label for="status">订单状态:</label><select id="status" class="form-control" name="status"><option value ="0">全部</option><option value ="1">待付款</option><option value="2">待发货</option><option value="3">待收货</option><option value="4">交易成功</option><option value="5">退款中</option></select></div></div><div class="form-inline mt10"><div class="form-group"><label for="name">收货人:</label><input size="8" type="text" class="form-control" id="name" name="name" placeholder=""></div></div><div class="form-inline mt10"><div class="form-group"><label for="order_sn">订单号:</label><input size="20" type="text" class="form-control" id="order_sn" name="order_sn" placeholder=""></div></div></form>'
,btn: ['导出', '取消']

2
resources/views/weixin/goods/categoryGoodsList.blade.php

@ -29,7 +29,7 @@
<?php if($goods_list){ ?>
<ul class="goods_list_small">
<?php foreach($goods_list as $k=>$v){ ?>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img class="imgzsy" alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b></div></div></a></li>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img class="imgzsy" alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php if($v['is_promote_goods']>0){ ?><span class="badge_comm" style="background-color:#f23030;">Hot</span> <?php } ?><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b></div></div></a></li>
<?php } ?>
</ul>
<?php }else{ ?>

2
resources/views/weixin/goods/goodsDetail.blade.php

@ -56,7 +56,7 @@ var swiper = new Swiper('.swiper-container', {
<div class="current-price">
<span></span><i class="price"><?php echo $post['price']; ?></i>
</div>
<span class="btn-retail">门店有售</span>
<?php if($post['is_promote_goods']>0){ ?><span class="btn-retail">促销</span><?php } ?>
</div>
<div class="stock-detail table-cell">

6
resources/views/weixin/goods/goodslist.blade.php

@ -30,11 +30,13 @@
</nav>
<div class="floor">
<?php if($goods_list){ ?>
<ul class="goods_list" id="goods_list">
<?php foreach($goods_list as $k=>$v){ ?>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b></div></div></a></li>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php if($v['is_promote_goods']>0){ ?><span class="badge_comm" style="background-color:#f23030;">Hot</span> <?php } ?><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b><span class="fr"><?php echo $v['sale']; ?>人付款</span></div></div></a></li>
<?php } ?>
</ul>
</ul><?php }else{ ?>
<div style="text-align:center;line-height:40px;color:#999;">暂无记录</div><?php } ?>
</div>
@include('weixin.common.footer')

295
resources/views/weixin/goods_brand/brandDetail.blade.php

@ -0,0 +1,295 @@
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>商品详情</title><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<link href="<?php echo env('APP_URL'); ?>/css/weixin/style.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/weixin/mobile.js"></script>
<meta name="keywords" content="关键词"><meta name="description" content="描述"></head><body style="background-color:#f1f1f1;">
<div class="classreturn loginsignup">
<div class="ds-in-bl return"><a href="javascript:history.back(-1);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/return.png" alt="返回"></a></div>
<div class="ds-in-bl tit center"><span>商品详情</span></div>
<div class="ds-in-bl nav_menu"><a href="javascript:void(0);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/class1.png" alt="菜单"></a></div>
</div>
@include('weixin.common.headerNav')
<!--商品详情-start-->
<div class="goods_detail">
<!--顶部滚动广告栏-start-->
<div class="tbanner">
<!-- Swiper -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide"><img src="<?php echo $post['goods_img']; ?>" alt=""></div>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination swiper-pagination-white"></div>
</div>
</div>
<link rel="stylesheet" href="<?php echo env('APP_URL'); ?>/css/swiper.min.css">
<style>
.swiper-container{width:100%;height:90vw;}
.swiper-slide{text-align:center;font-size:18px;background:#fff;}
.swiper-slide img{width:100%;height:100vw;}
</style>
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/swiper.min.js"></script>
<script>
//Swiper轮播
var swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
paginationClickable: true,
autoHeight: true, //enable auto height
slidesPerView: 1,
paginationClickable: true,
spaceBetween: 30,
loop: true,
centeredSlides: true,
autoplay: 3000,
autoplayDisableOnInteraction: false
});
</script>
<!--顶部滚动广告栏-end-->
<div class="goods-header">
<span class="wish-add fr<?php if(isset($post['is_collect']) && $post['is_collect']>=1){echo ' wish-add-activate';} ?>" onclick="collect_goods()">收藏</span><h1 class="title"><?php echo $post['title']; ?></h1>
<div class="goods-price">
<div class="current-price">
<span></span><i class="price"><?php echo $post['price']; ?></i>
</div>
<?php if($post['is_promote_goods']>0){ ?><span class="btn-retail">促销</span><?php } ?>
</div>
<div class="stock-detail table-cell">
<dl>
<dt>运费:</dt>
<dd>免运费</dd>
</dl>
<dl>
<dt>库存:</dt>
<dd><?php echo $post['goods_number']; ?></dd>
</dl>
<dl>
<dt>销量:</dt>
<dd><?php echo $post['sale']; ?></dd>
</dl>
</div>
<div class="goods-comment">用户评价<span><?php echo $post['goods_comments_num']; ?>条评价 ></span></div>
</div>
<div class="goods-content">
<div class="module-title">宝贝详情</div>
<div class="module-content"><?php echo $post['body']; ?></div>
</div>
</div>
<!--商品详情-end-->
<!-- 底部弹出层 -->
<div class="pop_box" style="display:none;" id="master">
<div class="goods_info_pop" style="padding-bottom:0px;">
<div class="cart_list" >
<div class="cart_list_info goods_list_item">
<div class="cart_list_img">
<img src="<?php echo $post['goods_img']; ?>" style="width:100%; height:100%;">
</div>
<div class="cart_goods_info">
<div class="cart_list_name">
<div class="cart_detail_gray" style=""><span style="" class="cart_detail_gray_name"><?php echo $post['title']; ?></span></div>
<div class="cart_detail_gray" style="">
<p class="cart_sum" id="total_price1_296"><span class="attr_price"><?php echo $post['price']; ?></span></p>
<p class="goods_type">库存<span class="attr_storage"><?php echo $post['goods_number']; ?></span>件</p>
</div>
</div>
</div> <!--cart_info-->
</div>
</div><!--item-->
<div class="pop_num">
<span>数量</span>
<div class="pop_sum">
<div class="cart_num_control pop_sum">
<input type="button" value="-" class="cart_num_button" onclick="cart_num_sub()">
<input type="text" value="1" class="cart_num_text" id="num">
<input type="button" value="+" class="cart_num_button" onclick="cart_num_add()">
</div>
</div>
</div>
<input type="hidden" id="id" value="<?php echo $post['id']; ?>">
<input type="hidden" id="goods_number" value="<?php echo $post['goods_number']; ?>">
<div class="registered_btn pop_btn confirmBtn" style="display:none;" onclick="dosubmit()">
<input type="hidden" name="cart_type" id="cart_type" value="">
<span>确定</span>
</div>
</div>
<div class="mask" onclick="masterunshow()"></div>
</div>
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/layer/mobile/layer.js"></script>
<script>
function mastershow(confirm)
{
//如果已经选择属性,则弹出确定按钮,否则弹出加入购物车和立即购买按钮
var selectname = $("#selectname").html();
if(selectname||confirm==1||confirm==2){
$("#cart_type").val(confirm);
$(".btnBox").hide();
$(".confirmBtn").show();
}else{
$(".btnBox").show();
$(".confirmBtn").hide();
}
$("#master").show();
}
function masterunshow()
{
$("#master").hide();
}
function cart_num_sub()
{
var num = $('#num').val();
if(num>1)
{
num = parseInt(num)-1;
$('#num').val(num);
}
}
function cart_num_add()
{
var goods_number = $('#goods_number').val();
var num = $('#num').val();
num = parseInt(num)+1;
if(goods_number<num)
{
//提示
layer.open({
content: '库存不足'
,skin: 'msg'
,time: 2 //2秒后自动关闭
});
return false;
}
$('#num').val(num);
}
function dosubmit()
{
var url = '<?php echo env('APP_API_URL').'/cart_add'; ?>';
var access_token = '<?php if(isset($_SESSION['weixin_user_info']['access_token'])){echo $_SESSION['weixin_user_info']['access_token'];} ?>';
if(access_token=='')
{
//提示
layer.open({
content: '请先登录'
,skin: 'msg'
,time: 2 //2秒后自动关闭
});
setTimeout("location.href = '<?php echo route('weixin_login',array('return_url'=>route('weixin_goods_detail',array('id'=>$post['id'])))); ?>'",1000);
return false;
}
var cart_type = $("#cart_type").val();
var goods_number = $("#num").val();
var goods_id = $("#id").val();
$.post(url,{access_token:access_token,goods_id:goods_id,goods_number:goods_number},function(res)
{
if(res.code==0)
{
if(cart_type == 2)
{
location.href = '<?php echo substr(route('weixin_cart_checkout',array('ids'=>1)),0,-1); ?>' + res.data;
return false;
}
//提示
layer.open({
content: res.msg
,skin: 'msg'
,time: 2 //2秒后自动关闭
});
}
else
{
//提示
layer.open({
content: res.msg
,skin: 'msg'
,time: 2 //2秒后自动关闭
});
}
},'json');
$("#master").hide();
}
function collect_goods()
{
var url = '<?php if(isset($post['is_collect']) && $post['is_collect']>=1){echo env('APP_API_URL').'/collect_goods_delete';}else{echo env('APP_API_URL').'/collect_goods_add';} ?>';
var access_token = '<?php if(isset($_SESSION['weixin_user_info']['access_token'])){echo $_SESSION['weixin_user_info']['access_token'];} ?>';
var goods_id = $("#id").val();
if(access_token=='')
{
//提示
layer.open({
content: '请先登录'
,skin: 'msg'
,time: 2 //2秒后自动关闭
});
setTimeout("location.href = '<?php echo route('weixin_login',array('return_url'=>route('weixin_goods_detail',array('id'=>$post['id'])))); ?>'",1000);
return false;
}
$.post(url,{access_token:access_token,goods_id:goods_id},function(res)
{
if(res.code==0)
{
window.location.reload();
}
else
{
}
layer.open({
content: res.msg
,skin: 'msg'
,time: 2 //2秒后自动关闭
});
},'json');
}
</script>
<!-- 底部按钮开始 -->
<div class="foohi">
<div class="bottom_tool_black">
<div class="bottom_tool_white">
<ul>
<a href="tel:12345678910"><li>
<img src="<?php echo env('APP_URL'); ?>/images/weixin/goods_ic_kefu.png">
<p>客服</p>
</li></a>
<a href="<?php echo route('weixin_cart'); ?>"><li>
<img src="<?php echo env('APP_URL'); ?>/images/weixin/goods_ic_cart.png">
<p>购物车</p>
</li></a>
</ul>
</div>
<div class="bottom_tool_btn">
<ul>
<a href="javascript:mastershow(1);"><li class="bg_c_yellow">加入购物车</li></a>
<a href="javascript:mastershow(2);"><li class="bg_c_orange">立即购买</li></a>
</ul>
</div>
</div>
</div>
<!-- 底部按钮结束 -->
</body></html>

29
resources/views/weixin/goods_brand/brandList.blade.php

@ -0,0 +1,29 @@
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>品牌大全</title><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<link href="<?php echo env('APP_URL'); ?>/css/weixin/style.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery.min.js"></script><script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/weixin/mobile.js"></script>
<meta name="keywords" content="关键词"><meta name="description" content="描述"></head><body style="background-color:#f1f1f1;">
<div class="classreturn loginsignup">
<div class="ds-in-bl return"><a href="javascript:history.back(-1);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/return.png" alt="返回"></a></div>
<div class="ds-in-bl tit center"><span>品牌列表</span></div>
</div>
<div class="floor">
<div class="brand-list">
<?php if($list){ ?>
<ul><?php foreach($list as $k=>$v){ ?>
<li><a href="<?php echo route('weixin_goods_list',['brand_id'=>$v['id']]); ?>"><img src="<?php echo $v['litpic']; ?>" alt="<?php echo $v['title']; ?>"></a></li>
<?php } ?>
<div class="cl"></div></ul><?php }else{ ?>
<div style="text-align:center;line-height:40px;color:#999;">暂无记录</div><?php } ?>
</div>
</div>
<style>
.brand-list{box-sizing:border-box;overflow:hidden;}
.brand-list ul li{float:left;width: 25%;background-color: #FFF;}
.brand-list ul a{display:block;border-right: 1px solid #f6f6f9;border-bottom: 1px solid #f6f6f9;}
.brand-list ul li img{display: block;width: 100%;transition: all 0.5s;}
</style>
@include('weixin.common.footer')
</body></html>

96
resources/views/weixin/index/index.blade.php

@ -51,7 +51,7 @@ var swiper = new Swiper('.swiper-container', {
<!--顶部滚动广告栏-end-->
<!--导航左右滑动-start-->
<div class="swiper-nav">
<!--<div class="swiper-nav">
<div class="swiper-wrapper">
<div class="swiper-slide">新闻</div>
<div class="swiper-slide">音乐</div>
@ -78,31 +78,23 @@ var swiper = new Swiper('.swiper-container', {
var swiper = new Swiper('.swiper-nav', {
slidesPerView: 4 //一行4列显示
});
</script>
</script>-->
<!--导航左右滑动-end-->
<!--菜单-start-->
<div class="floor home_menu">
<div class="floor home_menu" style="border-bottom:1px solid #f0f0f0;border-top:1px solid #f0f0f0;">
<nav>
<a href="<?php echo route('weixin_category_goods_list'); ?>">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_03.png" alt="全部分类" />
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_05.png" alt="全部分类" />
<span>全部分类</span>
</a>
<a href="http://www.shop.com/index.php/mobile/Goods/integralMall.html">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_05.png" alt="积分商城" />
<span>积分商城</span>
</a>
<a href="http://www.shop.com/index.php/mobile/Goods/brandstreet.html">
<a href="<?php echo route('weixin_brand_list'); ?>">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_07.png" alt="品牌街" />
<span>品牌街</span>
</a>
<a href="http://www.shop.com/index.php/mobile/Activity/promote_goods.html">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_09.png" alt="优惠活动" />
<span>优惠活动</span>
</a>
<a href="http://www.shop.com/index.php/mobile/Activity/group_list.html">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_15.png" alt="团购" />
<span>团购</span>
<a href="<?php echo route('weixin_goods_list',array('orderby'=>5)); ?>">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_15.png" alt="优惠商品" />
<span>优惠商品</span>
</a>
<a href="<?php echo route('weixin_order_list'); ?>">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_16.png" alt="我的订单" />
@ -116,13 +108,17 @@ var swiper = new Swiper('.swiper-nav', {
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_19.png" alt="个人中心" />
<span>个人中心</span>
</a>
<a href="javascript:;">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/icon_03.png" alt="敬请期待" />
<span>敬请期待</span>
</a>
</nav>
</div>
<!--菜单-end-->
<!--资讯头条-start-->
<div class="bggrey">
<div class="home_toutiao">
<div class="home_toutiao" style="border-bottom:1px solid #f0f0f0;">
<div class="home_toutiao_tit"><img src="<?php echo env('APP_URL'); ?>/images/weixin/ad_tit.png"></div>
<div class="home_toutiao_box">
<ul>
@ -137,11 +133,27 @@ var swiper = new Swiper('.swiper-nav', {
<!--猜您喜欢-start-->
<div class="floor guesslike">
<div class="banner_tit">- 精品推荐 -</div>
<div class="banner_tit">购·畅销</div>
<ul class="goods_list_s cl">
<?php if($goods_sale_list){foreach($goods_sale_list as $k=>$v){ ?>
<a href="<?php echo $v['goods_detail_url']; ?>"><li><span class="goods_thumb"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"></span>
<div class="goods_info"><p class="goods_tit"><?php echo $v['title']; ?></p>
<p class="goods_price"><b><?php echo $v['price']; ?></b></p>
<p class="goods_des">已售:<?php echo $v['sale']; ?><a href="<?php echo $v['goods_detail_url']; ?>"><span class="buy fr">立即抢购</span></a></p>
</div>
</li></a>
<?php }} ?>
</ul>
</div>
<!--猜您喜欢-end-->
<!--猜您喜欢-start-->
<div class="floor guesslike">
<div class="banner_headline"><div class="tit"><h4>购·精选</h4></div></div>
<div class="likeshop">
<ul class="goods_list" id="goods_list">
<?php if($goods_recommend_list){foreach($goods_recommend_list as $k=>$v){ ?>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b></div></div></a></li>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php if($v['is_promote_goods']>0){ ?><span class="badge_comm" style="background-color:#f23030;">Hot</span> <?php } ?><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b><span class="fr"><?php echo $v['sale']; ?>人付款</span></div></div></a></li>
<?php }} ?>
</ul>
</div>
@ -150,18 +162,46 @@ var swiper = new Swiper('.swiper-nav', {
<!--猜您喜欢-start-->
<div class="floor guesslike">
<div class="banner_tit">- 新品 -</div>
<ul class="goods_list_s cl">
<div class="banner_headline" style="margin-top:-4px;"><div class="tit"><h4>购·优惠</h4></div></div>
<div class="likeshop">
<ul class="goods_list" id="goods_list">
<?php if($goods_promote_list){foreach($goods_promote_list as $k=>$v){ ?>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php if($v['is_promote_goods']>0){ ?><span class="badge_comm" style="background-color:#f23030;">Hot</span> <?php } ?><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b><span class="fr"><?php echo $v['sale']; ?>人付款</span></div></div></a></li>
<?php }} ?>
</ul>
</div>
</div>
<!--猜您喜欢-end-->
<!--猜您喜欢-start-->
<div class="floor guesslike">
<div class="banner_headline"><div class="tit"><h4>购·新品</h4></div></div>
<div class="likeshop">
<ul class="goods_list" id="goods_list">
<?php if($goods_list){foreach($goods_list as $k=>$v){ ?>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php if($v['is_promote_goods']>0){ ?><span class="badge_comm" style="background-color:#f23030;">Hot</span> <?php } ?><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b><span class="fr"><?php echo $v['sale']; ?>人付款</span></div></div></a></li>
<?php }} ?>
</ul>
</div>
</div>
<!--猜您喜欢-end-->
<!--猜您喜欢-start-->
<!-- <div class="floor guesslike">
<ul class="goodslist_limg" id="goods_list">
<?php if($goods_list){foreach($goods_list as $k=>$v){ ?>
<a href="<?php echo $v['goods_detail_url']; ?>"><li><span class="goods_thumb"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"></span>
<div class="goods_info"><p class="goods_tit"><?php echo $v['title']; ?></p>
<p class="goods_price"><b><?php echo $v['price']; ?></b></p>
<p class="goods_des">库存:<?php echo $v['goods_number']; ?><a href="<?php echo $v['goods_detail_url']; ?>"><span class="buy fr">立即抢购</span></a></p>
</div>
</li></a>
<li><a href="<?php echo $v['goods_detail_url']; ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"><div class="goods_info"><p class="goods_tit"><?php if($v['is_promote_goods']>0){ ?><span class="badge_comm" style="background-color:#f23030;">Hot</span> <?php } ?><?php echo $v['title']; ?></p><div class="goods_price">¥<b><?php echo $v['price']; ?></b><span class="fr"><?php echo $v['sale']; ?>人付款</span></div></div></a></li>
<?php }} ?>
</ul>
</div>
</div> -->
<style>
.goodslist_limg li{border-bottom:10px solid #f0f0f0;}
.goodslist_limg li img{width: 100%;height: auto;display: block;}
.goodslist_limg li .goods_info{padding:15px;}
.goodslist_limg li .goods_tit{line-height:1.5;font-size:20px;color:#333;}
.goodslist_limg li .goods_price{font-size:24px;color:#fe3939;}
.goodslist_limg li .fr{font-size:16px;color:#999;}
</style>
<!--猜您喜欢-end-->
<style>
.banner_tit{font-size:18px;font-weight:400;background-color:#fff;color:#f23030;height:46px;line-height:46px;padding-left:10px;padding-right:10px;border-bottom:1px solid #eee;text-align:center;}

2
resources/views/weixin/user/userDistribution.blade.php

@ -23,7 +23,7 @@
<div class="money"><small></small><?php echo $user_info['commission']; ?></div>
</div>
<div class="floor">
<div class="banner_tit mt10">- 我的推荐 -</div>
<div class="banner_tit mt10">我的推荐</div>
<?php if($list){ ?>
<ul class="goods_list_s cl">
<?php foreach($list as $k=>$v){ ?>

6
routes/web.php

@ -64,7 +64,9 @@ Route::group(['prefix' => 'weixin', 'namespace' => 'Weixin'], function () {
Route::get('/tag{tag}', 'IndexController@tag')->name('weixin_tag'); //标签页
Route::get('/page/{id}', 'IndexController@page')->name('weixin_singlepage');//单页
Route::get('/goods/{id}', 'GoodsController@goodsDetail')->name('weixin_goods_detail'); //商品详情页
Route::get('/goodslist', 'GoodsController@goodsList')->name('weixin_goods_list'); //产品分类页
Route::get('/goodslist', 'GoodsController@goodsList')->name('weixin_goods_list'); //商品筛选列表
Route::get('/brandlist', 'GoodsBrandController@brandList')->name('weixin_brand_list'); //品牌列表
Route::get('/brand_detail/{id}', 'GoodsBrandController@brandDetail')->name('weixin_brand_detail'); //品牌详情
Route::get('/bonus_list', 'BonusController@bonusList')->name('weixin_bonus_list');
Route::any('/wxpay_notify', 'WxPayController@wxpayNotify')->name('weixin_wxpay_notify'); //微信回调
@ -142,6 +144,8 @@ Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web
Route::get('/goods_list', 'GoodsController@goodsList'); //商品列表
Route::get('/goodstype_list', 'GoodsTypeController@goodsTypeList'); //商品分类列表
Route::get('/goods_searchword_list', 'GoodsController@goodsSearchwordList'); //商品搜索词列表
Route::get('/goodsbrand_detail', 'GoodsBrandController@goodsBrandDetail'); //商品品牌详情
Route::get('/goodsbrand_list', 'GoodsBrandController@goodsBrandList'); //商品品牌列表
//地区,省市区
Route::get('/region_list', 'RegionController@regionList');
Route::get('/region_detail', 'RegionController@regionDetail');

Loading…
Cancel
Save