Authored by chaogeng

Merge branch 'dev-guang' into test5.7

... ... @@ -98,10 +98,10 @@
<label class="col-sm-2 control-label">图片类型:</label>
<div class="col-sm-8" style="padding-top: 6px">
<input type="radio" value="2" name="coverImageType" checked>
<label>长形</label>
<input type="radio" value="1" name="coverImageType">
<label>方形</label>
<input type="radio" value="2" name="coverImageType">
<label>长形</label>
<input type="hidden" id="coverImageType" value="[[coverImageType]]" for="radio"/>
</div>
</div>
... ... @@ -421,6 +421,67 @@
</div>
</div>
</script>
<!-- 一张图片 -->
<script type="text/template" id="template_dialog_grid2">
<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>
<tr id="relatGoods">
[[layout template_dialog_relatGoods]]
</tr>
</tbody>
</table>
</div>
<div class="form-group">
<div class="col-sm-2">
<button class="btn btn-info" type="button" id="imgsSelectBtn">上传多张图片</button>
</div>
</div>
</div>
</script>
<script type="text/template" id="template_dialog_relatGoods">
[[each contentData.data as datas index]]
<td>[[index+1]]</td>
<!-- multiple="true" -->
<td>
<input type="file" name="file" id="url-[[index]]" value="[[datas.src]]"
data-field="[[index]].src" data-index="[[index]]"/>
</td>
<td>
<div class="form-group">
[[each datas.tagList as item i]]
<div class="form-group">
<div class="col-sm-2">
<a class="fileinput-button-icon" href="javascript:void(0);">
<img src="[[item.pic_src]]" width="100px" height="100px">
</a>
</div>
<div class="col-sm-6">
<input class="form-control observe" value="[[item.tagName]]" placeholder="商品标题"
data-field='[[index]].tagList.[[i]].tagName'/>
</div>
<div class="col-sm-2">
<button class="btn btn-info" type="button" value="[[i]]" id="delRelProductBtn">删除</button>
</div>
</div>
[[/each]]
</div>
<div class="form-group">
<div class="col-sm-2">
<button class="btn btn-info" type="button" id="relGoodsSelectBtn">添加关联商品</button>
</div>
</div>
</td>
[[/each]]
</script>
<script type="text/template" id="template_dialog_imgmodule">
<div class="rows" id="moduleimgs">
<div class="form-group">
... ...
... ... @@ -112,7 +112,7 @@ gulp.task('server', function () {
'index.js',
"./apps/**/controllers/*.js",
"./apps/**/interfaces/*.js",
"./apps/**/views/**.html"
"./apps/**/views/**/*.html"
], server.restart);
});
... ...
... ... @@ -135,7 +135,7 @@ var Bll = {
}
// 对于图片资源位,增加图片的原始尺寸
if(module.contentData.dialog == 'template_dialog_grid') {
if(module.contentData.dialog == 'template_dialog_grid' || module.contentData.dialog == 'template_dialog_grid2') {
$.each(module.contentData.data, function(index, data) {
Bll.getPicNaturalSize(data);
});
... ... @@ -307,8 +307,8 @@ var Button = [
template_name: "text"
},
{
template_intro: "一张大图",
dialog: "template_dialog_grid",
template_intro: "单张大图",
dialog: "template_dialog_grid2",
template_name: "singleImage",
data: [{
"url": {
... ... @@ -317,7 +317,9 @@ var Button = [
},
"alt": "",
"src": "",
"imgId": ""
"imgId": "",
"tagList":[
]
}]
},
{
... ... @@ -361,8 +363,8 @@ var Button = [
dialog: "template_dialog_goods",
template_name: "goods",
data: []
},
{
},
/*{
template_intro: "推荐商品组",
dialog: "template_dialog_remgoods",
template_name: "goodsGroup",
... ... @@ -373,9 +375,9 @@ var Button = [
},
list: []
}]
},
},*/
{
template_intro: "一个链接",
template_intro: "链接",
dialog: "template_dialog_link",
template_name: "link",
data: [{
... ... @@ -772,6 +774,42 @@ var goodsgird = new common.grid({
name: "storage_num"
}]
});
//点击“添加商品”按钮(一张大图)
$(document).on("click", "#relGoodsSelectBtn", function () {
new common.dialog({
title: "选择商品",
zIndex: 52,
content: $("#template_dialog_goodsgird").html(),
width: '80%',
button: [{
value: "确定",
callback: function () {
var gs = goodsgird.selected.map(function (item, index) {
return {
pic_src: item.images_url,
product_skn: item.product_skn,
tagName: item.product_name,
}
})
Bll.module.contentData.data[0].tagList = Bll.module.contentData.data[0].tagList.concat(gs);
//Bll.module.contentData.data = Unique(Bll.module.contentData.data, "product_skc")
Bll.__render("#relatGoods", "template_dialog_relatGoods", Bll.module);
components.init();
Bll2.moveDrag();
},
css: "btn-primary"
}]
});
goodsgird.grid = null;
});
//点击“删除”按钮,删除添加商品(一张大图)
$(document).on("click", "#delRelProductBtn", function () {
var index = $(this).val();;
Bll.module.contentData.data[0].tagList.splice(index, 1);
Bll.__render("#relatGoods", "template_dialog_relatGoods", Bll.module);
components.init();
});
//点击“选择标签”按钮(添加商品)
$(document).on("click", "#goodsSelectBtn", function () {
new common.dialog({
... ... @@ -802,7 +840,6 @@ $(document).on("click", "#goodsSelectBtn", function () {
});
goodsgird.grid = null;
});
//点击“添加组”按钮(添加商品组)
$(document).on("click", "#goodsaddBtn", function () {
var item = $.extend(true, {}, Button[4].data[0]);
... ...