Merge branch 'dev_5.6' into test5.6
# Conflicts: # code/apps/goods/controllers/basegoods.js # code/apps/resource/views/__partail/jiangming.html # code/static/js.jquery/module/resource/resourceManage/ContentManage.js
Showing
7 changed files
with
61 additions
and
12 deletions
@@ -154,7 +154,19 @@ module.exports = { | @@ -154,7 +154,19 @@ module.exports = { | ||
154 | } | 154 | } |
155 | return callback(null, result); | 155 | return callback(null, result); |
156 | }); | 156 | }); |
157 | - } else { | 157 | + }else if (req.body.bucket === 'staticFile') { |
158 | + req.body.file = fs.createReadStream(req.files[req.body.filename].path); | ||
159 | + request.post({ | ||
160 | + url: config.domain + '/fileupload/uploadStaticFile', | ||
161 | + formData: req.body | ||
162 | + }, function optionalCallback(error, httpResponse, rebody) { | ||
163 | + if (!error && httpResponse.statusCode == 200) { | ||
164 | + result = JSON.parse(rebody); | ||
165 | + result.status = true; | ||
166 | + } | ||
167 | + return callback(null, result); | ||
168 | + }); | ||
169 | + }else { | ||
158 | req.body.file = fs.createReadStream(req.files[req.body.filename].path); | 170 | req.body.file = fs.createReadStream(req.files[req.body.filename].path); |
159 | request.post({ | 171 | request.post({ |
160 | url: config.domain + '/fileupload/upload', | 172 | url: config.domain + '/fileupload/upload', |
@@ -119,10 +119,11 @@ module.exports=function(app) { | @@ -119,10 +119,11 @@ module.exports=function(app) { | ||
119 | 119 | ||
120 | app.post("/product/queryProductPicBySkn","basegoods_queryProductPicBySkn"); | 120 | app.post("/product/queryProductPicBySkn","basegoods_queryProductPicBySkn"); |
121 | 121 | ||
122 | - app.post("/product/queryProductInfoBySkns","basegoods_queryProductInfoBySkns"); | ||
123 | - | ||
124 | - app.post("/product/searchProductDetail","basegoods_searchProductDetail"); | ||
125 | 122 | ||
126 | app.post("/basegoods/queryProductColors","basegoods_queryProductColors"); | 123 | app.post("/basegoods/queryProductColors","basegoods_queryProductColors"); |
127 | 124 | ||
125 | + | ||
126 | + app.post("/product/queryProductInfoBySkns","basegoods_queryProductInfoBySkns"); | ||
127 | + | ||
128 | + app.post("/product/searchProductDetail","basegoods_searchProductDetail"); | ||
128 | } | 129 | } |
@@ -14,7 +14,7 @@ module.exports={ | @@ -14,7 +14,7 @@ module.exports={ | ||
14 | {name: 'pageTitle', type: 'String'}, | 14 | {name: 'pageTitle', type: 'String'}, |
15 | {name: 'keyWord', type: 'String'}, | 15 | {name: 'keyWord', type: 'String'}, |
16 | {name: 'pageDesc', type: 'String'}, | 16 | {name: 'pageDesc', type: 'String'}, |
17 | - {name: 'content', type: 'String'} | 17 | + {name: 'zip', type: 'String'} |
18 | ] | 18 | ] |
19 | }, | 19 | }, |
20 | deleteById:{ | 20 | deleteById:{ |
@@ -48,6 +48,17 @@ | @@ -48,6 +48,17 @@ | ||
48 | <script type="text/template" id="template"> | 48 | <script type="text/template" id="template"> |
49 | 49 | ||
50 | <input type="text" hidden="true" id="id" value="[[id]]"/> | 50 | <input type="text" hidden="true" id="id" value="[[id]]"/> |
51 | + [[if !modifyFlag]] | ||
52 | + <div class="form-group"> | ||
53 | + <label class="col-sm-2 control-label">上传文件</label> | ||
54 | + <div class="col-sm-10"> | ||
55 | + <input type="hidden" name="zip" id="zip" class="form-control" required prompt="图片包"> | ||
56 | + <input id="uploadBox" name="图片包" type="file" | ||
57 | + style="position: absolute; top: 0;left: 0;z-index: -999"> | ||
58 | + <div id="chooseFile" class="file-name btn btn-success">上传图片包</div> | ||
59 | + </div> | ||
60 | + </div> | ||
61 | + [[/if]] | ||
51 | <div class="form-group"> | 62 | <div class="form-group"> |
52 | <label for="fileType" class="col-sm-2 control-label">静态文件类型:</label> | 63 | <label for="fileType" class="col-sm-2 control-label">静态文件类型:</label> |
53 | 64 | ||
@@ -83,9 +94,9 @@ | @@ -83,9 +94,9 @@ | ||
83 | </div> | 94 | </div> |
84 | </div> | 95 | </div> |
85 | 96 | ||
86 | - <div class="rows"> | 97 | + <div class="rows" [[if modifyFlag==0]]hidden="hidden"[[/if]]> |
87 | <label for="content" class="col-sm-2 control-label">内容:</label> | 98 | <label for="content" class="col-sm-2 control-label">内容:</label> |
88 | - <script id="content" style="width: 100%;" name="content" type="text/plain"></script> | 99 | + <script id="content" style="width: 100%;" name="content" type="text/plain"/> |
89 | </div> | 100 | </div> |
90 | 101 | ||
91 | 102 |
@@ -175,7 +175,8 @@ | @@ -175,7 +175,8 @@ | ||
175 | <input class="form-control observe" type="text" value="[[item.name]]" data-field="list.[[index]].name"> | 175 | <input class="form-control observe" type="text" value="[[item.name]]" data-field="list.[[index]].name"> |
176 | [[/if]] | 176 | [[/if]] |
177 | </div> | 177 | </div> |
178 | - [[if contentData.template_name=='appHotBrands']] | 178 | + |
179 | + [[if contentData.template_name=='appHotBrands'||contentData.template_name=='customBrands']] | ||
179 | <div class="form-group"> | 180 | <div class="form-group"> |
180 | <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="list.[[index]].url.action"> | 181 | <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="list.[[index]].url.action"> |
181 | [[layout action_template]] | 182 | [[layout action_template]] |
@@ -143,6 +143,7 @@ $(document).on('click', '#filter', function () { | @@ -143,6 +143,7 @@ $(document).on('click', '#filter', function () { | ||
143 | //编辑 | 143 | //编辑 |
144 | $(document).on('click', '.info-modify', function () { | 144 | $(document).on('click', '.info-modify', function () { |
145 | var item = g.rows[$(this).data("index")]; | 145 | var item = g.rows[$(this).data("index")]; |
146 | + item.modifyFlag = 1; | ||
146 | staticFileOP("编辑", '/staticFileManage/update', item); | 147 | staticFileOP("编辑", '/staticFileManage/update', item); |
147 | }); | 148 | }); |
148 | 149 | ||
@@ -151,7 +152,7 @@ function staticFileOP(prefix, url, item) { | @@ -151,7 +152,7 @@ function staticFileOP(prefix, url, item) { | ||
151 | var a = new common.edit(".confirm", { | 152 | var a = new common.edit(".confirm", { |
152 | //"bucket" : "author" | 153 | //"bucket" : "author" |
153 | }); | 154 | }); |
154 | - | 155 | + console.log(item); |
155 | var dialog = new common.dialog({ | 156 | var dialog = new common.dialog({ |
156 | width: '70%', | 157 | width: '70%', |
157 | title: prefix + '静态文件', | 158 | title: prefix + '静态文件', |
@@ -168,7 +169,8 @@ function staticFileOP(prefix, url, item) { | @@ -168,7 +169,8 @@ function staticFileOP(prefix, url, item) { | ||
168 | pageTitle: $('#pageTitle').val(), | 169 | pageTitle: $('#pageTitle').val(), |
169 | keyWord: $('#keyWord').val(), | 170 | keyWord: $('#keyWord').val(), |
170 | pageDesc: $('#pageDesc').val(), | 171 | pageDesc: $('#pageDesc').val(), |
171 | - content: baidu.getContent() | 172 | + content: baidu.getContent(), |
173 | + zip:$('#zip').val() | ||
172 | } | 174 | } |
173 | }, function (res) { | 175 | }, function (res) { |
174 | //res=res.data; | 176 | //res=res.data; |
@@ -206,4 +208,26 @@ function staticFileOP(prefix, url, item) { | @@ -206,4 +208,26 @@ function staticFileOP(prefix, url, item) { | ||
206 | 208 | ||
207 | 209 | ||
208 | a.init(); | 210 | a.init(); |
211 | + $("#uploadBox").ajaxfileupload({ | ||
212 | + 'action': '/ajax/upload', | ||
213 | + 'params': { | ||
214 | + bucket: "staticFile", | ||
215 | + __type: "upload" | ||
216 | + }, | ||
217 | + onComplete: function (response) { | ||
218 | + if (response.status && response.code == 200) { | ||
219 | + if(response.data){ | ||
220 | + common.util.__tip(response.message, "success"); | ||
221 | + $("#zip").val(response.data); | ||
222 | + } | ||
223 | + } else { | ||
224 | + common.util.__tip(response.message); | ||
225 | + } | ||
226 | + }, | ||
227 | + valid_extensions: ["zip"] | ||
228 | + }); | ||
209 | } | 229 | } |
230 | + | ||
231 | +$(document).on("click", "#chooseFile", function () { | ||
232 | + $("#uploadBox").click(); | ||
233 | +}); |
@@ -284,7 +284,7 @@ var Bll = { | @@ -284,7 +284,7 @@ var Bll = { | ||
284 | "id": Brands2[i].id, | 284 | "id": Brands2[i].id, |
285 | "title": Brands2[i].brand_name | 285 | "title": Brands2[i].brand_name |
286 | }; | 286 | }; |
287 | - } else if(Bll.module.contentData.template_name == "appHotBrands"){ | 287 | + } else if(Bll.module.contentData.template_name == "appHotBrands"||Bll.module.contentData.template_name == "customBrands"){ |
288 | pic = { | 288 | pic = { |
289 | "src": Brands2[i].brandIco, | 289 | "src": Brands2[i].brandIco, |
290 | "id": Brands2[i].id, | 290 | "id": Brands2[i].id, |
@@ -555,7 +555,7 @@ $(document).on("click", ".edit", function () { | @@ -555,7 +555,7 @@ $(document).on("click", ".edit", function () { | ||
555 | Bll.toast(index, Bll.module); | 555 | Bll.toast(index, Bll.module); |
556 | var _shopRecommendFlag = item.contentData.isShopRecommend==''?"N":item.contentData.isShopRecommend; | 556 | var _shopRecommendFlag = item.contentData.isShopRecommend==''?"N":item.contentData.isShopRecommend; |
557 | changeShopRecommendDivShow(_shopRecommendFlag); | 557 | changeShopRecommendDivShow(_shopRecommendFlag); |
558 | - }else if(item.contentData.template_name=='appHotBrands'){ | 558 | + }else if(item.contentData.template_name=='appHotBrands'||item.contentData.template_name=='customBrands'){ |
559 | //热门品牌兼容老版本,url设置空值 | 559 | //热门品牌兼容老版本,url设置空值 |
560 | var list = item.contentData.data.list; | 560 | var list = item.contentData.data.list; |
561 | for(var i=0;i<list.length;i++){ | 561 | for(var i=0;i<list.length;i++){ |
-
Please register or login to post a comment