Authored by dongjunjie

店铺装修

... ... @@ -47,7 +47,7 @@ var g = new common.grid({
display: "包含品牌",
name: "brands",
render: function(item) {
//console.log(item);
console.log(item);
if (item.brands instanceof Array && item.brands.length > 0) {
var html = '';
$.each(item.brands, function(i, value) {
... ... @@ -86,7 +86,7 @@ var g = new common.grid({
if (item.checkStatus) {
return ENUM.checkStatus[item.checkStatus]
} else {
return '装修';
return '装修';
}
}
}, {
... ... @@ -94,12 +94,22 @@ var g = new common.grid({
render: function(item) {
var HtmArr = [];
if(item.checkStatus == 200){
if(+item.checkStatus == 200){
HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/view/'+item.id+'/" class="btn btn-info btn-xs">装修查看</a>');
}else {
HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/editor/'+item.id+'/" class="btn btn-success btn-xs">装修编辑</a>');
}
if (item.checkStatus == 900) {
if(item.passStatus && +item.passStatus == 1){
if(+item.shopStatus == 1){
// 1开启 0 关闭
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class="closeshops btn btn-danger btn-xs">关店</a>');
}else{
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class=" openshops btn btn-success btn-xs">开店</a>');
}
}
if (+item.checkStatus == 900) {
HtmArr.push('<a href="javascript:void(0)" class="btn btn-warning btn-xs commentBtn" data-comment="'+item.comment+'">驳回理由</a>');
}
... ... @@ -124,4 +134,29 @@ $(document).on('click', ".commentBtn", function() {
function(){},
function(){}
);
});
var Bll={
toast:function(content,url,id){
common.dialog.confirm("温馨提示",content,function(){
common.util.__ajax({
url:url,
data:{shopsId:id}
},function(){
g.reload();
});
});
}
}
//关闭店铺
$('#basicTable').on('click', '.closeshops', function() {
var item=g.rows[$(this).data("index")];
Bll.toast("确定要关闭此店铺吗?","/supplier/store/closeShops",item.shopsId);
});
//开启店铺
$('#basicTable').on('click', '.openshops', function() {
var item=g.rows[$(this).data("index")];
Bll.toast("确定要开启此店铺吗?","/supplier/store/openShops",item.shopsId);
});
\ No newline at end of file
... ...
... ... @@ -9,22 +9,24 @@ var curPlatform = "shopWeb-pc"; //当前渲染页面用的模板名称
var curTemplateType = "2"; //当前模板类型 1:基础模板,2:经典模板
var shopType = 1; //店铺类型 1:单品牌,2:多品牌
var shopOperate = 'view'; //操作 editor:可编辑, view:查看不可编辑
var defaultSrc = "http://cdn.yoho.cn/yohobuy-portal/assets/images/shop.png"; //初始化默认图片路径
var ENUM = {
"editor-largePic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
"editor-smallPic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
"editor-largePic":{"src": defaultSrc, "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
"editor-largePic2":{"position":"", "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
"editor-smallPic":{"src": defaultSrc, "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
"editor-brand":{"position":"", "name":"", "url":""},
"editor-recommend": {"position":"", "name":"", "enName":"", "src":"", "url":"","isShowInApp":"Y"},
"editor-hotRecommend":{"position":"", "src":"", "url":""},
"editor-signboard":{"position":"", "src":"", "url":"","startTime": "","endTime": "","publishStatus": 0},
"editor-recommend": {"position":"", "name":"", "enName":"", "src":defaultSrc, "url":"","isShowInApp":"Y"},
"editor-hotRecommend":{"position":"", "src":defaultSrc, "url":""},
"editor-signboard":{"position":"", "src":defaultSrc, "url":"","startTime": "","endTime": "","publishStatus": 0},
"editor-newGoodTab":{"position":"", "name":"", "url":""},
"editor-hotGoodTab":{"position":"", "name":"", "url":""},
"editor-newProduct":{"productId":"", "position":"", "productName":"", "productPrice":"", "src":"", "url":""},
"editor-hotProduct":{"productId":"", "position":"", "productName":"", "productPrice":"", "src":"", "url":""}
"editor-newProduct":{"productId":"", "position":"", "productName":"", "productSkn":"", "salesPrice":"", "src":"", "url":""},
"editor-hotProduct":{"productId":"", "position":"", "productName":"", "productSkn":"", "salesPrice":"", "src":"", "url":""}
}; //添加一条不同弹层使用的初始化模板
var resourcesNew = {
"shopTopBanner":{
"id":"",
"data": [{"shopSrc": "", "detailSrc": "", "isShowShopName": "Y"}]
"data": [{"shopSrc": defaultSrc, "detailSrc": defaultSrc, "isShowShopName": "N"}]
},
"navigationBar":{
"id":"",
... ... @@ -32,19 +34,13 @@ var resourcesNew = {
},
"largeSlideImg":{
"id":"",
"data": [
{"position": 5, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 4, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 3, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 2, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 1, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}
]
"data": [{"position": 1, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]}]
},
"oneRowTwoColImages":{
"id":"",
"data": [
{"position": 2, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 1, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}
{"position": 2, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]},
{"position": 1, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]}
]
},
"brandBrowse":{
... ... @@ -54,16 +50,16 @@ var resourcesNew = {
"recommend":{
"id":"",
"title":"经典推荐",
"data": [{"position":1, "name":"", "enName":"", "src":"", "url":"","isShowInApp":"Y"}]
"data": [{"position":1, "name":"默认商品", "enName":"", "src":defaultSrc, "url":"","isShowInApp":"Y"}]
},
"hotRecommend":{
"id":"",
"title":"热销推荐",
"data": [{"position":1, "src":"", "url":""}]
"title":"",
"data": [{"position":1, "src":defaultSrc, "url":""}]
},
"signboard":{
"id":"",
"data": [{"position":1, "src":"", "url":"", "startTime": "", "endTime": "", "publishStatus": 0}]
"data": [{"position": 1, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]}]
},
"goodsTabBar":{
"id":"",
... ... @@ -74,14 +70,44 @@ var resourcesNew = {
},
"newProducts":{
"id":"",
"data": [{"productId":"0", "position":1, "productName":"默认商品", "productPrice":"默认价格", "src":"", "url":""}]
"data": []
},
"hotProducts":{
"id":"",
"data": [{"productId":"0", "position":1, "productName":"默认商品", "productPrice":"默认价格", "src":"", "url":""}]
"data": []
},
"allNewProducts":{
"id":"",
"data":[]
},
"allHotProducts":{
"id":"",
"data":[]
},
"shopTopBanner_APP":{
"id":"",
"isUsed":"N",
"data": [{"shopSrc": defaultSrc, "detailSrc": defaultSrc, "isShowShopName": "N"}]
},
"oneRowTwoColImages_APP":{
"id":"",
"isUsed":"N",
"data": [
{"position": 2, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]},
{"position": 1, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]}
]
},
"hotProducts_APP":{
"id":"",
"isUsed":"N",
"data": []
},
"allHotProducts_APP":{
"id":"",
"data":[]
}
} //初始化装修信息json
var shopsId, _id, jsonMain, jsonClone, topNewProducts, topHotProducts;
var shopsId, _id, jsonMain, jsonClone;
getParams();
findDecoration();
... ... @@ -113,10 +139,11 @@ function getParams(){
}
//json渲染模板
function showMain(){
$('#templateSelect').val(curTemplateType);
$('#templateSelect').val(jsonMain.templateType);
$("input[name='brandLevel'][value='"+curTemplateType+"']").attr('checked',"checked");
if(curPlatform == "shopWeb-pc"){
//console.log(jsonMain);
$('#main').empty().html(common.util.__template2($("#"+curPlatform+"-"+curTemplateType).html(),jsonMain));
} else if(curPlatform == "shopWeb-app"){
$('#main').empty().html(common.util.__template2($("#"+curPlatform).html(),jsonMain));
... ... @@ -127,6 +154,12 @@ function showMain(){
}else if(shopType == 1){
$(".model-brand").hide();
}
//标签长度样式自适应
$.each($(".contentpanel-pc .model-showTitle .showTab"),function(){
if($(this).width() > 280){
$(this).css("right",(280-($(this).width()))+"px");
}
})
showEditorIconEvent();
}
//弹窗编辑主流程
... ... @@ -170,27 +203,40 @@ function findDecoration(){
}
},
function(rs) {
//console.log(rs.data);
console.log(rs.data);
if(rs.data){
jsonMain = rs.data;
}
if(jsonMain.templateName){
curTemplateType = jsonMain.templateName;
}
//没有装修信息,初始化装修信息
if($.isEmptyObject(jsonMain.resources)){
jsonMain.resources = $.extend(true,{},resourcesNew);
}
//装修信息中品牌内容为空,初始化品牌
if(jsonMain.resources.brandBrowse.data.length < 1 && jsonMain.brandList){
cloneArr(jsonMain.brandList,jsonMain.resources.brandBrowse.data);
if(jsonMain.brandList){
if(jsonMain.resources.brandBrowse.data.length < 1){
cloneArr(jsonMain.brandList,jsonMain.resources.brandBrowse.data);
}
}else{
common.util.__tip("店铺没有品牌,无法装修,请返回添加品牌!");
return;
}
if(jsonMain.templateType && jsonMain.templateType != "0"){
curTemplateType = jsonMain.templateType;
}
//装修json克隆
jsonClone = $.extend(true,{},jsonMain);
//最新上架,最热商品接口
if(shopOperate == 'editor'){
findTopNewProducts();
findTopHotProducts();
if(!jsonMain.resources.allNewProducts.data || jsonMain.resources.allNewProducts.data.length < 1){
findTopNewProducts();
}
if(!jsonMain.resources.allHotProducts.data || jsonMain.resources.allHotProducts.data.length < 1){
findTopHotProducts();
}
if(!jsonMain.resources.allHotProducts_APP.data || jsonMain.resources.allHotProducts_APP.data.length < 1){
findTopHotProducts_APP();
}
}
showMain();
},true);
... ... @@ -204,7 +250,9 @@ function findTopNewProducts(){
"size": 20
}
},function(rs){
topNewProducts = rs.data;
if(rs.data.product_list){
jsonMain.resources.allNewProducts.data = rs.data.product_list;
}
},true);
}
//Ajax热销商品
... ... @@ -216,23 +264,39 @@ function findTopHotProducts(){
"size": 20
}
},function(rs){
topHotProducts = rs.data;
if(rs.data.product_list){
jsonMain.resources.allHotProducts.data = rs.data.product_list;
}
},true);
}
//Ajax热销商品---APP
function findTopHotProducts_APP(){
common.util.__ajax({
url:'/store/shop-decoration-hotProducts',
data: {
"shopsId": jsonMain.shopsId,
"size": 20
}
},function(rs){
if(rs.data.product_list){
jsonMain.resources.allHotProducts_APP.data = rs.data.product_list;
}
},true);
}
//Ajax保存,暂存:100,提交审核:200
function saveDecoration(submitStatus){
console.log(jsonMain);
common.util.__ajax({
url:'/store/shop-decoration-save',
data: {
"submitStatus": submitStatus,
"shopsId": jsonMain.shopsId,
"platform": jsonMain.platform,
"templateName": jsonMain.templateName,
"templateType": jsonMain.templateType,
"resources": JSON.stringify(jsonMain.resources)
}
},function(rs){
if(rs.data){
//console.log(rs.data);
if(submitStatus == 100){
jsonMain = rs.data;
jsonClone = $.extend(true,{},jsonMain);
... ... @@ -247,7 +311,7 @@ function saveDecoration(submitStatus){
}
//Ajax审核,审核通过:300,驳回:900
function checkDecoration(checkStatus,comment){
if(comment){
if(comment){ //驳回
common.util.__ajax({
url:'/store/shop-decoration-check',
data: {
... ... @@ -256,12 +320,12 @@ function checkDecoration(checkStatus,comment){
"comment": comment
}
},function(rs){
common.util.__tip("审核通过成功!","success");
common.util.__tip("审核驳回成功!","success");
setTimeout(function() {
location.href="/supplier/check/index";
}, 1000);
},true);
}else{
}else{ //通过
common.util.__ajax({
url:'/store/shop-decoration-check',
data: {
... ... @@ -269,7 +333,7 @@ function checkDecoration(checkStatus,comment){
"checkStatus": checkStatus
}
},function(rs){
common.util.__tip("审核驳回成功!","success");
common.util.__tip("审核通过成功!","success");
setTimeout(function() {
location.href="/supplier/check/index";
}, 1000);
... ... @@ -284,28 +348,51 @@ function gridInit(id){
switch (id){
//店铺顶部banner
case "editor-banner":
g = new common.grid({
hash: false,
el:"#"+id,
columns:[
{display:"店铺banner图片", render:function(item){
return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
}},
{display:"是否显示店铺名称", render:function(item){
if(item.isShowShopName == "Y"){
return "<lable><input type='radio' name='isShowShopName' value='Y' checked='checked'>显示店铺名称</lable><br>" +
"<lable><input type='radio' name='isShowShopName' value='N'>不显示店铺名称</lable>";
}else{
return "<lable><input type='radio' name='isShowShopName' value='Y'>显示店铺名称</lable><br>" +
"<lable><input type='radio' name='isShowShopName' value='N' checked='checked'>不显示店铺名称</lable>";
}
}},
{display:"商品详情页banner图片", render:function(item){
return "<input type=file name='DetailbannerImage' id='DetailbannerImage_"+item.__index+"' value='"+item.detailSrc+"' />";
}}
]
});
g.__rows=""||jsonClone.resources.shopTopBanner.data;
if(curPlatform == "shopWeb-pc"){
g = new common.grid({
hash: false,
el:"#"+id,
columns:[
{display:"店铺banner图片", render:function(item){
return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
}},
{display:"是否显示店铺名称", render:function(item){
if(item.isShowShopName == "Y"){
return "<lable><input type='radio' name='isShowShopName' value='Y' checked='checked'>显示店铺名称</lable><br>" +
"<lable><input type='radio' name='isShowShopName' value='N'>不显示店铺名称</lable>";
}else{
return "<lable><input type='radio' name='isShowShopName' value='Y'>显示店铺名称</lable><br>" +
"<lable><input type='radio' name='isShowShopName' value='N' checked='checked'>不显示店铺名称</lable>";
}
}},
{display:"商品详情页banner图片", render:function(item){
return "<input type=file name='DetailbannerImage' id='DetailbannerImage_"+item.__index+"' value='"+item.detailSrc+"' />";
}}
]
});
g.__rows=""||jsonClone.resources.shopTopBanner.data;
}
if(curPlatform == "shopWeb-app"){
g = new common.grid({
hash: false,
el:"#"+id,
columns:[
{display:"店铺banner图片", render:function(item){
return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
}},
{display:"是否显示店铺名称", render:function(item){
if(item.isShowShopName == "Y"){
return "<lable><input type='radio' name='isShowShopName' value='Y' checked='checked'>显示店铺名称</lable><br>" +
"<lable><input type='radio' name='isShowShopName' value='N'>不显示店铺名称</lable>";
}else{
return "<lable><input type='radio' name='isShowShopName' value='Y'>显示店铺名称</lable><br>" +
"<lable><input type='radio' name='isShowShopName' value='N' checked='checked'>不显示店铺名称</lable>";
}
}}
]
});
g.__rows=""||jsonClone.resources.shopTopBanner_APP.data;
}
g.init(g.__rows);
break;
... ... @@ -316,7 +403,7 @@ function gridInit(id){
el:"#"+id,
columns:[
{display:"编号", render:function(item){
return item.__index+1;
return item.__index+1;
}},
{display:"名称", render:function(item){
return "<input class='form-control inputChange' type=text name='name' value='"+item.name+"' data-index='"+item.__index+"' maxlength='5' />";
... ... @@ -332,20 +419,26 @@ function gridInit(id){
//店铺大图资源位
case "editor-largePic":
$('.editorTitle').html("<a href='javascript:' class='btn btn-success addBtn2' style='margin-right: 20px'><i class='fa fa-plus'></i> 添加资源大图</a><span class='largePicAddTip'></span>").css("margin-bottom","10px");
g = new common.grid({
hash: false,
el:"#"+id,
columns:[
{display:"排序", render:function(item){
item.position=item.position || (item.__index+1);
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
}},
{
display:"<div class='row'><div class='col-sm-2'>图片</div><div class='col-sm-3'>链接</div><div class='col-sm-2'>开始时间</div><div class='col-sm-2'>结束时间</div> " +
"<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>",
{display:"<div class='row'><div class='col-sm-2'>图片</div><div class='col-sm-3'>链接</div><div class='col-sm-2'>开始时间</div><div class='col-sm-2'>结束时间</div> " +
"<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>",
render: function (item) {
return resourcesHtmlInit(item,"largePic");
}
}
},
{display:"操作", render:function(item){
if(g.__rows.length > 1){
return "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' />";
}
}}
]
});
g.__rows=""||jsonClone.resources.largeSlideImg.data;
... ... @@ -370,7 +463,12 @@ function gridInit(id){
}
]
});
g.__rows=""||jsonClone.resources.oneRowTwoColImages.data;
if(curPlatform == "shopWeb-pc"){
g.__rows=""||jsonClone.resources.oneRowTwoColImages.data;
}
if(curPlatform == "shopWeb-app"){
g.__rows=""||jsonClone.resources.oneRowTwoColImages_APP.data;
}
g.init(g.__rows);
break;
... ... @@ -460,7 +558,7 @@ function gridInit(id){
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
}},
{display:"图片", render:function(item){
return "<input type=file name='signboardImage' id='signboardImage_"+item.__index+"' value='"+item.src+"' />";
return "<input type=file name='signboardImage' id='hotRecommendImage_"+item.__index+"' value='"+item.src+"' />";
}},
{display:"链接", render:function(item){
return "<input class='form-control inputChange' type=text name='url' value='"+item.url+"' data-index='"+item.__index+"' />";
... ... @@ -492,6 +590,7 @@ function gridInit(id){
//水牌signboard
case "editor-signboard":
$('.editorTitle').html("<a href='javascript:' class='btn btn-success addBtn2' style='margin-right: 20px'><i class='fa fa-plus'></i> 添加水牌</a><span class='largePicAddTip'></span>").css("margin-bottom","10px");
g = new common.grid({
hash: false,
el:"#"+id,
... ... @@ -500,34 +599,16 @@ function gridInit(id){
item.position=item.position || (item.__index+1);
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
}},
{display:"图片", render:function(item){
return "<input type=file name='signboardImage' id='signboardImage_"+item.__index+"' value='"+item.src+"' />";
}},
{display:"链接", render:function(item){
return "<input class='form-control inputChange' type=text name='url' value='"+item.url+"' data-index='"+item.__index+"' />";
}},
{display:"开始时间", render:function(item){
return "<input type=text class='form-control inputChange' readOnly='true' jsaction='time:end:endTime_"+item.__index+"' id='startTime_"+item.__index+"' name='startTime' value='"+item.startTime+"' data-index='"+item.__index+"' />";
}},
{display:"结束时间", render:function(item){
return "<input type=text class='form-control inputChange' readOnly='true' jsaction='time:start:startTime_"+item.__index+"' id='endTime_"+item.__index+"' name='endTime' value='"+item.endTime+"' data-index='"+item.__index+"' />";
}},
{display:"状态", render:function(item){
return "<span style='white-space: nowrap'>" + (item.publishStatus==0?"未发布":"已发布") + "</span>";
}},
{display:"操作", render:function(item){
var htmlPic = "",i=item.__index;
if(i == (g.__rows.length-1) && g.__rows.length > 1){
htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' /><br>";
htmlPic += "<input type=button class='btn btn-info btn-xs addBtn' style='margin-top: 10px' value='添加一条' data-index='"+item.__index+"' />";
}
if(i < (g.__rows.length-1) && g.__rows.length > 1){
htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' />";
{display:"<div class='row'><div class='col-sm-2'>图片</div><div class='col-sm-3'>链接</div><div class='col-sm-2'>开始时间</div><div class='col-sm-2'>结束时间</div> " +
"<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>",
render: function (item) {
return resourcesHtmlInit(item,"signboard");
}
if(i == (g.__rows.length-1) && g.__rows.length == 1){
htmlPic += "<input type=button class='btn btn-info btn-xs addBtn' value='添加一条' data-index='"+item.__index+"' />";
},
{display:"操作", render:function(item){
if(g.__rows.length > 1){
return "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' />";
}
return htmlPic;
}}
]
});
... ... @@ -634,12 +715,7 @@ function gridInit(id){
//新品上架
case "editor-newProduct":
$("#"+id).html("<div id='editor-newProduct-grid' style='width: 500px; float: left'></div><div class='top20List' style='float: left;margin-left: 40px'></div> ");
if(topNewProducts){
$("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),topNewProducts));
}else{
$("#"+id+" .top20List").html("最新上架20条加载失败,请重新加载!");
}
//左侧已选商品
g = new common.grid({
hash: false,
el:"#editor-newProduct-grid",
... ... @@ -659,18 +735,19 @@ function gridInit(id){
});
g.__rows=""||jsonClone.resources.newProducts.data;
g.init(g.__rows);
productTopDataLink(g.__rows);
//右侧热销排名前20商品
if(jsonMain.resources.allNewProducts.data.length > 0){
$("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),jsonMain.resources.allNewProducts));
productTopDataLink(g.__rows);
}else{
$("#"+id+" .top20List").html("<font color='red'>*&nbsp;&nbsp;最新上架20条加载失败,请重新加载页面!</font>");
}
break;
//人气单品
case "editor-hotProduct":
$("#"+id).html("<div id='editor-hotProduct-grid' style='width: 500px; float: left'></div><div class='top20List' style='float: left;margin-left: 40px'></div> ");
if(topHotProducts){
$("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),topHotProducts));
}else{
$("#"+id+" .top20List").html("最新上架20条加载失败,请重新加载!");
}
//左侧已选商品
g = new common.grid({
hash: false,
el:"#editor-hotProduct-grid",
... ... @@ -688,9 +765,27 @@ function gridInit(id){
}}
]
});
g.__rows=""||jsonClone.resources.hotProducts.data;
if(curPlatform == "shopWeb-pc"){
g.__rows=""||jsonClone.resources.hotProducts.data;
//右侧热销排名前20商品
if(jsonMain.resources.allHotProducts.data.length > 0){
$("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),jsonMain.resources.allHotProducts));
productTopDataLink(g.__rows);
}else{
$("#"+id+" .top20List").html("<font color='red'>*&nbsp;&nbsp;最新上架20条加载失败,请重新加载页面!</font>");
}
}
if(curPlatform == "shopWeb-app"){
g.__rows=""||jsonClone.resources.hotProducts_APP.data;
//右侧热销排名前20商品
if(jsonMain.resources.allHotProducts_APP.data.length > 0){
$("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),jsonMain.resources.allHotProducts_APP));
productTopDataLink(g.__rows);
}else{
$("#"+id+" .top20List").html("<font color='red'>*&nbsp;&nbsp;最新上架20条加载失败,请重新加载页面!</font>");
}
}
g.init(g.__rows);
productTopDataLink(g.__rows);
break;
default :
... ... @@ -703,9 +798,24 @@ function freshJson(id,data,status){
case "editor-banner":
if(status == 1){
data[0].isShowShopName = $("input[name='isShowShopName']:checked").val();
cloneArr(data,jsonMain.resources.shopTopBanner.data);
if(curPlatform == "shopWeb-app"){
jsonMain.resources.shopTopBanner_APP.isUsed = "Y";
cloneArr(data,jsonMain.resources.shopTopBanner_APP.data);
}
if(curPlatform == "shopWeb-pc"){
cloneArr(data,jsonMain.resources.shopTopBanner.data);
if(jsonMain.resources.shopTopBanner_APP.isUsed == "N"){
cloneArr(data,jsonMain.resources.shopTopBanner_APP.data);
cloneArr(data,jsonClone.resources.shopTopBanner_APP.data);
}
}
}else if(status == 0){
cloneArr(jsonMain.resources.shopTopBanner.data,data);
if(curPlatform == "shopWeb-app"){
cloneArr(jsonMain.resources.shopTopBanner_APP.data,data);
}
if(curPlatform == "shopWeb-pc"){
cloneArr(jsonMain.resources.shopTopBanner.data,data);
}
}
break;
... ... @@ -727,9 +837,24 @@ function freshJson(id,data,status){
case "editor-smallPic":
if(status == 1){
cloneArr(sortJson(data,1),jsonMain.resources.oneRowTwoColImages.data);
if(curPlatform == "shopWeb-app"){
jsonMain.resources.oneRowTwoColImages_APP.isUsed = "Y";
cloneArr(sortJson(data,1),jsonMain.resources.oneRowTwoColImages_APP.data);
}
if(curPlatform == "shopWeb-pc"){
cloneArr(sortJson(data,1),jsonMain.resources.oneRowTwoColImages.data);
if(jsonMain.resources.oneRowTwoColImages_APP.isUsed == "N"){
cloneArr(sortJson(data,1),jsonMain.resources.oneRowTwoColImages_APP.data);
cloneArr(sortJson(data,1),jsonClone.resources.oneRowTwoColImages_APP.data);
}
}
}else if(status == 0){
cloneArr(jsonMain.resources.oneRowTwoColImages.data,data);
if(curPlatform == "shopWeb-app"){
cloneArr(jsonMain.resources.oneRowTwoColImages_APP.data,data);
}
if(curPlatform == "shopWeb-pc"){
cloneArr(jsonMain.resources.oneRowTwoColImages.data,data);
}
}
break;
... ... @@ -793,9 +918,24 @@ function freshJson(id,data,status){
case "editor-hotProduct":
if(status == 1){
cloneArr(sortJson(data,1),jsonMain.resources.hotProducts.data);
if(curPlatform == "shopWeb-app"){
jsonMain.resources.hotProducts_APP.isUsed = "Y";
cloneArr(sortJson(data,1),jsonMain.resources.hotProducts_APP.data);
}
if(curPlatform == "shopWeb-pc"){
cloneArr(sortJson(data,1),jsonMain.resources.hotProducts.data);
if(jsonMain.resources.hotProducts_APP.isUsed == "N"){
cloneArr(sortJson(data,1),jsonMain.resources.hotProducts_APP.data);
cloneArr(sortJson(data,1),jsonClone.resources.hotProducts_APP.data);
}
}
}else if(status == 0){
cloneArr(jsonMain.resources.hotProducts.data,data);
if(curPlatform == "shopWeb-app"){
cloneArr(jsonMain.resources.hotProducts_APP.data,data);
}
if(curPlatform == "shopWeb-pc"){
cloneArr(jsonMain.resources.hotProducts.data,data);
}
}
break;
... ... @@ -965,9 +1105,13 @@ function showEditorIconEvent(){
var _this = $(this);
var editorModelId = $(this).attr("data-toggle");
var editorModelTitle = $(this).attr("data-title");
var editorIcon = "<div class='editorBorder'></div>" +
"<a class='editorIcon' href='javascrip:'>编辑</a>"
var editorIcon = "";
if(editorModelId == "editor-brand-app" || editorModelId == "editor-largePic-app" || editorModelId == "editor-recommend-app"){
editorIcon += "<div class='editorBorder' style='border: 5px solid #ff69b4'></div>"
}else{
editorIcon += "<div class='editorBorder'></div>"
}
editorIcon += "<a class='editorIcon' href='javascript:'>编辑</a>"
_this.append(editorIcon);
//编辑事件
editorIconEvent(editorModelTitle,editorModelId);
... ... @@ -1006,14 +1150,18 @@ function untilEditorEvent(id){
var _index = obj.key.replace(/^file_onComplete_recommendImage_/,'');
g.__rows[_index].src = obj.data;
}
if(/^file_onComplete_hotRecommendImage_/.test(obj.key)){
var _index = obj.key.replace(/^file_onComplete_hotRecommendImage_/,'');
g.__rows[_index].src = obj.data;
}
if(/^file_onComplete_signboardImage_/.test(obj.key)){
var _index = obj.key.replace(/^file_onComplete_signboardImage_/,'');
g.__rows[_index].src = obj.data;
var _indexList = _index.split("_");
g.__rows[_indexList[0]].data[_indexList[1]].src = obj.data;
}
});
$("#"+id+" nav").hide();
$(".modal-dialog").css("width","900px");
$(".modal-dialog .modal-body .editor-dialog").css("max-height","650px");
$(".modal-dialog").css("width","960px");
$(".modal-dialog .modal-body .editor-dialog").css("overflow-y","auto");
$(".modal-dialog .modal-body .editor-dialog").css("overflow-x","hidden");
}
... ... @@ -1025,11 +1173,16 @@ function resourcesHtmlInit(item,resName){
htmlPic += "<div class='row'>" +
"<div class='col-sm-2'><input type=file name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' /></div>" +
"<div class='col-sm-3'><input type=text class='form-control inputChange' name='url' value='"+ picList[i].url +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-2'>" +
"<input type=text class='form-control inputChange' readOnly='true' jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-2'>" +
"<input type=text class='form-control inputChange' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-1'><span style='white-space: nowrap;'>"+ (picList[i].publishStatus==0?"未发布":"已发布") +"</span></div>" +
"<div class='col-sm-2'>";
if(i>0){
htmlPic += "<input type=text class='form-control' disabled jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' />" +
"<span style='color: #999; font-size: 12px'>*上一条结束时间</span>";
}else{
htmlPic += "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' data-index='"+ item.__index +"_"+ i +"' />";
}
htmlPic += "</div><div class='col-sm-2'>" +
"<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-1'><span class='publishStatus' style='white-space: nowrap; line-height: 40px'>"+ checkdate(picList[i].startTime,picList[i].endTime) +"</span></div>" +
"<div class='col-sm-2'>";
if(i == (picList.length-1) && picList.length > 1){
htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+ item.__index +"_"+ i +"' /><br>";
... ... @@ -1088,6 +1241,41 @@ function cloneArr(arr1,arr2){
}
return arr2;
}
//时间校验
function checkdate(startDate,endDate){
if (endDate) {
var endDateTemp = endDate.split(" ");
var arrEndDate = endDateTemp[0].split("-");
var arrEndTime = endDateTemp[1].split(":");
var allEndDate = new Date(arrEndDate[0], parseInt(arrEndDate[1])-1, arrEndDate[2], arrEndTime[0], arrEndTime[1], arrEndTime[2]);
}
if(startDate){
var startDateTemp = startDate.split(" ");
var arrStartDate = startDateTemp[0].split("-");
var arrStartTime = startDateTemp[1].split(":");
var allStartDate = new Date(arrStartDate[0], parseInt(arrStartDate[1])-1, arrStartDate[2], arrStartTime[0], arrStartTime[1], arrStartTime[2]);
}
var nowDate = new Date();
if(startDate && endDate){
if(nowDate > allEndDate) {
return "<b style='color: #ec971f'>已过期</b>";
}else if(allStartDate > nowDate){
return "<b style='color: #428bca'>未发布</b>";
}else{
return "<b style='color: #5cb85c'>发布中</b>";
}
}else if(!startDate && endDate){
if(nowDate > allEndDate) {
return "<b style='color: #ec971f'>已过期</b>";
}else{
return "<b style='color: #5cb85c'>发布中</b>";
}
}else{
return "<b style='color: #428bca'>未发布</b>";
}
return true;
}
/********************事件绑定*********************/
... ... @@ -1109,20 +1297,18 @@ $(document).on("click","input[name=brandLevel]",function(){
})
//选择使用模板
$(document).on("change","#templateSelect",function(){
jsonMain.templateName = $(this).val();
jsonMain.templateType = $(this).val();
$(this).removeClass("error");
})
//暂存模板
$(document).on("click","#saveModule",function(){
if(jsonMain.templateName == "0"){
common.util.__tip("请选择展示使用模板!");
return;
}
saveDecoration(100);
})
//提交审核
$(document).on("click","#submitModule",function(){
if(jsonMain.templateName == "0"){
if(jsonMain.templateType == "0"){
common.util.__tip("请选择展示使用模板!");
$("#templateSelect").focus().addClass("error");
return;
}
saveDecoration(200);
... ... @@ -1181,12 +1367,27 @@ $(document).on("click",".addBtn",function(){
if(indexList.length > 1){
g.__rows[indexList[0]].data.push($.extend({},ENUM[curDialogId]));
if(curDialogId == "editor-largePic" || curDialogId == "editor-smallPic" || curDialogId == "editor-signboard"){
(g.__rows[indexList[0]].data)[(parseInt(indexList[1]) + 1)].startTime = (g.__rows[indexList[0]].data)[indexList[1]].endTime;
}
}else{
g.__rows.push($.extend({},ENUM[curDialogId]));
}
g.init(g.__rows);
untilEditorEvent(curDialogId);
});
//资源位大图,水牌添加一条资源位
$(document).on("click",".addBtn2",function(){
if( curDialogId == "editor-largePic" && g.__rows.length > 4){
$(".largePicAddTip").text("* 最多只能添加5个资源位大图!").css("color","#ff0000");
return;
}else{
$(".largePicAddTip").empty();
g.__rows.push($.extend(true,{},ENUM["editor-largePic2"]));
g.init(g.__rows);
untilEditorEvent(curDialogId);
}
});
//input change同时更新json
$(document).on("change",".inputChange",function(){
var _index = $(this).attr("data-index");
... ... @@ -1198,6 +1399,23 @@ $(document).on("change",".inputChange",function(){
}else{
g.__rows[indexList[0]][_name] = $(this).val();
}
if(curDialogId == "editor-largePic" || curDialogId == "editor-smallPic" || curDialogId == "editor-signboard"){
if($(this).attr("name") == "endTime"){
if(g.__rows[indexList[0]].data.length - 1 > indexList[1]){
(g.__rows[indexList[0]].data)[(parseInt(indexList[1]) + 1)].startTime = $(this).val();
$(this).parents(".row").next().children().find("input[name='startTime']").val($(this).val());
var endDate = $(this).parents(".row").next().children().find("input[name='endTime']").val();
$(this).parents(".row").next().children().find(".publishStatus").html(checkdate($(this).val(),endDate));
}
var startDate = $(this).parents(".row").find("input[name='startTime']").val();
$(this).parents(".row").find(".publishStatus").html(checkdate(startDate,$(this).val()));
}
if($(this).attr("name") == "startTime"){
var endDate = $(this).parents(".row").find("input[name='endTime']").val();
$(this).parents(".row").find(".publishStatus").html(checkdate($(this).val(),endDate));
}
}
$(this).removeClass("error");
});
//checkBox change同时更新json
... ... @@ -1219,12 +1437,13 @@ $(document).on("click",".topAdd",function(){
item.src = $(this).find('img').attr("src");
item.productId = $(this).attr("data-productId");
item.productName = $(this).attr("data-productName");
item.productPrice = $(this).attr("data-productPrice");
item.salesPrice = $(this).attr("data-productPrice");
item.productSkn = $(this).attr("data-productSkn");
g.__rows.push(item);
g.init(g.__rows);
untilEditorEvent(curDialogId);
productTopDataLink(g.__rows);
$(".topTip span").text("已经勾选"+ g.__rows.length +"件,最多勾选8件商品!");
}
}else{
... ...
... ... @@ -22,12 +22,13 @@ app端店铺模板css
/*------------------------banner--------------------------*/
.contentpanel-app .model-banner{
width: 100%;
height: 100px;
height: 150px;
position: relative;
overflow: hidden;
}
.contentpanel-app .model-banner img{
width: 100%;
height: 100px;
position: absolute;
clip: rect(0,640px,150px,0);
}
.contentpanel-app .model-banner h1{
position: absolute;
... ... @@ -43,14 +44,15 @@ app端店铺模板css
.contentpanel-app .model-nav ul li{
float: left;
width: 25%;
line-height: 20px;
padding: 0 10px;
font-size: 14px;
height: 30px;
line-height: 28px;
padding: 1px 10px;
font-size: 28px;
border-right: 2px solid #ccc;
margin: 10px 0;
margin: 30px 0;
text-align: center;
}
.contentpanel-app .model-nav ul li a{color: #ccc; font-weight: bold}
.contentpanel-app .model-nav ul li a{color: #ccc}
.contentpanel-app .model-nav ul li.active a{color: #585858}
/*------------------------main--------------------------*/
... ... @@ -58,66 +60,65 @@ app端店铺模板css
clear: both;
width: 100%;
background: #f5f7f6;
padding-bottom: 10px;
}
/*------------------------品牌一览(多品牌商铺专有)--------------------------*/
.contentpanel-app .brand-list{
text-align: center;
margin-bottom: 5px;
}
.contentpanel-app .brand-list span{
display: block;
padding: 10px 0;
font-size: 16px;
font-weight: bold;
line-height: 60px;
height: 60px;
font-size: 28px;
}
.contentpanel-app .brand-list ul{
border: solid #ccc;
border-width:1px 0 0px 0 ;
padding: 0 4px;
}
.contentpanel-app .brand-list ul li{
float: left;
width: 25%;
padding: 5px;
padding: 20px 4px;
}
.contentpanel-app .brand-list ul li a{
display: block;
width: 100%;
height: 60px;
height: 100px;
}
.contentpanel-app .brand-list ul li img{
width: 100%;
height: 60px;
height: 100px;
}
/*------------------------大图--------------------------*/
.contentpanel-app .largePic img{
width: 100%;
height: 100px;
height: 180px;
}
/*------------------------小图--------------------------*/
.contentpanel-app .model-smallPic{
width: 90%;
height: 80px;
margin: 10px auto;
width: 580px;
height: 150px;
margin: 20px auto;
background: #fff;
}
.contentpanel-app .model-smallPic ul li{
float: left;
width: 50%;
height: 80px;
height: 150px;
}
.contentpanel-app .model-smallPic ul li:first-of-type{
padding-right: 5px;
padding-right: 15px;
}
.contentpanel-app .model-smallPic ul li:last-of-type{
padding-left: 5px;
padding-left: 15px;
}
.contentpanel-app .model-smallPic img{
width: 100%;
height: 100%;
width: 275px;
height: 150px;
border:0px solid #000;
}
... ... @@ -128,19 +129,19 @@ app端店铺模板css
.contentpanel-app .sortList span{
display: block;
text-align: center;
padding: 10px;
width: 90%;
height: 60px;
line-height: 60px;
width: 580px;
background: #fff;
margin: 0 auto;
font-size: 16px;
font-size: 28px;
color: #999;
font-weight: bold;
}
.contentpanel-app .sortList .sortListDetail{
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
position: relative;
padding: 10px 10px 0;
padding: 20px 4px 10px;
}
.contentpanel-app .sortList .sortListDetail ul li{
float: left;
... ... @@ -148,18 +149,19 @@ app端店铺模板css
}
.contentpanel-app .sortList .sortListDetail ul li img{
display: block;
width: 100%;
height: 100px;
padding: 0 5px;
width: 150px;
height: 120px;
margin: 0 4px;
}
.contentpanel-app .sortList .sortListDetail ul li a{
display: block;
width: 100%;
text-align: center;
padding: 5px 0;
padding: 10px 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 16px;
}
/*------------------------人气单品--------------------------*/
... ... @@ -170,16 +172,15 @@ app端店铺模板css
.contentpanel-app .showTitle{
width: 100%;
height: 50px;
line-height: 50px;
height: 98px;
line-height: 98px;
text-align: center;
position: relative;
box-sizing: content-box;
border-bottom: 1px solid #ccc;
}
.contentpanel-app .showTitle span{
font-size: 16px;
font-weight: bold;
font-size: 28px;
color: #585858;
}
.contentpanel-app .showTitle a{
... ... @@ -191,35 +192,37 @@ app端店铺模板css
/*------------------------人气单品详情--------------------------*/
.contentpanel-app .model-showDetail{
padding: 10px 5px;
padding: 50px 25px;
}
.contentpanel-app .model-showDetail ul li{
float: left;
width: 50%;
padding: 0 5px;
position: relative;
margin-bottom: 5px;
margin-bottom:10px;
padding: 0 5px;
}
.contentpanel-app .model-showDetail ul li img{
width: 100%;
height: 150px;
height: 300px;
display: block;
}
.contentpanel-app .shadow{
width: 100%;
background: #666;
opacity: 0.5;
padding: 0 5px;
padding: 5px 10px;
}
.contentpanel-app .model-showDetail ul li a{
display: block;
font-size: 14px;
font-size: 22px;
color: #fff;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.contentpanel-app .model-showDetail ul li b{
font-size: 22px;
display: block;
color: #fff;
font-weight: normal;
}
... ...
... ... @@ -4,6 +4,7 @@ pc端店铺模板css
.editor-dialog ul.upload-image-list{padding: 0 10px}
.editor-dialog input.numInput{ width: 40px}
.editorTitle input.error,.editor-dialog input.error{ border: 2px solid #ff0000}
.moduleTypeSelect .error{ border: 2px solid #ff0000}
.editorTip{ color: #ff0000}
.contentpanel-pc {color: #585858; font-size: 12px; font-family:'Microsoft YaHei'}
... ... @@ -74,8 +75,8 @@ pc端店铺模板css
/*------------------------商品分类列表--------------------------*/
.contentpanel-pc .sortList{
width: 100%;
height: 300px;
background: #f5f7f6;
height: 200px;
background: url("../assets/images/shop1.png");
}
.contentpanel-pc .sortList a{ color: #585858}
... ... @@ -106,22 +107,37 @@ pc端店铺模板css
}
/*------------------------经典推荐--------------------------*/
.contentpanel-pc .typicRecommendDetail ul li a{
display: inline-block;
.contentpanel-pc .typicRecommendDetail ul li .recommendNames{
display: block;
width: 60%;
height: 30px;
line-height: 30px;
float: left;
height: 50px;
}
.contentpanel-pc .typicRecommendDetail ul li a,.contentpanel-pc .typicRecommendDetail ul li span{
display: block;
width: 100%;
color: #585858;
font-size: 14px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-right: 10px;
}
.contentpanel-pc .typicRecommendDetail ul li a{
height: 30px;
line-height: 30px;
}
.contentpanel-pc .typicRecommendDetail ul li span{
height: 20px;
line-height: 20px;
color: #999999;
font-size: 12px;
}
.contentpanel-pc .typicRecommendDetail ul li img{
display: block;
float: right;
height: 30px;
width: 40px;
height: 50px;
width: 40%;
}
/*------------------------热销推荐--------------------------*/
... ... @@ -148,6 +164,11 @@ pc端店铺模板css
width: 80%;
padding-left: 10px;
}
.contentpanel-pc .model-main-right-default{
width: 792px;
height: 920px;
background: url("../assets/images/shop2.png");
}
/*------------------------slide--------------------------*/
.contentpanel-pc .model-slide{
... ... @@ -384,6 +405,4 @@ pc端店铺模板css
.topList .topTip{
color: #ff0000;
margin-top: 20px;
}
}
\ No newline at end of file
... ...
exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://localhost:30012';
//exports.domain = 'http://172.16.6.115:8080/platform';
exports.res = [
{
... ... @@ -9,7 +8,7 @@ exports.res = [
view: 'pages/store/shop2',
src:'/store/shop'
},
{//查询装修模板内容
{//保存装修模板,提交审核模板
route:"/store/shop-decoration-save",
method:"POST",
url:"/ShopsDecoratorRest/saveShopsDecorator",
... ... @@ -17,11 +16,11 @@ exports.res = [
{name: 'shopsId', type: 'Number'},
{name: 'submitStatus', type: 'Number'},
{name: 'platform', type: 'String'},
{name: 'templateName', type: 'String'},
{name: 'templateType', type: 'String'},
{name: 'resources', type: 'String'}
]
},
{//保存装修模板,提交审核模板
{//查询装修模板内容
route:"/store/shop-decoration-find",
method:"POST",
url:"/ShopsDecoratorRest/findShopsDecoratorDetail",
... ...
exports.domain = require('../config/common.js').domain;
// exports.domain ="http://172.16.6.239:8080/";
//路由配置
exports.res = [
{
// 店铺创建列表页面
route: '/supplier/store/index',
method: 'GET',
view: 'pages/store/index',
data: {
gridurl:'/supplier/store/indexPage',
authority:'{"btn":false,"info":"info","create":true,"operationStatus":1,"checkStatusArr":"100,200,900"}',
add:true,
pagetitle:{
level1title:"店铺管理",
level2title:"创建店铺管理",
level3title:"创建店铺列表"
},
searchStatus:[
{value:"100",name:"暂存"},
{value:"200",name:"待审核"},
{value:"900",name:"驳回"}
]
},
src:'/store/index'
},{
// 店铺信息管理页面
route: '/supplier/store/examine',
method: 'GET',
view: 'pages/store/index',
data: {
gridurl:'/supplier/store/indexPage',
authority:'{"btn":true,"info":"info3","operationStatus":2,"checkStatusArr":"200,300,900"}', //300,200,900
pagetitle:{
level1title:"店铺管理",
level2title:"店铺信息管理",
level3title:"店铺信息列表"
},
searchStatus:[
{value:"200",name:"审核中"},
{value:"300",name:"通过"},
{value:"900",name:"驳回"}
]
},
src:'/store/index',
},{
// 店铺审核管理页面
route: '/supplier/check/index',
method: 'GET',
view: 'pages/store/index',
data: {
basicTab:true,
gridurl:'/supplier/store/indexPage',
authority:'{"btn":false,"info":"info2","operationStatus":0,"checkStatusArr":"200"}',
pagetitle:{
level1title:"店铺管理",
level2title:"店铺审核管理",
level3title:"店铺审核列表"
}
},
src:'/store/index',
},{
//获取列表数据
route: '/supplier/store/indexPage',
method: 'POST',
url:"/ShopsRest/getShopList",
params:[
{name: 'supplierId', type: 'Number'},
{name: 'brandId', type: 'Number'},
{name: 'operationStatus', type: 'Number'},
{name: 'checkStatus', type: 'Number'},
{name: 'checkStatusArr', type: 'String'},
{name: 'size', type: 'Number'},
{name: 'page', type: 'Number'}
]
},{
// 关店
route: '/supplier/store/closeShops',
method: 'POST',
url:"/ShopsRest/closeShops",
params:[
{name:"shopsId",type:"Number"}
]
},{
// 开店
route: '/supplier/store/openShops',
method: 'POST',
url:"/ShopsRest/openShops",
params:[
{name:"shopsId",type:"Number"}
]
}
,{
// 店铺详细信息页面渲染
//创建店铺的列表中,点击详情和编辑的url:/ShopsRest/getShopDetailById
route: '/supplier/store/info/:shopsId',
method: 'GET',
view: 'pages/store/info',
url:"/ShopsRest/getShopDetailById",
params:[{
name:'shopsId',
type:'String'
}],
src:'/store/info'
}
,{
// 店铺详细信息页面渲染
route: '/supplier/store/info2/:shopsId',
method: 'GET',
view: 'pages/store/info',
url:"/ShopsRest/getShopDetailById",
params:[{
name:'shopsId',
type:'String'
}],
data:{
data:{
btn:true
}
},
src:'/store/info'
}
,{
// 店铺详细信息页面渲染
route: '/supplier/store/info3/:shopsId',
method: 'GET',
view: 'pages/store/info',
url:"/ShopsCheckRest/getLastCheckShopInfoById",
params:[{
name:'shopsId',
type:'String'
}],
src:'/store/info'
},
{//审核通过
route: '/Shops/ShopsRest/checkShopPass',
method:"POST",
url:"/ShopsRest/checkShopPass",
params:[
{name:"shopsId",type:"Number"}
]
},
{//驳回
route: '/Shops/ShopsRest/checkReject',
method:"POST",
url:"/ShopsRest/checkReject",
params:[
{name:"shopsId",type:"Number"}
]
}
//*******************************
,{
// 修改店铺页面渲染
//创建店铺的列表中,点击详情和编辑的url:/ShopsRest/getShopDetailById
route: '/supplier/store/update/:shopsId',
method: 'GET',
view: 'pages/store/edit',
url:"/ShopsRest/getShopDetailById",
params:[{
name:'shopsId',
type:'String'
}],
data:{
pageTitel:"修改店铺",
action:'/store/update'
},
src:'/store/edit'
},{
// 修改店铺页面提交
route: '/store/update',
method: 'POST',
url: '/ShopsRest/updateShops',
params:[
{name:"shopsId",type:"Number"},
{name:"shopName",type:"String"},
{name:"shopDomain",type:"String"},
{name:"shopNature",type:"Number"},
{name:"websiteUrl",type:"String"},
{name:"otherUrl",type:"String"},
{name:"shopAddress",type:"String"},
{name:"createPid",type:"Number"},
{name:"shopsType",type:"Number"},
{name:"shopLogo",type:"String"},
{name:"shopIntro",type:"String"},
{name:"onCheck",type:"Number"},
{name:"shopRelation",type:"String"}
]
},{
// 新增店铺页面渲染
route: '/supplier/store/add',
method: 'GET',
view: 'pages/store/edit',
src:'/store/edit',
data:{
pageTitel:"创建店铺",
action:'/store/add',
data:{
shopId:0
}
}
}, {// 新增店铺数据
route: '/store/add',
method: 'POST',
url: '/ShopsRest/addShops',
params:[
{name:"shopId",type:"Number",def:0},
{name:"shopName",type:"String"},
{name:"shopDomain",type:"String"},
{name:"shopNature",type:"Number"},
{name:"createPid",type:"Number"},
{name:"shopsType",type:"Number"},
{name:"shopLogo",type:"String"},
{name:"shopIntro",type:"String"},
{name:"websiteUrl",type:"String"},
{name:"otherUrl",type:"String"},
{name:"shopAddress",type:"String"},
{name:"onCheck",type:"Number"},
{name:"shopRelation",type:"String"}
]
}
//***********************************
,{
// 店铺管理员关系列表
route: '/supplier/storeadmin/index',
method: 'GET',
view: 'pages/store/adminindex',
data: {
gridurl:'/supplier/storeadmin/indexPage'
},
src:'/store/adminindex'
},{
// 店铺管理员关系列表
route: '/supplier/storeadmin/indexPage',
method: 'POST',
url:"/ShopsAdminRest/getShopsAdminList",
params:[
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'}
]
},{
// 移除店铺管理员关系列表
route: '/supplier/storeadmin/delete',
method: 'POST',
url:"/ShopsAdminRest/delAdminRelation",
params:[
{name:"id",type:"Number"}
]
}
,{
// 店铺管理员关系新增
route: '/supplier/storeadmin/adminAdd',
method: 'GET',
view: 'pages/store/adminedit',
src:'/store/adminedit'
},{
// 店铺管理员关系新增
route: '/supplier/storeadmin/addguanxi',
method: 'POST',
url:"/ShopsAdminRest/addAdminRelation",
params:[
{name:"shopsId",type:"Number"},
{name:"adminPid",type:"Number"},
{name:"identity",type:"Number"}
]
},{
// 修改店铺页面渲染
route: '/supplier/store/adminupdate/:id',
method: 'GET',
view: 'pages/store/adminedit',
url:"/ShopsAdminRest/getAdminRelationDetailById",
params:[{
name:'id',
type:'String'
}],
src:'/store/adminedit'
},{
// 修改店铺管理员关系
route: '/supplier/storeadmin/updateguanxi',
method: 'POST',
url:"/ShopsAdminRest/updateAdminRalation",
params:[
{name:"id",type:"Number"},
{name:"shopsId",type:"Number"},
{name:"adminPid",type:"Number"},
{name:"identity",type:"Number"}
]
},{
// 根据品牌选择供应商
route: '/supplier/storeadmin/supplierlist',
method: 'POST',
url:"/supplier/supplier/selectSupplierByBrandId",
params:[
{name:"brandId",type:"Number"}
]
}
]
\ No newline at end of file
... ...
<div class="tabheader">
<ul class="nav nav-tabs">
<li data-toggle="shopWeb-pc" class="active"><a href="javascript:">店铺装修(PC端)</a></li>
<li data-toggle="shopWeb-app"><a href="javascript:">店铺装修(移动端)</a></li>
<li data-toggle="shopWeb-pc" class="active"><a href="javascript:">店铺装修(PC端)</a></li>
<li data-toggle="shopWeb-app"><a href="javascript:">店铺装修(移动端)</a></li>
</ul>
</div>
... ... @@ -10,7 +10,7 @@
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body" style="display: block;">
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">店铺管理</a></li>
... ... @@ -75,20 +75,20 @@
<!--左侧main-->
<div class="model-main-left">
<!--商品列表-->
<div class="sortList">(固定内容!)</div>
<div class="sortList"></div>
<!--水牌-->
<div class="model-recommend model-signboard model-editor" data-toggle="editor-signboard" data-title="水牌位编辑">
<div class="recommendDetail signboardDetail">
<ul>
[[each resources.signboard.data as item _index]]
<li><a href="[[item.url]]"><img src="[[item.src]]"></a></li>
<li><a href="[[item.data[0].url]]"><img src="[[item.data[0].src]]"></a></li>
[[/each]]
</ul>
</div>
</div>
</div>
<!--右侧main-->
<div class="model-main-right">(固定内容!)</div>
<div class="model-main-right model-main-right-default"></div>
<div class="clear"></div>
</div>
</div>
... ... @@ -123,7 +123,7 @@
<!--左侧main-->
<div class="model-main-left">
<!--商品列表-->
<div class="sortList">(固定内容!)</div>
<div class="sortList"></div>
<!--品牌集合-->
<div class="model-recommend model-brand model-editor" style="display: none" data-toggle="editor-brand" data-title="品牌集合编辑">
<div class="recommendTitle">品牌集合</div>
... ... @@ -141,7 +141,14 @@
<div class="recommendDetail typicRecommendDetail">
<ul>
[[each resources.recommend.data as item _index]]
<li><a href="[[item.url]]">[[item.name]]</a><img src="[[item.src]]"></li>
<li>
<div class="recommendNames">
<a href="[[item.url]]">[[item.name]]</a>
<span>[[item.enName]]</span>
</div>
<img src="[[item.src]]">
<div class="clear"></div>
</li>
[[/each]]
</ul>
</div>
... ... @@ -178,20 +185,16 @@
<!--新品上架-->
<div class="model-show">
<div class="model-showTitle">
[[if resources.newProducts.data.length > 0]]
<div class="showName"><span>新品上架&nbsp;&nbsp;NEW</span></div>
[[else]]
<div class="showName model-editor" data-toggle="editor-newProduct" data-title="新品上架商品编辑"><span>新品上架&nbsp;&nbsp;NEW</span></div>
[[/if]]
<div class="showTab model-editor" data-toggle="editor-newGoodTab" data-title="新品上架标签编辑">
<ul>
[[each resources.goodsTabBar.data.new as item _index]]
[[if item.name]]
[[if _index == 0]]
<li style="border-right: 0"><a href="[[item.url]]">[[item.name]]</a></li>
[[else]]
<li><a href="[[item.url]]">[[item.name]]</a></li>
[[/if]]
[[if _index == 0]]
<li style="border-right: 0"><a href="[[item.url]]">[[item.name]]</a></li>
[[else]]
<li><a href="[[item.url]]">[[item.name]]</a></li>
[[/if]]
[[/if]]
[[/each]]
</ul>
... ... @@ -200,9 +203,13 @@
</div>
<div class="model-showDetail model-editor" data-toggle="editor-newProduct" data-title="新品上架商品编辑">
<ul>
[[if resources.newProducts.data.length > 0]]
[[each resources.newProducts.data as item _index]]
<li><img src="[[item.src]]"><div class="shadow"><a href="javascript:">[[item.productName]]</a><b>¥[[item.productPrice]]</b></div></li>
<li><img src="[[item.src]]"><div class="shadow"><a href="javascript:">[[item.productName]]</a><b>¥[[item.salesPrice]]</b></div></li>
[[/each]]
[[else]]
<li><img src="http://cdn.yoho.cn/yohobuy-portal/assets/images/shop.png"><div class="shadow"><a href="javascript:">商品展示样例</a><b>¥商品价格</b></div></li>
[[/if]]
</ul>
<div class="clear"></div>
</div>
... ... @@ -211,20 +218,16 @@
<!--人气单品-->
<div class="model-show">
<div class="model-showTitle">
[[if resources.hotProducts.data.length > 0]]
<div class="showName"><span>人气单品&nbsp;&nbsp;NEW</span></div>
[[else]]
<div class="showName model-editor" data-toggle="editor-hotProduct" data-title="人气单品商品编辑"><span>人气单品&nbsp;&nbsp;NEW</span></div>
[[/if]]
<div class="showTab model-editor" data-toggle="editor-hotGoodTab" data-title="人气单品标签编辑">
<ul>
[[each resources.goodsTabBar.data.hot as item _index]]
[[if item.name]]
[[if _index == 0]]
<li style="border-right: 0"><a href="[[item.url]]">[[item.name]]</a></li>
[[else]]
<li><a href="[[item.url]]">[[item.name]]</a></li>
[[/if]]
[[if _index == 0]]
<li style="border-right: 0"><a href="[[item.url]]">[[item.name]]</a></li>
[[else]]
<li><a href="[[item.url]]">[[item.name]]</a></li>
[[/if]]
[[/if]]
[[/each]]
</ul>
... ... @@ -233,9 +236,13 @@
</div>
<div class="model-showDetail model-editor" data-toggle="editor-hotProduct" data-title="人气单品商品编辑">
<ul>
[[if resources.hotProducts.data.length > 0]]
[[each resources.hotProducts.data as item _index]]
<li><img src="[[item.src]]"><div class="shadow"><a href="javascript:">[[item.productName]]</a><b>¥[[item.productPrice]]</b></div></li>
<li><img src="[[item.src]]"><div class="shadow"><a href="javascript:">[[item.productName]]</a><b>¥[[item.salesPrice]]</b></div></li>
[[/each]]
[[else]]
<li><img src="http://cdn.yoho.cn/yohobuy-portal/assets/images/shop.png"><div class="shadow"><a href="javascript:">商品展示样例</a><b>¥商品价格</b></div></li>
[[/if]]
</ul>
<div class="clear"></div>
</div>
... ... @@ -252,10 +259,17 @@
<div class="model-wrap contentpanel-app">
<!--banner-->
<div class="model-banner model-editor" data-toggle="editor-banner" data-title="顶部图片编辑">
[[if resources.shopTopBanner_APP.isUsed == "Y"]]
<img src="[[resources.shopTopBanner_APP.data[0].shopSrc]]">
[[if resources.shopTopBanner_APP.data[0].isShowShopName == "Y"]]
<h1>[[shopName]]</h1>
[[/if]]
[[else]]
<img src="[[resources.shopTopBanner.data[0].shopSrc]]">
[[if resources.shopTopBanner.data[0].isShowShopName == "Y"]]
<h1>[[shopName]]</h1>
[[/if]]
[[/if]]
</div>
<!--nav-->
<div class="model-nav">
... ... @@ -281,9 +295,15 @@
<!--小图-->
<div class="model-smallPic model-editor" data-toggle="editor-smallPic" data-title="资源位小图编辑">
<ul>
[[if resources.oneRowTwoColImages_APP.isUsed == "Y"]]
[[each resources.oneRowTwoColImages_APP.data as item _index]]
<li><img src="[[item.data[0].src]]"></li>
[[/each]]
[[else]]
[[each resources.oneRowTwoColImages.data as item _index]]
<li><img src="[[item.data[0].src]]"></li>
[[/each]]
[[/if]]
</ul>
</div>
<div class="clear"></div>
... ... @@ -293,9 +313,9 @@
<div class="sortListDetail model-editor" data-toggle="editor-recommend-app" data-title="热门品类编辑">
<ul>
[[each resources.recommend.data as item _index]]
[[if item.isShowInApp == "Y"]]
<li><img src="[[item.src]]"><a href="[[item.url]]">[[item.name]]</a></li>
[[/if]]
[[if item.isShowInApp == "Y"]]
<li><img src="[[item.src]]"><a href="[[item.url]]">[[item.name]]</a></li>
[[/if]]
[[/each]]
</ul>
<div class="clear"></div>
... ... @@ -310,9 +330,19 @@
</div>
<div class="model-showDetail model-editor" data-toggle="editor-hotProduct" data-title="人气单品商品编辑">
<ul>
[[if resources.hotProducts_APP.isUsed == "Y"]]
[[each resources.hotProducts_APP.data as item _index]]
<li><img src="[[item.src]]"><div class="shadow"><a href="javascript:">[[item.productName]]</a><b>¥[[item.salesPrice]]</b></div></li>
[[/each]]
[[else]]
[[if resources.hotProducts.data.length > 0]]
[[each resources.hotProducts.data as item _index]]
<li><img src="[[item.src]]"><div class="shadow"><a href="javascript:">[[item.productName]]</a><b>¥[[item.productPrice]]</b></div></li>
<li><img src="[[item.src]]"><div class="shadow"><a href="javascript:">[[item.productName]]</a><b>¥[[item.salesPrice]]</b></div></li>
[[/each]]
[[else]]
<li><img src="http://cdn.yoho.cn/yohobuy-portal/assets/images/shop.png"><div class="shadow"><a href="javascript:">商品展示样例</a><b>¥商品价格</b></div></li>
[[/if]]
[[/if]]
</ul>
<div class="clear"></div>
</div>
... ... @@ -326,9 +356,9 @@
<div class="topListName">畅销排行Top20</div>
<div class="topListDetail">
<ul>
[[each product_list as item _index]]
<li class="topAdd" data-productId="[[item.product_id]]" data-productName="[[item.product_name]]" data-productPrice="[[item.sales_price]]">
<a href="javascript:"><img src="[[item.default_images]]"><b></b><span>top[[_index+1]]</span><i></i></a>
[[each data as item _index]]
<li class="topAdd" data-productId="[[item.productId]]" data-productName="[[item.productName]]" data-productPrice="[[item.salesPrice]]" data-productSkn="[[item.productSkn]]">
<a href="javascript:"><img src="[[item.src]]"><b></b><span>top[[_index+1]]</span><i></i></a>
</li>
[[/each]]
</ul>
... ...