You've already forked qlg.tsgz.moe
							
							Init Repo
This commit is contained in:
		
							
								
								
									
										126
									
								
								hyhproject/admin/view/goodsappraises/edit.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										126
									
								
								hyhproject/admin/view/goodsappraises/edit.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,126 @@
 | 
			
		||||
{extend name="base" /}
 | 
			
		||||
{block name="js"}
 | 
			
		||||
<script src="__ADMIN__/goodsappraises/goodsappraises.js?v={$v}" type="text/javascript"></script>
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="main"}
 | 
			
		||||
<script type="text/javascript" src="__STATIC__/plugins/raty/jquery.raty.min.js"></script>
 | 
			
		||||
<script>
 | 
			
		||||
$(function(){
 | 
			
		||||
var options = {
 | 
			
		||||
      hints         : ['很不满意', '不满意', '一般', '满意', '非常满意'],
 | 
			
		||||
      width:200,
 | 
			
		||||
      targetKeep: true,
 | 
			
		||||
      starHalf:'__STATIC__/plugins/raty/img/star-half-big.png',
 | 
			
		||||
      starOff:'__STATIC__/plugins/raty/img/star-off-big.png',
 | 
			
		||||
      starOn:'__STATIC__/plugins/raty/img/star-on-big.png',
 | 
			
		||||
      cancelOff: '__STATIC__/plugins/raty/img/cancel-off-big.png',
 | 
			
		||||
        cancelOn: '__STATIC__/plugins/raty/img/cancel-on-big.png'
 | 
			
		||||
    }
 | 
			
		||||
  options.target='#goodsScore_hint';
 | 
			
		||||
  options.score='{$data['goodsScore']}';
 | 
			
		||||
  $('.goodsScore').raty(options);
 | 
			
		||||
 | 
			
		||||
  options.target='#timeScore_hint';
 | 
			
		||||
  options.score='{$data['timeScore']}';
 | 
			
		||||
  $('.timeScore').raty(options);
 | 
			
		||||
 | 
			
		||||
  options.target='#serviceScore_hint';
 | 
			
		||||
  options.score='{$data['serviceScore']}';
 | 
			
		||||
  $('.serviceScore').raty(options);
 | 
			
		||||
 | 
			
		||||
  editInit();
 | 
			
		||||
      
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
<form id="goodsAppraisesForm" autocomplete="off">
 | 
			
		||||
<table class='wst-form wst-box-top'>
 | 
			
		||||
  <tr>
 | 
			
		||||
      <th width='150'>商品:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
            <img src='__IMGURL__/{$data["goodsImg"]}' width='50' style="float:left;" /> 
 | 
			
		||||
            <p style="float:left;height:50px;line-height:25px;width:245px;overflow:hidden;margin-left:5px;">{$data['goodsName']}</p>
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th>所属订单:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
              {$data['orderNo']}
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th>用户:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
              {$data['loginName']}
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th>评价:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
                <div style='width:500px;'>
 | 
			
		||||
                  <div style='float:left;width:70px;'>商品评分:</div>
 | 
			
		||||
                  <div style='float:left;width:430px;'>
 | 
			
		||||
                    <div class="goodsScore" class="ipt" style='float:left'></div>
 | 
			
		||||
                    <div id="goodsScore_hint"  style='float:left'></div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div id="score_error"></div>
 | 
			
		||||
 | 
			
		||||
               <div style='width:500px;'>
 | 
			
		||||
                    <div style='float:left;width:70px;'> 时效评分:</div>
 | 
			
		||||
                    <div style='float:left;width:430px;'>
 | 
			
		||||
                      <div class="timeScore" class="ipt" style='float:left'></div>
 | 
			
		||||
                      <div id="timeScore_hint" style='float:left'></div>
 | 
			
		||||
                    </div>
 | 
			
		||||
               </div>
 | 
			
		||||
 | 
			
		||||
               <div style='width:500px;'>
 | 
			
		||||
                  <div style='float:left;width:70px;'>服务评分:</div>
 | 
			
		||||
                  <div style='float:left;width:430px;'>
 | 
			
		||||
                      <div class="serviceScore" class="ipt" style='float:left'></div>
 | 
			
		||||
                      <div id="serviceScore_hint"  style='float:left'></div>
 | 
			
		||||
                  </div>
 | 
			
		||||
               </div>
 | 
			
		||||
          </td>
 | 
			
		||||
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th>状态:</th>
 | 
			
		||||
          <td class='layui-form'>
 | 
			
		||||
            <input type="checkbox" id="isShow" {if $data['isShow']==1}checked{/if} name="isShow" value="1" class="ipt" lay-skin="switch" lay-filter="isShow" lay-text="显示|隐藏">
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th>评语:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
              <textarea style="width:300px;height:100px" id="content" name="content" class="ipt">{$data['content']}</textarea>
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th>附件:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
              <div id="appraise-img">
 | 
			
		||||
              {if !empty($data['images'])}
 | 
			
		||||
                {volist name="$data['images']" id="img"}
 | 
			
		||||
                <img src="__IMGURL__/{$img}/thumb80" layer-src="__IMGURL__/{$img}" width="50" />
 | 
			
		||||
                {/volist}
 | 
			
		||||
              {/if}
 | 
			
		||||
            </div>
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
  
 | 
			
		||||
  <tr>
 | 
			
		||||
     <td colspan='2' align='center' class="wst-bottombar">
 | 
			
		||||
       <input type="hidden" name="id" id="id" class="ipt" value="{$data['id']+0}" />
 | 
			
		||||
       <button type="submit"  class='btn btn-primary btn-mright'><i class="fa fa-check"></i>提交</button>
 | 
			
		||||
       <button type="button"  class='btn' onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返回</button>
 | 
			
		||||
     </td>
 | 
			
		||||
  </tr>
 | 
			
		||||
</table>
 | 
			
		||||
</form>
 | 
			
		||||
<script>
 | 
			
		||||
$(function(){
 | 
			
		||||
  parent.showImg({photos: $('#appraise-img')});
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
{/block}
 | 
			
		||||
							
								
								
									
										139
									
								
								hyhproject/admin/view/goodsappraises/goodsappraises.js
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										139
									
								
								hyhproject/admin/view/goodsappraises/goodsappraises.js
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,139 @@
 | 
			
		||||
var mmg;
 | 
			
		||||
function initGrid(){
 | 
			
		||||
    var h = WST.pageHeight();
 | 
			
		||||
    var cols = [
 | 
			
		||||
            {title:'商品主图', name:'goodsImg', width: 30, renderer: function(val,item,rowIndex){
 | 
			
		||||
            	var thumb = item['goodsImg'];
 | 
			
		||||
	        	//thumb = thumb.replace('.','_thumb.');
 | 
			
		||||
	        	return "<span class='weixin'><img id='img' onmouseout='toolTip()' onmouseover='toolTip()' style='height:40px;width:40px;' src='"+WST.conf.IMGURL+"/"+thumb
 | 
			
		||||
            	+"'><span class='imged' style='left:45px;'><img  style='height:150px;width:150px;' src='"+WST.conf.IMGURL+"/"+item['goodsImg']+"'></span></span>";
 | 
			
		||||
            }},
 | 
			
		||||
            {title:'订单号', name:'orderNo',sortable: true, width: 90},
 | 
			
		||||
            {title:'商品', name:'goodsName',sortable: true, width: 100,renderer: function(val,item,rowIndex){
 | 
			
		||||
                return "<span  ><p class='wst-nowrap'>"+item['goodsName']+"</p></span>";
 | 
			
		||||
            }},
 | 
			
		||||
            
 | 
			
		||||
            {title:'商品评分', name:'goodsScore',sortable: true, width: 80, renderer: function(val,item,rowIndex){
 | 
			
		||||
            	var s="<div style='line-height:28px;'>";
 | 
			
		||||
	        	for(var i=0;i<val;++i){
 | 
			
		||||
	        		s +="<img src='"+WST.conf.ROOT+"/hyhproject/admin/view/goodsappraises/icon_score_yes.png'>";
 | 
			
		||||
	        	}
 | 
			
		||||
	        	s += "</div>";
 | 
			
		||||
	        	return s;
 | 
			
		||||
            }},
 | 
			
		||||
            {title:'时效评分', name:'timeScore',sortable: true, width: 80, renderer: function(val,item,rowIndex){
 | 
			
		||||
            	var s="<div style='line-height:28px;'>";
 | 
			
		||||
	        	for(var i=0;i<val;++i){
 | 
			
		||||
	        		s +="<img src='"+WST.conf.ROOT+"/hyhproject/admin/view/goodsappraises/icon_score_yes.png'>";
 | 
			
		||||
	        	}
 | 
			
		||||
	        	s += "</div>";
 | 
			
		||||
	        	return s;
 | 
			
		||||
            }},
 | 
			
		||||
            {title:'服务评分', name:'serviceScore',sortable: true, width: 80, renderer: function(val,item,rowIndex){
 | 
			
		||||
            	var s="<div style='line-height:28px;'>";
 | 
			
		||||
	        	for(var i=0;i<val;++i){
 | 
			
		||||
	        		s +="<img src='"+WST.conf.ROOT+"/hyhproject/admin/view/goodsappraises/icon_score_yes.png'>";
 | 
			
		||||
	        	}
 | 
			
		||||
	        	s += "</div>";
 | 
			
		||||
	        	return s;
 | 
			
		||||
            }},
 | 
			
		||||
            {title:'评价内容', name:'content', width: 155},
 | 
			
		||||
            {title:'状态', name:'isShow', width: 20,sortable: true, renderer: function(val,item,rowIndex){
 | 
			
		||||
            	return (val==0)?"<span class='statu-no'><i class='fa fa-ban'></i> 隐藏</span>":"<span class='statu-yes'><i class='fa fa-check-circle'></i> 显示</span></h3>";
 | 
			
		||||
            }},
 | 
			
		||||
            {title:'操作', name:'' ,width:95, align:'center', renderer: function(val,item,rowIndex){
 | 
			
		||||
                var h = "";
 | 
			
		||||
	            if(WST.GRANT.PJGL_02)h += "<a class='btn btn-blue' href='"+WST.U('admin/goodsappraises/toEdit','id='+item['id'])+"'><i class='fa fa-pencil'></i>修改</a> ";
 | 
			
		||||
	            if(WST.GRANT.PJGL_03)h += "<a class='btn btn-red' href='javascript:toDel(" + item['id'] + ")'><i class='fa fa-trash-o'></i>删除</a> "; 
 | 
			
		||||
	            return h;
 | 
			
		||||
            }}
 | 
			
		||||
            ];
 | 
			
		||||
 
 | 
			
		||||
    mmg = $('.mmg').mmGrid({height: h-85,indexCol: true,indexColWidth:50, cols: cols,method:'POST',
 | 
			
		||||
        url: WST.U('admin/goodsappraises/pageQuery'), fullWidthRows: true, autoLoad: true,
 | 
			
		||||
        remoteSort:true ,
 | 
			
		||||
        sortName: 'orderNo',
 | 
			
		||||
        sortStatus: 'desc',
 | 
			
		||||
        plugins: [
 | 
			
		||||
            $('#pg').mmPaginator({})
 | 
			
		||||
        ]
 | 
			
		||||
    });  
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
function toDel(id){
 | 
			
		||||
	var box = WST.confirm({content:"您确定要删除该记录吗?",yes:function(){
 | 
			
		||||
	           var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
	           	$.post(WST.U('admin/goodsappraises/del'),{id:id},function(data,textStatus){
 | 
			
		||||
	           			  layer.close(loading);
 | 
			
		||||
	           			  var json = WST.toAdminJson(data);
 | 
			
		||||
	           			  if(json.status=='1'){
 | 
			
		||||
	           			    	WST.msg("操作成功",{icon:1});
 | 
			
		||||
	           			    	layer.close(box);
 | 
			
		||||
	           		            loadGrid();
 | 
			
		||||
	           			  }else{
 | 
			
		||||
	           			    	WST.msg(json.msg,{icon:2});
 | 
			
		||||
	           			  }
 | 
			
		||||
	           		});
 | 
			
		||||
	            }});
 | 
			
		||||
}
 | 
			
		||||
function loadGrid(){
 | 
			
		||||
	var query = WST.getParams('.query');
 | 
			
		||||
  query.page = 1;
 | 
			
		||||
	mmg.load(query);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function editInit(){
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
/* 表单验证 */
 | 
			
		||||
    $('#goodsAppraisesForm').validator({
 | 
			
		||||
            fields: {
 | 
			
		||||
                content: {
 | 
			
		||||
                  rule:"required;length(3~50)",
 | 
			
		||||
                  msg:{length:"评价内容为3-50个字",required:"评价内容为3-50个字"},
 | 
			
		||||
                  tip:"评价内容为3-50个字",
 | 
			
		||||
                  ok:"",
 | 
			
		||||
                },
 | 
			
		||||
                score:  {
 | 
			
		||||
                  rule:"required",
 | 
			
		||||
                  msg:{required:"评分必须大于0"},
 | 
			
		||||
                  ok:"",
 | 
			
		||||
                  target:"#score_error",
 | 
			
		||||
                },
 | 
			
		||||
                
 | 
			
		||||
            },
 | 
			
		||||
 | 
			
		||||
          valid: function(form){
 | 
			
		||||
            var params = WST.getParams('.ipt');
 | 
			
		||||
                //获取修改的评分
 | 
			
		||||
                params.goodsScore = $('.goodsScore').find('[name=score]').val();
 | 
			
		||||
                params.timeScore = $('.timeScore').find('[name=score]').val();
 | 
			
		||||
                params.serviceScore = $('.serviceScore').find('[name=score]').val();
 | 
			
		||||
            var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
            $.post(WST.U('admin/goodsappraises/'+((params.id==0)?"add":"edit")),params,function(data,textStatus){
 | 
			
		||||
              layer.close(loading);
 | 
			
		||||
              var json = WST.toAdminJson(data);
 | 
			
		||||
              if(json.status=='1'){
 | 
			
		||||
                  WST.msg("操作成功",{icon:1});
 | 
			
		||||
                  location.href=WST.U('Admin/goodsappraises/index');
 | 
			
		||||
              }else{
 | 
			
		||||
                    WST.msg(json.msg,{icon:2});
 | 
			
		||||
              }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
function toolTip(){
 | 
			
		||||
    $('body').mousemove(function(e){
 | 
			
		||||
    	var windowH = $(window).height();  
 | 
			
		||||
        if(e.pageY >= windowH*0.8){
 | 
			
		||||
        	var top = windowH*0.233;
 | 
			
		||||
        	$('.imged').css('margin-top',-top);
 | 
			
		||||
        }else{
 | 
			
		||||
        	var top = windowH*0.06;
 | 
			
		||||
        	$('.imged').css('margin-top',-top);
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								hyhproject/admin/view/goodsappraises/icon_score_yes.png
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								hyhproject/admin/view/goodsappraises/icon_score_yes.png
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 631 B  | 
							
								
								
									
										34
									
								
								hyhproject/admin/view/goodsappraises/list.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										34
									
								
								hyhproject/admin/view/goodsappraises/list.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
{extend name="base" /}
 | 
			
		||||
{block name="css"}
 | 
			
		||||
<link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" />
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="js"}
 | 
			
		||||
<script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
 | 
			
		||||
<script src="__ADMIN__/goodsappraises/goodsappraises.js?v={$v}" type="text/javascript"></script>
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="main"}
 | 
			
		||||
<div class="wst-toolbar">
 | 
			
		||||
	<div id="query" style="float:left;">
 | 
			
		||||
		<select id="areaId1" class='query' level="0" onchange="WST.ITAreas({id:'areaId1',val:this.value,className:'query'});" >
 | 
			
		||||
		  <option value="-1">-请选择地区-</option>
 | 
			
		||||
		  {foreach $area1 as $v}
 | 
			
		||||
        	<option value="<?=$v['areaId']?>"><?=$v['areaName']?></option>
 | 
			
		||||
          {/foreach}
 | 
			
		||||
		</select>
 | 
			
		||||
		<input type="text" name="shopName" placeholder='店铺名称' id="shopName" class="query" />
 | 
			
		||||
		<input type="text" name="goodsName" placeholder='商品名称' id="goodsName" class="query" />
 | 
			
		||||
		<button type="button"  class='btn btn-primary btn-mright' onclick="javascript:loadGrid()"><i class="fa fa-search"></i>查询</button>
 | 
			
		||||
	</div>
 | 
			
		||||
   <div style="clear:both"></div>
 | 
			
		||||
</div>
 | 
			
		||||
<div class='wst-grid'>
 | 
			
		||||
 <div id="mmg" class="mmg layui-form"></div>
 | 
			
		||||
 <div id="pg" style="text-align: right;"></div>
 | 
			
		||||
</div>
 | 
			
		||||
<script>
 | 
			
		||||
$(function(){
 | 
			
		||||
	initGrid();
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
{/block}
 | 
			
		||||
		Reference in New Issue
	
	Block a user