Authored by 陶雨

Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into develop

... ... @@ -149,6 +149,12 @@ var util = {
});
}else if(/^console\.[^\(]+\([^\)*]\)$/.test(trim)){
return trim+";";
}else if(/^layout\s+/.test(trim)){
// var items=/^layout\s+(\w*)/.exec(trim);
var items=trim.split(/\s+/g);
items[2]=source[items[2]]||source;
console.error(items[2]);
return "result.push('"+util.__template2(document.getElementById(items[1]).innerHTML,items[2]).replace(/\n/g,'')+ "')";
}
else {
return "result.push(" + code + ")";
... ... @@ -156,7 +162,7 @@ var util = {
}
// var PARAMS={};
var OBJECT = /\.\w+|'.*'|".*"/g;
var KEYWORDS = 'for,if,else,each,as,console';
var KEYWORDS = 'for,if,else,each,as,console,layout';
var SPECHAR = /\W/g;
var NUMBER = /^\d[^,]*|,\d[^,]*/g;
... ...
... ... @@ -9,6 +9,8 @@ var ENUM={};
// });
console.log(ENUM);
var edit=new common.edit(".modal-body",{bucket:"goodsimg"});
var Bll={
Brands:[],
Brands1:{},
... ... @@ -63,6 +65,7 @@ var Bll={
}
]
});
edit.init();
},
rendContent:function(){
$("#add-content").html(common.util.__template2($("#template_content").html(),{modules:Bll.contentDatas}));
... ... @@ -139,24 +142,20 @@ $(document).on("click","#submit",function(){
var Button=[
{
text:"文本",
template:"template_content_text",
dialog:"template_dialog_text",
data:{text:""},
template_name:"text"
},
{
text:"一张大图",
template:"template_1",
dialog:"dialog_1",
dialog:"template_dialog_grid",
template_name:"singleImage",
"data": {
"0": {
"url": {},
data:[{
"url": "",
"alt": "",
"src": "http://img11.static.yhbimg.com/yhb-img01/2016/03/31/03/01076e3caed758a1c18c91a0e9cae3368f.jpg?imageView/{mode}/w/{width}/h/{height}",
"src": "",
"imgId": "0"
}
}
}],
},
{
text:"两张小图",
... ...
... ... @@ -305,9 +305,9 @@
</div>
</div>
</li>
[[else if module.template_name=='text']]
[[else if module.template_name=='singleImage']]
stringify
[[/if]]
[[/each]]
</script>
... ... @@ -317,4 +317,32 @@
<div class="rows">
<textarea rows="2" class="form-control observe" placeholder="文章摘要" data-field="text" >[[data.text]]</textarea>
</div>
[[layout template_dialog_grid]]
</script>
<!-- 一张图片 -->
<script type="text/template" id="template_dialog_grid">
<div class="rows">
<div id="grid-baseFrom">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each data as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" data-prefix="aaa.imgs" data-field="src" id="titleImage-image-src[[index]]" value="[[item.src]]" data-index="[[index]]" /></td>
<td>
</td>
</tr>
[[/each]]
</tbody>
</table>
</div>
</div>
</script>
\ No newline at end of file
... ...