完善商品栏目管理选择模板,商品栏目、商品伪静态地址生成
This commit is contained in:
@@ -27,7 +27,13 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" required aria-required="true" placeholder="填写栏目名称">
|
||||
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" required aria-required="true" placeholder="填写栏目名称" onblur="aoutoTransform()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目路径:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="FilePath" name="FilePath" maxlength="100" type="text" class="form-control" aria-required="true" placeholder="填写栏目路径,SEO优化使用,最多支持4级目录,可以输入字母、数字和-">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -69,29 +75,34 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
<option value="@s" >@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
if (s.ToLower().StartsWith("index"))
|
||||
{
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>*@
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品详情模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
if (s.ToLower().StartsWith("detail"))
|
||||
{
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">隐藏栏目:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -145,5 +156,30 @@
|
||||
DoPost("addArticleKindForm");
|
||||
CKEDITOR.replace('KindInfo');
|
||||
})
|
||||
function aoutoTransform() {
|
||||
var title = $("#KindName").val();
|
||||
var filePath = $("#FilePath").val();
|
||||
var pid = $("#PId").val();
|
||||
if (!filePath) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/AdminCP/Server/Hanzi2Pinyin",
|
||||
data: { name: title, pid: pid, t: "category" },
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
if (data.message) {
|
||||
$("#FilePath").val(data.message);
|
||||
}
|
||||
} else {
|
||||
layer.alert(data.message, { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
@foreach (var m in Model)
|
||||
{
|
||||
<tr class="treegrid-@m.Id @(m.PId !=0?"treegrid-parent-"+m.PId:"") ">
|
||||
<td>@m.KindName</td>
|
||||
<td><a href="@ViewsHelper.EchoURL(m)" target="_blank" title="新窗口打开栏目">@m.KindName</a></td>
|
||||
<td>
|
||||
@m.Id
|
||||
</td>
|
||||
|
||||
@@ -28,7 +28,13 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" value="@Model.KindName" required aria-required="true" placeholder="填写栏目名称">
|
||||
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" value="@Model.KindName" required aria-required="true" placeholder="填写栏目名称" onblur="aoutoTransform()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目路径:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="FilePath" name="FilePath" maxlength="100" type="text" class="form-control" aria-required="true" placeholder="填写栏目路径,SEO优化使用,最多支持4级目录,可以输入字母、数字和-" value="@Model.FilePath">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -86,28 +92,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" asp-for="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
if (s.ToLower().StartsWith("index"))
|
||||
{
|
||||
<option value="@s" @(Model.TemplateFile == s?"selected":"")>@s</option>
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品详情模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" asp-for="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
if (s.ToLower().StartsWith("detail"))
|
||||
{
|
||||
<option value="@s" @(Model.DetailTemplateFile == s?"selected":"")>@s</option>
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>*@
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">隐藏栏目:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -162,4 +174,29 @@
|
||||
DoPost("editCategoryForm");
|
||||
CKEDITOR.replace('KindInfo');
|
||||
})
|
||||
function aoutoTransform() {
|
||||
var title = $("#KindName").val();
|
||||
var filePath = $("#FilePath").val();
|
||||
var pid = $("#PId").val();
|
||||
if (!filePath) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/AdminCP/Server/Hanzi2Pinyin",
|
||||
data: { name: title, pid: pid, t: "category" },
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
if (data.message) {
|
||||
$("#FilePath").val(data.message);
|
||||
}
|
||||
} else {
|
||||
layer.alert(data.message, { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -135,7 +135,10 @@
|
||||
title: '所属分类'
|
||||
}, {
|
||||
field: 'Title',
|
||||
title: '商品标题',
|
||||
title: '商品标题',
|
||||
formatter: function (value, row, index) {
|
||||
return '<a href="/Product/Detail/' + row["id"] + '" target="_blank" title="新窗口打开预览商品">' + value + '</a>'
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'Price',
|
||||
|
||||
Reference in New Issue
Block a user