You've already forked qlg.tsgz.moe
							
							Init Repo
This commit is contained in:
		
							
								
								
									
										94
									
								
								hyhproject/home2/view/default/shops/goodsappraises/goodsappraises.js
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										94
									
								
								hyhproject/home2/view/default/shops/goodsappraises/goodsappraises.js
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,94 @@
 | 
			
		||||
/**获取本店分类**/
 | 
			
		||||
function getShopsCats(objId,pVal,objVal){
 | 
			
		||||
	$('#'+objId).empty();
 | 
			
		||||
	$.post(WST.U('home/shopcats/listQuery'),{parentId:pVal},function(data,textStatus){
 | 
			
		||||
	     var json = WST.toJson(data);
 | 
			
		||||
	     var html = [],cat;
 | 
			
		||||
	     html.push("<option value='' >-请选择-</option>");
 | 
			
		||||
	     if(json.status==1 && json.list){
 | 
			
		||||
	    	 json = json.list;
 | 
			
		||||
			 for(var i=0;i<json.length;i++){
 | 
			
		||||
			     cat = json[i];
 | 
			
		||||
			     html.push("<option value='"+cat.catId+"' "+((objVal==cat.catId)?"selected":"")+">"+cat.catName+"</option>");
 | 
			
		||||
			 }
 | 
			
		||||
	     }
 | 
			
		||||
	     $('#'+objId).html(html.join(''));
 | 
			
		||||
	});
 | 
			
		||||
}
 | 
			
		||||
