You've already forked qlg.tsgz.moe
							
							Init Repo
This commit is contained in:
		
							
								
								
									
										91
									
								
								hyhproject/admin/view/recommends/brands.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										91
									
								
								hyhproject/admin/view/recommends/brands.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,91 @@
 | 
			
		||||
{extend name="base" /}
 | 
			
		||||
{block name="js"}
 | 
			
		||||
<script src="__ADMIN__/recommends/recommends.js?v=1{$v}" type="text/javascript"></script>
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="main"}
 | 
			
		||||
<style>
 | 
			
		||||
input[type=text]{padding: 6px 5px;}
 | 
			
		||||
</style>
 | 
			
		||||
<form autocomplete='off'>
 | 
			
		||||
<div id='alertTips' class='alert alert-success alert-tips fade in'>
 | 
			
		||||
  <div id='headTip' class='head'><i class='fa fa-lightbulb-o'></i>操作说明</div>
 | 
			
		||||
  <ul class='body'>
 | 
			
		||||
      <li>本功能主要用于前台品牌展示的推荐设置。</li>
 | 
			
		||||
      <li>本功能为扩展功能,开发者可通过组合不同的商品分类和推荐类型在前台进行品牌信息的展示</li>
 | 
			
		||||
  </ul>
 | 
			
		||||
</div>
 | 
			
		||||
<table class='wst-form wst-box-top'>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th width='120'>商品分类<font color='red'>*</font>:</th>
 | 
			
		||||
	     <td colspan='2'>
 | 
			
		||||
	        <select id="cat12_0" class='ipt pgoodsCats1_2' level="0" onchange="WST.ITGoodsCats({id:'cat12_0',val:this.value,isRequire:false,className:'pgoodsCats1_2'});">
 | 
			
		||||
	          <option value=''>请选择</option>
 | 
			
		||||
	          {volist name=":WSTGoodsCats(0)" id="vo"}
 | 
			
		||||
	          <option value="{$vo['catId']}">{$vo['catName']}</option>
 | 
			
		||||
	          {/volist}
 | 
			
		||||
	        </select>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td>
 | 
			
		||||
	         
 | 
			
		||||
	     </td>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th width='120'>搜索:</th>
 | 
			
		||||
	     <td colspan='2'>
 | 
			
		||||
	        <input type='text' id='key_2' style='width:250px' class='ipt_2' placeholder='品牌名称'/>
 | 
			
		||||
	        <button type="button" class="btn btn-primary" onclick='javascript:loadBrands("_2")'><i class="fa fa-search"></i>搜索</button>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td>
 | 
			
		||||
	       商品分类<font color='red'>*</font>:
 | 
			
		||||
	        <select id="cat22_0" class='ipt pgoodsCats2_2' level="0" onchange="WST.ITGoodsCats({id:'cat22_0',val:this.value,isRequire:false,className:'pgoodsCats2_2',afterFunc:'listQueryByBrands'});">
 | 
			
		||||
	          <option value=''>所有分类</option>
 | 
			
		||||
	          {volist name=":WSTGoodsCats(0)" id="vo"}
 | 
			
		||||
	          <option value="{$vo['catId']}">{$vo['catName']}</option>
 | 
			
		||||
	          {/volist}
 | 
			
		||||
	        </select>
 | 
			
		||||
	       <input type='hidden' id='dataType_2' value='0'/>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th>请选择<font color='red'>*</font>:</th>
 | 
			
		||||
	     <td width='320'>
 | 
			
		||||
	       <div class="recom-lbox">
 | 
			
		||||
	            <div class="trow head">
 | 
			
		||||
	              <div class="tck"><input onclick="WST.checkChks(this,'.lchk_2')" type="checkbox"></div>
 | 
			
		||||
	              <div class="ttxt">品牌</div>
 | 
			
		||||
	            </div>
 | 
			
		||||
	            <div id="llist_2" style="width:350px;"></div>
 | 
			
		||||
	       </div>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td align='center'>
 | 
			
		||||
	       <input type='button' value='》》' class='btn btn-primary' onclick='javascript:moveRight("_2")'/>
 | 
			
		||||
	       <br/><br/>
 | 
			
		||||
	       <input type='button' value='《《' class='btn btn-primary' onclick='javascript:moveLeft("_2")'/>
 | 
			
		||||
	       <input type='hidden' id='ids_2'/>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td>
 | 
			
		||||
	       <div class="recom-rbox">
 | 
			
		||||
	            <div class="trow head">
 | 
			
		||||
		            <div class="tck"><input onclick="WST.checkChks(this,'.rchk_2')" type="checkbox"></div>
 | 
			
		||||
		            <div class="ttxt">品牌</div>
 | 
			
		||||
		            <div class="top">排序</div>
 | 
			
		||||
		        </div>
 | 
			
		||||
	            <div id="rlist_2"></div>
 | 
			
		||||
	       </div>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  {if WSTGrant('PPTJ_04')}
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <td colspan='4' align='center' style='padding-top:10px;'>
 | 
			
		||||
        <button type="button" class="btn btn-primary" onclick='javascript:editBrands("_2")'><i class="fa fa-check"></i>保存</button>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  {/if}
 | 
			
		||||
