|
|
1
|
+<!DOCTYPE html>
|
|
|
2
|
+
|
|
|
3
|
+<style>
|
|
|
4
|
+.sale-category-detail-page .goods-image {
|
|
|
5
|
+ display: flex;
|
|
|
6
|
+}
|
|
|
7
|
+
|
|
|
8
|
+
|
|
|
9
|
+.sale-category-detail-page .goods-image .img {
|
|
|
10
|
+ width: 104px;
|
|
|
11
|
+ height: 104px;
|
|
|
12
|
+ margin-right: 10px;
|
|
|
13
|
+ background-size: cover;
|
|
|
14
|
+ background-repeat: no-repeat;
|
|
|
15
|
+ background-position: center;
|
|
|
16
|
+ position: relative;
|
|
|
17
|
+}
|
|
|
18
|
+
|
|
|
19
|
+.sale-category-detail-page .goods-image .img:hover:before {
|
|
|
20
|
+ content: "删除";
|
|
|
21
|
+ width: 100%;
|
|
|
22
|
+ display: block;
|
|
|
23
|
+ position: absolute;
|
|
|
24
|
+ top: 0;
|
|
|
25
|
+ background: #000;
|
|
|
26
|
+ opacity: 0.5;
|
|
|
27
|
+ color: #fff;
|
|
|
28
|
+ text-align: center;
|
|
|
29
|
+ line-height: 104px;
|
|
|
30
|
+}
|
|
|
31
|
+</style>
|
|
|
32
|
+<div class="sale-category-detail-page" fit="true" style="overflow-y: scroll">
|
|
|
33
|
+ <form name="categoryEditForm" id="categoryEditForm" method="post" enctype="multipart/form-data">
|
|
|
34
|
+ <input type="hidden" name="id" />
|
|
|
35
|
+ <input type="hidden" name="parentId" id="parentId"/>
|
|
|
36
|
+ <div style="margin-top: 5px;margin-left: 30px">
|
|
|
37
|
+ <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
|
|
|
38
|
+ <tr style="height: 60px">
|
|
|
39
|
+ <td width="20%"><span style="color:red">*</span><label>名称</label></td>
|
|
|
40
|
+ <td>
|
|
|
41
|
+ <div style="width:200px;">
|
|
|
42
|
+ <input class="easyui-textbox" id="categoryName" name="categoryName" data-options="validType:'length[1,30]'" />
|
|
|
43
|
+ </div>
|
|
|
44
|
+ </td>
|
|
|
45
|
+ </tr>
|
|
|
46
|
+ <tr style="height: 60px">
|
|
|
47
|
+ <td width="20%"><span style="color:red">*</span><label>排序值</label></td>
|
|
|
48
|
+ <td>
|
|
|
49
|
+ <input class="easyui-numberbox" id="orderBy" name="orderBy" data-options="validType:'length[1,10]'" />
|
|
|
50
|
+ </td>
|
|
|
51
|
+ </tr>
|
|
|
52
|
+ </table>
|
|
|
53
|
+ </div>
|
|
|
54
|
+
|
|
|
55
|
+ <div class="goods-image" style="margin-top: 5px;margin-left: 30px">
|
|
|
56
|
+ <table border="0" style="width:95%;margin-top:5px;line-height:30px;" >
|
|
|
57
|
+ <tr style="height: 60px">
|
|
|
58
|
+ <td width="20%"><span style="color:red">*</span><label>分类图标</label></td>
|
|
|
59
|
+ <td width="80%">
|
|
|
60
|
+ <!--<div class="img" data-url="http://img11.static.yhbimg.com/salecategoryimg/2018/12/18/11/01a8ea37ad7b8f112d2727ff1ee507a926.png"
|
|
|
61
|
+ style="background-image:url(http://img11.static.yhbimg.com/salecategoryimg/2018/12/18/11/01a8ea37ad7b8f112d2727ff1ee507a926.png);"></div>-->
|
|
|
62
|
+ <div id="imageUpload"></div>
|
|
|
63
|
+ </td>
|
|
|
64
|
+ </tr>
|
|
|
65
|
+ </table>
|
|
|
66
|
+
|
|
|
67
|
+ </div>
|
|
|
68
|
+
|
|
|
69
|
+ <div style="margin-top: 5px;margin-left: 30px">
|
|
|
70
|
+ <table border="0" style="width:95%;margin-top:5px;line-height:30px;" >
|
|
|
71
|
+ <tr style="height: 60px">
|
|
|
72
|
+ <td width="20%"><span style="color:red">*</span><label>跳转类型</label></td>
|
|
|
73
|
+ <td>
|
|
|
74
|
+ <div style="width:200px;">
|
|
|
75
|
+ <input class="easyui-textbox" name="linkType" data-options="validType:'length[1,30]'" />
|
|
|
76
|
+ </div>
|
|
|
77
|
+ </td>
|
|
|
78
|
+ </tr>
|
|
|
79
|
+ <tr style="height: 60px">
|
|
|
80
|
+ <td width="20%"><span style="color:red">*</span><label>跳转目的</label></td>
|
|
|
81
|
+ <td>
|
|
|
82
|
+ <input class="easyui-textbox" name="linkDetail" data-options="validType:'length[1,10]'" />
|
|
|
83
|
+ </td>
|
|
|
84
|
+ </tr>
|
|
|
85
|
+ </table>
|
|
|
86
|
+ </div>
|
|
|
87
|
+ </form>
|
|
|
88
|
+</div>
|
|
|
89
|
+<script>
|
|
|
90
|
+ $(function () {
|
|
|
91
|
+ this.dom = {
|
|
|
92
|
+ imageUpload: $('#categoryEditForm #imageUpload')
|
|
|
93
|
+ };
|
|
|
94
|
+
|
|
|
95
|
+ $("#categoryEditForm #categoryName").textbox({
|
|
|
96
|
+ required: true,
|
|
|
97
|
+ missingMessage: "销售类目名称不能为空",
|
|
|
98
|
+ prompt: "请输入",
|
|
|
99
|
+ width: "200px"
|
|
|
100
|
+ });
|
|
|
101
|
+
|
|
|
102
|
+ $("#categoryEditForm #orderBy").numberbox({
|
|
|
103
|
+ required: true,
|
|
|
104
|
+ precision:0,
|
|
|
105
|
+ min:1,
|
|
|
106
|
+ missingMessage: "排序值不能为空",
|
|
|
107
|
+ prompt: "请输入",
|
|
|
108
|
+ width:"200px"
|
|
|
109
|
+ });
|
|
|
110
|
+
|
|
|
111
|
+
|
|
|
112
|
+ this.dom.imageUpload.imageUpload({
|
|
|
113
|
+ width: 104,
|
|
|
114
|
+ height: 104,
|
|
|
115
|
+ realInputName: "imageUrl",
|
|
|
116
|
+ url: contextPath + '/fileupload/upload',
|
|
|
117
|
+ queryParams: {
|
|
|
118
|
+ bucket: "salecategoryimg"
|
|
|
119
|
+ },
|
|
|
120
|
+ onBeforeSubmit: function () {
|
|
|
121
|
+ $.messager.progress({
|
|
|
122
|
+ title: "正在执行",
|
|
|
123
|
+ msg: "正在执行,请稍后...",
|
|
|
124
|
+ interval: 500,
|
|
|
125
|
+ text: ""
|
|
|
126
|
+ });
|
|
|
127
|
+ },
|
|
|
128
|
+ filterFileName: function (data) {
|
|
|
129
|
+ if (!data || data.code != 200) {
|
|
|
130
|
+ $.messager.progress("close");
|
|
|
131
|
+ $.messager.alert("错误", data.message);
|
|
|
132
|
+ return "";
|
|
|
133
|
+ }
|
|
|
134
|
+ return data.data.url;
|
|
|
135
|
+ },
|
|
|
136
|
+ onLoadSuccess: function (data) {
|
|
|
137
|
+ console.log(data.data );
|
|
|
138
|
+ $.messager.progress("close");
|
|
|
139
|
+ $(document).find('.file-close').click();
|
|
|
140
|
+ $('#categoryEditForm #imageUpload').before('<div class="img" data-url="' + data.data + '" style="background-image:url(' + data.data + ');">');
|
|
|
141
|
+ return false;
|
|
|
142
|
+ }
|
|
|
143
|
+ });
|
|
|
144
|
+
|
|
|
145
|
+
|
|
|
146
|
+
|
|
|
147
|
+
|
|
|
148
|
+ $("#categoryEditForm #parentId").val(saleCategoryParentId);
|
|
|
149
|
+
|
|
|
150
|
+ if (saleCategoryId > 0) {
|
|
|
151
|
+ $.post(contextPath + "/saleCategory/getSaleCategoryById", {
|
|
|
152
|
+ id: saleCategoryId
|
|
|
153
|
+ }, function (data) {
|
|
|
154
|
+ $("#categoryEditForm").form("load", data.data);
|
|
|
155
|
+
|
|
|
156
|
+ });
|
|
|
157
|
+ }
|
|
|
158
|
+ });
|
|
|
159
|
+
|
|
|
160
|
+</script> |