|
@@ -6,8 +6,8 @@
|
|
<meta name="renderer" content="webkit">
|
|
<meta name="renderer" content="webkit">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
- <link rel="stylesheet" href="../lib/layui-v2.5.4/css/layui.css" media="all">
|
|
|
|
- <link rel="stylesheet" href="../css/public.css" media="all">
|
|
|
|
|
|
+ <link rel="stylesheet" href="{__STATIC_PATH}admin/lib/layui-v2.5.4/css/layui.css" media="all">
|
|
|
|
+ <link rel="stylesheet" href="{__STATIC_PATH}admin/css/public.css" media="all">
|
|
<style>
|
|
<style>
|
|
.inoutCls {
|
|
.inoutCls {
|
|
height: 22px;
|
|
height: 22px;
|
|
@@ -116,9 +116,9 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
-<script src="../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
|
|
|
|
-<script src="../lib/layui-v2.5.4/layui.js" charset="utf-8"></script>
|
|
|
|
-<script src="../js/common.js?v5" charset="utf-8"></script>
|
|
|
|
|
|
+<script src="{__STATIC_PATH}admin/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
|
|
|
|
+<script src="{__STATIC_PATH}admin/lib/layui-v2.5.4/layui.js" charset="utf-8"></script>
|
|
|
|
+<script src="{__STATIC_PATH}admin/js/common.js?v5" charset="utf-8"></script>
|
|
<!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
|
|
<!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
|
|
<script>
|
|
<script>
|
|
layui.use(['form', 'laypage'], function () {
|
|
layui.use(['form', 'laypage'], function () {
|
|
@@ -134,7 +134,7 @@
|
|
|
|
|
|
// 添加 分类
|
|
// 添加 分类
|
|
$('.add').on('click', function () {
|
|
$('.add').on('click', function () {
|
|
- layObj.dialog('dialog.html')
|
|
|
|
|
|
+ layObj.dialog("{:url('add')}")
|
|
});
|
|
});
|
|
|
|
|
|
//监听状态 更改
|
|
//监听状态 更改
|
|
@@ -144,7 +144,7 @@
|
|
let id = obj.othis.parent().attr('data-id');
|
|
let id = obj.othis.parent().attr('data-id');
|
|
let status = obj.elem.checked ? 1 : 0;
|
|
let status = obj.elem.checked ? 1 : 0;
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: '{:u("admin/change")}?id=' + id + '&status=' + status,
|
|
|
|
|
|
+ url: '{:url("admin/change")}?id=' + id + '&status=' + status,
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
|
|
|
}
|
|
}
|
|
@@ -161,14 +161,14 @@
|
|
if (!name && type == 3) { // 演示 应该放到修改回调中 进行处理
|
|
if (!name && type == 3) { // 演示 应该放到修改回调中 进行处理
|
|
return $(that).parent().remove()
|
|
return $(that).parent().remove()
|
|
}
|
|
}
|
|
- let url = '{:u("admin/edit")}?id=' + id + '&name=' + name
|
|
|
|
|
|
+ let url = '{:url("admin/edit")}?id=' + id + '&name=' + name
|
|
layObj.get(url, (res) =>{
|
|
layObj.get(url, (res) =>{
|
|
if (name && res) {
|
|
if (name && res) {
|
|
$(that).val(name)
|
|
$(that).val(name)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: '{:u("admin/edit")}?id=' + id + '&name=' + name,
|
|
|
|
|
|
+ url: '{:url("admin/edit")}?id=' + id + '&name=' + name,
|
|
success(res) {
|
|
success(res) {
|
|
if (name && res) {
|
|
if (name && res) {
|
|
$(that).val(name)
|
|
$(that).val(name)
|
|
@@ -188,7 +188,7 @@
|
|
msg = '二';
|
|
msg = '二';
|
|
}
|
|
}
|
|
layObj.box(`是否删除${msg}级分类`, () => {
|
|
layObj.box(`是否删除${msg}级分类`, () => {
|
|
- let url = '{:u("admin/del")}?id=' + id
|
|
|
|
|
|
+ let url = '{:url("admin/del")}?id=' + id
|
|
layObj.get(url, (res) =>{
|
|
layObj.get(url, (res) =>{
|
|
$(this).parent().remove()
|
|
$(this).parent().remove()
|
|
})
|
|
})
|
|
@@ -203,8 +203,8 @@
|
|
if(!val){
|
|
if(!val){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- // let url = '{:u("admin/sort")}?id=' + id + '&sort='+val;
|
|
|
|
- let url = 'http:www.baidu.com';
|
|
|
|
|
|
+ let url = '{:url("admin/sort")}?id=' + id + '&sort='+val;
|
|
|
|
+ // let url = 'http:www.baidu.com';
|
|
layObj.get(url,function (res) {
|
|
layObj.get(url,function (res) {
|
|
console.log(res, 'sort');
|
|
console.log(res, 'sort');
|
|
})
|
|
})
|