Browse Source

goodslist

master
ZLW-PC\Administrator 7 years ago
parent
commit
e99c04dd9b
  1. 2
      app/Http/Controllers/Api/ArticleController.php
  2. 16
      app/Http/Controllers/Api/GoodsController.php
  3. 1
      app/Http/Controllers/Api/SlideController.php
  4. 335
      app/Http/Controllers/Home/IndexController.php
  5. 7
      app/Http/Controllers/Weixin/ArticleController.php
  6. 20
      app/Http/Controllers/Weixin/GoodsController.php
  7. 1
      app/Http/Controllers/Weixin/IndexController.php
  8. 2
      app/Http/Model/Goods.php
  9. 1
      app/Http/Model/Slide.php
  10. 70
      lqycms.sql
  11. 20
      public/css/style.css
  12. 2
      resources/views/home/common/footer.blade.php
  13. 26
      resources/views/home/common/header.blade.php
  14. 73
      resources/views/home/index/arclist.blade.php
  15. 161
      resources/views/home/index/goodslist.blade.php
  16. 218
      resources/views/home/index/index.blade.php

2
app/Http/Controllers/Api/ArticleController.php

@ -31,8 +31,6 @@ class ArticleController extends CommonController
foreach($res['list'] as $k=>$v)
{
$res['list'][$k]->pubdate = date('Y-m-d H:i',$v->pubdate);
$res['list'][$k]->addtime = date('Y-m-d H:i',$v->addtime);
$res['list'][$k]->article_detail_url = route('weixin_article_detail',array('id'=>$v->id));
}

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

@ -35,14 +35,14 @@ class GoodsController extends CommonController
//参数
$data['limit'] = $request->input('limit', 10);
$data['offset'] = $request->input('offset', 0);
if($request->input('typeid', '') != '' && $request->input('typeid', '') != 0){$data['typeid'] = $request->input('typeid');}
if($request->input('tuijian', '') != ''){$data['tuijian'] = $request->input('tuijian');}
if($request->input('status', '') != ''){$data['status'] = $request->input('status');}
if($request->input('keyword', '') != ''){$data['keyword'] = $request->input('keyword');}
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');}
if($request->input('typeid', null) != null && $request->input('typeid', '') != 0){$data['typeid'] = $request->input('typeid');}
if($request->input('tuijian', null) != null){$data['tuijian'] = $request->input('tuijian');}
if($request->input('status', null) != null){$data['status'] = $request->input('status');}
if($request->input('keyword', null) != null){$data['keyword'] = $request->input('keyword');}
if($request->input('min_price', null) != null){$data['min_price'] = $request->input('min_price');}
if($request->input('max_price', null) != null){$data['max_price'] = $request->input('max_price');}
if($request->input('orderby', null) != null){$data['orderby'] = $request->input('orderby');}
if($request->input('brand_id', null) != null){$data['brand_id'] = $request->input('brand_id');}
$res = Goods::getList($data);

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

@ -20,6 +20,7 @@ class SlideController extends CommonController
$data['limit'] = $request->input('limit', 10);
$data['offset'] = $request->input('offset', 0);
if($request->input('group_id', null) !== null){$data['group_id'] = $request->input('group_id');}
if($request->input('type', null) !== null){$data['type'] = $request->input('type');}
$res = Slide::getList($data);
if($res == false)

335
app/Http/Controllers/Home/IndexController.php

