Showing
15 changed files
with
348 additions
and
155 deletions
@@ -17,8 +17,9 @@ new common.dropDown({el:"#supplierId",ajax:"getjitSup",params:function(){ | @@ -17,8 +17,9 @@ new common.dropDown({el:"#supplierId",ajax:"getjitSup",params:function(){ | ||
17 | 17 | ||
18 | $('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>'); | 18 | $('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>'); |
19 | 19 | ||
20 | +var loadModal = null; | ||
21 | + | ||
20 | function batchExport(el, type) { | 22 | function batchExport(el, type) { |
21 | - var loadModal = null; | ||
22 | 23 | ||
23 | return { | 24 | return { |
24 | params: { | 25 | params: { |
@@ -44,16 +45,16 @@ function batchExport(el, type) { | @@ -44,16 +45,16 @@ function batchExport(el, type) { | ||
44 | //$(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", "")); | 45 | //$(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", "")); |
45 | }, | 46 | }, |
46 | onComplete: function(response) { | 47 | onComplete: function(response) { |
47 | - console.log(response); | 48 | + console.log("批量接口返回数据",response); |
48 | $("#message").html(''); | 49 | $("#message").html(''); |
50 | + if (response.code == 200&&response.data.taskId) { | ||
51 | + __ajaxExeclById(response.data.taskId); | ||
52 | + // common.util.__tip(response.message, 'success'); | ||
53 | + return; | ||
54 | + } | ||
49 | if (loadModal) { | 55 | if (loadModal) { |
50 | loadModal.close(); | 56 | loadModal.close(); |
51 | } | 57 | } |
52 | - if (response.code == 200&&response.data.failFileReason.length==0) { | ||
53 | - | ||
54 | - common.util.__tip(response.message, 'success'); | ||
55 | - return; | ||
56 | - } | ||
57 | if(response.data&&response.data.failFileReason.length){ | 58 | if(response.data&&response.data.failFileReason.length){ |
58 | $("#message").html(response.data.failFileReason.join('<br/>')); | 59 | $("#message").html(response.data.failFileReason.join('<br/>')); |
59 | return false; | 60 | return false; |
@@ -79,17 +80,26 @@ $(document).on("change","#brandId",function(){ | @@ -79,17 +80,26 @@ $(document).on("change","#brandId",function(){ | ||
79 | 80 | ||
80 | 81 | ||
81 | function __ajaxExeclById(unquid){ | 82 | function __ajaxExeclById(unquid){ |
82 | - var fn=arguments.callee; | 83 | + var params={param:unquid}; |
84 | + | ||
83 | common.util.__ajax({ | 85 | common.util.__ajax({ |
84 | - url:'', | ||
85 | - data:{unquid:unquid} | 86 | + url:'/ajax/queryBatchImportResult', |
87 | + data:params | ||
86 | },function(res){ | 88 | },function(res){ |
87 | - if(res.data){ | ||
88 | - $("#message").html(''); | 89 | + if(res.data.length){ |
90 | + | ||
89 | //成功操作 | 91 | //成功操作 |
92 | + if (loadModal) { | ||
93 | + loadModal.close(); | ||
94 | + } | ||
95 | + common.util.__tip(res.message, 'success'); | ||
90 | 96 | ||
91 | }else{ | 97 | }else{ |
92 | - fn.call(null,unquid); | 98 | + setTimeout(function(){ |
99 | + __ajaxExeclById.call(null,unquid); | ||
100 | + },5000); | ||
93 | } | 101 | } |
94 | - }); | 102 | + $("#message").html(res.message); |
103 | + },true); | ||
95 | } | 104 | } |
105 | +// __ajaxExeclById("batchBasePrd1459835824928"); |
@@ -37,7 +37,9 @@ var urlObj = { | @@ -37,7 +37,9 @@ var urlObj = { | ||
37 | 'guangCommentGetFilterItems':'/guang/comment/getItems', // 逛-评论列表-获取筛选条件 | 37 | 'guangCommentGetFilterItems':'/guang/comment/getItems', // 逛-评论列表-获取筛选条件 |
38 | 'guangPlusSatrChannel':'/guang/plustarcategory/getCategoryNames', // 逛-plus star 频道 | 38 | 'guangPlusSatrChannel':'/guang/plustarcategory/getCategoryNames', // 逛-plus star 频道 |
39 | 'queryBrandByShopId': '/query/brandByshopId', //查询店铺下关联品牌 | 39 | 'queryBrandByShopId': '/query/brandByshopId', //查询店铺下关联品牌 |
40 | - 'querySupplierByShopId': '/query/supplierByshopId' //查询店铺下关联供应商 | 40 | + 'querySupplierByShopId': '/query/supplierByshopId', //查询店铺下关联供应商 |
41 | + | ||
42 | + 'guangGetSort':'/guang/article/getSortList'//逛-分类 | ||
41 | }; | 43 | }; |
42 | 44 | ||
43 | var minimumResultsForSearch = ["sortbybrand", "getjitSup", "sortsize2"]; | 45 | var minimumResultsForSearch = ["sortbybrand", "getjitSup", "sortsize2"]; |
@@ -203,7 +203,8 @@ var util = { | @@ -203,7 +203,8 @@ var util = { | ||
203 | keys.push(key + "=" + JSON.stringify(source[key])); | 203 | keys.push(key + "=" + JSON.stringify(source[key])); |
204 | } | 204 | } |
205 | } | 205 | } |
206 | - var header = "var result=[]," + keys.join(',') + ";"; | 206 | + var params1=keys.join(',').length?","+keys.join(','):""; |
207 | + var header = "var result=[]" + params1 + ";"; | ||
207 | 208 | ||
208 | 209 | ||
209 | 210 |
1 | var $ = require('jquery'), | 1 | var $ = require('jquery'), |
2 | common = require('../common/common'); | 2 | common = require('../common/common'); |
3 | +var ENUM={}; | ||
4 | +// common.util.__ajax({ | ||
5 | +// url:'EnumListRest/getEnumList', | ||
6 | +// async:false | ||
7 | +// },function(res){ | ||
8 | +// ENUM=res.data; | ||
9 | +// }); | ||
10 | + | ||
11 | +$("#panel-body").html(common.util.__template2($("#tempalte1").html(),{})); | ||
12 | + | ||
13 | +new common.dropDown({el:"#authorId",ajax:"guangGetAuthorList"}); | ||
14 | +new common.dropDown({el:"#maxSortId",ajax:"guangGetSort",params:function(){ | ||
15 | + return {pid:0}; | ||
16 | +}}); | ||
17 | +new common.dropDown({el:"#minSortId",ajax:"guangGetSort",params:function(){ | ||
18 | + return {pid:$("#maxSortId").val()}; | ||
19 | +}}); | ||
20 | + | ||
21 | +var g=new common.gird({ | ||
22 | + el:"grid", | ||
23 | + columns:[ | ||
24 | + {display:"选择","type":"checkbox"}, | ||
25 | + {display:"标签名",name:"tagName"} | ||
26 | + ] | ||
27 | +}); | ||
28 | + | ||
29 | + | ||
30 | +$(document).on("click","#addUrl",function(){ | ||
31 | + common.dialog.confirm("添加链接",common.util.__template2($("#template2").html(),{}),function(){ | ||
32 | + | ||
33 | + }); | ||
34 | +}); | ||
35 | +$(document).on("click","#TagsSelectBtn",function(){ | ||
36 | + common.dialog.confirm("选择标签","<div id='gird'></div>",function(){ | ||
37 | + | ||
38 | + }); | ||
39 | + g.init('/guang/tags/getList'); | ||
40 | +}); | ||
41 | + | ||
42 | +var e=new common.edit("#panel-body",{}); | ||
43 | +e.init(); | ||
44 | + | ||
45 | +$(document).on("click","#submit",function(){ | ||
46 | + e.submit($("#panel-body").attr("action"),function(){ | ||
47 | + | ||
48 | + }); | ||
49 | +}); | ||
3 | 50 |
@@ -250,4 +250,28 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month | @@ -250,4 +250,28 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month | ||
250 | img { | 250 | img { |
251 | max-width: 100%; | 251 | max-width: 100%; |
252 | } | 252 | } |
253 | +} | ||
254 | +.tagwrap{ | ||
255 | + padding: 10px; | ||
256 | +} | ||
257 | +span.tag{ | ||
258 | + display: block; | ||
259 | + float: left; | ||
260 | + padding: 2px 5px; | ||
261 | + text-decoration: none; | ||
262 | + background: #1caf9a; | ||
263 | + color: #fff; | ||
264 | + margin-right: 5px; | ||
265 | + margin-bottom: 5px; | ||
266 | + font-size: 13px; | ||
267 | + -moz-border-radius: 2px; | ||
268 | + -webkit-border-radius: 2px; | ||
269 | + border-radius: 2px; | ||
270 | +} | ||
271 | + span.tag a { | ||
272 | + font-weight: bold; | ||
273 | + color: #fff; | ||
274 | + opacity: 0.5; | ||
275 | + text-decoration: none; | ||
276 | + font-size: 11px; | ||
253 | } | 277 | } |
@@ -15,11 +15,11 @@ var config = { | @@ -15,11 +15,11 @@ var config = { | ||
15 | // domain:'http://192.168.102.216:8080/platform', | 15 | // domain:'http://192.168.102.216:8080/platform', |
16 | // domain: 'http://172.16.6.240:8088/platform', | 16 | // domain: 'http://172.16.6.240:8088/platform', |
17 | // domain:'http://172.16.6.240:8088/platform',// 王书生 | 17 | // domain:'http://172.16.6.240:8088/platform',// 王书生 |
18 | - // domain: 'http://172.16.6.124:8088/platform',//陈超 | 18 | + domain: 'http://172.16.6.214:8088/platform',//陈超 |
19 | //http://172.16.6.124:8088/platform/product/queryAllProductAttr | 19 | //http://172.16.6.124:8088/platform/product/queryAllProductAttr |
20 | // domain: 'http://172.16.6.227:8088/platform', //玛丽 | 20 | // domain: 'http://172.16.6.227:8088/platform', //玛丽 |
21 | - //domain:'http://172.16.6.197:8080/yohobuy-platform-web',//葛超 | ||
22 | - domain: 'http://192.168.102.202:8088/platform', | 21 | + // domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超 |
22 | + // domain: 'http://192.168.102.202:8088/platform', | ||
23 | //domain: 'http://172.16.6.239:8080', //孙杰翔 | 23 | //domain: 'http://172.16.6.239:8080', //孙杰翔 |
24 | loggers: { | 24 | loggers: { |
25 | api: { | 25 | api: { |
@@ -547,5 +547,12 @@ exports.res = [{ //基础商品列表 | @@ -547,5 +547,12 @@ exports.res = [{ //基础商品列表 | ||
547 | name: "barCode", | 547 | name: "barCode", |
548 | type: "String" | 548 | type: "String" |
549 | }] | 549 | }] |
550 | + },{ | ||
551 | + route:'/ajax/queryBatchImportResult', | ||
552 | + method:'POST', | ||
553 | + url:'/product/queryBatchImportResult', | ||
554 | + params:[ | ||
555 | + {name:"param",type:"String"} | ||
556 | + ] | ||
550 | } | 557 | } |
551 | ]; | 558 | ]; |
@@ -140,6 +140,13 @@ exports.res = [ | @@ -140,6 +140,13 @@ exports.res = [ | ||
140 | params:[ | 140 | params:[ |
141 | {name:"brandId",type:"Number"} | 141 | {name:"brandId",type:"Number"} |
142 | ] | 142 | ] |
143 | + },{ | ||
144 | + route:'/guang/article/getSortList', | ||
145 | + method:'POST', | ||
146 | + url:'/guang/article/getSortList', | ||
147 | + params:[ | ||
148 | + {name:"pid",type:"Number"} | ||
149 | + ] | ||
143 | } | 150 | } |
144 | 151 | ||
145 | ] | 152 | ] |
@@ -526,6 +526,16 @@ exports.res = [ | @@ -526,6 +526,16 @@ exports.res = [ | ||
526 | method:'GET', | 526 | method:'GET', |
527 | view:'pages/guang/contentEdit', | 527 | view:'pages/guang/contentEdit', |
528 | src:'/guang/contentEdit' | 528 | src:'/guang/contentEdit' |
529 | + }, | ||
530 | + { | ||
531 | + route:'/guang/article/getEnumList', | ||
532 | + method:'POST', | ||
533 | + url:'EnumListRest/getEnumList' | ||
534 | + }, | ||
535 | + { | ||
536 | + route:'/guang/tags/getList', | ||
537 | + method:'POST', | ||
538 | + url:'/guang/tags/getList' | ||
529 | } | 539 | } |
530 | ]; | 540 | ]; |
531 | 541 |
1 | var authService = require('../service/auth'); | 1 | var authService = require('../service/auth'); |
2 | var uploader=require('../service/upload'); | 2 | var uploader=require('../service/upload'); |
3 | -var down=require('../service/down'); | ||
4 | -var ueditor=require('../service/ueditor'); | ||
5 | -var link=require('../service/link'); | ||
6 | 3 | ||
7 | module.exports = { | 4 | module.exports = { |
8 | '/auth_bak':function(req, res){ | 5 | '/auth_bak':function(req, res){ |
@@ -75,15 +72,15 @@ module.exports = { | @@ -75,15 +72,15 @@ module.exports = { | ||
75 | authService.callLogin(user,password,res); | 72 | authService.callLogin(user,password,res); |
76 | }, | 73 | }, |
77 | '/ajax/upload':function(req,res){ | 74 | '/ajax/upload':function(req,res){ |
78 | - uploader.uploadFile(req,res); | 75 | + uploader.uploadFile(req,res); |
79 | }, | 76 | }, |
80 | '/ajax/down':function(req,res){ | 77 | '/ajax/down':function(req,res){ |
81 | - down.downFile(req,res); | 78 | + uploader.downFile(req,res); |
82 | }, | 79 | }, |
83 | '/ajax/ueditor':function(req,res){ | 80 | '/ajax/ueditor':function(req,res){ |
84 | - ueditor.uploadFile(req,res); | 81 | + uploader.ueditor(req,res); |
85 | }, | 82 | }, |
86 | '/ajax/link/:name':function(req,res){ | 83 | '/ajax/link/:name':function(req,res){ |
87 | - link.linkFile(req,res); | 84 | + uploader.linkFile(req,res); |
88 | } | 85 | } |
89 | } | 86 | } |
server/stub/service/down.js
deleted
100644 → 0
1 | -var request = require('request'); | ||
2 | -var _ = require('lodash'); | ||
3 | -var fs = require('fs'); | ||
4 | -var ipaddr = require('ipaddr.js'); | ||
5 | -var domain = require('../../config/common.js').domain; | ||
6 | -//var domain = 'http://172.16.6.227:8088/platform'; //马力 | ||
7 | -// var domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; | ||
8 | - | ||
9 | -exports.downFile = function(req, res) { | ||
10 | - var options = { | ||
11 | - method: 'POST', | ||
12 | - url: domain + '/batch/export', | ||
13 | - headers: { | ||
14 | - 'content-type': 'application/json' | ||
15 | - }, | ||
16 | - body: req.query, | ||
17 | - json: true | ||
18 | - }; | ||
19 | - request(options).pipe(res); | ||
20 | -} |
server/stub/service/link.js
deleted
100644 → 0
1 | -var request = require('request'); | ||
2 | -var _ = require('lodash'); | ||
3 | -var fs = require('fs'); | ||
4 | -var path=require('path'); | ||
5 | -var domain = require('../../config/common.js').domain; | ||
6 | - | ||
7 | -exports.linkFile = function(req, res) { | ||
8 | - request.get(domain+"/common/"+req.params.name+".xlsx").pipe(res); | ||
9 | -} |
server/stub/service/ueditor.js
deleted
100644 → 0
1 | -var request = require('request'); | ||
2 | -var _ = require('lodash'); | ||
3 | -var fs = require('fs'); | ||
4 | -var ipaddr = require('ipaddr.js'); | ||
5 | -var domain = require('../../config/common.js').domain; | ||
6 | -//var domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力 | ||
7 | -// var domain = 'http://172.16.6.162:8088/platform'; | ||
8 | -//var domain = 'http://172.16.6.240:8088/platform'; | ||
9 | - | ||
10 | -exports.uploadFile = function(req, res) { | ||
11 | - var headers = {}; | ||
12 | - if (req.session && req.session.user) { | ||
13 | - var ipObject = ipaddr.process(req.ip).octets | ||
14 | - var ip = ipObject ? ipObject.join('.') : req.ip; | ||
15 | - | ||
16 | - headers = { | ||
17 | - 'x-user-id': req.session.user.auth.pid, | ||
18 | - 'x-user-name': req.session.user.auth.account, | ||
19 | - 'x-site-type': 1, | ||
20 | - 'x-client-ip': ip | ||
21 | - }; | ||
22 | - | ||
23 | - }else{ | ||
24 | - res.json({ | ||
25 | - code: "501", | ||
26 | - message: "用户失效,请重新登录" | ||
27 | - }); | ||
28 | - } | ||
29 | - | ||
30 | - console.log(req.files); | ||
31 | - if (req.is("multipart/form-data")) { | ||
32 | - req.body.file = fs.createReadStream(req.files.upfile.path); | ||
33 | - req.body.bucket="goodsimg"; | ||
34 | - request.post({ | ||
35 | - url: domain + '/fileupload/upload', | ||
36 | - formData: req.body | ||
37 | - }, function optionalCallback(error, httpResponse, body) { | ||
38 | - // {"code":200,"data":"http://img12.static.yhbimg.com/goodsimg/2016/03/10/20/0258a569ab956e81339c7212bb23767c2d.jpg","message":"上传成功","status":true} | ||
39 | - // {"originalName":"demo.jpg","name":"demo.jpg","url":"upload\/demo.jpg","size":"99697","type":".jpg","state":"SUCCESS"} | ||
40 | - // {"originalName":"018da7232374448d10a565fdfe6211d078.jpg","name":"","url":"","type":".jpg","state":"SUCCESS"} | ||
41 | - if (!error && httpResponse.statusCode == 200) { | ||
42 | - var json = JSON.parse(body); | ||
43 | - var result={}; | ||
44 | - result.originalName=json.data.substring(json.data.lastIndexOf('/')+1); | ||
45 | - result.name=result.originalName; | ||
46 | - result.url=json.data; | ||
47 | - result.type=json.data.substring(json.data.lastIndexOf('.')); | ||
48 | - result.state=json.message=="上传成功"?"SUCCESS":"FAIL"; | ||
49 | - res.send(JSON.stringify(result)); | ||
50 | - }else{ | ||
51 | - res.send({code:"500",message:"接口异常"}); | ||
52 | - } | ||
53 | - }); | ||
54 | - | ||
55 | - } else { | ||
56 | - res.json({ | ||
57 | - code: "500", | ||
58 | - message: "请求类型错误" | ||
59 | - }); | ||
60 | - } | ||
61 | -} |
@@ -48,8 +48,7 @@ exports.uploadFile = function(req, res) { | @@ -48,8 +48,7 @@ exports.uploadFile = function(req, res) { | ||
48 | request.post({ | 48 | request.post({ |
49 | url: domain + '/batch/import?'+url.join("&"), | 49 | url: domain + '/batch/import?'+url.join("&"), |
50 | formData: req.body, | 50 | formData: req.body, |
51 | - headers: headers, | ||
52 | - timeout: 300000 | 51 | + headers: headers |
53 | }, function optionalCallback(error, httpResponse, body) { | 52 | }, function optionalCallback(error, httpResponse, body) { |
54 | if (error) { | 53 | if (error) { |
55 | return console.error('upload failed:', error); | 54 | return console.error('upload failed:', error); |
@@ -128,4 +127,95 @@ function joinimg(url) { | @@ -128,4 +127,95 @@ function joinimg(url) { | ||
128 | } else { | 127 | } else { |
129 | return 'http://img12.'+ url; | 128 | return 'http://img12.'+ url; |
130 | } | 129 | } |
130 | +} | ||
131 | + | ||
132 | +// exports.getSaveState=function(req,res){ | ||
133 | +// console.log("6666666"); | ||
134 | +// request.post({ | ||
135 | +// url: domain + '/product/queryBatchImportResult', | ||
136 | +// formData: req.body | ||
137 | +// }, function optionalCallback(error, httpResponse, body) { | ||
138 | +// console.log(body); | ||
139 | +// if (error) { | ||
140 | +// return console.error('upload failed:', error); | ||
141 | +// } | ||
142 | +// if (!error && httpResponse.statusCode == 200) { | ||
143 | +// var json = JSON.parse(body); | ||
144 | +// json.status = true; | ||
145 | +// // console.log(json); | ||
146 | +// res.json(json); | ||
147 | +// } else { | ||
148 | +// res.json(errBackMsg); | ||
149 | +// } | ||
150 | +// }); | ||
151 | +// } | ||
152 | + | ||
153 | +exports.ueditor = function(req, res) { | ||
154 | + var headers = {}; | ||
155 | + if (req.session && req.session.user) { | ||
156 | + var ipObject = ipaddr.process(req.ip).octets | ||
157 | + var ip = ipObject ? ipObject.join('.') : req.ip; | ||
158 | + | ||
159 | + headers = { | ||
160 | + 'x-user-id': req.session.user.auth.pid, | ||
161 | + 'x-user-name': req.session.user.auth.account, | ||
162 | + 'x-site-type': 1, | ||
163 | + 'x-client-ip': ip | ||
164 | + }; | ||
165 | + | ||
166 | + }else{ | ||
167 | + res.json({ | ||
168 | + code: "501", | ||
169 | + message: "用户失效,请重新登录" | ||
170 | + }); | ||
171 | + } | ||
172 | + | ||
173 | + console.log(req.files); | ||
174 | + if (req.is("multipart/form-data")) { | ||
175 | + req.body.file = fs.createReadStream(req.files.upfile.path); | ||
176 | + req.body.bucket="goodsimg"; | ||
177 | + request.post({ | ||
178 | + url: domain + '/fileupload/upload', | ||
179 | + formData: req.body | ||
180 | + }, function optionalCallback(error, httpResponse, body) { | ||
181 | + // {"code":200,"data":"http://img12.static.yhbimg.com/goodsimg/2016/03/10/20/0258a569ab956e81339c7212bb23767c2d.jpg","message":"上传成功","status":true} | ||
182 | + // {"originalName":"demo.jpg","name":"demo.jpg","url":"upload\/demo.jpg","size":"99697","type":".jpg","state":"SUCCESS"} | ||
183 | + // {"originalName":"018da7232374448d10a565fdfe6211d078.jpg","name":"","url":"","type":".jpg","state":"SUCCESS"} | ||
184 | + if (!error && httpResponse.statusCode == 200) { | ||
185 | + var json = JSON.parse(body); | ||
186 | + var result={}; | ||
187 | + result.originalName=json.data.substring(json.data.lastIndexOf('/')+1); | ||
188 | + result.name=result.originalName; | ||
189 | + result.url=json.data; | ||
190 | + result.type=json.data.substring(json.data.lastIndexOf('.')); | ||
191 | + result.state=json.message=="上传成功"?"SUCCESS":"FAIL"; | ||
192 | + res.send(JSON.stringify(result)); | ||
193 | + }else{ | ||
194 | + res.send({code:"500",message:"接口异常"}); | ||
195 | + } | ||
196 | + }); | ||
197 | + | ||
198 | + } else { | ||
199 | + res.json({ | ||
200 | + code: "500", | ||
201 | + message: "请求类型错误" | ||
202 | + }); | ||
203 | + } | ||
204 | +} | ||
205 | + | ||
206 | +exports.linkFile = function(req, res) { | ||
207 | + request.get(domain+"/common/"+req.params.name+".xlsx").pipe(res); | ||
208 | +} | ||
209 | + | ||
210 | +exports.downFile = function(req, res) { | ||
211 | + var options = { | ||
212 | + method: 'POST', | ||
213 | + url: domain + '/batch/export', | ||
214 | + headers: { | ||
215 | + 'content-type': 'application/json' | ||
216 | + }, | ||
217 | + body: req.query, | ||
218 | + json: true | ||
219 | + }; | ||
220 | + request(options).pipe(res); | ||
131 | } | 221 | } |
@@ -11,12 +11,7 @@ | @@ -11,12 +11,7 @@ | ||
11 | </ul> | 11 | </ul> |
12 | 12 | ||
13 | <div> | 13 | <div> |
14 | - <div style="width: 30%;float: left;"> | ||
15 | <h4>添加文章</h4> | 14 | <h4>添加文章</h4> |
16 | - </div> | ||
17 | - <div style="width: 70%;float: right;"> | ||
18 | - | ||
19 | - </div> | ||
20 | </div> | 15 | </div> |
21 | </div> | 16 | </div> |
22 | </div><!-- media --> | 17 | </div><!-- media --> |
@@ -29,14 +24,13 @@ | @@ -29,14 +24,13 @@ | ||
29 | <div class="panel-heading"> | 24 | <div class="panel-heading"> |
30 | <h4 class="panel-title">添加文章</h4> | 25 | <h4 class="panel-title">添加文章</h4> |
31 | </div> | 26 | </div> |
32 | - <div class="panel-body"> | 27 | + <div class="panel-body form-horizontal" id="panel-body" action="{{action}}"> |
33 | 28 | ||
34 | </div> | 29 | </div> |
35 | <div class="panel-footer"> | 30 | <div class="panel-footer"> |
36 | <div class="row"> | 31 | <div class="row"> |
37 | <div class="col-sm-9 col-sm-offset-3"> | 32 | <div class="col-sm-9 col-sm-offset-3"> |
38 | - <input type="hidden" name="id" value="41968"> | ||
39 | - <button type="submit" data-loading-text="保存中..." class="btn btn-primary mr5">保存</button> | 33 | + <button type="submit" id="submit" class="btn btn-primary mr5">保存</button> |
40 | </div> | 34 | </div> |
41 | </div> | 35 | </div> |
42 | </div> | 36 | </div> |
@@ -46,20 +40,30 @@ | @@ -46,20 +40,30 @@ | ||
46 | </div> | 40 | </div> |
47 | 41 | ||
48 | <script type="text/tempalte" id="tempalte1"> | 42 | <script type="text/tempalte" id="tempalte1"> |
49 | - <div class="rows"> | 43 | + <div class="row" id="baseform"> |
50 | <div class="form-group"> | 44 | <div class="form-group"> |
51 | - <label class="col-sm-1 control-label">文章标题</label> | ||
52 | - <div class="col-sm-9"> | 45 | + <label class="col-sm-2 control-label">文章标题:</label> |
46 | + <div class="col-sm-8"> | ||
53 | <input type="text" id="articleTitle" class="form-control" placeholder="文章标题" required="" value="[[articleTitle]]"> | 47 | <input type="text" id="articleTitle" class="form-control" placeholder="文章标题" required="" value="[[articleTitle]]"> |
54 | </div> | 48 | </div> |
55 | </div> | 49 | </div> |
56 | <div class="form-group"> | 50 | <div class="form-group"> |
57 | - <label class="col-sm-1 control-label">文章分类</label> | 51 | + <label class="col-sm-2 control-label">文章分类:</label> |
58 | <!--文章分类--> | 52 | <!--文章分类--> |
53 | + <div class="col-sm-2"> | ||
54 | + <select class="form-control" id="maxSortId"> | ||
55 | + <option value="[[maxSortId||'-1']]">[[maxSortName||'请选择一级分类']]</option> | ||
56 | + </select> | ||
57 | + </div> | ||
58 | + <div class="col-sm-2"> | ||
59 | + <select class="form-control" id="minSortId"> | ||
60 | + <option value="[[minSortId||'-1']]">[[minSortName||'请选择二级分类']]</option> | ||
61 | + </select> | ||
62 | + </div> | ||
59 | </div> | 63 | </div> |
60 | <div class="form-group"> | 64 | <div class="form-group"> |
61 | - <label class="col-sm-1 control-label">性别</label> | ||
62 | - <div class="col-sm-9"> | 65 | + <label class="col-sm-2 control-label">性别:</label> |
66 | + <div class="col-sm-8"> | ||
63 | <input type="radio" value="1" name="articleGender"> | 67 | <input type="radio" value="1" name="articleGender"> |
64 | <label>男</label> | 68 | <label>男</label> |
65 | <input type="radio" value="2" name="articleGender"> | 69 | <input type="radio" value="2" name="articleGender"> |
@@ -70,30 +74,30 @@ | @@ -70,30 +74,30 @@ | ||
70 | </div> | 74 | </div> |
71 | </div> | 75 | </div> |
72 | <div class="form-group"> | 76 | <div class="form-group"> |
73 | - <label class="col-sm-1 control-label">选择作者</label> | ||
74 | - <div class="col-sm-9"> | 77 | + <label class="col-sm-2 control-label">选择作者:</label> |
78 | + <div class="col-sm-8"> | ||
75 | <select class="form-control" id="authorId"> | 79 | <select class="form-control" id="authorId"> |
76 | <option value="[[authorId||'']]">[[authorName||'请选择']]</option> | 80 | <option value="[[authorId||'']]">[[authorName||'请选择']]</option> |
77 | </select> | 81 | </select> |
78 | </div> | 82 | </div> |
79 | </div> | 83 | </div> |
80 | <div class="form-group"> | 84 | <div class="form-group"> |
81 | - <label class="col-sm-1 control-label">文章摘要</label> | ||
82 | - <div class="col-sm-9"> | 85 | + <label class="col-sm-2 control-label">文章摘要:</label> |
86 | + <div class="col-sm-8"> | ||
83 | <textarea rows="2" id="articleSummary" class="form-control" placeholder="文章摘要" > | 87 | <textarea rows="2" id="articleSummary" class="form-control" placeholder="文章摘要" > |
84 | [[articleSummary]] | 88 | [[articleSummary]] |
85 | </textarea> | 89 | </textarea> |
86 | </div> | 90 | </div> |
87 | </div> | 91 | </div> |
88 | <div class="form-group"> | 92 | <div class="form-group"> |
89 | - <label class="col-sm-1 control-label">封面图</label> | ||
90 | - <div class="col-sm-9"> | 93 | + <label class="col-sm-2 control-label">封面图:</label> |
94 | + <div class="col-sm-8"> | ||
91 | <input type="file" name="coverImage" id="coverImage" value="[[coverImage]]" /> | 95 | <input type="file" name="coverImage" id="coverImage" value="[[coverImage]]" /> |
92 | </div> | 96 | </div> |
93 | </div> | 97 | </div> |
94 | <div class="form-group"> | 98 | <div class="form-group"> |
95 | - <label class="col-sm-1 control-label">图片类型</label> | ||
96 | - <div class="col-sm-9"> | 99 | + <label class="col-sm-2 control-label">图片类型:</label> |
100 | + <div class="col-sm-8"> | ||
97 | <input type="radio" value="1" name="coverImageType"> | 101 | <input type="radio" value="1" name="coverImageType"> |
98 | <label>方形</label> | 102 | <label>方形</label> |
99 | <input type="radio" value="2" name="coverImageType" checked=""> | 103 | <input type="radio" value="2" name="coverImageType" checked=""> |
@@ -103,8 +107,8 @@ | @@ -103,8 +107,8 @@ | ||
103 | </div> | 107 | </div> |
104 | 108 | ||
105 | <div class="form-group"> | 109 | <div class="form-group"> |
106 | - <label class="col-sm-1 control-label">文章类型</label> | ||
107 | - <div class="col-sm-9"> | 110 | + <label class="col-sm-2 control-label">文章类型:</label> |
111 | + <div class="col-sm-8"> | ||
108 | <select class="form-control" value="[[articleType]]" id="articleType"> | 112 | <select class="form-control" value="[[articleType]]" id="articleType"> |
109 | <option value="1">普通文章</option> | 113 | <option value="1">普通文章</option> |
110 | <option value="2">广告</option> | 114 | <option value="2">广告</option> |
@@ -112,8 +116,8 @@ | @@ -112,8 +116,8 @@ | ||
112 | </div> | 116 | </div> |
113 | </div> | 117 | </div> |
114 | <div class="form-group"> | 118 | <div class="form-group"> |
115 | - <label class="col-sm-1 control-label">广告尺寸</label> | ||
116 | - <div class="col-sm-9"> | 119 | + <label class="col-sm-2 control-label">广告尺寸:</label> |
120 | + <div class="col-sm-8"> | ||
117 | <select class="form-control" value="[[adsImgSize]]" id="adsImgSize"> | 121 | <select class="form-control" value="[[adsImgSize]]" id="adsImgSize"> |
118 | <option value="">请选择广告图片尺寸</option> | 122 | <option value="">请选择广告图片尺寸</option> |
119 | <option value="10881088">1088X1088</option> | 123 | <option value="10881088">1088X1088</option> |
@@ -122,32 +126,116 @@ | @@ -122,32 +126,116 @@ | ||
122 | </select> | 126 | </select> |
123 | </div> | 127 | </div> |
124 | </div> | 128 | </div> |
129 | + | ||
130 | + </div> | ||
131 | + <div class="row"> | ||
125 | 132 | ||
126 | <div class="form-group"> | 133 | <div class="form-group"> |
127 | - <label class="col-sm-1 control-label">链接</label> | ||
128 | - <div class="col-sm-9"> | ||
129 | - <input type="text" name="url" id="url" value="" class="form-control" placeholder="请输入内容链接" readonly="true" required=""> <button type="button" class="btn btn-info" id="addUrl">添加链接</button> | 134 | + <label class="col-sm-2 control-label">链接:</label> |
135 | + <div class="col-sm-7"> | ||
136 | + | ||
137 | + <input type="text" name="url" id="url" value="" class="form-control" placeholder="请输入内容链接" readonly="true" required=""> | ||
130 | <p style="color:#999">注:链接中不能有英文单引号</p> | 138 | <p style="color:#999">注:链接中不能有英文单引号</p> |
131 | </div> | 139 | </div> |
140 | + <div class="col-sm-1"> | ||
141 | + <button type="button" class="btn btn-info" id="addUrl">添加链接</button> | ||
142 | + </div> | ||
132 | </div> | 143 | </div> |
133 | 144 | ||
134 | <div class="form-group"> | 145 | <div class="form-group"> |
135 | - <label class="col-sm-1 control-label">文章内容</label> | ||
136 | - <div class="col-sm-9"> | 146 | + <label class="col-sm-2 control-label">文章内容:</label> |
147 | + <div class="col-sm-8"> | ||
137 | <select class="form-control"></select> | 148 | <select class="form-control"></select> |
138 | </div> | 149 | </div> |
139 | </div> | 150 | </div> |
140 | <div class="form-group"> | 151 | <div class="form-group"> |
141 | - <label class="col-sm-1 control-label">添加品牌</label> | ||
142 | - <div class="col-sm-9"> | ||
143 | - <select class="form-control"></select> | 152 | + <label class="col-sm-2 control-label">添加品牌:</label> |
153 | + <div class="col-sm-8"> | ||
154 | + <ul class="cover-image-list col-sm-10" id="addPic" style="padding: 0;margin: 0;"> | ||
155 | + <li class="cover-image-item fileinput-button"> | ||
156 | + <div class="goods-img"> | ||
157 | + <a class="fileinput-button-icon" href="javascript:void(0);">+</a> | ||
158 | + <input type="file" class="goods-img-upload picfile" name="picfile" required="required" placeholder="图片"> | ||
159 | + </div> | ||
160 | + </li> | ||
161 | + </ul> | ||
144 | </div> | 162 | </div> |
145 | </div> | 163 | </div> |
146 | <div class="form-group"> | 164 | <div class="form-group"> |
147 | - <label class="col-sm-1 control-label">选择标签</label> | ||
148 | - <div class="col-sm-9"> | ||
149 | - <select class="form-control"></select> | 165 | + <label class="col-sm-2 control-label">选择标签:</label> |
166 | + <div class="col-sm-6"> | ||
167 | + <div id="taglist" class="tagwrap"> | ||
168 | + <span class="tag"><span>街头 </span><a href="#" title="Removing tag">x</a></span> | ||
169 | + </div> | ||
170 | + </div> | ||
171 | + <div class="col-sm-1"> | ||
172 | + <button class="btn btn-info" type="button" id="TagsSelectBtn">选择标签</button> | ||
150 | </div> | 173 | </div> |
151 | </div> | 174 | </div> |
152 | </div> | 175 | </div> |
176 | +</script> | ||
177 | + | ||
178 | +<script type="text/tempalte" id="template2"> | ||
179 | + <div class="rows"> | ||
180 | + <div class="form-group"> | ||
181 | + <label class="col-sm-2 control-label">选择跳转目的地:</label> | ||
182 | + <div class="col-sm-8"> | ||
183 | + <select name="goTo" class="form-control"> | ||
184 | + <option value="">选择跳转目的</option> | ||
185 | + <option value="brand">品牌列表页</option> | ||
186 | + <option value="productDetail">商品详情页</option> | ||
187 | + <option value="coupon">优惠券页</option> | ||
188 | + <option value="fav">收藏列表页</option> | ||
189 | + <option value="mine">我的页面</option> | ||
190 | + <option value="list">列表或搜索页</option> | ||
191 | + <option value="attention">关注页</option> | ||
192 | + <option value="plus">plus页</option> | ||
193 | + <option value="star">star页</option> | ||
194 | + <option value="new">新品到着页</option> | ||
195 | + <option value="sale">折扣页</option> | ||
196 | + <option value="h5">h5网页</option> | ||
197 | + <option value="guangchannel">逛频道</option> | ||
198 | + <option value="gender">男女首页</option> | ||
199 | + <option value="activity">app活动页</option> | ||
200 | + <option value="home" selected="selected">频道首页</option> | ||
201 | + <option value="yohood">YOHOOD</option> | ||
202 | + <option value="top100">热销排行</option> | ||
203 | + <option value="activitytemplate">活动模板</option> | ||
204 | + <option value="globalpurchase">全球购</option> | ||
205 | + <option value="subchannel">二级频道</option> | ||
206 | + <option value="guangchannel">逛频道或SHOW晒单页</option> | ||
207 | + <option value="showgoods">去晒单</option> | ||
208 | + <option value="limitpurchase">尖货频道</option> | ||
209 | + <option value="vippro">会员商品</option> | ||
210 | + <option value="shortsize">断码页</option> | ||
211 | + <option value="discountmarket">折扣专区</option> | ||
212 | + <option value="discountmarketpro">折扣专区详情页</option> | ||
213 | + </select> | ||
214 | + | ||
215 | + </div> | ||
216 | + </div> | ||
217 | + | ||
218 | + <div class="form-group"> | ||
219 | + <label class="col-sm-2 control-label">跳转地址:</label> | ||
220 | + <div class="col-sm-8"> | ||
221 | + <textarea rows="2" id="articleSummary" class="form-control" placeholder="文章摘要" ></textarea> | ||
222 | + </div> | ||
223 | + | ||
224 | + </div> | ||
225 | + </div> | ||
226 | +</script> | ||
227 | + | ||
228 | +<script type="text/template" id="template3"> | ||
229 | + | ||
230 | +[[each aa as index]] | ||
231 | + <li class="cover-image-item image-list" data-index="2"> | ||
232 | + <div class="goods-img"> | ||
233 | + <a class="fileinput-button-icon" href="javascript:void(0);"> | ||
234 | + <img src="http://img11.static.yhbimg.com\goodsimg/2016/04/05/08/018a152691c03886bb23fc3eabb8ebafbf.jpg?imageView/2/w/100/h/100"> | ||
235 | + </a> | ||
236 | + <i class="remove-item-btn remove1 glyphicon glyphicon-remove-circle" data-index="2"></i> | ||
237 | + </div> | ||
238 | + </li> | ||
239 | +[[/each]] | ||
240 | + | ||
153 | </script> | 241 | </script> |
-
Please register or login to post a comment