Authored by 马力

Merge branch 'test5.6' into gray

# Conflicts:
#	code/apps/resource/views/__partail/jiangming.html
... ... @@ -119,10 +119,12 @@ module.exports=function(app) {
app.post("/product/queryProductPicBySkn","basegoods_queryProductPicBySkn");
app.post("/basegoods/queryProductColors","basegoods_queryProductColors");
app.post("/basegoods/queryProductLabels","basegoods_queryProductLabels");
app.post("/product/queryProductInfoBySkns","basegoods_queryProductInfoBySkns");
app.post("/product/searchProductDetail","basegoods_searchProductDetail");
... ...
... ... @@ -5,16 +5,14 @@
[[each data as item index]]
<!-- 店招模块 -->
[[if item.moduleType == 'ShopBanner']]
[[if templateType == '2']]
<!-- 展示装修数据 -->
[[if item.moduleData]]
<div class="app-top-banner">
<div class="app-shop-banner modular-editor" data-type="ShopBanner" data-title="编辑店招模块" data-index="[[index]]" non-delete="true">
<img src="[[item.moduleData.data[0].pic]]" alt="#" class="img-item">
</div>
<div style="position: relative">
<div class="app-shop-info"><label><input class="appShopInfo" name="appShopInfo" type="checkbox" [[item.moduleData.data[0].showShopInfo ? 'checked' : '']] />展示店铺介绍 </label></div>
<img src="/static/assets/images/decorator/app-shop-intro.png" alt="#" class="app-shop-intro">
</div>
<img src="/static/assets/images/decorator/tab.png" alt="#" class="app-shop-intro">
</div>
[[else]]
<!--展示默认的-->
... ... @@ -22,15 +20,29 @@
<div class="app-shop-banner modular-editor" data-type="ShopBanner" data-title="编辑店招模块" data-index="[[index]]" non-delete="true">
<img src="/static/assets/images/decorator/yoho-logo.png" alt="#" class="logo">
</div>
<div style="position: relative">
<div class="app-shop-info"><label><input class="appShopInfo" name="appShopInfo" type="checkbox" />展示店铺介绍 </label></div>
<img src="/static/assets/images/decorator/app-shop-intro.png" alt="#" class="app-shop-intro">
<img src="/static/assets/images/decorator/tab.png" alt="#" class="app-shop-intro">
</div>
[[/if]]
[[else]]
<!-- 展示装修数据 -->
[[if item.moduleData]]
<div class="app-top-banner">
<div class="app-shop-banner modular-editor" data-type="ShopBanner" data-title="编辑店招模块" data-index="[[index]]" non-delete="true" non-added="true">
<img src="[[item.moduleData.data[0].pic]]" alt="#" class="img-item">
</div>
<img src="/static/assets/images/decorator/tab.png" alt="#" class="app-shop-intro">
</div>
[[else]]
<!--展示默认的-->
<div class="app-top-banner">
<div class="app-shop-banner modular-editor" data-type="ShopBanner" data-title="编辑店招模块" data-index="[[index]]" non-delete="true" non-added="true">
<img src="/static/assets/images/decorator/yoho-logo.png" alt="#" class="logo">
</div>
<img src="/static/assets/images/decorator/tab.png" alt="#" class="app-shop-intro">
</div>
[[/if]]
[[/if]]
[[/if]]
<!-- 商品列表 -->
[[if item.moduleType == 'ProductList']]
... ...
... ... @@ -51,11 +51,19 @@ var Bll = {
Bll.base = new base();
// 加载模板列表
let index = 0;
let defaltFlag = true;
$.each(shopTemplates, function(_index, template) {
if(template.flag && template.flag === 1) {
index = _index;
Bll.templateType = template.templateType;
return;
if(defaltFlag){
if(template.status == 2){
defaltFlag = false;
index = _index;
Bll.templateType = template.templateType;
return;
}else if(template.flag && template.flag === 1) {
index = _index;
Bll.templateType = template.templateType;
return;
}
}
});
Bll.renderTemplateList(index);
... ... @@ -830,6 +838,7 @@ var Bll = {
columns: [
{
display: '直播封面',
width:250,
render: function(item) {
return common.util.__template2($('#upload-image-template').html(), {item: item});
}
... ... @@ -842,6 +851,7 @@ var Bll = {
},
{
display: '直播介绍',
width:250,
render: function(item) {
var htmlArr = [];
htmlArr.push('<div data-index="' + item.__index + '">');
... ... @@ -1216,21 +1226,6 @@ var Bll = {
callback: function() {
let validation = false;
let moduleType = Bll.moduleDataList[index].moduleType;
if(moduleType == 'RecommendProduct' || moduleType == 'AppRecommendProduct') {
validation = Bll.validator.validateModule(moduleType, Bll.recommendProduct);
//获取推荐商品详细信息
Bll.getRecommendProductDetailData();
if(searchProductInfo == null || searchProductInfo === undefined || searchProductInfo.length <= 0){
common.util.__tip('推荐商品模块自动获取该店铺下商品为空,请先在该店铺下添加可售商品!', 'warning');
return;
}
} else {
validation = Bll.validator.validateModule(moduleType, Bll.moduleGrid.__rows);
}
if(! validation) {
return false;
}
// 单模块校验通过
Bll.moduleDataList[index].dataValid = true;
... ... @@ -1243,11 +1238,33 @@ var Bll = {
}
if(moduleType == 'RecommendProduct' || moduleType == 'AppRecommendProduct') {
validation = Bll.validator.validateModule(moduleType, Bll.recommendProduct);
Bll.saveRecommendProduct(index);
var displayType = Bll.recommendProduct.displayType;
if(displayType == 1){// 根据skn查询
sknList = Bll.recommendProduct.sknList;
if(sknList.length >0){
var productInfo = Bll.getProductDetailBySkns(sknList.toString());
Bll.moduleDataList[index].moduleData.productInfo = productInfo;
}
}else if(displayType == 0){ // 通过搜索查询商品信息;
var lineNumber = Bll.recommendProduct.lineNumber;
var order = Bll.moduleDataList[index].moduleData.data[0].order;
var shopId = Bll.shopId;
searchProductInfo = Bll.searchProductDetail(lineNumber, order, shopId);
Bll.moduleDataList[index].moduleData.productInfo = searchProductInfo;
if(searchProductInfo == null || searchProductInfo === undefined || searchProductInfo.length <= 0){
common.util.__tip('推荐商品模块自动获取该店铺下商品为空,请先在该店铺下添加可售商品!', 'warning');
return;
}
}
} else {
validation = Bll.validator.validateModule(moduleType, Bll.moduleGrid.__rows);
Bll.moduleDataList[index].moduleData.data = Bll.moduleGrid.__rows;
}
if(! validation) {
return false;
}
// 处理模块数据,增加资源位标识,用于热点分析
$.each(Bll.moduleDataList[index].moduleData.data, function(index, item) {
item.id = Bll.generateRandomNumber();
... ...
... ... @@ -23,7 +23,7 @@
/* shop banner + shop intro */
.app-top-banner {
height: 260px;
/*height: 260px;*/
}
.app-shop-info{
... ... @@ -51,7 +51,7 @@
.app-shop-intro {
position: relative;
z-index: 11;
top: -20px;
/*top: -20px;*/
}
/* 上传店铺banner图片 */
... ...