@ -16,11 +16,67 @@ class IndexController extends CommonController
public function index()
{
//商品列表
$where['status'] = 0;
$data['goods_list'] = object_to_array(DB::table('goods')->where($where)->select('id','title','price','litpic','description','shipping_fee','market_price','goods_number','sale')->take(30)->orderBy('pubdate','desc')->get());
$data['goods_type_list'] = object_to_array(DB::table('goods_type')->where(['pid'=>0,'status'=>1])->select('id','name')->take(30)->orderBy('listorder','asc')->get());
$data['slide_list'] = object_to_array(DB::table('slide')->where(['group_id'=>0,'type'=>0,'is_show'=>0])->take(30)->orderBy('listorder','asc')->get());
$data['ztad_list'] = object_to_array(DB::table('slide')->where(['group_id'=>1,'type'=>0,'is_show'=>0])->take(30)->orderBy('listorder','asc')->get());
$pagesize = 15;
$offset = 0;
if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;}
$postdata = array(
'status' => 0,
'limit' => $pagesize,
'offset' => $offset
);
$url = env('APP_API_URL')."/goods_list";
$res = curl_request($url,$postdata,'GET');
$data['list'] = $res['data']['list'];
$data['totalpage'] = ceil($res['data']['count']/$pagesize);
if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1)
{
$html = '';
if($res['data']['list'])
{
foreach($res['data']['list'] as $k => $v)
{
$html .= '<li><a href="'.route('home_goods',array('id'=>$v['id'])).'" target="_blank"><img src="'.$v['litpic'].'" alt="'.$v['title'].'">';
$html .= '<p class="title">'.$v['title'].'</p>';
$html .= '<p class="desc"><span class="price-point"><i></i>库存('.$v['goods_number'].')</span> '.$v['description'].'</p>';
$html .= '<div class="item-prices red"><div class="item-link">立即<br>抢购</div><div class="item-info"><div class="price"><i>¥</i><em class="J_actPrice"><span class="yen">'.ceil($v['price']).'</span></em></div>';
$html .= '<div class="dock"><div class="dock-price"><del class="orig-price">¥'.$v['market_price'].'</del> <span class="benefit">包邮</span></div><div class="prompt"><div class="sold-num"><em>'.$v['sale'].'</em> 件已付款</div></div></div></div></div></a></li>';
/* if($v['is_promote_goods']>0)
{
$html .= '<span class="badge_comm" style="background-color:#f23030;">Hot</span>';
}
$html .= $v['title'].'</p><div class="goods_price">¥<b>'.$v['price'].'</b><span class="fr">'.$v['sale'].'人付款</span></div></div></a>';
$html .= '</li>'; */
}
}
exit(json_encode($html));
}
//商品分类列表
$postdata = array(
'pid' => 0,
'limit' => 15,
'offset' => 0
);
$url = env('APP_API_URL')."/goodstype_list";
$res = curl_request($url,$postdata,'GET');
$data['goodstype_list'] = $res['data']['list'];
//banner轮播图
$postdata = array(
'type' => 0,
'limit' => 5,
'offset' => 0
);
$url = env('APP_API_URL')."/slide_list";
$res = curl_request($url,$postdata,'GET');
$data['slide_list'] = $res['data']['list'];
return view('home.index.index',$data);
}
@ -28,74 +84,61 @@ class IndexController extends CommonController
//商品列表页
public function goodslist(Request $request)
{
$typeid = $request->input('id', '');
$page = $request->input('page', '');
//推荐
if($request->input('tuijian', '') != ''){$where['tuijian'] = $request->input('tuijian');}
if($request->input('brand_id', '') != ''){$where['brand_id'] = $request->input('brand_id');DB::table('goods_brand')->where(array('id'=>$where['brand_id']))->increment('click', 1);}
$pagenow = $page;
$post = '';
if($typeid)
{
$where['typeid'] = $typeid;
$post = object_to_array(DB::table('goods_type')->where('id', $typeid)->first(), 1);
}
$data['post'] = $post;
$goods = DB::table("goods");
if(isset($where)){$goods = $goods->where($where);}
$data['typeid'] = 0;
if($request->input('typeid', null) != null){$data['typeid'] = $request->input('typeid');}
if($request->input('keyword', '') != ''){$goods = $goods->where('title', 'like', '%'.$request->input('keyword').'%');}
$pagesize = 15;
$offset = 0;
if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;}
$counts = $goods->count();
if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');}
$pagesize = sysconfig('CMS_PAGESIZE');$page=0;
if($counts % $pagesize){//取总数据量除以每页数的余数
$pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果
}else{$pages = $counts/$pagesize;}
if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;}
$data['page'] = $page;
$data['pages'] = $pages;
$data['counts'] = $counts;
$start = $page*$pagesize;
//排序
if($request->input('orderby', null) != null)
//商品列表
$postdata = array(
'typeid' => $data['typeid'],
'limit' => $pagesize,
'offset' => $offset
);
$url = env('APP_API_URL')."/goods_list";
$res = curl_request($url,$postdata,'GET');
$data['list'] = $res['data']['list'];
$data['totalpage'] = ceil($res['data']['count']/$pagesize);
if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1)
{
switch ($request->input('orderby'))
$html = '';
if($res['data']['list'])
{
case 1:
$goods = $goods->orderBy('sale','desc'); //销量从高到低
break;
case 2:
$goods = $goods->orderBy('comments','desc'); //评论从高到低
break;
case 3:
$goods = $goods->orderBy('price','desc'); //价格从高到低
break;
case 4:
$goods = $goods->orderBy('price','asc'); //价格从低到高
break;
case 5:
$timestamp = time();
$goods = $goods->where('promote_start_date','<=',$timestamp)->where('promote_end_date','>=',$timestamp); //促销商品
break;
default:
$goods = $goods->orderBy('pubdate','desc'); //最新
foreach($res['data']['list'] as $k => $v)
{
$html .= '<li><a href="'.route('home_goods',array('id'=>$v['id'])).'" target="_blank"><img src="'.$v['litpic'].'" alt="'.$v['title'].'">';
$html .= '<p class="title">'.$v['title'].'</p>';
$html .= '<p class="desc"><span class="price-point"><i></i>库存('.$v['goods_number'].')</span> '.$v['description'].'</p>';
$html .= '<div class="item-prices red"><div class="item-link">立即<br>抢购</div><div class="item-info"><div class="price"><i>¥</i><em class="J_actPrice"><span class="yen">'.ceil($v['price']).'</span></em></div>';
$html .= '<div class="dock"><div class="dock-price"><del class="orig-price">¥'.$v['market_price'].'</del> <span class="benefit">包邮</span></div><div class="prompt"><div class="sold-num"><em>'.$v['sale'].'</em> 件已付款</div></div></div></div></div></a></li>';
/* if($v['is_promote_goods']>0)
{
$html .= '<span class="badge_comm" style="background-color:#f23030;">Hot</span>';
}
$html .= $v['title'].'</p><div class="goods_price">¥<b>'.$v['price'].'</b><span class="fr">'.$v['sale'].'人付款</span></div></div></a>';
$html .= '</li>'; */
}
}
}
$posts = object_to_array($goods->skip($start)->take($pagesize)->get());
$data['posts'] = $posts; //获取列表
$data['pagenav'] = '';if($nextpage<=$pages && $nextpage>0){$data['pagenav'] = $this->listpageurl(route('home_goodslist'),$_SERVER['QUERY_STRING'],$nextpage);}
$data['goods_type_list'] = object_to_array(DB::table('goods_type')->where(['pid'=>0,'status'=>1])->select('id','name')->take(30)->orderBy('listorder','asc')->get());
$data['id'] = $typeid;
exit(json_encode($html));
}
//商品分类列表
$postdata = array(
'pid' => 0,
'limit' => 15,
'offset' => 0
);
$url = env('APP_API_URL')."/goodstype_list";
$res = curl_request($url,$postdata,'GET');
$data['goodstype_list'] = $res['data']['list'];
return view('home.index.goodslist', $data);
}
@ -155,81 +198,113 @@ class IndexController extends CommonController
}
//列表页
public function category($cat, $page=0)
public function category(Request $request)
{
$pagenow = $page;
if(empty($cat) || !preg_match('/[0-9]+/',$cat)){return redirect()->route('page404');}
if(cache("catid$cat")){$post = cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);if(empty($post)){return redirect()->route('page404');} cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));}
$data['post'] = $post;
$subcat="";$sql="";
$post2 = object_to_array(DB::table('arctype')->select('id')->where('pid', $cat)->get());
if(!empty($post2)){foreach($post2 as $row){$subcat=$subcat."typeid=".$row["id"]." or ";}}
$subcat=$subcat."typeid=".$cat;
$sql=$subcat." or typeid2 in (".$cat.")";//echo $subcat2;exit;
$data['sql'] = $sql;
$counts = DB::table("article")->whereRaw($sql)->count();
if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);}
$pagesize = sysconfig('CMS_PAGESIZE');$page=0;
if($counts % $pagesize){//取总数据量除以每页数的余数
$pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果
}else{$pages = $counts/$pagesize;}
if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;}
$data['page'] = $page;
$data['pages'] = $pages;
$data['counts'] = $counts;
$start = $page*$pagesize;
$data['posts'] = arclist(array("sql"=>$sql, "limit"=>"$start,$pagesize")); //获取列表
$data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat)); //获取分页列表
if($post['templist']=='category2'){if(!empty($pagenow)){return redirect()->route('page404');}}
$pagesize = 10;
$offset = 0;
//文章分类
$postdata = array(
'id' => $cat
);
$url = env('APP_API_URL')."/arctype_detail";
$arctype_detail = curl_request($url,$postdata,'GET');
$data['post'] = $arctype_detail['data'];
dd($data['post']);
if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;}
//文章列表
$postdata2 = array(
'limit' => $pagesize,
'offset' => $offset
);
if($request->input('typeid', null) != null){$postdata2['typeid'] = $request->input('typeid');}
$url = env('APP_API_URL')."/article_list";
$res = curl_request($url,$postdata2,'GET');
$data['list'] = $res['data']['list'];
$data['totalpage'] = ceil($res['data']['count']/$pagesize);
if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1)
{
$html = '';
if($res['data']['list'])
{
foreach($res['data']['list'] as $k => $v)
{
$html .= '<li><a href="'.$v['article_detail_url'].'">'.$v['title'].'</a><p>'.$v['pubdate'].'</p></li>';
}
}
exit(json_encode($html));
}
return view('home.index.'.$post['templist'], $data);
return view('home.index.'.$data['post']['templist'], $data);
}
//文章列表页
public function arclist(Request $request)
{
$cat = $request->input('id', '');
$page = $request->input('page', '');
$pagenow = $page;
$post = '';
{
$pagesize = 10;
$offset = 0;
if($cat)
//文章分类
if($request->input('typeid', null) != null)
{
$where['typeid'] = $cat;
$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);
$postdata = array(
'id' => $request->input('typeid')
);
$url = env('APP_API_URL')."/arctype_detail";
$arctype_detail = curl_request($url,$postdata,'GET');
$data['post'] = $arctype_detail['data'];
}
$data['post'] = $post;
if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;}
$article = DB::table("article");
if(isset($where)){$article = $article->where($where);}
//文章列表
$postdata2 = array(
'limit' => $pagesize,
'offset' => $offset
);
if($request->input('typeid', null) != null){$postdata2['typeid'] = $request->input('typeid');}
$counts = $article->count();
if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);}
$pagesize = sysconfig('CMS_PAGESIZE');$page=0;
if($counts % $pagesize){//取总数据量除以每页数的余数
$pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果
}else{$pages = $counts/$pagesize;}
if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;}
$data['page'] = $page;
$data['pages'] = $pages;
$data['counts'] = $counts;
$start = $page*$pagesize;
$posts = object_to_array($article->skip($start)->take($pagesize)->get());
$url = env('APP_API_URL')."/article_list";
$res = curl_request($url,$postdata2,'GET');
$data['list'] = $res['data']['list'];
$data['posts'] = $posts; //获取列表
$data['pagenav'] = '';if($nextpage<=$pages && $nextpage>0){$data['pagenav'] = $this->listpageurl(route('home_arclist'),$_SERVER['QUERY_STRING'],$nextpage);}
$data['arctype_list'] = object_to_array(DB::table('arctype')->where(['pid'=>0,'is_show'=>0])->select('id','name')->take(30)->orderBy('listorder','asc')->get());
$data['id'] = $cat;
$data['totalpage'] = ceil($res['data']['count']/$pagesize);
if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1)
{
$html = '';
if($res['data']['list'])
{
foreach($res['data']['list'] as $k => $v)
{
$html .= '<div class="list">';
if(!empty($v['litpic']))
{
$html .= '<a class="limg" href="'.get_front_url(array("id"=>$v['id'],"catid"=>$v['typeid'],"type"=>'content')).'"><img alt="'.$v['title'].'" src="'.$v['litpic'].'"></a>';
}
$html .= '<strong class="tit"><a href="'.get_front_url(array("id"=>$v['id'],"catid"=>$v['typeid'],"type"=>'content')).'">'.$v['title'].'</a></strong><p>'.mb_strcut($v['description'],0,150,'UTF-8').'..</p>';
$html .= '<div class="info"><span class="fl">';
$taglist=taglist($v['id']);
if($taglist)
{
foreach($taglist as $row)
{
$html .= '<a href="'.get_front_url(array("tagid"=>$row['id'],"type"=>'tags')).'">'.$row['tag'].'</a>';
}
}
$html .= '<em>'.date("m-d H:i",$v['pubdate']).'</em></span><span class="fr"><em>'.$v['click'].'</em>人阅读</span></div><div class="cl"></div></div>';
}
}
exit(json_encode($html));
}
return view('home.index.arclist', $data);
}

