Authored by wangwei

好店推荐楼层

... ... @@ -2006,22 +2006,34 @@
</div>
<div class="form-group">
<div class="col-sm-6">
<label style="cursor: pointer;"><input type="checkbox" name="isShopRecommend" value="N" [[contentData.data.title.isShopRecommend=='N'?'checked':'']]>固定推荐</label>
<label style="cursor: pointer;"><input type="checkbox" name="isShopRecommend" value="Y" [[contentData.data.title.isShopRecommend=='Y'?'checked':'']]>>个性化推荐</label>
<input type="hidden" id="isShopRecommend" for="checkbox" value="[[contentData.data.isShopRecommend]]" />
<input type="radio" class="isShopRecommend" name="isShopRecommend" value="N" [[contentData.isShopRecommend=="N"?"checked":""]]> 固定推荐
<input type="radio" class="isShopRecommend" name="isShopRecommend" value="Y" [[contentData.isShopRecommend=="Y"?"checked":""]]> 个性化推荐&emsp;
<input type="hidden" id="isShopRecommend" for="radio" value="[[contentData.isShopRecommend]]" />
</div>
<div class="col-sm-6">
</div>
</div>
<div class="form-group">
<div class="col-sm-6">
<div class="col-sm-10" id="shopRecommendTip" style="display: none">
<span style="color:red">提示:选择频道后无需手动配置,将根据大数据个性化算法,抓取内容展示给用户。</span>
<span style="color:red" id="isRecommendInfo" style="display: none">提示:此处配置的内容,将按顺序固定展示。</span>
</div>
<div class="col-sm-6">
<div class="col-sm-10" id="shopBaseTip">
<span style="color:red" style="display: none">提示:此处配置的内容,将按顺序固定展示。</span>
</div>
</div>
<div>
<div class="form-group" id="shopRecommendDiv" style="display: none">
<div class="col-sm-12">
<select name="shopChannelId" class="shopChannelId observe form-control input-form" value="[[contentData.shopChannelId]]" data-field="contentData.shopChannelId">
<option value="0">选择频道</option>
<option value="1">男生</option>
<option value="2">女生</option>
<option value="3">潮童</option>
<option value="4">创意生活</option>
</select>
</div>
</div>
<div id="shopBaseDiv">
<p><input type="button" name="select-pic" class="btn btn-info btn-xs addBtn" value="添加店铺" data-limit="12" style="margin:10px;" data-event="shopRecommend.list"></p>
<ul class="draggable" data-array="data.list">
[[each contentData.data.list as item index]]
... ... @@ -2030,7 +2042,7 @@
<tbody>
<tr>
<td align="center">[[index+1]]<br/>店铺</td>
<td align="center"><input type="file" name="file" value="[[item.src]]" class="observe" data-field="list.[[index]].src" required/></td>
<td align="center"><input type="file" name="file" value="[[item.src]]" class="shopRecommendRequired observe" data-field="list.[[index]].src" /></td>
<td>
<div class="form-group">
<div class="col-sm-10">
... ... @@ -2046,12 +2058,12 @@
</div>
</td>
<td align="center">
<input type="text" placeholder="店铺id" value="[[item.shopId]]" class="observe number form-control input-form" data-field="list.[[index]].shopId" required/>
<input type="text" placeholder="店铺id" value="[[item.shopId]]" class="shopRecommendRequired observe number form-control input-form" data-field="list.[[index]].shopId"/>
</td>
</tr>
<tr>
<td align="center">商品</td>
<td align="center"><input type="file" name="file" value="[[item.goods0.src]]" class="observe" data-field="list.[[index]].goods0.src" required/></td>
<td align="center"><input type="file" name="file" value="[[item.goods0.src]]" class="shopRecommendRequired observe" data-field="list.[[index]].goods0.src" /></td>
<td>
<div class="form-group">
<div class="col-sm-10">
... ... @@ -2069,7 +2081,7 @@
</tr>
<tr>
<td align="center">商品</td>
<td align="center"><input type="file" name="file" value="[[item.goods1.src]]" class="observe" data-field="list.[[index]].goods1.src" required/></td>
<td align="center"><input type="file" name="file" value="[[item.goods1.src]]" class="shopRecommendRequired observe" data-field="list.[[index]].goods1.src" /></td>
<td>
<div class="form-group">
<div class="col-sm-10">
... ... @@ -2092,17 +2104,6 @@
[[/each]]
</ul>
</div>
<div class="form-group" style="display: none">
<div class="col-sm-12">
<select name="channelId" class="observe form-control input-form" value="[[contentData.shopChannelId]]">
<option value="0">选择频道</option>
<option value="1">男生</option>
<option value="2">女生</option>
<option value="3">潮童</option>
<option value="4">创意生活</option>
</select>
</div>
</div>
</script>
<!--VIP专享-->
... ...
... ... @@ -76,7 +76,7 @@
<div class="shopRecommend">
<p class="title"><span>[[module.contentData.data.title.name]]</span>
</p>
[[if module.contentData.data.isShopRecommend=='N']]
[[if module.contentData.isShopRecommend=='N']]
[[each module.contentData.data.list as item i]]
[[if i == 0]]
<div class="recommend-info">
... ...
... ... @@ -1236,6 +1236,8 @@ var Button = [
template_intro: "好店推荐",
__title:"好店推荐",
dialog: "shopRecommend-template",
isShopRecommend:"",
shopChannelId:"",
data: {
"title": {
"name": "",
... ... @@ -1245,8 +1247,6 @@ var Button = [
"url": ""
}
},
"isShopRecommend":"",
"shopChannelId":"",
"list": [
{
"url": {
... ...
... ... @@ -354,9 +354,7 @@ var addObj = {
"action": "",
"url": ""
}
},
"isShopRecommend":"",
"shopChannelId":""
}
},
vipUse_banner_image: {//新人专享->banner
"src": "",
... ...
... ... @@ -84,6 +84,19 @@ var Bll = {
return false;
}
var couponFlag = true;
//好店推荐切换radio,增加/删除校验
var shopRecommendFlag = false;
if(module.contentData.template_name == 'shopRecommend') {
if(module.contentData.isShopRecommend=="N"||module.contentData.isShopRecommend==""){
$(".shopRecommendRequired").attr("required",true);
module.contentData.shopChannelId='';
module.contentData.isShopRecommend="N"
}else{
$(".shopRecommendRequired").attr("required",false);
}
}
if (Validate[module.contentData.template_name]) {
Validate[module.contentData.template_name].forEach(function (item) {
couponFlag = item.fn(module.contentData);
... ... @@ -487,9 +500,12 @@ $(document).on("click", ".del", function () {//删除
$(document).on("click", ".edit", function () {
var index = $(this).data("index");
var item = Bll.contentDatas[currIndex][index];
Bll.module = $.extend(true, {}, item);
Bll.toast(index, Bll.module);
if(item.contentData.template_name=='shopRecommend'){
var _shopRecommendFlag = item.contentData.isShopRecommend==''?"N":item.contentData.isShopRecommend;
changeShopRecommendDivShow(_shopRecommendFlag);
}
});
/*根据limit判断最多添加条数, 根据event判断添加的类型, data-event:template_name + "-template"*/
... ... @@ -661,6 +677,20 @@ $(document).on("click", '.is_show_name', function () {
Bll.renderDialog("imageList-template");
});
//*****************************************************************//
//*****************************************************************//
/*好店推荐*/
$(document).on("click", '.isShopRecommend', function () {
var _isShopRecommend = $(this).val();
Bll.module.contentData.isShopRecommend = _isShopRecommend;
//Bll.renderDialog("shopRecommend-template");
//切换到推荐
changeShopRecommendDivShow(_isShopRecommend)
});
$(document).on("change", '.shopChannelId', function () {
Bll.module.contentData.shopChannelId = $(this).val();
//Bll.renderDialog("shopRecommend-template");
});
//*****************************************************************//
/*推荐(标题 + 12张图)*/
$(document).on("change", '#recommendContentFive-is_show', function () {
Bll.module.contentData.data.title.is_show = 1 - Bll.module.contentData.data.title.is_show;
... ... @@ -839,7 +869,6 @@ $(document).on("click", "#sub_btn", function () {
contentData.data.begin_time = dateStrToSeconds(contentData.data.begin_time);
contentData.data.end_time = dateStrToSeconds(contentData.data.end_time);
}
data.content[i] = JSON.stringify(common.util.__ArrayToObj(contentData));
data.content[i] = JSON.stringify(common.util.__ArrayToObj(Bll.contentDatas[currIndex][i].contentData));
if (Bll.contentDatas[currIndex][i].id) {
... ... @@ -1616,3 +1645,18 @@ function validateRollingOverContent(data) {
return errArr;
}
//切换好店推荐div是否展示
function changeShopRecommendDivShow(shopRecommendFlag){
if(shopRecommendFlag=='Y'){
$("#shopBaseTip").css('display','none');
$("#shopRecommendTip").css('display','block');
$("#shopBaseDiv").css('display','none');
$("#shopRecommendDiv").css('display','block');
}else if(shopRecommendFlag=='N'){
//切换到基础
$("#shopBaseTip").css('display','block');
$("#shopRecommendTip").css('display','none');
$("#shopBaseDiv").css('display','block');
$("#shopRecommendDiv").css('display','none');
}
}
\ No newline at end of file
... ...