You've already forked qlg.tsgz.moe
							
							Init Repo
This commit is contained in:
		
							
								
								
									
										62
									
								
								hyhproject/admin/view/userranks/edit.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										62
									
								
								hyhproject/admin/view/userranks/edit.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,62 @@
 | 
			
		||||
{extend name="base" /}
 | 
			
		||||
{block name="css"}
 | 
			
		||||
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" />
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="js"}
 | 
			
		||||
<script type='text/javascript' src='__STATIC__/plugins/webuploader/webuploader.js?v={$v}'></script>
 | 
			
		||||
<script src="__ADMIN__/userranks/userranks.js?v={$v}" type="text/javascript"></script>
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="main"}
 | 
			
		||||
<div class="l-loading" style="display: block" id="wst-loading"></div>
 | 
			
		||||
<form id="userRankForm" autocomplete="off">
 | 
			
		||||
<table class='wst-form wst-box-top'>
 | 
			
		||||
      <tr>
 | 
			
		||||
      <th width='150'>会员等级名称<font color='red'>*</font>:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
            <input type="text" class="ipt" id="rankName" name="rankName" value="{$data['rankName']}" />
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th width='100'>会员等级图标:</th>
 | 
			
		||||
          <td><div id='userranksPicker'>上传图标</div><span id='uploadMsg'></span></td>
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th width='100'>预览图:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
            <div style="min-height:30px;" id="preview">
 | 
			
		||||
              {if (isset($data['userrankImg']))}
 | 
			
		||||
                <img src="__IMGURL__/{$data['userrankImg']}" height="25" />
 | 
			
		||||
              {/if}
 | 
			
		||||
            </div>
 | 
			
		||||
            <input type="hidden" name="userrankImg" id="userrankImg" value="{$data['userrankImg']}" class="ipt" />
 | 
			
		||||
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th>积分下限(大于或等于)<font color='red'>*</font>:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
              <input type="text" class="ipt" id="startScore" name="startScore" value="{$data['startScore']}" />
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <th>积分上限(小于)<font color='red'>*</font>:</th>
 | 
			
		||||
          <td>
 | 
			
		||||
              <input type="text" class="ipt" id="endScore" name="endScore" value="{$data['endScore']}" />
 | 
			
		||||
          </td>
 | 
			
		||||
       </tr>
 | 
			
		||||
       <tr>
 | 
			
		||||
          <td colspan='2' align='center' class='wst-bottombar'>
 | 
			
		||||
             <input type="hidden" name="id" id="rankId" class="ipt" value="{$data['rankId']+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(){editInit()});
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
{/block}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										23
									
								
								hyhproject/admin/view/userranks/list.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										23
									
								
								hyhproject/admin/view/userranks/list.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
{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__/userranks/userranks.js?v={$v}" type="text/javascript"></script>
 | 
			
		||||
{/block}
 | 
			
		||||
{block name="main"}
 | 
			
		||||
{if WSTGrant('HYDJ_01')}
 | 
			
		||||
<div class="wst-toolbar">
 | 
			
		||||
   <button class="btn btn-success f-right" onclick="javascript:location.href='<?=url("userranks/toEdit")?>'"><i class='fa fa-plus'></i>	新增</button>
 | 
			
		||||
   <div style="clear:both"></div>
 | 
			
		||||
</div>
 | 
			
		||||
{/if}
 | 
			
		||||
<div class='wst-grid'>
 | 
			
		||||
<div id="mmg" class="mmg"></div>
 | 
			
		||||
<div id="pg" style="text-align: right;"></div>
 | 
			
		||||
</div>
 | 
			
		||||
<script>
 | 
			
		||||
  $(function(){initGrid()});
 | 
			
		||||
</script>
 | 
			
		||||
{/block}
 | 
			
		||||
							
								
								
									
										111
									
								
								hyhproject/admin/view/userranks/userranks.js
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										111
									
								
								hyhproject/admin/view/userranks/userranks.js
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,111 @@
 | 
			
		||||
var mmg;
 | 
			
		||||
function initGrid(){
 | 
			
		||||
    var h = WST.pageHeight();
 | 
			
		||||
    var cols = [
 | 
			
		||||
            {title:'会员等级图标', name:'userrankImg', width: 30,renderer:function(val,item,rowIndex){
 | 
			
		||||
            return '<img src="'+WST.conf.IMGURL+'/'+item['userrankImg']+'" height="28px" />';
 | 
			
		||||
          }},
 | 
			
		||||
            {title:'会员等级名称', name:'rankName' ,width:100},
 | 
			
		||||
            {title:'积分下限', name:'startScore' ,width:100},
 | 
			
		||||
            {title:'积分上限', name:'endScore' ,width:60},
 | 
			
		||||
            {title:'操作', name:'' ,width:180, align:'center', renderer: function(val,item,rowIndex){
 | 
			
		||||
                var h = "";
 | 
			
		||||
                if(WST.GRANT.HYDJ_02)h += "<a  class='btn btn-blue' onclick='javascript:toEdit("+item['rankId']+")'><i class='fa fa-pencil'></i>修改</a> ";
 | 
			
		||||
                if(WST.GRANT.HYDJ_03)h += "<a  class='btn btn-red' onclick='javascript:toDel(" + item['rankId'] + ")'><i class='fa fa-trash-o'></i>删除</a> ";
 | 
			
		||||
                return h;
 | 
			
		||||
            }}
 | 
			
		||||
            ];
 | 
			
		||||
 
 | 
			
		||||
    mmg = $('.mmg').mmGrid({height: h-80,indexCol: true, cols: cols,method:'POST',
 | 
			
		||||
        url: WST.U('admin/userranks/pageQuery'), fullWidthRows: true, autoLoad: true,
 | 
			
		||||
        plugins: [
 | 
			
		||||
            $('#pg').mmPaginator({})
 | 
			
		||||
        ]
 | 
			
		||||
    });   
 | 
			
		||||
}
 | 
			
		||||
function toEdit(id){
 | 
			
		||||
    location.href = WST.U('admin/userranks/toEdit','id='+id);
 | 
			
		||||
}
 | 
			
		||||
function toDel(id){
 | 
			
		||||
	var box = WST.confirm({content:"您确定要删除该记录吗?",yes:function(){
 | 
			
		||||
	           var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
	           	$.post(WST.U('admin/userranks/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);
 | 
			
		||||
	           		        mmg.load();
 | 
			
		||||
	           			  }else{
 | 
			
		||||
	           			    	WST.msg(json.msg,{icon:2});
 | 
			
		||||
	           			  }
 | 
			
		||||
	           		});
 | 
			
		||||
	            }});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function editInit(){
 | 
			
		||||
 /* 表单验证 */
 | 
			
		||||
    $('#userRankForm').validator({
 | 
			
		||||
            fields: {
 | 
			
		||||
                rankName: {
 | 
			
		||||
                  rule:"required",
 | 
			
		||||
                  msg:{required:"请输入会员等级名称"},
 | 
			
		||||
                  tip:"请输入会员等级名称",
 | 
			
		||||
                  ok:"",
 | 
			
		||||
                },
 | 
			
		||||
                userrankImg: {
 | 
			
		||||
                  rule:"required",
 | 
			
		||||
                  msg:{required:"请输上传会员图标"},
 | 
			
		||||
                  tip:"请输上传会员图标",
 | 
			
		||||
                  ok:"",
 | 
			
		||||
                }
 | 
			
		||||
                
 | 
			
		||||
            },
 | 
			
		||||
 | 
			
		||||
          valid: function(form){
 | 
			
		||||
            var params = WST.getParams('.ipt');
 | 
			
		||||
            var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
 | 
			
		||||
            $.post(WST.U('admin/userranks/'+((params.rankId==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/userranks/index');
 | 
			
		||||
              }else{
 | 
			
		||||
                    WST.msg(json.msg,{icon:2});
 | 
			
		||||
              }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
//文件上传
 | 
			
		||||
WST.upload({
 | 
			
		||||
    pick:'#userranksPicker',
 | 
			
		||||
    formData: {dir:'userranks'},
 | 
			
		||||
    accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'},
 | 
			
		||||
    callback:function(f){
 | 
			
		||||
      var json = WST.toAdminJson(f);
 | 
			
		||||
      if(json.status==1){
 | 
			
		||||
      $('#uploadMsg').empty().hide();
 | 
			
		||||
      //保存上传的图片路径
 | 
			
		||||
      $('#userrankImg').val(json.savePath+json.name);
 | 
			
		||||
      $('#preview').html('<img src="'+WST.conf.IMGURL+'/'+json.savePath+json.thumb+'" height="25" />');
 | 
			
		||||
      }else{
 | 
			
		||||
        WST.msg(json.msg,{icon:2});
 | 
			
		||||
      }
 | 
			
		||||
  },
 | 
			
		||||
  progress:function(rate){
 | 
			
		||||
      $('#uploadMsg').show().html('已上传'+rate+"%");
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		
 | 
			
		||||
		Reference in New Issue
	
	Block a user