7
app/Http/Controllers/Weixin/ArticleController.php

@ -35,6 +35,13 @@ class ArticleController extends CommonController
);
$url = env('APP_API_URL')."/article_list";
$res = curl_request($url,$postdata2,'GET');
if($res['data']['list'])
{
foreach($res['data']['list'] as $k => $v)
{
$res['data']['list'][$k]['pubdate'] = date("Y-m-d H:i",$v['pubdate']);
}
}
$data['list'] = $res['data']['list'];
$data['totalpage'] = ceil($res['data']['count']/$pagesize);

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

@ -41,15 +41,15 @@ class GoodsController extends CommonController
//商品列表
public function goodsList(Request $request)
{
if($request->input('typeid', '') != ''){$param['typeid'] = $request->input('typeid');}
if($request->input('tuijian', '') != ''){$param['tuijian'] = $request->input('tuijian');}
if($request->input('keyword', '') != ''){$param['keyword'] = $request->input('keyword');}
if($request->input('status', '') != ''){$param['status'] = $request->input('status');}
if($request->input('is_promote', '') != ''){$param['is_promote'] = $request->input('is_promote');}
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');}
if($request->input('typeid', null) != null){$param['typeid'] = $request->input('typeid');}
if($request->input('tuijian', null) != null){$param['tuijian'] = $request->input('tuijian');}
if($request->input('keyword', null) != null){$param['keyword'] = $request->input('keyword');}
if($request->input('status', null) != null){$param['status'] = $request->input('status');}
if($request->input('is_promote', null) != null){$param['is_promote'] = $request->input('is_promote');}
if($request->input('orderby', null) != null){$param['orderby'] = $request->input('orderby');}
if($request->input('max_price', null) != null){$param['max_price'] = $request->input('max_price');}else{$param['max_price'] = 99999;}
if($request->input('min_price', null) != null){$param['min_price'] = $request->input('min_price');}else{$param['min_price'] = 0;}
if($request->input('brand_id', null) != null){$param['brand_id'] = $request->input('brand_id');}
//商品列表
$postdata = $param;
@ -68,7 +68,7 @@ class GoodsController extends CommonController
public function categoryGoodsList(Request $request)
{
$data['typeid'] = 0;
if($request->input('typeid', '') != ''){$data['typeid'] = $request->input('typeid');}
if($request->input('typeid', null) != null){$data['typeid'] = $request->input('typeid');}
$pagesize = 10;
$offset = 0;

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

@ -29,6 +29,7 @@ class IndexController extends CommonController
//banner轮播图
$postdata = array(
'type' => 1,
'limit' => 5,
'offset' => 0
);

2
app/Http/Model/Goods.php

@ -33,7 +33,7 @@ class Goods extends BaseModel
//常用字段
protected static $common_field = array(
'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'
'id', 'typeid', 'tuijian', 'click', 'title', 'description', '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正常 1已删除 2下架 3申请上架

1
app/Http/Model/Slide.php

@ -26,6 +26,7 @@ class Slide extends Model
$model = new Slide;
if(isset($group_id)){$where['group_id'] = $group_id;}
if(isset($type)){$where['type'] = $type;}
if($where){$model = $model->where($where);}

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

20
public/css/style.css

@ -55,25 +55,33 @@ a{color:#313131;text-decoration:none;}a:hover{text-decoration:none;color:#22ac38
.site-nav .quick-menu {float: right;line-height: 30px;}
.site-nav .quick-menu li {position: relative;_width: 0;float: left;white-space: nowrap;margin: 0 9px;}
.site-nav .quick-menu li a {display: block;height: 100%;}
.ju-naver {position: relative;z-index: 8000;background-color: #fff;width: 100%;height: 80px;-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.13);-moz-box-shadow: 0 1px 3px rgba(0,0,0,.13);box-shadow: 0 1px 3px rgba(0,0,0,.13);border-bottom: 1px solid #eee\9;}
.site-nav .mobile a:hover .weixin-qr{display: block;}
.site-nav .mobile a .weixin-qr{display: none;position: absolute;top:30px;left: 0;width: 150px;z-index:999;}
.ju-naver {position: relative;background-color: #fff;width: 100%;height: 80px;-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.13);-moz-box-shadow: 0 1px 3px rgba(0,0,0,.13);box-shadow: 0 1px 3px rgba(0,0,0,.13);border-bottom: 1px solid #eee\9;}
.ju-naver .logo {position: relative;float: left;font-weight: 400;}
.ju-naver .ju-logo-show {visibility: visible;z-index: 2;}
.ju-naver .ju-logo img{width: 150px;height:80px;}
.ju-naver a {display: block;text-decoration: none;}
.ju-naver .nav-menu {float: right;margin-top: 28px;}
.ju-naver .nav-menu li {display: inline-block;position: relative;margin-right: 2px;}
.ju-naver .nav-menu li{display:inline-block;position:relative;margin-left:5px;}
.ju-naver .nav-menu a {color: #4A4A4A;font-size: 16px;position: relative;padding:2px 6px;-webkit-border-radius: 3px;-webkit-background-clip: padding-box;-moz-border-radius: 3px;-moz-background-clip: padding;border-radius: 3px;background-clip: padding-box;}
.ju-naver .nav-menu a:hover {background-color: #EDEDED;}
.ju-naver .nav-menu .current a, .ju-naver .nav-menu .current a:hover{background-color: #E61414;color: #fff;}
#slideBox{width:740px;height:347px;overflow:hidden;position:relative;}
#slideBox ul#show_pic{margin:0;padding:0;list-style:none;width:7400px;height:347px;position:absolute;}
.content{font:normal 18px/180% "Microsoft YaHei";color:#222;margin-bottom:15px;}
.content p{/* margin-bottom:1.35em; */}.content u{color:#0366d6;text-decoration:none;}.content h2,.tagarct{font-size:22px;line-height:1.176;color:#22ac38;padding-top:15px;padding-bottom:10px;}.content strong,.content b{color:#22ac38;font-size:18px;}
.content img{max-width:640px;width:expression(this.width > 640 ? "640px" :this.width);height:auto;}
.content blockquote{padding:.6em 1em;border-left:.4em solid #cad4f2;background:#f0f0f0;}
.dinfo,.timely{color:#aaa;font-size:12px;line-height:1.5;font-family:SimSun;margin:5px 0 8px;}.dinfo a,.timely #atime{color:#22ac38;}
#slideBox{height:347px;overflow:hidden;position:relative;}
#slideBox ul#show_pic{margin:0;padding:0;list-style:none;width:9600px;height:347px;position:absolute;}
#slideBox ul#show_pic li{float:left;margin:0;padding:0;height:347px;}
#slideBox ul#show_pic li img{display:block;}
#iconBall{position:absolute;bottom:0;right:0;}
#iconBall li{float:left;color:#7a7a7a;width:32px;height:28px;line-height:28px;cursor:pointer;text-align:center;font-size:14px;padding-top:4px;}
#iconBall li.active{background:url(../images/ibg.png) no-repeat;color:#fff;}
#slideText{width:740px;height:28px;background:rgba(0,0,0,0.7);color:#fff;position:absolute;left:0px;bottom:0px;*background:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#b2000000,endColorstr=#b2000000);}
#slideText{width:960px;height:28px;background:rgba(0,0,0,0.7);color:#fff;position:absolute;left:0px;bottom:0px;*background:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#b2000000,endColorstr=#b2000000);}
#textBall{position:absolute;left:10px;bottom:5px;}
#textBall li{float:left;cursor:pointer;display:none;color:#fff;font-size:14px;}
#textBall li.active{display:block;}
@ -86,5 +94,5 @@ a{color:#313131;text-decoration:none;}a:hover{text-decoration:none;color:#22ac38
.titem{padding-bottom:10px;border-bottom:1px dotted #e0e0e0;margin-bottom:10px;}
.iztad{height:120px;overflow:hidden;margin-top:5px;}
#footer{font-size:12px;text-align:center;margin-bottom:10px;margin-top:10px;color:#5D5D5D;}
#footer{color:#fafafa;font-size:12px;background:#161616;padding:15px 0;text-align:center;}
.tm{overflow:hidden;position:fixed;left:1px;bottom:15px;z-index:999;_position:absolute;}

2
resources/views/home/common/footer.blade.php

@ -1 +1 @@
<div id="footer" class="box">&copy;<?php echo sysconfig('CMS_WEBNAME'); ?> 部分文章来源于网络,如果侵犯了您的权益,请联系我们。<div class="m-auto"><script>count_js();</script></div></div>
<div id="footer"><div class="box">&copy;<?php echo sysconfig('CMS_WEBNAME'); ?> 部分文章来源于网络,如果侵犯了您的权益,请联系我们。<div class="m-auto"><script>count_js();</script></div></div></div>

26
resources/views/home/common/header.blade.php

@ -1,26 +1,18 @@
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery.min.js"></script>
<div id="site-nav" class="site-nav">
<div class="box">
<div style="width:960px;margin-left:auto;margin-right:auto;">
<p class="menu-left">
<span class="mobile">
<a class="mobileLink" href="<?php echo route('home'); ?>">
<?php echo sysconfig('CMS_WEBNAME'); ?>
<a class="mobileLink" href="javascript:;">
手机版
<img class="weixin-qr" src="<?php echo env('APP_URL'); ?>/images/weixin/erweima.png">
</a>
</span>
<span class="login-info"><a class="user-nick" href="//i.taobao.com/my_taobao.htm">缘中仙2008</a> <a href="//login.taobao.com/member/logout.jhtml?f=top&amp;out=true&amp;redirectURL=https%3A%2F%2Fdetail.ju.taobao.com%2Fhome.htm%3Fspm%3D608.2291429.102212b.2.18df210XU8Vrg%26id%3D10000064961473%26item_id%3D523987525652" id="J_Logout">退出</a></span>
<span class="login-info"><a class="user-nick" href="<?php echo route('home'); ?>"><?php echo sysconfig('CMS_WEBNAME'); ?></a></span>
</p>
<ul class="quick-menu">
<li>
<a href="//trade.ju.taobao.com/trade/my_ju.htm" target="_blank">我的聚划算</a>
</li>
<li class="cart">
<a href="//cart.taobao.com/my_cart.htm" target="_blank">购物车</a>
</li>
<li>
<a href="//freeway.ju.taobao.com/front/sellerHome.htm" target="_blank">商户中心</a>
</li>
<li>
<a href="//o.ju.taobao.com/tg/hpcenter/index.htm?reqType=index" target="_blank">帮助</a>
</li>
<li><a href="<?php echo route('home_singlepage',array('id'=>'help')); ?>">帮助中心</a></li>
</ul>
</div>
</div>
@ -32,7 +24,7 @@
<li class="menu-brands<?php if(route('home_brandlist') == url()->full()){echo ' current';} ?>"><a class="menu-link" href="<?php echo route('home_brandlist'); ?>">品牌团</a></li>
<li class="menu-goodslist<?php if(route('home_goodslist') == url()->full()){echo ' current';} ?>"><a class="menu-link" href="<?php echo route('home_goodslist'); ?>">优质精选</a></li>
<li class="menu-goodslist<?php if(route('home_goodslist',array('orderby'=>1)) == url()->full()){echo ' current';} ?>"><a class="menu-link" href="<?php echo route('home_goodslist',array('orderby'=>1)); ?>">超值热卖</a></li>
<li class="menu-qqjx<?php if(route('home_arclist') == url()->full()){echo ' current';} ?>"><a class="menu-link" href="<?php echo route('home_arclist'); ?>">动态</a></li>
<li class="menu-qqjx<?php if(route('home_arclist') == url()->full()){echo ' current';} ?>"><a class="menu-link" href="<?php echo route('home_arclist'); ?>">热点资讯</a></li>
<li class="menu-liangfan<?php if(route('home_singlepage',array('id'=>'about')) == url()->full()){echo ' current';} ?>"><a class="menu-link" href="<?php echo route('home_singlepage',array('id'=>'about')); ?>">关于我们</a></li>
</ul>
</div>

73
resources/views/home/index/arclist.blade.php

@ -1,13 +1,70 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title><?php if($post){echo $post["name"].'_'.sysconfig('CMS_WEBNAME');}else{echo '动态';} ?></title><meta name="keywords" content="{dede:field.keywords/}" /><meta name="description" content="{dede:field.description function='html2text(@me)'/}" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/style.css"><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script></head><body>
<title><?php if(isset($post)){echo $post["name"].'_'.sysconfig('CMS_WEBNAME');}else{echo '动态';} ?></title><meta name="keywords" content="{dede:field.keywords/}" /><meta name="description" content="{dede:field.description function='html2text(@me)'/}" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/style.css"><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script></head><body>
@include('home.common.header')
<div class="box" style="padding-top:20px;">
<?php if(!empty($posts)){foreach($posts as $row){ ?><div class="list"><?php if(!empty($row['litpic'])){ ?><a class="limg" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><img alt="<?php echo $row['title']; ?>" src="<?php echo $row['litpic']; ?>"></a><?php } ?>
<strong class="tit"><a href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a></strong><p><?php echo mb_strcut($row['description'],0,150,'UTF-8'); ?>..</p>
<div class="info"><span class="fl"><?php $taglist=taglist($row['id']);if($taglist){foreach($taglist as $row){ ?><a href="<?php echo get_front_url(array("tagid"=>$row['id'],"type"=>'tags')); ?>"><?php echo $row['tag']; ?></a><?php }} ?><em><?php echo date("m-d H:i",$row['pubdate']); ?></em></span><span class="fr"><em><?php echo $row['click']; ?></em>人阅读</span></div><div class="cl"></div></div><?php }} ?>
<div class="box" style="padding-top:20px;" id="arclist">
<?php if($list){foreach($list as $k=>$v){ ?><div class="list"><?php if(!empty($v['litpic'])){ ?><a class="limg" href="<?php echo get_front_url(array("id"=>$v['id'],"catid"=>$v['typeid'],"type"=>'content')); ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"></a><?php } ?>
<strong class="tit"><a href="<?php echo get_front_url(array("id"=>$v['id'],"catid"=>$v['typeid'],"type"=>'content')); ?>"><?php echo $v['title']; ?></a></strong><p><?php echo mb_strcut($v['description'],0,150,'UTF-8'); ?>..</p>
<div class="info"><span class="fl"><?php $taglist=taglist($v['id']);if($taglist){foreach($taglist as $row){ ?><a href="<?php echo get_front_url(array("tagid"=>$row['id'],"type"=>'tags')); ?>"><?php echo $row['tag']; ?></a><?php }} ?><em><?php echo date("m-d H:i",$v['pubdate']); ?></em></span><span class="fr"><em><?php echo $v['click']; ?></em>人阅读</span></div><div class="cl"></div></div><?php }} ?>
</div>
<?php if($pagenav){ ?><div class="pages"><ul><li style="width:180px;"><a href="<?php echo $pagenav; ?>">获取更多</a></li></ul><div class="cl"></div></div><?php } ?>
<script>
$(function(){
var ajaxload = false;
var maxpage = false;
var startpage = 1;
var totalpage = <?php echo $totalpage; ?>;
var tmp_url = window.location.href;
msg = tmp_url.split("#");
tmp_url = msg[0];
$(window).scroll(function ()
{
var listheight = $("#arclist").outerHeight();
if ($(document).scrollTop() + $(window).height() >= listheight)
{
if(startpage >= totalpage)
{
//$("#submit_bt_one").html("已是最后一页,没有更多数据!");
return false;
}
if(!ajaxload && !maxpage)
{
ajaxload = true;
//$("#submit_bt_one").html("努力加载中...");
var url = tmp_url;
var nextpage = startpage+1;
$.get(url,{page_ajax:1,page:nextpage},function(res)
{
if(res)
{
$("#arclist").append(res);
startpage++;
if(startpage >= totalpage)
{
maxpage = true;
//$("#submit_bt_one").html("已是最后一页,没有更多数据!");
}
else
{
//$("#submit_bt_one").html("点击加载更多");
}
ajaxload = false;
}
else
{
//$("#submit_bt_one").html("请求失败,请稍候再试!");
ajaxload = false;
}
},'json');
}
}
});
});
</script>
@include('home.common.footer')</body></html>

161
resources/views/home/index/goodslist.blade.php

@ -14,9 +14,9 @@
<div class="box">
<div class="cat-menu-h">
<ul class="clearfix">
<li><a href="<?php echo route('home_goodslist'); ?>">全部</a></li>
<?php if($goods_type_list){foreach($goods_type_list as $k=>$v){ ?>
<li><a<?php if($v['id']==$id){echo ' class="hover"';} ?> href="<?php echo route('home_goodslist',array('id'=>$v['id'])); ?>"><?php echo $v['name']; ?></a></li><?php }} ?>
<li><a<?php if(route('home_goodslist') == url()->full()){echo ' class="hover"';} ?> href="<?php echo route('home_goodslist'); ?>">全部</a></li>
<?php if($goodstype_list){foreach($goodstype_list as $k=>$v){ ?>
<li><a<?php if(route('home_goodslist',array('typeid'=>$v['id'])) == url()->full()){echo ' class="hover"';} ?> href="<?php echo route('home_goodslist',array('typeid'=>$v['id'])); ?>"><?php echo $v['name']; ?></a></li><?php }} ?>
<li><a class="forecast" href="<?php echo route('home_goodslist',array('tuijian'=>1)); ?>"> [推荐] </a></li>
</ul>
@ -26,8 +26,8 @@
<div style="background-color:#F3F3F3;padding:15px 0;">
<div class="box">
<ul class="pul">
<?php if($posts){foreach($posts as $k=>$v){ ?>
<ul class="pul" id="goods_list">
<?php if($list){foreach($list as $k=>$v){ ?>
<li><a href="<?php echo route('home_goods',array('id'=>$v['id'])); ?>" target="_blank"><img src="<?php echo $v['litpic']; ?>" alt="<?php echo $v['title']; ?>">
<p class="title"><?php echo $v['title']; ?></p>
<p class="desc"><span class="price-point"><i></i>库存(<?php echo $v['goods_number']; ?>)</span> <?php echo $v['description']; ?></p>
@ -37,92 +37,67 @@
</a></li>
<?php }} ?>
</ul></div>
<script>
$(function(){
var ajaxload = false;
var maxpage = false;
var startpage = 1;
var totalpage = <?php echo $totalpage; ?>;
var tmp_url = window.location.href;
msg = tmp_url.split("#");
tmp_url = msg[0];
$(window).scroll(function ()
{
var listheight = $("#goods_list").outerHeight();
if ($(document).scrollTop() + $(window).height() >= listheight)
{
if(startpage >= totalpage)
{
//$("#submit_bt_one").html("已是最后一页,没有更多数据!");
return false;
}
if(!ajaxload && !maxpage)
{
ajaxload = true;
//$("#submit_bt_one").html("努力加载中...");
var url = tmp_url;
var nextpage = startpage+1;
$.get(url,{page_ajax:1,page:nextpage},function(res)
{
if(res)
{
$("#goods_list").append(res);
startpage++;
if(startpage >= totalpage)
{
maxpage = true;
//$("#submit_bt_one").html("已是最后一页,没有更多数据!");
}
else
{
//$("#submit_bt_one").html("点击加载更多");
}
ajaxload = false;
}
else
{
//$("#submit_bt_one").html("请求失败,请稍候再试!");
ajaxload = false;
}
},'json');
}
}
});
});
</script>
</div><!-- box end -->
<?php if($pagenav){ ?><div class="pages"><ul><li style="width:180px;"><a href="<?php echo $pagenav; ?>">获取更多</a></li></ul><div class="cl"></div></div><?php } ?>
</div><!-- box end -->@include('home.common.footer')
<script>//图片幻灯
var glide =new function(){
function $id(id){return document.getElementById(id);};
this.layerGlide=function(auto,oEventCont,oTxtCont,oSlider,sSingleSize,second,fSpeed,point){
var oSubLi = $id(oEventCont).getElementsByTagName('li');
var oTxtLi = $id(oTxtCont).getElementsByTagName('li');
var interval,timeout,oslideRange;
var time=1;
var speed = fSpeed
var sum = oSubLi.length;
var a=0;
var delay=second * 1000;
var setValLeft=function(s){
return function(){
oslideRange = Math.abs(parseInt($id(oSlider).style[point]));
$id(oSlider).style[point] =-Math.floor(oslideRange+(parseInt(s*sSingleSize) - oslideRange)*speed) +'px';
if(oslideRange==[(sSingleSize * s)]){
clearInterval(interval);
a=s;
}
}
};
var setValRight=function(s){
return function(){
oslideRange = Math.abs(parseInt($id(oSlider).style[point]));
$id(oSlider).style[point] =-Math.ceil(oslideRange+(parseInt(s*sSingleSize) - oslideRange)*speed) +'px';
if(oslideRange==[(sSingleSize * s)]){
clearInterval(interval);
a=s;
}
}
}
function autoGlide(){
for(var c=0;c<sum;c++){oSubLi[c].className='';oTxtLi[c].className='';};
clearTimeout(interval);
if(a==(parseInt(sum)-1)){
for(var c=0;c<sum;c++){oSubLi[c].className='';oTxtLi[c].className='';};
a=0;
oSubLi[a].className="active";
oTxtLi[a].className = "active";
interval = setInterval(setValLeft(a),time);
timeout = setTimeout(autoGlide,delay);
}else{
a++;
oSubLi[a].className="active";
oTxtLi[a].className = "active";
interval = setInterval(setValRight(a),time);
timeout = setTimeout(autoGlide,delay);
}
}
if(auto){timeout = setTimeout(autoGlide,delay);};
for(var i=0;i<sum;i++){
oSubLi[i].onmouseover = (function(i){
return function(){
for(var c=0;c<sum;c++){oSubLi[c].className='';oTxtLi[c].className='';};
clearTimeout(timeout);
clearInterval(interval);
oSubLi[i].className = "active";
oTxtLi[i].className = "active";
if(Math.abs(parseInt($id(oSlider).style[point]))>[(sSingleSize * i)]){
interval = setInterval(setValLeft(i),time);
this.onmouseout=function(){if(auto){timeout = setTimeout(autoGlide,delay);};};
}else if(Math.abs(parseInt($id(oSlider).style[point]))<[(sSingleSize * i)]){
interval = setInterval(setValRight(i),time);
this.onmouseout=function(){if(auto){timeout = setTimeout(autoGlide,delay);};};
}
}
})(i)
}
}
}
//调用语句
glide.layerGlide(
true, //设置是否自动滚动
'iconBall', //对应索引按钮
'textBall', //标题内容文本
'show_pic', //焦点图片容器
740, //设置滚动图片位移像素
2, //设置滚动时间2秒
0.1, //设置过渡滚动速度
'left' //设置滚动方向“向左”
);</script></body></html>
@include('home.common.footer')
</body></html>

218
resources/views/home/index/index.blade.php

@ -5,15 +5,47 @@
.main-theme .item{width: 33.3%;width: 33.3% !important;height:120px;float: left;overflow: hidden;-webkit-transition: width .3s ease;-moz-transition: width .3s ease;-o-transition: width .3s ease;transition: width .3s ease;}
.main-theme .item img{width:100%;height:100%;}
</style>
<div class="box hdp" style="margin-top:5px;"><div class="fl"><div id="slideBox"><ul style="left: 0px;" id="show_pic">
<?php if($slide_list){foreach($slide_list as $k=>$v){ ?><li><a href="<?php echo $v['url']; ?>" target="_blank"><img width="740px" height="347px" alt="<?php echo $v['title']; ?>" src="<?php echo $v['pic']; ?>"></a></li><?php }} ?></ul><div id="slideText"></div><ul id="iconBall"><?php if($slide_list){$i=1;foreach($slide_list as $k=>$v){ ?><li><?php echo $i;$i=$i+1; ?></li><?php }} ?></ul>
<ul id="textBall"><?php if($slide_list){foreach($slide_list as $k=>$v){ ?><li><a href="javascript:void(0)"><?php echo $v['title']; ?></a></li><?php }} ?></ul></div>
<div class="iztad"><div class="main-theme">
<?php if($ztad_list){foreach($ztad_list as $k=>$v){ ?><a class="item on" target="_blank" href="<?php echo $v['url']; ?>"><img class="img" src="<?php echo $v['pic']; ?>"></a><?php }} ?>
</div></div></div>
<div class="fr"><img src="images/3.jpg"></div></div>
<!--顶部滚动广告栏-start-->
<?php if($slide_list){ ?>
<div class="box" style="margin-top:10px;margin-bottom:10px;">
<!-- Swiper -->
<div class="swiper-container">
<div class="swiper-wrapper">
<?php foreach($slide_list as $k=>$v){ ?>
<div class="swiper-slide"><a href="<?php echo $v['url']; ?>"><img src="<?php echo $v['pic']; ?>" alt="<?php echo $v['title']; ?>"></a></div>
<?php } ?>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination swiper-pagination-white"></div>
</div>
</div>
<?php } ?>
<link rel="stylesheet" href="<?php echo env('APP_URL'); ?>/css/swiper.min.css">
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/swiper.min.js"></script>
<style>
.swiper-container{width:100%;height:auto;}
.swiper-slide{text-align:center;font-size:18px;background:#fff;}
.swiper-slide img{width:100%;height:320px;}
</style>
<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-->
<!--导航栏-start-->
<style>
.cat-menu-h {padding:8px 0;margin-bottom:10px;background-color: #fff;border-bottom: 1px dotted #ccc;border-top: 1px dotted #ccc;}
.cat-menu-h ul {font-size: 14px;}
@ -26,15 +58,17 @@
<div class="box">
<div class="cat-menu-h">
<ul class="clearfix">
<li><a href="<?php echo route('home_goodslist'); ?>">全部</a></li>
<?php if($goods_type_list){foreach($goods_type_list as $k=>$v){ ?>
<li><a href="<?php echo route('home_goodslist',array('id'=>$v['id'])); ?>"><?php echo $v['name']; ?></a></li><?php }} ?>
<li><a<?php if(route('home_goodslist') == url()->full()){echo ' class="hover"';} ?> href="<?php echo route('home_goodslist'); ?>">全部</a></li>
<?php if($goodstype_list){foreach($goodstype_list as $k=>$v){ ?>
<li><a<?php if(route('home_goodslist',array('typeid'=>$v['id'])) == url()->full()){echo ' class="hover"';} ?> href="<?php echo route('home_goodslist',array('typeid'=>$v['id'])); ?>"><?php echo $v['name']; ?></a></li><?php }} ?>
<li><a class="forecast" href="<?php echo route('home_goodslist',array('tuijian'=>1)); ?>"> [推荐] </a></li>
</ul>
<form method="get" class="m-sch fr" name="formsearch" action="<?php echo route('home_goodslist'); ?>"><input class="sch-txt" name="keyword" type="text" value="搜索 按Enter键" onfocus="if(value=='搜索 按Enter键') {value=''}" onblur="if(value=='') {value='搜索 按Enter键'}"></form>
<div class="cl"></div></div>
</div>
<!--导航栏-end-->
<style>
.brandul{margin-right:-10px;}
.brandul li{margin: 0 10px 10px 0;-webkit-box-shadow: 0 1px 0 rgba(0,0,0,.1);-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1);box-shadow: 0 1px 0 rgba(0,0,0,.1);float: left;}
@ -45,14 +79,7 @@
.brandul .brand-des .fl{margin-left:10px;}
.brandul .brand-des .fr{margin-right:20px;}
</style>
<div class="box" style="margin-bottom:5px;">
<ul class="brandul">
<li>
<a href="http://ju.taobao.com/tg/brand_items.htm?act_sign_id=28794165&amp;seller_id=880734502" target="_blank">
<img class="brand-pic" src="/images/3.jpg">
<div class="brand-des"><span class="fl"></span>
<span class="fr"><em>234100</em>件已付款 &nbsp; <em>仅剩1天</em></span></div></a>
</li>
<div class="box" style="margin-bottom:5px;"><ul class="brandul">
<li>
<a href="http://ju.taobao.com/tg/brand_items.htm?act_sign_id=28794165&amp;seller_id=880734502" target="_blank">
<img class="brand-pic" src="/images/3.jpg">
@ -77,12 +104,11 @@
<div class="brand-des"><span class="fl"></span>
<span class="fr"><em>234100</em>件已付款 &nbsp; <em>仅剩1天</em></span></div></a>
</li>
</ul>
</div>
</ul></div>
<div class="box">
<ul class="pul">
<?php if($goods_list){foreach($goods_list as $k=>$v){ ?>
<ul class="pul" id="goods_list">
<?php if($list){foreach($list as $k=>$v){ ?>
<li><a href="<?php echo route('home_goods',array('id'=>$v['id'])); ?>" target="_blank"><img src="<?php echo $v['litpic']; ?>" alt="<?php echo $v['title']; ?>">
<p class="title"><?php echo $v['title']; ?></p>
<p class="desc"><span class="price-point"><i></i>库存(<?php echo $v['goods_number']; ?>)</span> <?php echo $v['description']; ?></p>
@ -92,89 +118,67 @@
</a></li>
<?php }} ?>
</ul></div>
@include('home.common.footer')
<script>//图片幻灯
var glide =new function(){
function $id(id){return document.getElementById(id);};
this.layerGlide=function(auto,oEventCont,oTxtCont,oSlider,sSingleSize,second,fSpeed,point){
var oSubLi = $id(oEventCont).getElementsByTagName('li');
var oTxtLi = $id(oTxtCont).getElementsByTagName('li');
var interval,timeout,oslideRange;
var time=1;
var speed = fSpeed
var sum = oSubLi.length;
var a=0;
var delay=second * 1000;
var setValLeft=function(s){
return function(){
oslideRange = Math.abs(parseInt($id(oSlider).style[point]));
$id(oSlider).style[point] =-Math.floor(oslideRange+(parseInt(s*sSingleSize) - oslideRange)*speed) +'px';
if(oslideRange==[(sSingleSize * s)]){
clearInterval(interval);
a=s;
}
}
};
var setValRight=function(s){
return function(){
oslideRange = Math.abs(parseInt($id(oSlider).style[point]));
$id(oSlider).style[point] =-Math.ceil(oslideRange+(parseInt(s*sSingleSize) - oslideRange)*speed) +'px';
if(oslideRange==[(sSingleSize * s)]){
clearInterval(interval);
a=s;
}
}
}
function autoGlide(){
for(var c=0;c<sum;c++){oSubLi[c].className='';oTxtLi[c].className='';};
clearTimeout(interval);
if(a==(parseInt(sum)-1)){
for(var c=0;c<sum;c++){oSubLi[c].className='';oTxtLi[c].className='';};
a=0;
oSubLi[a].className="active";
oTxtLi[a].className = "active";
interval = setInterval(setValLeft(a),time);
timeout = setTimeout(autoGlide,delay);
}else{
a++;
oSubLi[a].className="active";
oTxtLi[a].className = "active";
interval = setInterval(setValRight(a),time);
timeout = setTimeout(autoGlide,delay);
}
}
if(auto){timeout = setTimeout(autoGlide,delay);};
for(var i=0;i<sum;i++){
oSubLi[i].onmouseover = (function(i){
return function(){
for(var c=0;c<sum;c++){oSubLi[c].className='';oTxtLi[c].className='';};
clearTimeout(timeout);
clearInterval(interval);
oSubLi[i].className = "active";
oTxtLi[i].className = "active";
if(Math.abs(parseInt($id(oSlider).style[point]))>[(sSingleSize * i)]){
interval = setInterval(setValLeft(i),time);
this.onmouseout=function(){if(auto){timeout = setTimeout(autoGlide,delay);};};
}else if(Math.abs(parseInt($id(oSlider).style[point]))<[(sSingleSize * i)]){
interval = setInterval(setValRight(i),time);
this.onmouseout=function(){if(auto){timeout = setTimeout(autoGlide,delay);};};
}
}
})(i)
}
}
}
//调用语句
glide.layerGlide(
true, //设置是否自动滚动
'iconBall', //对应索引按钮
'textBall', //标题内容文本
'show_pic', //焦点图片容器
740, //设置滚动图片位移像素
2, //设置滚动时间2秒
0.1, //设置过渡滚动速度
'left' //设置滚动方向“向左”
);</script></body></html>
<script>
$(function(){
var ajaxload = false;
var maxpage = false;
var startpage = 1;
var totalpage = <?php echo $totalpage; ?>;
var tmp_url = window.location.href;
msg = tmp_url.split("#");
tmp_url = msg[0];
$(window).scroll(function ()
{
var listheight = $("#goods_list").outerHeight();
if ($(document).scrollTop() + $(window).height() >= listheight)
{
if(startpage >= totalpage)
{
//$("#submit_bt_one").html("已是最后一页,没有更多数据!");
return false;
}
if(!ajaxload && !maxpage)
{
ajaxload = true;
//$("#submit_bt_one").html("努力加载中...");
var url = tmp_url;
var nextpage = startpage+1;
$.get(url,{page_ajax:1,page:nextpage},function(res)
{
if(res)
{
$("#goods_list").append(res);
startpage++;
if(startpage >= totalpage)
{
maxpage = true;
//$("#submit_bt_one").html("已是最后一页,没有更多数据!");
}
else
{
//$("#submit_bt_one").html("点击加载更多");
}
ajaxload = false;
}
else
{
//$("#submit_bt_one").html("请求失败,请稍候再试!");
ajaxload = false;
}
},'json');
}
}
});
});
</script>
@include('home.common.footer')
</body></html>
Loading…
Cancel
Save