作者 王晓刚
1 个管道 的构建 通过 耗费 24 秒

合并分支 'wxg' 到 'master'

修改问题文档



查看合并请求 !95
@@ -10,6 +10,11 @@ @@ -10,6 +10,11 @@
10 <script type="text/javascript" src="__CDN__/assets/store/js/pagination/js/pagination.min.js"></script> 10 <script type="text/javascript" src="__CDN__/assets/store/js/pagination/js/pagination.min.js"></script>
11 <link rel="stylesheet" href="__CDN__/assets/store/js/pagination/css/pagination.css"> 11 <link rel="stylesheet" href="__CDN__/assets/store/js/pagination/css/pagination.css">
12 <style> 12 <style>
  13 + .wnzd{
  14 + overflow: hidden;
  15 + white-space: nowrap;
  16 + text-overflow: ellipsis;
  17 + }
13 .priceBtn{ 18 .priceBtn{
14 position: relative; 19 position: relative;
15 } 20 }
@@ -569,7 +574,7 @@ @@ -569,7 +574,7 @@
569 <li><a href="#" data-sort="9" onclick="selectDistributor(this)">厂家直销</a></li> 574 <li><a href="#" data-sort="9" onclick="selectDistributor(this)">厂家直销</a></li>
570 </ul> 575 </ul>
571 </div> 576 </div>
572 - <p> 577 + <p class="wnzd">
573 为你找到<span id="resultsNum">0件</span>相关商品 578 为你找到<span id="resultsNum">0件</span>相关商品
574 </p> 579 </p>
575 </div> 580 </div>
@@ -744,7 +749,7 @@ @@ -744,7 +749,7 @@
744 } 749 }
745 750
746 //初始化商品列表 751 //初始化商品列表
747 - function initGoodsList(page = 1, pageNum = 10){ 752 + function initGoodsList(page = 1, pageNum = 10 , store_id = null){
748 //排序规则 753 //排序规则
749 var sort = $('.activeBtn').attr('data-sort'); 754 var sort = $('.activeBtn').attr('data-sort');
750 //关键字 755 //关键字
@@ -752,7 +757,7 @@ @@ -752,7 +757,7 @@
752 $.ajax({ 757 $.ajax({
753 url:"{:url('index/goods/get_all')}", 758 url:"{:url('index/goods/get_all')}",
754 type:"POST", 759 type:"POST",
755 - data:{"province_id":province_id,"page":page,"pageNum":pageNum,'paginate':1,'sort':sort,'keyword':keyword,'lng':lng,'lat':lat}, 760 + data:{"province_id":province_id,"page":page,"pageNum":pageNum,'paginate':1,'sort':sort,'keyword':keyword,'lng':lng,'lat':lat, 'store_id':store_id},
756 success:function(res){ 761 success:function(res){
757 var goods_html = ""; 762 var goods_html = "";
758 $(res.data.data).each(function (key1, vo) { 763 $(res.data.data).each(function (key1, vo) {
@@ -781,11 +786,11 @@ @@ -781,11 +786,11 @@
781 //初始化分页 786 //初始化分页
782 var totalPage = Math.ceil(res.data.total/pageNum); 787 var totalPage = Math.ceil(res.data.total/pageNum);
783 initPaging(res.data.total,res.data.current_page,totalPage,pageNum); 788 initPaging(res.data.total,res.data.current_page,totalPage,pageNum);
784 - // 随机向地图添加25个标注 789 + // 添加标注
785 $(res.wait).each(function (key, w) { 790 $(res.wait).each(function (key, w) {
786 var point = new BMap.Point(w.lng, w.lat); 791 var point = new BMap.Point(w.lng, w.lat);
787 // console.log(point); 792 // console.log(point);
788 - addMarker2(point); 793 + addMarker2(point,w.id);
789 }); 794 });
790 }, 795 },
791 error:function(res){ 796 error:function(res){
@@ -1017,11 +1022,19 @@ @@ -1017,11 +1022,19 @@
1017 } 1022 }
1018 1023
1019 //添加标注点 1024 //添加标注点
1020 - function addMarker2(point){ 1025 + function addMarker2(point,store_id){
1021 console.log(point); 1026 console.log(point);
1022 var marker = new BMap.Marker(point); 1027 var marker = new BMap.Marker(point);
1023 console.log(marker); 1028 console.log(marker);
1024 mapObj.addOverlay(marker); 1029 mapObj.addOverlay(marker);
  1030 + marker.customData={store_id:store_id};//自定义参数id
  1031 + marker.addEventListener("click",attribute);
  1032 + }
  1033 + function attribute(e){
  1034 + console.log(e);
  1035 + window.event.stopPropagation();
  1036 + var store_id= e.target.customData.store_id;
  1037 + initGoodsList(1,10,store_id);
1025 } 1038 }
1026 </script> 1039 </script>
1027 </body> 1040 </body>