function getCat(val){
 | 
			
		||||
  if(val==0){
 | 
			
		||||
     $('#cat2').html("<option value='' >-请选择-</option>");
 | 
			
		||||
     return;
 | 
			
		||||
  }
 | 
			
		||||
  $.post(WST.U('home/shopcats/listQuery'),{parentId:val},function(data,textStatus){
 | 
			
		||||
       var json = WST.toJson(data);
 | 
			
		||||
       var html = [],cat;
 | 
			
		||||
       html.push("<option value='' >-请选择-</option>");
 | 
			
		||||
       if(json.status==1 && json.list){
 | 
			
		||||
         json = json.list;
 | 
			
		||||
       for(var i=0;i<json.length;i++){
 | 
			
		||||
           cat = json[i];
 | 
			
		||||
           html.push("<option value='"+cat.catId+"'>"+cat.catName+"</option>");
 | 
			
		||||
        }
 | 
			
		||||
       }
 | 
			
		||||
       $('#cat2').html(html.join(''));
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
function showImg(id){
 | 
			
		||||
  layer.photos({
 | 
			
		||||
      photos: '#img-file-'+id
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
function queryByPage(p){
 | 
			
		||||
	$('#list').html('<img src="'+WST.conf.ROOT+'/hyhproject/home/view/default/img/loading.gif">正在加载数据...');
 | 
			
		||||
	var params = {};
 | 
			
		||||
	params = WST.getParams('.s-query');
 | 
			
		||||
	params.key = $.trim($('#key').val());
 | 
			
		||||
	params.page = p;
 | 
			
		||||
	$.post(WST.U('home/goodsappraises/queryByPage'),params,function(data,textStatus){
 | 
			
		||||
	    var json = WST.toJson(data);
 | 
			
		||||
	    $('#list').empty();
 | 
			
		||||
	    if(json.status==1){
 | 
			
		||||
	    	json = json.data;
 | 
			
		||||
	       	var gettpl = document.getElementById('tblist').innerHTML;
 | 
			
		||||
	       	laytpl(gettpl).render(json.Rows, function(html){
 | 
			
		||||
	       		$('#list').html(html);
 | 
			
		||||
	        	for(var g=0;g<=json.Rows.length;g++){
 | 
			
		||||
	       			showImg(g);
 | 
			
		||||
	       		}
 | 
			
		||||
	       		$('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+window.conf.GOODS_LOGO});
 | 
			
		||||
	       	});
 | 
			
		||||
	       	laypage({
 | 
			
		||||
		        cont: 'pager', 
 | 
			
		||||
		        pages:json.TotalPage, 
 | 
			
		||||
		        curr: json.CurrentPage,
 | 
			
		||||
		        skin: '#e23e3d',
 | 
			
		||||
		        groups: 3,
 | 
			
		||||
		        jump: function(e, first){
 | 
			
		||||
		        	if(!first){
 | 
			
		||||
		        		queryByPage(e.curr);
 | 
			
		||||
		        	}
 | 
			
		||||
		        } 
 | 
			
		||||
		    });
 | 
			
		||||
       	}  
 | 
			
		||||
	});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function reply(t,id){
 | 
			
		||||
 var params = {};
 | 
			
		||||
 if($('#reply-'+id).val()==''){
 | 
			
		||||
    WST.msg('回复内容不能为空',{icon:2});
 | 
			
		||||
    return false;
 | 
			
		||||
 }
 | 
			
		||||
 params.reply = $('#reply-'+id).val();
 | 
			
		||||
 params.id=id;
 | 
			
		||||
 $.post(WST.U('home/goodsappraises/shopReply'),params,function(data){
 | 
			
		||||
    var json = WST.toJson(data);
 | 
			
		||||
    if(json.status==1){
 | 
			
		||||
      var today = new Date();
 | 
			
		||||
          today = today.toLocaleDateString();
 | 
			
		||||
      var html = '<p class="reply-content">'+params.reply+'【'+today+'】</p>'
 | 
			
		||||
      $(t).parent().html(html);
 | 
			
		||||
    }
 | 
			
		||||
 });
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										107
									
								
								hyhproject/home2/view/default/shops/goodsappraises/list.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										107
									
								
								hyhproject/home2/view/default/shops/goodsappraises/list.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,107 @@
 | 
			
		||||
{extend name="default/shops/base" /}
 | 
			
		||||
{block name="title"}评价列表-卖家中心{__block__}{/block}
 | 
			
		||||
{block name="content"}
 | 
			
		||||
 | 
			
		||||
<div class="wst-shop-head"><span>评价列表</span></div>
 | 
			
		||||
<div class="wst-shop-tbar">
 | 
			
		||||
  <label>
 | 
			
		||||
    商品分类:
 | 
			
		||||
    <select name="cat1" id="cat1" onchange="getCat(this.value)" class="s-query">
 | 
			
		||||
        <option value="">-请选择-</option>
 | 
			
		||||
      {volist name=":WSTShopCats(0)" id="vo"}
 | 
			
		||||
            <option value="{$vo['catId']}" >{$vo['catName']}</option>
 | 
			
		||||
      {/volist}
 | 
			
		||||
    </select>
 | 
			
		||||
    <select name="cat2" id="cat2" class="s-query"><option value="">-请选择-</option></select>
 | 
			
		||||
  </label>
 | 
			
		||||
  <label>
 | 
			
		||||
    商品名称:<input type="text" name="goodsName" id="goodsName" class="s-query" /><a class="s-btn" onclick="queryByPage()">查询</a>
 | 
			
		||||
  </label>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="wst-shop-content"> 
 | 
			
		||||
   <table class='wst-list'>
 | 
			
		||||
   <thead>
 | 
			
		||||
   <tr>
 | 
			
		||||
     <th width="40">序号</th>
 | 
			
		||||
     <th width="400">商品</th>
 | 
			
		||||
     <th>商品评分</th>
 | 
			
		||||
     <th>服务评分</th>
 | 
			
		||||
     <th>时效评分</th>
 | 
			
		||||
   </tr>
 | 
			
		||||
   </thead>
 | 
			
		||||
   <tbody id='list'></tbody>
 | 
			
		||||
   <tfoot>
 | 
			
		||||
     <tr><td colspan='10' style='padding-top:10px;text-align:center;'>
 | 
			
		||||
       <div id='pager'></div>
 | 
			
		||||
     </td></tr>
 | 
			
		||||
   </tfoot>
 | 
			
		||||
   
 | 
			
		||||
   <script id="tblist" type="text/html">
 | 
			
		||||
   {{# for(var i = 0; i < d.length; i++){ }}
 | 
			
		||||
   <tr>
 | 
			
		||||
      <td rowspan="2">{{i+1}}</td>
 | 
			
		||||
      <td rowspan="2">
 | 
			
		||||
          <div class="appra-img">
 | 
			
		||||
          <a href="{{WST.U("home/goods/detail","id="+d[i]['goodsId'])}}">
 | 
			
		||||
            <img class='gImg'  data-original='__IMGURL__/{{d[i].goodsImg}}'/>
 | 
			
		||||
          </a>
 | 
			
		||||
        </div>
 | 
			
		||||
          <p class="appra-goodsName">
 | 
			
		||||
            {{WST.cutStr(d[i]['goodsName'],43)}}
 | 
			
		||||
          </p>
 | 
			
		||||
      </td>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      <td>
 | 
			
		||||
      {{# for(var gs=0;gs<d[i]['goodsScore'];++gs){ }}
 | 
			
		||||
          <img src="__STATIC__/plugins/raty/img/star-on.png">
 | 
			
		||||
      {{# } }}
 | 
			
		||||
      </td>
 | 
			
		||||
 | 
			
		||||
      <td>
 | 
			
		||||
      {{# for(var gs=0;gs<d[i]['serviceScore'];++gs){ }}
 | 
			
		||||
          <img src="__STATIC__/plugins/raty/img/star-on.png">
 | 
			
		||||
      {{# } }}
 | 
			
		||||
      </td>
 | 
			
		||||
      
 | 
			
		||||
      <td>
 | 
			
		||||
      {{# for(var gs=0;gs<d[i]['timeScore'];++gs){ }}
 | 
			
		||||
          <img src="__STATIC__/plugins/raty/img/star-on.png">
 | 
			
		||||
      {{# } }}
 | 
			
		||||
      </td>     
 | 
			
		||||
   </tr>
 | 
			
		||||
   <tr style="border-bottom:1px solid #ccc;">
 | 
			
		||||
         <td colspan='3'>评价[{{d[i]['loginName']}}]:{{d[i]['content']}}
 | 
			
		||||
             
 | 
			
		||||
            {{#  if(WST.blank(d[i]['images'])!=''){ var img = d[i]['images'].split(','); var length = img.length;  }}
 | 
			
		||||
            <div id="img-file-{{i}}">
 | 
			
		||||
            {{#  for(var g=0;g<length;g++){  }}
 | 
			
		||||
                   <img src="__IMGURL__/{{img[g]}}/thumb80" layer-src="__IMGURL__/{{img[g]}}" width="30" height="30" />
 | 
			
		||||
            {{#  } }}
 | 
			
		||||
            </div>
 | 
			
		||||
            {{# }  }}
 | 
			
		||||
            <div class="reply-box">
 | 
			
		||||
              {{# if(d[i]['shopReply']==null || d[i]['shopReply']=='') { }}
 | 
			
		||||
              <textarea cols="65" rows="5" id="reply-{{d[i]['gaId']}}" ></textarea>
 | 
			
		||||
              <a class="reply-btn s-btn" onclick="reply(this,{{d[i]['gaId']}})">回复</a>
 | 
			
		||||
              {{# }else{ }}
 | 
			
		||||
               <p class="reply-content">{{d[i]['shopReply']}}【{{d[i]['replyTime']}}】</p>
 | 
			
		||||
              {{# } }}
 | 
			
		||||
 | 
			
		||||
            </div>
 | 
			
		||||
         </td>
 | 
			
		||||
      </tr>
 | 
			
		||||
 | 
			
		||||
   {{# } }}
 | 
			
		||||
   </script>
 | 
			
		||||
  </table>
 | 
			
		||||
</div>
 | 
			
		||||
{/block}  
 | 
			
		||||
{block name="js"}
 | 
			
		||||
<script type='text/javascript' src='__STYLE__/shops/goodsappraises/goodsappraises.js?v={$v}'></script>
 | 
			
		||||
<script>
 | 
			
		||||
$(function(){
 | 
			
		||||
  queryByPage();
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
{/block}
 | 
			
		||||
		Reference in New Issue
	
	Block a user