Authored by 陶雨

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

Conflicts:
	server/views/pages/guang/contentEdit.html
... ... @@ -77,7 +77,7 @@ var Button=[
},
{
"template_name": "appIconList",
"template_intro": "图标",
"template_intro": "图标入口",
dialog:"icon-template",
"data": [
{
... ... @@ -367,7 +367,32 @@ var Button=[
data: {}
},
{
template_intro:"一个连接",
template_intro:"推荐品牌",
template_name:"appHotBrands",
dialog:"brands-template",
"data": {
"title": {
"title": ""
},
"is_show_name": "N",
"list": []
}
},
{
template_intro:"自定义品牌",
template_name:"customBrands",
dialog:"brands-template",
"data": {
"title": {
"title": "",
"param": "",
"param_value": ""
},
"list": []
}
},
{
template_intro:"一个链接",
dialog:"template_dialog_link",
template_name:"link",
data:[
... ... @@ -383,6 +408,36 @@ var Button=[
}
},
{
template_intro:"轮播banner",
template_name:"carouselBanner",
dialog:"carouselBanner-template",
"data": {
"speed": "",
"list": []
}
},
{
template_intro:"kids推荐品牌",
template_name:"kidsBrands",
dialog:"brands-template",
"data": {
"params": {
"param": "",
"paramValue": "",
"title": "",
"more": "",
"more_url": ""
},
"list": []
}
},
{
template_intro:"推荐(L1-RT1-RF2)",
template_name:"",
dialog:"noEdit-template",
"data": {}
},
{
template_intro:"添加楼层",
dialog:"icon-template",
template_name:"addfloor",
... ... @@ -506,6 +561,74 @@ var Button=[
}
},
{
template_intro:"文本导航",
dialog:"textNav-template",
template_name:"textNav",
data: []
},
{
template_intro:"图片列表",
dialog:"imageList-template",
template_name:"imageList",
"data": {
"title": {
"title": "",
"column_num": "",
"is_show_name": "N"
},
"list": []
}
},
{
template_intro:"标题标签",
dialog:"noEdit-template",
template_name:"",
"data": {}
},
{
template_intro:"编辑推荐",
dialog:"noEdit-template",
template_name:"",
"data": {}
},
{
template_intro:"热门品类",
dialog:"hotCategory-template",
template_name:"hotCategory",
"data": {
"title": {
"name": "",
"more_name": "",
"more_url": {
"action": "",
"url": ""
}
},
"blocks": [],
"list": [],
"imgs": []
}
},
{
template_intro:"有序焦点",
dialog:"debrisSlider-template",
template_name:"debrisSlider",
"data": {
"big_image": [
{
"src": "",
"url": {
action:"",
url:""
},
"title": ""
}
],
"left": [],
"right": []
}
},
{
template_intro:"新人专享",
dialog:"newUserFloor-template",
template_name:"newUserFloor",
... ... @@ -555,6 +678,28 @@ var Button=[
}
},
{
template_intro:"自定义参数",
dialog:"paramsGroup-template",
template_name:"paramsGroup",
data: {
"title": "",
"more": "",
"more_url": "",
"list": [
{
"title": "",
"params": ""
}
]
}
},
{
template_intro:"自定义参数图片",
dialog:"noEdit-template",
template_name:"",
data: {}
},
{
template_intro:"站内公告",
dialog:"noEdit-template",
template_name:"announcement",
... ... @@ -585,7 +730,7 @@ var Button=[
dialog:"multiLabelImage-template",
template_name:"multiLabelImage",
data: {
"label_list":[
"label":[
{
"title": "",
"url": {
... ...
... ... @@ -144,7 +144,7 @@ $(document).on("click", '#multiLabelImage-addImage', function() {
});
$(document).on("click", '#multiLabelImage-addOne', function() {
Bll.module.contentData.data.label_list.push({
Bll.module.contentData.data.label.push({
"src": "",
"url": {
"action": "",
... ... @@ -154,6 +154,18 @@ $(document).on("click", '#multiLabelImage-addOne', function() {
Bll.renderDialog("multiLabelImage-template");
});
$(document).on("click", '#imageGroup-addOne', function() {
Bll.module.contentData.data.list.push({
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
});
Bll.renderDialog("imageGroup-template");
});
$(document).on("click", '#matchImage-addOne', function() {
Bll.module.contentData.data.list.push({
"title": "",
... ... @@ -164,6 +176,35 @@ $(document).on("click", '#matchImage-addOne', function() {
});
Bll.renderDialog("matchImage-template");
});
/*自定义参数*/
$(document).on("click", '.paramsGroupDel', function() {
console.log($(this).data("index"));
Bll.module.contentData.data.list.splice($(this).data("index"));
Bll.renderDialog("paramsGroup-template");
});
$(document).on("click", '#paramsGroup-addOne', function() {
Bll.module.contentData.data.list.push(
{
"title": "",
"params": ""
}
);
Bll.renderDialog("paramsGroup-template");
});
/*新人专享*/
$(document).on("click", '#newUserFloor-addBanner', function() {
Bll.module.contentData.data.banner_image.push(
{
"src": "",
"url": {
"action": "",
"url": ""
},
"title": ""
}
);
Bll.renderDialog("newUserFloor-template");
});
$(document).on("click", "#sub_btn", function() {
var data = {
... ...
... ... @@ -60,13 +60,13 @@
<div class="form-group">
[[each contentData.data.label as item index]]
<label class="control-label">标签[[index+1]]:</label>
<input type="text" class="observe" value="[[item.title]]" data-field="label_list.[[index]].title" required="required" style="width: 100px">
<input type="text" class="observe" value="[[item.title]]" data-field="label.[[index]].title" required="required" style="width: 100px">
<label class="control-label">跳转目的</label>
<select name="goTo" class="observe" value="[[item.url.action]]" data-field="label_list.[[index]].url.action" style="width: 120px" >
<select name="goTo" class="observe" value="[[item.url.action]]" data-field="label.[[index]].url.action" style="width: 120px" >
[[layout action_template]]
</select>
<label>跳转地址</label>
<input type="text" class="observe" value="[[item.url.url]]" data-field="label_list.[[index]].url.url" required="required" style="width: 120px" /><br>
<input type="text" class="observe" value="[[item.url.url]]" data-field="label.[[index]].url.url" required="required" style="width: 120px" /><br>
[[/each]]
</div>
<a href="JavaScript:;" id="multiLabelImage-addOne" class="btn btn-primary btn-xs">添加标签</a>
... ... @@ -323,6 +323,200 @@
</tbody>
</table>
</div>
<a href="JavaScript:;" id="imageGroup-addOne" class="btn btn-primary btn-xs">添加图片</a>
</div>
</script>
<!--自定义参数-->
<script type="text/template" id="paramsGroup-template">
<div class="panel-body" id="paramsGroup-baseFrom">
<div class="form-group">
<label class="col-sm-2 control-label">标题设置:</label>
<div class="col-sm-4">
<input type="text" class="form-control observe" value="[[contentData.data.title]]" required="required" data-field="title">
</div>
<label class="col-sm-2 control-label">更多设置:</label>
<div class="col-sm-4">
<input type="text" value="[[contentData.data.more]]" class="form-control observe" data-field="more">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">跳转地址</label>
<div class="col-sm-4">
<input value="[[contentData.data.more_url.url]]" class="form-control observe" required="required" data-field="more_url.url"/>
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</div>
<div id="paramsGroup-bottom">
<ul id="sortable" class="sortable" style="margin:10px;width:100%;">
[[each contentData.data.list as item index]]
<li>
<table style="width:100%;z-index:-1;">
<tbody>
<tr>
<td width="100px">标题:<input type="text" required style="width: 60px;" class="observe" value="[[item.title]]" data-field="list.[[index]].title"></td>
<td>参数:<input type="text" style="width:300px;" class="observe" value="[[item.params]]" data-field="list.[[index]].params"></td>
<td><button class="btn btn-danger btn-sm paramsGroupDel" type="button" data-index="[[index]]">删除</button></td>
</tr>
</tbody>
</table>
<p style="color:#999">如:http://list.yohobuy.com/?gender=1,3&amp;msort=1,3 参数为:gender=1,3&amp;msort=1,3</p>
</li>
[[/each]]
</ul>
<button type="button" class="btn btn-sm" id="paramsGroup-addOne">添加一个</button>
</div>
</div>
</script>
<!--新人专享-->
<script type="text/template" id="newUserFloor-template">
<div class="panel-body" id="newUserFloor-baseFrom">
<div class="new_user_floor">
<p>标题 : <input type="text" value="[[contentData.data.title.name]]" class="observe" data-field="title.name"> 更多名称 : <input type="text" value="[[contentData.data.title.more_name]]" style="width:50px;" class="observe" data-field="title.more_name"> </p>
<p>
更多链接 : <select name="goTo" class="observe" value="[[contentData.data.title.more_url.action]]" data-field="title.more_url.action">
[[layout action_template]]
</select>
<input value="[[contentData.data.title.more_url.url]]" class="observe" required="required" data-field="title.more_url.url"/>
</p>
<p>活动 ID <input type="text" class="observe" value="[[contentData.data.title.active_id]]" data-field="title.active_id"></p>
<p><input type="button" class="btn btn-info btn-xs" value="添加banner" style="margin:10px;" id="newUserFloor-addBanner"></p>
</div>
<div id="newUserFloor-bottom">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each contentData.data.banner_image as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="banner_image.[[index]].src"/></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="form-control observe" value="[[item.url.action]]" data-field="banner_image.[[index]].url.action">
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="form-control observe" required="required" data-field="banner_image.[[index]].url.url"/>
</div>
<div class="col-sm-12">
<input placeholder="图片描述" value="[[item.title]]" class="form-control observe" required="required" data-field="banner_image.[[index]].title"/>
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</div>
</div>
</script>
<!--有序焦点-->
<script type="text/template" id="debrisSlider-template">
<div class="panel-body" id="debrisSlider-baseFrom">
<div class="debris_slider">
<p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加左图" style="margin:10px;" id="select-left-pic"></p>
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each contentData.data.left as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="left.[[index]].src"/></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="observe" value="[[url.action]]" data-field="left.[[index]].action">
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="observe" required="required" data-field="left.[[index]].url.url"/>
</div>
<div class="col-sm-12">
<input placeholder="图片描述" value="[[item.title]]" class="observe" required="required" data-field="left.[[index]].title"/>
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
<p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加中间图" style="margin:10px;" id="select-big-pic"></p>
<div class="image-info">
<ul class="sortable" style="width:100%;">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each contentData.data.big_image as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="big_image.[[index]].src"/></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="observe" value="[[url.action]]" data-field="big_image.[[index]].action">
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="observe" required="required" data-field="big_image.[[index]].url.url"/>
</div>
<div class="col-sm-12">
<input placeholder="图片描述" value="[[item.title]]" class="observe" required="required" data-field="big_image.[[index]].title"/>
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</ul>
</div>
<p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加右图" style="margin:10px;" id="select-right-pic"></p>
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each contentData.data.right as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="right.[[index]].src"/></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="observe" value="[[url.action]]" data-field="right.[[index]].action">
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="observe" required="required" data-field="right.[[index]].url.url"/>
</div>
<div class="col-sm-12">
<input placeholder="图片描述" value="[[item.title]]" class="observe" required="required" data-field="right.[[index]].title"/>
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</div>
</div>
</script>
<!--select选项-->
... ... @@ -364,4 +558,31 @@
<script type="text/template" id="noEdit-template">
<div>固定内容,暂时无法编辑!</div>
</script>
<!--有序焦点-->
<script type="text/template" id="debrisSlider-grid">
<li>
<table style="width:100%;z-index:-1;" id="tableImageBox">
<tbody>
<tr>
<td style="width:100px;"><img class="bImgBox" src="[[src]]"></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="recommendContent-observe" value="[[url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[url.url]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</div>
<div class="col-sm-12">
<input placeholder="图片描述" value="[[url.title]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</div>
</td>
<td><input type="button" value="更换图片" class="btn btn-info btn-xs change-big-pic" data-id=""> <input class="btn btn-danger btn-xs del-pic" type="button" value="删除" data-id=""></td>
</tr>
</tbody>
</table>
</li>
</script>
\ No newline at end of file
... ...
... ... @@ -184,10 +184,10 @@
</div>
[[else if module.contentData.template_name=='imageGroup']]
<div class="custom-group-list focus">
<div class="custom-group-box">
<div class="image-group-box">
<div class="row">
[[each module.contentData.data.list as item index]]
<div class="col-lg-[[12/(module.contentData.data.show_num?module.contentData.data.show_num:4)]]">
<div class="col-lg-[[12/(module.contentData.data.show_num=='0'?3:module.contentData.data.show_num)]]">
<img src="[[item.src]]" class="image-group-box-[[module.contentData.data.show_num==1?'big':'small']]">
</div>
[[/each]]
... ...