</table>
 | 
			
		||||
</form>
 | 
			
		||||
<script>
 | 
			
		||||
$(function(){
 | 
			
		||||
	listQueryByBrands('_2');
 | 
			
		||||
	$('#headTip').WSTTips({width:90,height:35,callback:function(v){}});
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
{/block}
 | 
			
		||||
							
								
								
									
										97
									
								
								hyhproject/admin/view/recommends/goods.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										97
									
								
								hyhproject/admin/view/recommends/goods.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,97 @@
 | 
			
		||||
{extend name="base" /}
 | 
			
		||||
{block name="js"}
 | 
			
		||||
<script src="__ADMIN__/recommends/recommends.js?v=1{$v}" type="text/javascript"></script>
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="main"}
 | 
			
		||||
<style>
 | 
			
		||||
input[type=text]{padding: 6px 5px;}
 | 
			
		||||
</style>
 | 
			
		||||
<form autocomplete='off'>
 | 
			
		||||
<div id='alertTips' class='alert alert-success alert-tips fade in'>
 | 
			
		||||
  <div id='headTip' class='head'><i class='fa fa-lightbulb-o'></i>操作说明</div>
 | 
			
		||||
  <ul class='body'>
 | 
			
		||||
      <li>本功能主要用于前台商品展示的推荐设置,例如首页各楼层,猜你喜欢,最新上架,热销商品,推荐商城等等。</li>
 | 
			
		||||
      <li>若未进行过商品的推荐操作,则系统默认按照商品销量、上架时间排序;若有设置过则以设置的商品及排序为主。</li>
 | 
			
		||||
      <li>本功能为扩展功能,开发者可通过组合不同的商品分类和推荐类型在前台进行商品信息的展示</li>
 | 
			
		||||
  </ul>
 | 
			
		||||
</div>
 | 
			
		||||
<table class='wst-form wst-box-top'>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th width='120'>商品分类<font color='red'>*</font>:</th>
 | 
			
		||||
	     <td colspan='2'>
 | 
			
		||||
	        <select id="cat12_0" class='ipt pgoodsCats1_2' level="0" onchange="WST.ITGoodsCats({id:'cat12_0',val:this.value,isRequire:false,className:'pgoodsCats1_2'});">
 | 
			
		||||
	          <option value=''>请选择</option>
 | 
			
		||||
	          {volist name=":WSTGoodsCats(0)" id="vo"}
 | 
			
		||||
	          <option value="{$vo['catId']}">{$vo['catName']}</option>
 | 
			
		||||
	          {/volist}
 | 
			
		||||
	        </select>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td>
 | 
			
		||||
	        商品分类<font color='red'>*</font>:
 | 
			
		||||
	        <select id="cat22_0" class='ipt pgoodsCats2_2' level="0" onchange="WST.ITGoodsCats({id:'cat22_0',val:this.value,isRequire:false,className:'pgoodsCats2_2',afterFunc:'listQueryByGoods'});">
 | 
			
		||||
	          <option value=''>所有分类</option>
 | 
			
		||||
	          {volist name=":WSTGoodsCats(0)" id="vo"}
 | 
			
		||||
	          <option value="{$vo['catId']}">{$vo['catName']}</option>
 | 
			
		||||
	          {/volist}
 | 
			
		||||
	        </select>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th width='120'>搜索:</th>
 | 
			
		||||
	     <td colspan='2'>
 | 
			
		||||
	        <input type='text' id='key_2' style='width:250px' class='ipt_2' placeholder='商品名称、商品编号'/>
 | 
			
		||||
	        <button type="button" class="btn btn-primary" onclick='javascript:loadGoods("_2")'><i class="fa fa-search"></i>搜索</button>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td style='padding-left:30px;'>
 | 
			
		||||
	       类型<font color='red'>*</font>:
 | 
			
		||||
	       <select id='dataType_2' onchange='listQueryByGoods("_2")'>
 | 
			
		||||
	          <option value='0'>推荐</option>
 | 
			
		||||
	          <option value='1'>热销</option>
 | 
			
		||||
	          <option value='2'>精品</option>
 | 
			
		||||
	          <option value='3'>新品</option>
 | 
			
		||||
	        </select>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th>请选择<font color='red'>*</font>:</th>
 | 
			
		||||
	     <td width='320'>
 | 
			
		||||
	       <div class="recom-lbox">
 | 
			
		||||
	            <div class="trow head">
 | 
			
		||||
	              <div class="tck"><input onclick="WST.checkChks(this,'.lchk_2')" type="checkbox"></div>
 | 
			
		||||
	              <div class="ttxt">商品</div>
 | 
			
		||||
	            </div>
 | 
			
		||||
	            <div id="llist_2" style="width:350px;"></div>
 | 
			
		||||
	       </div>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td align='center'>
 | 
			
		||||
	       <input type='button' value='》》' class='btn btn-primary' onclick='javascript:moveRight("_2")'/>
 | 
			
		||||
	       <br/><br/>
 | 
			
		||||
	       <input type='button' value='《《' class='btn btn-primary' onclick='javascript:moveLeft("_2")'/>
 | 
			
		||||
	       <input type='hidden' id='ids_2'/>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td>
 | 
			
		||||
	       <div class="recom-rbox">
 | 
			
		||||
	            <div class="trow head">
 | 
			
		||||
		            <div class="tck"><input onclick="WST.checkChks(this,'.rchk_2')" type="checkbox"></div>
 | 
			
		||||
		            <div class="ttxt">商品</div>
 | 
			
		||||
		            <div class="top">排序</div>
 | 
			
		||||
		        </div>
 | 
			
		||||
	            <div id="rlist_2"></div>
 | 
			
		||||
	       </div>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  {if WSTGrant('SPTJ_04')}
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <td colspan='4' align='center' style='padding-top:10px;'>
 | 
			
		||||
	     	<button type="button" class="btn btn-primary" onclick='javascript:editGoods("_2")'><i class="fa fa-check"></i>保存</button>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  {/if}
 | 
			
		||||
</table>
 | 
			
		||||
</form>
 | 
			
		||||
<script>
 | 
			
		||||
$(function(){
 | 
			
		||||
	listQueryByGoods('_2');
 | 
			
		||||
	$('#headTip').WSTTips({width:90,height:35,callback:function(v){}});
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
{/block}
 | 
			
		||||
							
								
								
									
										276
									
								
								hyhproject/admin/view/recommends/recommends.js
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										276
									
								
								hyhproject/admin/view/recommends/recommends.js
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,276 @@
 | 
			
		||||
function moveRight(suffix){
 | 
			
		||||
	$('input[name="lchk'+suffix+'"]:checked').each(function(){
 | 
			
		||||
		var html = [];
 | 
			
		||||
		html.push('<div class="trow"><div class="tck"><input type="checkbox" name="rchk'+suffix+'" class="rchk'+suffix+'" value="'+$(this).val()+'"></div>');
 | 
			
		||||
		html.push('<div class="ttxt">'+$(this).parent().parent().find('.ttxt').html()+'</div>');
 | 
			
		||||
		html.push('<div class="top"><input type="text" class="s-sort s-ipt'+suffix+'" value="0" v="'+$(this).val()+'"></div></div>');
 | 
			
		||||
		$(this).parent().parent().remove();
 | 
			
		||||
		$('#rlist'+suffix).append(html.join(''));
 | 
			
		||||
	});
 | 
			
		||||
	var ids = [];
 | 
			
		||||
	$('input[name="rchk'+suffix+'"]').each(function(){
 | 
			
		||||
		ids.push($(this).val());
 | 
			
		||||
	});
 | 
			
		||||
	$('#ids'+suffix).val(ids.join(','));
 | 
			
		||||
}
 | 
			
		||||
function moveLeft(suffix){
 | 
			
		||||
	$('input[name="rchk'+suffix+'"]:checked').each(function(){
 | 
			
		||||
		var html = [];
 | 
			
		||||
		html.push('<div class="trow"><div class="tck"><input type="checkbox" name="lchk'+suffix+'" class="lchk'+suffix+'" value="'+$(this).val()+'"></div>');
 | 
			
		||||
		html.push('<div class="ttxt">'+$(this).parent().parent().find('.ttxt').html()+'</div></div>');
 | 
			
		||||
		$(this).parent().parent().remove();
 | 
			
		||||
		$('#llist'+suffix).append(html.join(''));
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
/**商品**/
 | 
			
		||||
function loadGoods(suffix){
 | 
			
		||||
	var params = WST.getParams('.ipt'+suffix);
 | 
			
		||||
	params.key = params['key'+suffix];
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats1'+suffix);
 | 
			
		||||
	if(params.goodsCatId==''){
 | 
			
		||||
		WST.msg('请选择一个商品分类',{icon:2});
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/searchGoods'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		if(!json.data)return;
 | 
			
		||||
    		json = json.data;
 | 
			
		||||
    		$("#llist"+suffix).empty();
 | 
			
		||||
    		var ids = $('#ids'+suffix).val().split(',');
 | 
			
		||||
			var data,html=[];
 | 
			
		||||
			for(var i=0;i<json.length;i++){
 | 
			
		||||
				data = json[i]; 
 | 
			
		||||
				if($.inArray(data.goodsId.toString(),ids)==-1){
 | 
			
		||||
					html.push('<div class="trow"><div class="tck"><input type="checkbox" name="lchk'+suffix+'" class="lchk'+suffix+'" value="'+data.goodsId+'"></div>');
 | 
			
		||||
					html.push('<div class="ttxt">【'+data.shopName+'】'+data.goodsName+'</div></div>');
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			$("#llist"+suffix).html(html.join(''));
 | 
			
		||||
    	}else{
 | 
			
		||||
    		WST.msg(json.msg,{icon:2});
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
function listQueryByGoods(suffix){
 | 
			
		||||
	suffix = (typeof(suffix)=='object')?'_2':suffix;
 | 
			
		||||
	$('#rlist'+suffix).empty();
 | 
			
		||||
	$('#ids'+suffix).val('');
 | 
			
		||||
	var params = {};
 | 
			
		||||
	params.dataType = $('#dataType'+suffix).val();
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats2'+suffix);
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/listQueryByGoods'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		if(json.data && json.data.length){
 | 
			
		||||
    		    json = json.data;
 | 
			
		||||
				var data,html=[],ids = [];
 | 
			
		||||
				for(var i=0;i<json.length;i++){
 | 
			
		||||
					data = json[i]; 
 | 
			
		||||
					ids.push(data.dataId);
 | 
			
		||||
					html.push('<div class="trow"><div class="tck"><input type="checkbox" name="rchk'+suffix+'" class="rchk'+suffix+'" value="'+data.dataId+'"></div>');
 | 
			
		||||
					html.push('<div class="ttxt">【'+data.shopName+'】'+data.goodsName+'</div>');
 | 
			
		||||
					html.push('<div class="top"><input type="text" class="s-sort s-ipt'+suffix+'" value="'+data.dataSort+'" v="'+data.dataId+'"></div></div>');
 | 
			
		||||
				}
 | 
			
		||||
				$('#ids'+suffix).val(ids.join(','));
 | 
			
		||||
				$("#rlist"+suffix).html(html.join(''));
 | 
			
		||||
    		}
 | 
			
		||||
    		if(WST.ITGetGoodsCatVal('pgoodsCats1'+suffix)>0)loadGoods(suffix);
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
function editGoods(suffix){
 | 
			
		||||
	var params = {},ids = [];
 | 
			
		||||
	$('input[name="rchk'+suffix+'"]').each(function(){
 | 
			
		||||
		ids.push($(this).val());
 | 
			
		||||
	});
 | 
			
		||||
	$('.s-ipt'+suffix).each(function(){
 | 
			
		||||
		params['ipt'+$(this).attr('v')] = $(this).val();
 | 
			
		||||
	})
 | 
			
		||||
	params.ids = ids.join(',');
 | 
			
		||||
	params.dataType = $('#dataType'+suffix).val();
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats2'+suffix);
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/editGoods'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		WST.msg("保存成功",{icon:1});
 | 
			
		||||
    	}else{
 | 
			
		||||
    		WST.msg(json.msg,{icon:2});
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/***店铺**/
 | 
			
		||||
function loadShops(suffix){
 | 
			
		||||
	var params = WST.getParams('.ipt'+suffix);
 | 
			
		||||
	params.key = params['key'+suffix];
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats1'+suffix);
 | 
			
		||||
	if(params.goodsCatId==''){
 | 
			
		||||
		WST.msg('请选择一个经营范围',{icon:2});
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/searchShops'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		if(!json.data)return;
 | 
			
		||||
    		json = json.data;
 | 
			
		||||
    		$("#llist"+suffix).empty();
 | 
			
		||||
    		var ids = $('#ids'+suffix).val().split(',');
 | 
			
		||||
			var data,html=[];
 | 
			
		||||
			for(var i=0;i<json.length;i++){
 | 
			
		||||
				data = json[i]; 
 | 
			
		||||
				if($.inArray(data.shopId.toString(),ids)==-1){
 | 
			
		||||
					html.push('<div class="trow"><div class="tck"><input type="checkbox" name="lchk'+suffix+'" class="lchk'+suffix+'" value="'+data.shopId+'"></div>');
 | 
			
		||||
					html.push('<div class="ttxt">【'+data.shopSn+'】'+data.shopName+'</div></div>');
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			$("#llist"+suffix).html(html.join(''));
 | 
			
		||||
    	}else{
 | 
			
		||||
    		WST.msg(json.msg,{icon:2});
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
function listQueryByShops(suffix){
 | 
			
		||||
	suffix = (typeof(suffix)=='object')?'_2':suffix;
 | 
			
		||||
	$('#rlist'+suffix).empty();
 | 
			
		||||
	$('#ids'+suffix).val('');
 | 
			
		||||
	var params = {};
 | 
			
		||||
	params.dataType = $('#dataType'+suffix).val();
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats2'+suffix);
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/listQueryByShops'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		if(json.data && json.data.length){
 | 
			
		||||
    		    json = json.data;
 | 
			
		||||
				var data,html=[],ids = [];
 | 
			
		||||
				for(var i=0;i<json.length;i++){
 | 
			
		||||
					data = json[i]; 
 | 
			
		||||
					ids.push(data.dataId);
 | 
			
		||||
					html.push('<div class="trow"><div class="tck"><input type="checkbox" name="rchk'+suffix+'" class="rchk'+suffix+'" value="'+data.dataId+'"></div>');
 | 
			
		||||
					html.push('<div class="ttxt">【'+data.shopSn+'】'+data.shopName+'</div>');
 | 
			
		||||
					html.push('<div class="top"><input type="text" class="s-sort s-ipt'+suffix+'" value="'+data.dataSort+'" v="'+data.dataId+'"></div></div>');
 | 
			
		||||
				}
 | 
			
		||||
				$('#ids'+suffix).val(ids.join(','));
 | 
			
		||||
				$("#rlist"+suffix).html(html.join(''));
 | 
			
		||||
    		}
 | 
			
		||||
    		if(WST.ITGetGoodsCatVal('pgoodsCats1'+suffix)>0)loadShops(suffix);
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function editShops(suffix){
 | 
			
		||||
	var params = {},ids = [];
 | 
			
		||||
	$('input[name="rchk'+suffix+'"]').each(function(){
 | 
			
		||||
		ids.push($(this).val());
 | 
			
		||||
	});
 | 
			
		||||
	$('.s-ipt'+suffix).each(function(){
 | 
			
		||||
		params['ipt'+$(this).attr('v')] = $(this).val();
 | 
			
		||||
	})
 | 
			
		||||
	params.ids = ids.join(',');
 | 
			
		||||
	params.dataType = $('#dataType'+suffix).val();
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats2'+suffix);
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/editShops'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		WST.msg("保存成功",{icon:1});
 | 
			
		||||
    	}else{
 | 
			
		||||
    		WST.msg(json.msg,{icon:2});
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
/**品牌**/
 | 
			
		||||
function loadBrands(suffix){
 | 
			
		||||
	var params = WST.getParams('.ipt'+suffix);
 | 
			
		||||
	params.key = params['key'+suffix];
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats1'+suffix);
 | 
			
		||||
	if(params.goodsCatId==''){
 | 
			
		||||
		WST.msg('请选择一个商品分类',{icon:2});
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/searchBrands'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		if(!json.data)return;
 | 
			
		||||
    		json = json.data;
 | 
			
		||||
    		$("#llist"+suffix).empty();
 | 
			
		||||
    		var ids = $('#ids'+suffix).val().split(',');
 | 
			
		||||
			var data,html=[];
 | 
			
		||||
			for(var i=0;i<json.length;i++){
 | 
			
		||||
				data = json[i]; 
 | 
			
		||||
				if($.inArray(data.brandId.toString(),ids)==-1){
 | 
			
		||||
					html.push('<div class="trow"><div class="tck"><input type="checkbox" name="lchk'+suffix+'" class="lchk'+suffix+'" value="'+data.brandId+'"></div>');
 | 
			
		||||
					html.push('<div class="ttxt">'+data.brandName+'</div></div>');
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			$("#llist"+suffix).html(html.join(''));
 | 
			
		||||
    	}else{
 | 
			
		||||
    		WST.msg(json.msg,{icon:2});
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
function listQueryByBrands(suffix){
 | 
			
		||||
	suffix = (typeof(suffix)=='object')?'_2':suffix;
 | 
			
		||||
	$('#rlist'+suffix).empty();
 | 
			
		||||
	$('#ids'+suffix).val('');
 | 
			
		||||
	var params = {};
 | 
			
		||||
	params.dataType = $('#dataType'+suffix).val();
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats2'+suffix);
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/listQueryByBrands'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		if(json.data && json.data.length){
 | 
			
		||||
    		    json = json.data;
 | 
			
		||||
				var data,html=[],ids = [];
 | 
			
		||||
				for(var i=0;i<json.length;i++){
 | 
			
		||||
					data = json[i]; 
 | 
			
		||||
					ids.push(data.dataId);
 | 
			
		||||
					html.push('<div class="trow"><div class="tck"><input type="checkbox" name="rchk'+suffix+'" class="rchk'+suffix+'" value="'+data.dataId+'"></div>');
 | 
			
		||||
					html.push('<div class="ttxt">'+data.brandName+'</div>');
 | 
			
		||||
					html.push('<div class="top"><input type="text" class="s-sort s-ipt'+suffix+'" value="'+data.dataSort+'" v="'+data.dataId+'"></div></div>');
 | 
			
		||||
				}
 | 
			
		||||
				$('#ids'+suffix).val(ids.join(','));
 | 
			
		||||
				$("#rlist"+suffix).html(html.join(''));
 | 
			
		||||
    		}
 | 
			
		||||
    		if(WST.ITGetGoodsCatVal('pgoodsCats1'+suffix)>0)loadBrands(suffix);
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function editBrands(suffix){
 | 
			
		||||
	var params = {},ids = [];
 | 
			
		||||
	$('input[name="rchk'+suffix+'"]').each(function(){
 | 
			
		||||
		ids.push($(this).val());
 | 
			
		||||
	});
 | 
			
		||||
	$('.s-ipt'+suffix).each(function(){
 | 
			
		||||
		params['ipt'+$(this).attr('v')] = $(this).val();
 | 
			
		||||
	})
 | 
			
		||||
	params.ids = ids.join(',');
 | 
			
		||||
	params.dataType = $('#dataType'+suffix).val();
 | 
			
		||||
	params.goodsCatId = WST.ITGetGoodsCatVal('pgoodsCats2'+suffix);
 | 
			
		||||
	var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
    $.post(WST.U('admin/recommends/editBrands'),params,function(data,textStatus){
 | 
			
		||||
    	layer.close(loading);
 | 
			
		||||
    	var json = WST.toAdminJson(data);
 | 
			
		||||
    	if(json.status=='1'){
 | 
			
		||||
    		WST.msg("保存成功",{icon:1});
 | 
			
		||||
    	}else{
 | 
			
		||||
    		WST.msg(json.msg,{icon:2});
 | 
			
		||||
    	}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										91
									
								
								hyhproject/admin/view/recommends/shops.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										91
									
								
								hyhproject/admin/view/recommends/shops.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,91 @@
 | 
			
		||||
{extend name="base" /}
 | 
			
		||||
{block name="js"}
 | 
			
		||||
<script src="__ADMIN__/recommends/recommends.js?v=1{$v}" type="text/javascript"></script>
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="main"}
 | 
			
		||||
<style>
 | 
			
		||||
input[type=text]{padding: 6px 5px;}
 | 
			
		||||
</style>
 | 
			
		||||
<div id='alertTips' class='alert alert-success alert-tips fade in'>
 | 
			
		||||
  <div id='headTip' class='head'><i class='fa fa-lightbulb-o'></i>操作说明</div>
 | 
			
		||||
  <ul class='body'>
 | 
			
		||||
      <li>本功能主要用于前台店铺展示的推荐设置</li>
 | 
			
		||||
      <li>本功能为扩展功能,开发者可通过组合不同的商品分类和推荐类型在前台进行店铺信息的展示</li>
 | 
			
		||||
  </ul>
 | 
			
		||||
</div>
 | 
			
		||||
<form autocomplete='off'>
 | 
			
		||||
<table class='wst-form wst-box-top'>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th width='120'>经营范围<font color='red'>*</font>:</th>
 | 
			
		||||
	     <td colspan='2'>
 | 
			
		||||
	        <select id="cat12_0" class='ipt pgoodsCats1_2' level="0" onchange="WST.ITGoodsCats({id:'cat12_0',val:this.value,isRequire:false,className:'pgoodsCats1_2'});">
 | 
			
		||||
	          <option value=''>请选择</option>
 | 
			
		||||
	          {volist name=":WSTGoodsCats(0)" id="vo"}
 | 
			
		||||
	          <option value="{$vo['catId']}">{$vo['catName']}</option>
 | 
			
		||||
	          {/volist}
 | 
			
		||||
	        </select>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td>
 | 
			
		||||
	         
 | 
			
		||||
	     </td>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th width='120'>搜索:</th>
 | 
			
		||||
	     <td colspan='2'>
 | 
			
		||||
	        <input type='text' id='key_2' style='width:250px' class='ipt_2' placeholder='店铺名称、店铺编号'/>
 | 
			
		||||
	        <button type="button" class="btn btn-primary" onclick='javascript:loadShops("_2")'><i class="fa fa-search"></i>搜索</button>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td>
 | 
			
		||||
	       经营范围<font color='red'>*</font>:
 | 
			
		||||
	        <select id="cat22_0" class='ipt pgoodsCats2_2' level="0" onchange="WST.ITGoodsCats({id:'cat22_0',val:this.value,isRequire:false,className:'pgoodsCats2_2',afterFunc:'listQueryByShops'});">
 | 
			
		||||
	          <option value=''>所有范围</option>
 | 
			
		||||
	          {volist name=":WSTGoodsCats(0)" id="vo"}
 | 
			
		||||
	          <option value="{$vo['catId']}">{$vo['catName']}</option>
 | 
			
		||||
	          {/volist}
 | 
			
		||||
	        </select>
 | 
			
		||||
	       <input type='hidden' id='dataType_2' value='0'/>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <th>请选择<font color='red'>*</font>:</th>
 | 
			
		||||
	     <td width='320'>
 | 
			
		||||
	       <div class="recom-lbox">
 | 
			
		||||
	            <div class="trow head">
 | 
			
		||||
	              <div class="tck"><input onclick="WST.checkChks(this,'.lchk_2')" type="checkbox"></div>
 | 
			
		||||
	              <div class="ttxt">店铺</div>
 | 
			
		||||
	            </div>
 | 
			
		||||
	            <div id="llist_2" style="width:350px;"></div>
 | 
			
		||||
	       </div>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td align='center'>
 | 
			
		||||
	       <input type='button' value='》》' class='btn btn-primary' onclick='javascript:moveRight("_2")'/>
 | 
			
		||||
	       <br/><br/>
 | 
			
		||||
	       <input type='button' value='《《' class='btn btn-primary' onclick='javascript:moveLeft("_2")'/>
 | 
			
		||||
	       <input type='hidden' id='ids_2'/>
 | 
			
		||||
	     </td>
 | 
			
		||||
	     <td>
 | 
			
		||||
	       <div class="recom-rbox">
 | 
			
		||||
	            <div class="trow head">
 | 
			
		||||
		            <div class="tck"><input onclick="WST.checkChks(this,'.rchk_2')" type="checkbox"></div>
 | 
			
		||||
		            <div class="ttxt">店铺</div>
 | 
			
		||||
		            <div class="top">排序</div>
 | 
			
		||||
		        </div>
 | 
			
		||||
	            <div id="rlist_2"></div>
 | 
			
		||||
	       </div>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  {if WSTGrant('DPTJ_04')}
 | 
			
		||||
	  <tr>
 | 
			
		||||
	     <td colspan='4' align='center' style='padding-top:10px;'>
 | 
			
		||||
	     	<button type="button" class="btn btn-primary" onclick='javascript:editShops("_2")'><i class="fa fa-check"></i>保存</button>
 | 
			
		||||
	     </td>
 | 
			
		||||
	  </tr>
 | 
			
		||||
	  {/if}
 | 
			
		||||
</table>
 | 
			
		||||
</form>
 | 
			
		||||
<script>
 | 
			
		||||
$(function(){
 | 
			
		||||
	listQueryByShops('_2');
 | 
			
		||||
	$('#headTip').WSTTips({width:90,height:35,callback:function(v){}});
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
{/block}
 | 
			
		||||
		Reference in New Issue
	
	Block a user