TradeRule后台完成

This commit is contained in:
2020-05-28 21:57:14 +08:00
parent d5f22242de
commit 4854268cd2
6 changed files with 72 additions and 105 deletions

View File

@ -7,111 +7,43 @@
<script src="__ADMIN__/js/ztree/jquery.ztree.all-3.5.js?v={$v}"></script>
<script src="__STATIC__/plugins/webuploader/webuploader.js?v={$v}" type="text/javascript" ></script>
<script src="__STATIC__/plugins//kindeditor/kindeditor.js?v={$v}" type="text/javascript" ></script>
<script src="__ADMIN__/articles/articles.js?v={$v}" type="text/javascript"></script>
<script src="__ADMIN__/trade_rule/trade_rule.js?v={$v}" type="text/javascript"></script>
<script>
$(function () {
initCombo(0);
{if condition="$object['articleId'] !=0 "}
{if condition="$object['id'] !=0 "}
WST.setValues({$object});
{/if}
$('#articleForm').validator({
fields: {
articleTitle: {
tip: "请输入文章名称",
rule: '文章名称:required;length[~50];'
title: {
tip: "请输入标题",
rule: '标题:required;length[~50];'
},
catIds: {
tip: "请选择文章分类",
rule: "文章分类:required;",
target:"#catIdt"
},
articleKey: {
tip: "请输入关键字",
rule: '关键字:required;length[~100];'
},
layoutType: {
tip: "请选择移动端布局样式",
rule: '关键字:required;length[~100];'
},
articleContent: {
tip: "请输入文章内容",
rule: '文章内容:required;'
content: {
tip: "请输入内容",
rule: '内容:required;'
}
},
valid: function(form){
var articleId = $('#articleId').val();
toEdits(articleId);
var id = $('#id').val();
toEdits(id);
}
})
});
</script>
{/block}
{block name="main"}
<input type='hidden' id='articleId' value='{$object["articleId"]}'/>
<input type='hidden' id='id' value='{$object["id"]}'/>
<form id='articleForm' autocomplete="off">
<table class='wst-form wst-box-top '>
<tr>
<th width='150'>文章标题<font color='red'>*</font></th>
<td><input type="text" id='articleTitle' name='articleTitle' maxLength='50' style='width:300px;' class='ipt'/></td>
<th width='150'>标题<font color='red'>*</font></th>
<td><input type="text" id='title' name='title' maxLength='50' style='width:300px;' class='ipt'/></td>
</tr>
<tr>
<th width='150' align='right'>分类类型<font color='red'>*</font></th>
<td>
<input id="catSel" type="text" readonly onclick="showMenu();" style='width:250px;' value="{$object.catName}"/>
<div id="ztreeMenuContent" class="ztreeMenuContent">
<ul id="dropDownTree" class="ztree" style="margin-top:0; width:250px; height: 300px;"></ul>
</div>
<input id="catId" class="text ipt" autocomplete="off" type="hidden" value=""/>
</td>
</tr>
<tr>
<th width='150'>是否显示<font color='red'>*</font></th>
<td height='24' class="layui-form">
<input type="checkbox" id="isShow" {if $object['isShow']==1}checked{/if} name="isShow" value="1" class="ipt" lay-skin="switch" lay-filter="isShow" lay-text="显示|隐藏">
</td>
</tr>
<tr>
<th width='150'>关键字<font color='red'>*</font></th>
<td><input type="text" id='articleKey' name='articleKey' maxLength='120' style='width:600px;' class='ipt'/></td>
</tr>
<tr >
<th>移动端布局样式预览图:</th>
<td class="typeState" style="padding-top: 10px;">
<li>
<input type='radio' name='TypeStatus' class='ipt' value='1'/>
<label>
<img src="__ADMIN__/img/news_1.png" style="width:150px;height:80px;">
</label>
</li>
<li>
<input type='radio' name='TypeStatus' class='ipt' value='2' />
<label>
<img src="__ADMIN__/img/news_2.png" style="width:150px;height:80px;">
</label>
</li>
<li>
<input type='radio' name='TypeStatus' class='ipt' value='3' />
<label>
<img src="__ADMIN__/img/news_3.png" style="width:150px;height:80px;">
</label>
</li>
</td>
</tr>
<tr>
<th>封面图片:</th>
<td>
<div id='coverImgPicker'>请上传封面图片</div><span id='coverImgMsg'></span>图片大小:230x195(px),格式为 gif, jpg, jpeg, png
<input type="hidden" id='coverImg' name="coverImg" class="ipt"/>
</td>
</tr>
<tr>
<th>预览图:</th>
<td><div style="min-height:70px;" id="preview">{if ($object['articleId']!=0 && $object['coverImg'])}<img src="__IMGURL__/{$object['coverImg']}" height="152" />{/if}</div></td>
</tr>
<tr>
<th width='150'>文章内容<font color='red'>*</font></th>
<th width='150'>内容<font color='red'>*</font></th>
<td>
<textarea id='articleContent' name='articleContent' class="form-control ipt" style='width:80%;height:400px'></textarea>
<textarea id='content' name='content' class="form-control ipt" style='width:80%;height:400px'></textarea>
</td>
</tr>
<tr>
@ -143,9 +75,9 @@ $(function(){
});
//编辑器
KindEditor.ready(function(K) {
editor1 = K.create('textarea[name="articleContent"]', {
editor1 = K.create('textarea[name="content"]', {
height:'350px',
uploadJson : WST.conf.ROOT+'/admin/articles/editorUpload',
uploadJson : WST.conf.ROOT+'/admin/trade_rule/editorUpload',
allowFileManager : false,
allowImageUpload : true,
allowMediaUpload : false,