林一峰
7 years ago
19 changed files with 102 additions and 76 deletions
-
38app/Http/Controllers/Weixin/GoodsController.php
-
19public/css/weixin/style.css
-
0public/js/My97DatePicker/My97DatePicker.zip
-
2public/js/layer-mobile.js
-
BINpublic/js/layer/layer-v3.1.0.zip
-
0public/js/layer/layer.js
-
2public/js/layer/mobile/layer.js
-
1public/js/layer/mobile/need/layer.css
-
BINpublic/js/layer/theme/default/icon-ext.png
-
BINpublic/js/layer/theme/default/icon.png
-
1public/js/layer/theme/default/layer.css
-
BINpublic/js/layer/theme/default/loading-0.gif
-
BINpublic/js/layer/theme/default/loading-1.gif
-
BINpublic/js/layer/theme/default/loading-2.gif
-
2resources/views/weixin/index/category.blade.php
-
57resources/views/weixin/index/category2.blade.php
-
39resources/views/weixin/index/goodslist.blade.php
-
15resources/views/weixin/index/search.blade.php
-
2routes/web.php
@ -0,0 +1,38 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Weixin; |
|||
|
|||
use App\Http\Controllers\Weixin\CommonController; |
|||
use Illuminate\Http\Request; |
|||
|
|||
class GoodsController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
//商品列表
|
|||
public function goodslist(Request $request) |
|||
{ |
|||
if($request->input('typeid', '') != ''){$data['typeid'] = $request->input('typeid');} |
|||
if($request->input('tuijian', '') != ''){$data['tuijian'] = $request->input('tuijian');} |
|||
if($request->input('keyword', '') != ''){$data['keyword'] = $request->input('keyword');} |
|||
if($request->input('status', '') != ''){$data['status'] = $request->input('status');} |
|||
if($request->input('is_promote', '') != ''){$data['is_promote'] = $request->input('is_promote');} |
|||
if($request->input('orderby', '') != ''){$data['orderby'] = $request->input('orderby');} |
|||
if($request->input('max_price', '') != ''){$data['max_price'] = $request->input('max_price');}else{$data['max_price'] = 99999;} |
|||
if($request->input('min_price', '') != ''){$data['min_price'] = $request->input('min_price');}else{$data['min_price'] = 0;} |
|||
|
|||
//商品列表
|
|||
$postdata = array( |
|||
'limit' => 10, |
|||
'offset' => 0 |
|||
); |
|||
$url = env('APP_API_URL')."/goods_list"; |
|||
$goods_list = curl_request($url,$postdata,'GET'); |
|||
$data['goods_list'] = $goods_list['data']['list']; |
|||
|
|||
return view('weixin.index.goodslist', $data); |
|||
} |
|||
|
|||
} |
@ -1,2 +0,0 @@ |
|||
/*! layer mobile-v2.0 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */ |
|||
;!function(a){"use strict";var b=document,c="querySelectorAll",d="getElementsByClassName",e=function(a){return b[c](a)},f={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},g={extend:function(a){var b=JSON.parse(JSON.stringify(f));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};g.touch=function(a,b){a.addEventListener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layui-m-layer"],j=function(a){var b=this;b.config=g.extend(a),b.view()};j.prototype.view=function(){var a=this,c=a.config,f=b.createElement("div");a.id=f.id=i[0]+h,f.setAttribute("class",i[0]+" "+i[0]+(c.type||0)),f.setAttribute("index",h);var g=function(){var a="object"==typeof c.title;return c.title?'<h3 style="'+(a?c.title[1]:"")+'">'+(a?c.title[0]:c.title)+"</h3>":""}(),j=function(){"string"==typeof c.btn&&(c.btn=[c.btn]);var a,b=(c.btn||[]).length;return 0!==b&&c.btn?(a='<span yes type="1">'+c.btn[0]+"</span>",2===b&&(a='<span no type="0">'+c.btn[1]+"</span>"+a),'<div class="layui-m-layerbtn">'+a+"</div>"):""}();if(c.fixed||(c.top=c.hasOwnProperty("top")?c.top:100,c.style=c.style||"",c.style+=" top:"+(b.body.scrollTop+c.top)+"px"),2===c.type&&(c.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(c.content||"")+"</p>"),c.skin&&(c.anim="up"),"msg"===c.skin&&(c.shade=!1),f.innerHTML=(c.shade?"<div "+("string"==typeof c.shade?'style="'+c.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(c.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(c.skin?"layui-m-layer-"+c.skin+" ":"")+(c.className?c.className:"")+" "+(c.anim?"layui-m-anim-"+c.anim:"")+'" '+(c.style?'style="'+c.style+'"':"")+">"+g+'<div class="layui-m-layercont">'+c.content+"</div>"+j+"</div></div></div>",!c.type||2===c.type){var k=b[d](i[0]+c.type),l=k.length;l>=1&&layer.close(k[0].getAttribute("index"))}document.body.appendChild(f);var m=a.elem=e("#"+a.id)[0];c.success&&c.success(m),a.index=h++,a.action(c,m)},j.prototype.action=function(a,b){var c=this;a.time&&(g.timer[c.index]=setTimeout(function(){layer.close(c.index)},1e3*a.time));var e=function(){var b=this.getAttribute("type");0==b?(a.no&&a.no(),layer.close(c.index)):a.yes?a.yes(c.index):layer.close(c.index)};if(a.btn)for(var f=b[d]("layui-m-layerbtn")[0].children,h=f.length,i=0;h>i;i++)g.touch(f[i],e);if(a.shade&&a.shadeClose){var j=b[d]("layui-m-layershade")[0];g.touch(j,function(){layer.close(c.index,a.end)})}a.end&&(g.end[c.index]=a.end)},a.layer={v:"2.0",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var c=e("#"+i[0]+a)[0];c&&(c.innerHTML="",b.body.removeChild(c),clearTimeout(g.timer[a]),delete g.timer[a],"function"==typeof g.end[a]&&g.end[a](),delete g.end[a])},closeAll:function(){for(var a=b[d](i[0]),c=0,e=a.length;e>c;c++)layer.close(0|a[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var a=document.scripts,c=a[a.length-1],d=c.src,e=d.substring(0,d.lastIndexOf("/")+1);c.getAttribute("merge")||document.head.appendChild(function(){var a=b.createElement("link");return a.href=e+"need/layer.css?2.0",a.type="text/css",a.rel="styleSheet",a.id="layermcss",a}())}()}(window); |
Binary file not shown.
@ -0,0 +1,2 @@ |
|||
/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */ |
|||
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window); |
1
public/js/layer/mobile/need/layer.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Binary file not shown.
After Width: 180 | Height: 100 | Size: 5.8 KiB |
Binary file not shown.
After Width: 210 | Height: 61 | Size: 11 KiB |
1
public/js/layer/theme/default/layer.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Binary file not shown.
After Width: 60 | Height: 24 | Size: 5.7 KiB |
Binary file not shown.
After Width: 37 | Height: 37 | Size: 701 B |
Binary file not shown.
After Width: 32 | Height: 32 | Size: 1.7 KiB |
@ -1,57 +0,0 @@ |
|||
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta http-equiv="Cache-Control" content="no-siteapp" /><meta http-equiv="Cache-Control" content="no-transform" /><meta name="mobile-agent" content="format=xhtml;url=http://m.bnbni.com<?php echo GetCurUrl(); ?>"> |
|||
<title><?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?></title><meta name="keywords" content="<?php echo $post["keywords"]; ?>" /><meta name="description" content="<?php echo $post["description"]; ?>" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/images/style.css" media="all"><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/jquery.min.js"></script><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script><script>uaredirect("http://m.bnbni.com/cat{dede:type}[field:ID /]{/dede:type}");</script></head><body><script>site();</script>
|
|||
@include('home.common.header')<div id="tad"><script>tjs();</script></div> |
|||
|
|||
<div class="box mt10"><div class="fl_640"><h1 class="arct"><?php echo $post["typename"]; ?></h1>
|
|||
<div class="content"><?php echo $post["content"]; ?></div><div id="lad1"><script>ljs1();</script></div></div><!-- fl_640 end -->
|
|||
|
|||
<div class="fr_300"><div id="rad1"><script>rjs1();</script></div> |
|||
<div class="side"><div class="stit"><h3>热门文章</h3><a href="javascript:getmore({PageSize:5,_token:'{{ csrf_token() }}',typeid:<?php echo $post['id']; ?>,tuijian:1,mode:1,orderby:'rand()'});" class="more">换一换</a><div class="cl"></div></div> |
|||
<ul class="uli chs" id="xglist"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"tuijian"=>1));if($posts){foreach($posts as $row){ ?><li><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a></li><?php }} ?></ul><div class="cl"></div></div>
|
|||
|
|||
<div id="rad3"><script>rjs3();</script></div> |
|||
<div class="side"><div class="stit"><h3>猜你喜欢</h3><a href="javascript:getmore({PageSize:5,_token:'{{ csrf_token() }}',typeid:<?php echo $post['id']; ?>,mode:2,orderby:'rand()'});" class="more">换一换</a><div class="cl"></div></div> |
|||
<div class="uli2" id="xglike"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"orderby"=>'rand()'));if($posts){foreach($posts as $row){ ?><div class="suli"><?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 } ?><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a><div class="sulii"><?php if(!empty($row['writer'])){echo '<span class="time">'.$row['writer'].'</span>';}elseif(!empty($row['source'])){echo '<span class="time">'.$row['source'].'</span>';} ?> 阅读(<?php echo $row['click']; ?>)</div><div class="cl"></div></div><?php }} ?><div class="cl"></div></div></div>
|
|||
|
|||
<div id="rad2"><script>rjs2();</script></div></div><!-- fr_300 end --></div><!-- box end --> |
|||
<script> |
|||
function getmore(condition) |
|||
{ |
|||
var url = "<?php echo sysconfig('CMS_BASEHOST'); ?>/api/listarc"; |
|||
//var typeid = "";
|
|||
$.post(url,condition,function(res){ |
|||
if(res.code==0) |
|||
{ |
|||
var json = res.data; //数组
|
|||
var str = ''; |
|||
$.each(json, function (index) { |
|||
//循环获取数据
|
|||
//var title = json[index].title;
|
|||
if(condition.mode==1) |
|||
{ |
|||
str = str + '<li><a target="_blank" href="'+json[index].url+'">'+json[index].title+'</a></li>'; |
|||
} |
|||
else if(condition.mode==2) |
|||
{ |
|||
var litpic = '';if(json[index].litpic!==''){litpic = '<a class="limg" href="'+json[index].url+'"><img alt="'+json[index].title+'" src="'+json[index].litpic+'"></a>';} |
|||
str = str + '<div class="suli">'+litpic+'<a target="_blank" href="'+json[index].url+'">'+json[index].title+'</a><div class="sulii">阅读('+json[index].click+')</div><div class="cl"></div></div>'; |
|||
} |
|||
}); |
|||
|
|||
if(str!='' && str!=null && condition.mode==1) |
|||
{ |
|||
$('#xglist').html(str); |
|||
} |
|||
else if(str!='' && str!=null && condition.mode==2) |
|||
{ |
|||
$('#xglike').html(str); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
|
|||
} |
|||
},'json'); |
|||
} |
|||
</script> |
|||
@include('home.common.footer')</body></html> |
@ -0,0 +1,39 @@ |
|||
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/> |
|||
<title>LQYCMS微商城</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> |
|||
<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> |
|||
|
|||
<nav class="storenav"> |
|||
<ul class="table-cell"> |
|||
<li> |
|||
<span class="lb">综合</span> |
|||
</li> |
|||
<li class="red"> |
|||
<a href="/index.php/Mobile/Goods/search/id/0/q/冰箱/sort/sales_sum"> |
|||
<span class="dq">销量</span> |
|||
</a> |
|||
</li> |
|||
<li> |
|||
<a href="/index.php/Mobile/Goods/search/id/0/q/冰箱/sort/shop_price/sort_asc/desc"> |
|||
<span class="jg">价格 </span> |
|||
<i class="pr bpr1"></i> |
|||
</a> |
|||
</li> |
|||
</ul><div class="cl"></div> |
|||
</nav> |
|||
|
|||
<div class="floor"> |
|||
<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>
|
|||
<?php } ?>
|
|||
</ul> |
|||
</div> |
|||
|
|||
@include('weixin.common.footer') |
|||
</body></html> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue