|
@@ -9,22 +9,24 @@ var curPlatform = "shopWeb-pc"; //当前渲染页面用的模板名称 |
|
@@ -9,22 +9,24 @@ var curPlatform = "shopWeb-pc"; //当前渲染页面用的模板名称 |
9
|
var curTemplateType = "2"; //当前模板类型 1:基础模板,2:经典模板
|
9
|
var curTemplateType = "2"; //当前模板类型 1:基础模板,2:经典模板
|
10
|
var shopType = 1; //店铺类型 1:单品牌,2:多品牌
|
10
|
var shopType = 1; //店铺类型 1:单品牌,2:多品牌
|
11
|
var shopOperate = 'view'; //操作 editor:可编辑, view:查看不可编辑
|
11
|
var shopOperate = 'view'; //操作 editor:可编辑, view:查看不可编辑
|
|
|
12
|
+var defaultSrc = "http://cdn.yoho.cn/yohobuy-portal/assets/images/shop.png"; //初始化默认图片路径
|
12
|
var ENUM = {
|
13
|
var ENUM = {
|
13
|
- "editor-largePic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
|
|
|
14
|
- "editor-smallPic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
|
14
|
+ "editor-largePic":{"src": defaultSrc, "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
|
|
|
15
|
+ "editor-largePic2":{"position":"", "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
|
|
|
16
|
+ "editor-smallPic":{"src": defaultSrc, "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
|
15
|
"editor-brand":{"position":"", "name":"", "url":""},
|
17
|
"editor-brand":{"position":"", "name":"", "url":""},
|
16
|
- "editor-recommend": {"position":"", "name":"", "enName":"", "src":"", "url":"","isShowInApp":"Y"},
|
|
|
17
|
- "editor-hotRecommend":{"position":"", "src":"", "url":""},
|
|
|
18
|
- "editor-signboard":{"position":"", "src":"", "url":"","startTime": "","endTime": "","publishStatus": 0},
|
18
|
+ "editor-recommend": {"position":"", "name":"", "enName":"", "src":defaultSrc, "url":"","isShowInApp":"Y"},
|
|
|
19
|
+ "editor-hotRecommend":{"position":"", "src":defaultSrc, "url":""},
|
|
|
20
|
+ "editor-signboard":{"position":"", "src":defaultSrc, "url":"","startTime": "","endTime": "","publishStatus": 0},
|
19
|
"editor-newGoodTab":{"position":"", "name":"", "url":""},
|
21
|
"editor-newGoodTab":{"position":"", "name":"", "url":""},
|
20
|
"editor-hotGoodTab":{"position":"", "name":"", "url":""},
|
22
|
"editor-hotGoodTab":{"position":"", "name":"", "url":""},
|
21
|
- "editor-newProduct":{"productId":"", "position":"", "productName":"", "productPrice":"", "src":"", "url":""},
|
|
|
22
|
- "editor-hotProduct":{"productId":"", "position":"", "productName":"", "productPrice":"", "src":"", "url":""}
|
23
|
+ "editor-newProduct":{"productId":"", "position":"", "productName":"", "productSkn":"", "salesPrice":"", "src":"", "url":""},
|
|
|
24
|
+ "editor-hotProduct":{"productId":"", "position":"", "productName":"", "productSkn":"", "salesPrice":"", "src":"", "url":""}
|
23
|
}; //添加一条不同弹层使用的初始化模板
|
25
|
}; //添加一条不同弹层使用的初始化模板
|
24
|
var resourcesNew = {
|
26
|
var resourcesNew = {
|
25
|
"shopTopBanner":{
|
27
|
"shopTopBanner":{
|
26
|
"id":"",
|
28
|
"id":"",
|
27
|
- "data": [{"shopSrc": "", "detailSrc": "", "isShowShopName": "Y"}]
|
29
|
+ "data": [{"shopSrc": defaultSrc, "detailSrc": defaultSrc, "isShowShopName": "N"}]
|
28
|
},
|
30
|
},
|
29
|
"navigationBar":{
|
31
|
"navigationBar":{
|
30
|
"id":"",
|
32
|
"id":"",
|
|
@@ -32,19 +34,13 @@ var resourcesNew = { |
|
@@ -32,19 +34,13 @@ var resourcesNew = { |
32
|
},
|
34
|
},
|
33
|
"largeSlideImg":{
|
35
|
"largeSlideImg":{
|
34
|
"id":"",
|
36
|
"id":"",
|
35
|
- "data": [
|
|
|
36
|
- {"position": 5, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
|
|
|
37
|
- {"position": 4, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
|
|
|
38
|
- {"position": 3, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
|
|
|
39
|
- {"position": 2, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
|
|
|
40
|
- {"position": 1, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}
|
|
|
41
|
- ]
|
37
|
+ "data": [{"position": 1, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]}]
|
42
|
},
|
38
|
},
|
43
|
"oneRowTwoColImages":{
|
39
|
"oneRowTwoColImages":{
|
44
|
"id":"",
|
40
|
"id":"",
|
45
|
"data": [
|
41
|
"data": [
|
46
|
- {"position": 2, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
|
|
|
47
|
- {"position": 1, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}
|
42
|
+ {"position": 2, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]},
|
|
|
43
|
+ {"position": 1, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]}
|
48
|
]
|
44
|
]
|
49
|
},
|
45
|
},
|
50
|
"brandBrowse":{
|
46
|
"brandBrowse":{
|
|
@@ -54,16 +50,16 @@ var resourcesNew = { |
|
@@ -54,16 +50,16 @@ var resourcesNew = { |
54
|
"recommend":{
|
50
|
"recommend":{
|
55
|
"id":"",
|
51
|
"id":"",
|
56
|
"title":"经典推荐",
|
52
|
"title":"经典推荐",
|
57
|
- "data": [{"position":1, "name":"", "enName":"", "src":"", "url":"","isShowInApp":"Y"}]
|
53
|
+ "data": [{"position":1, "name":"默认商品", "enName":"", "src":defaultSrc, "url":"","isShowInApp":"Y"}]
|
58
|
},
|
54
|
},
|
59
|
"hotRecommend":{
|
55
|
"hotRecommend":{
|
60
|
"id":"",
|
56
|
"id":"",
|
61
|
- "title":"热销推荐",
|
|
|
62
|
- "data": [{"position":1, "src":"", "url":""}]
|
57
|
+ "title":"",
|
|
|
58
|
+ "data": [{"position":1, "src":defaultSrc, "url":""}]
|
63
|
},
|
59
|
},
|
64
|
"signboard":{
|
60
|
"signboard":{
|
65
|
"id":"",
|
61
|
"id":"",
|
66
|
- "data": [{"position":1, "src":"", "url":"", "startTime": "", "endTime": "", "publishStatus": 0}]
|
62
|
+ "data": [{"position": 1, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]}]
|
67
|
},
|
63
|
},
|
68
|
"goodsTabBar":{
|
64
|
"goodsTabBar":{
|
69
|
"id":"",
|
65
|
"id":"",
|
|
@@ -74,14 +70,44 @@ var resourcesNew = { |
|
@@ -74,14 +70,44 @@ var resourcesNew = { |
74
|
},
|
70
|
},
|
75
|
"newProducts":{
|
71
|
"newProducts":{
|
76
|
"id":"",
|
72
|
"id":"",
|
77
|
- "data": [{"productId":"0", "position":1, "productName":"默认商品", "productPrice":"默认价格", "src":"", "url":""}]
|
73
|
+ "data": []
|
78
|
},
|
74
|
},
|
79
|
"hotProducts":{
|
75
|
"hotProducts":{
|
80
|
"id":"",
|
76
|
"id":"",
|
81
|
- "data": [{"productId":"0", "position":1, "productName":"默认商品", "productPrice":"默认价格", "src":"", "url":""}]
|
77
|
+ "data": []
|
|
|
78
|
+ },
|
|
|
79
|
+ "allNewProducts":{
|
|
|
80
|
+ "id":"",
|
|
|
81
|
+ "data":[]
|
|
|
82
|
+ },
|
|
|
83
|
+ "allHotProducts":{
|
|
|
84
|
+ "id":"",
|
|
|
85
|
+ "data":[]
|
|
|
86
|
+ },
|
|
|
87
|
+ "shopTopBanner_APP":{
|
|
|
88
|
+ "id":"",
|
|
|
89
|
+ "isUsed":"N",
|
|
|
90
|
+ "data": [{"shopSrc": defaultSrc, "detailSrc": defaultSrc, "isShowShopName": "N"}]
|
|
|
91
|
+ },
|
|
|
92
|
+ "oneRowTwoColImages_APP":{
|
|
|
93
|
+ "id":"",
|
|
|
94
|
+ "isUsed":"N",
|
|
|
95
|
+ "data": [
|
|
|
96
|
+ {"position": 2, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]},
|
|
|
97
|
+ {"position": 1, "data":[{"src": defaultSrc, "url": "", "startTime": "", "endTime": ""}]}
|
|
|
98
|
+ ]
|
|
|
99
|
+ },
|
|
|
100
|
+ "hotProducts_APP":{
|
|
|
101
|
+ "id":"",
|
|
|
102
|
+ "isUsed":"N",
|
|
|
103
|
+ "data": []
|
|
|
104
|
+ },
|
|
|
105
|
+ "allHotProducts_APP":{
|
|
|
106
|
+ "id":"",
|
|
|
107
|
+ "data":[]
|
82
|
}
|
108
|
}
|
83
|
} //初始化装修信息json
|
109
|
} //初始化装修信息json
|
84
|
-var shopsId, _id, jsonMain, jsonClone, topNewProducts, topHotProducts;
|
110
|
+var shopsId, _id, jsonMain, jsonClone;
|
85
|
|
111
|
|
86
|
getParams();
|
112
|
getParams();
|
87
|
findDecoration();
|
113
|
findDecoration();
|
|
@@ -113,10 +139,11 @@ function getParams(){ |
|
@@ -113,10 +139,11 @@ function getParams(){ |
113
|
}
|
139
|
}
|
114
|
//json渲染模板
|
140
|
//json渲染模板
|
115
|
function showMain(){
|
141
|
function showMain(){
|
116
|
- $('#templateSelect').val(curTemplateType);
|
142
|
+ $('#templateSelect').val(jsonMain.templateType);
|
117
|
$("input[name='brandLevel'][value='"+curTemplateType+"']").attr('checked',"checked");
|
143
|
$("input[name='brandLevel'][value='"+curTemplateType+"']").attr('checked',"checked");
|
118
|
|
144
|
|
119
|
if(curPlatform == "shopWeb-pc"){
|
145
|
if(curPlatform == "shopWeb-pc"){
|
|
|
146
|
+ //console.log(jsonMain);
|
120
|
$('#main').empty().html(common.util.__template2($("#"+curPlatform+"-"+curTemplateType).html(),jsonMain));
|
147
|
$('#main').empty().html(common.util.__template2($("#"+curPlatform+"-"+curTemplateType).html(),jsonMain));
|
121
|
} else if(curPlatform == "shopWeb-app"){
|
148
|
} else if(curPlatform == "shopWeb-app"){
|
122
|
$('#main').empty().html(common.util.__template2($("#"+curPlatform).html(),jsonMain));
|
149
|
$('#main').empty().html(common.util.__template2($("#"+curPlatform).html(),jsonMain));
|
|
@@ -127,6 +154,12 @@ function showMain(){ |
|
@@ -127,6 +154,12 @@ function showMain(){ |
127
|
}else if(shopType == 1){
|
154
|
}else if(shopType == 1){
|
128
|
$(".model-brand").hide();
|
155
|
$(".model-brand").hide();
|
129
|
}
|
156
|
}
|
|
|
157
|
+ //标签长度样式自适应
|
|
|
158
|
+ $.each($(".contentpanel-pc .model-showTitle .showTab"),function(){
|
|
|
159
|
+ if($(this).width() > 280){
|
|
|
160
|
+ $(this).css("right",(280-($(this).width()))+"px");
|
|
|
161
|
+ }
|
|
|
162
|
+ })
|
130
|
showEditorIconEvent();
|
163
|
showEditorIconEvent();
|
131
|
}
|
164
|
}
|
132
|
//弹窗编辑主流程
|
165
|
//弹窗编辑主流程
|
|
@@ -170,27 +203,40 @@ function findDecoration(){ |
|
@@ -170,27 +203,40 @@ function findDecoration(){ |
170
|
}
|
203
|
}
|
171
|
},
|
204
|
},
|
172
|
function(rs) {
|
205
|
function(rs) {
|
173
|
- //console.log(rs.data);
|
206
|
+ console.log(rs.data);
|
174
|
if(rs.data){
|
207
|
if(rs.data){
|
175
|
jsonMain = rs.data;
|
208
|
jsonMain = rs.data;
|
176
|
}
|
209
|
}
|
177
|
- if(jsonMain.templateName){
|
|
|
178
|
- curTemplateType = jsonMain.templateName;
|
|
|
179
|
- }
|
|
|
180
|
//没有装修信息,初始化装修信息
|
210
|
//没有装修信息,初始化装修信息
|
181
|
if($.isEmptyObject(jsonMain.resources)){
|
211
|
if($.isEmptyObject(jsonMain.resources)){
|
182
|
jsonMain.resources = $.extend(true,{},resourcesNew);
|
212
|
jsonMain.resources = $.extend(true,{},resourcesNew);
|
183
|
}
|
213
|
}
|
184
|
//装修信息中品牌内容为空,初始化品牌
|
214
|
//装修信息中品牌内容为空,初始化品牌
|
185
|
- if(jsonMain.resources.brandBrowse.data.length < 1 && jsonMain.brandList){
|
|
|
186
|
- cloneArr(jsonMain.brandList,jsonMain.resources.brandBrowse.data);
|
215
|
+ if(jsonMain.brandList){
|
|
|
216
|
+ if(jsonMain.resources.brandBrowse.data.length < 1){
|
|
|
217
|
+ cloneArr(jsonMain.brandList,jsonMain.resources.brandBrowse.data);
|
|
|
218
|
+ }
|
|
|
219
|
+ }else{
|
|
|
220
|
+ common.util.__tip("店铺没有品牌,无法装修,请返回添加品牌!");
|
|
|
221
|
+ return;
|
|
|
222
|
+ }
|
|
|
223
|
+ if(jsonMain.templateType && jsonMain.templateType != "0"){
|
|
|
224
|
+ curTemplateType = jsonMain.templateType;
|
187
|
}
|
225
|
}
|
188
|
//装修json克隆
|
226
|
//装修json克隆
|
189
|
jsonClone = $.extend(true,{},jsonMain);
|
227
|
jsonClone = $.extend(true,{},jsonMain);
|
|
|
228
|
+
|
190
|
//最新上架,最热商品接口
|
229
|
//最新上架,最热商品接口
|
191
|
if(shopOperate == 'editor'){
|
230
|
if(shopOperate == 'editor'){
|
192
|
- findTopNewProducts();
|
|
|
193
|
- findTopHotProducts();
|
231
|
+ if(!jsonMain.resources.allNewProducts.data || jsonMain.resources.allNewProducts.data.length < 1){
|
|
|
232
|
+ findTopNewProducts();
|
|
|
233
|
+ }
|
|
|
234
|
+ if(!jsonMain.resources.allHotProducts.data || jsonMain.resources.allHotProducts.data.length < 1){
|
|
|
235
|
+ findTopHotProducts();
|
|
|
236
|
+ }
|
|
|
237
|
+ if(!jsonMain.resources.allHotProducts_APP.data || jsonMain.resources.allHotProducts_APP.data.length < 1){
|
|
|
238
|
+ findTopHotProducts_APP();
|
|
|
239
|
+ }
|
194
|
}
|
240
|
}
|
195
|
showMain();
|
241
|
showMain();
|
196
|
},true);
|
242
|
},true);
|
|
@@ -204,7 +250,9 @@ function findTopNewProducts(){ |
|
@@ -204,7 +250,9 @@ function findTopNewProducts(){ |
204
|
"size": 20
|
250
|
"size": 20
|
205
|
}
|
251
|
}
|
206
|
},function(rs){
|
252
|
},function(rs){
|
207
|
- topNewProducts = rs.data;
|
253
|
+ if(rs.data.product_list){
|
|
|
254
|
+ jsonMain.resources.allNewProducts.data = rs.data.product_list;
|
|
|
255
|
+ }
|
208
|
},true);
|
256
|
},true);
|
209
|
}
|
257
|
}
|
210
|
//Ajax热销商品
|
258
|
//Ajax热销商品
|
|
@@ -216,23 +264,39 @@ function findTopHotProducts(){ |
|
@@ -216,23 +264,39 @@ function findTopHotProducts(){ |
216
|
"size": 20
|
264
|
"size": 20
|
217
|
}
|
265
|
}
|
218
|
},function(rs){
|
266
|
},function(rs){
|
219
|
- topHotProducts = rs.data;
|
267
|
+ if(rs.data.product_list){
|
|
|
268
|
+ jsonMain.resources.allHotProducts.data = rs.data.product_list;
|
|
|
269
|
+ }
|
|
|
270
|
+ },true);
|
|
|
271
|
+}
|
|
|
272
|
+//Ajax热销商品---APP
|
|
|
273
|
+function findTopHotProducts_APP(){
|
|
|
274
|
+ common.util.__ajax({
|
|
|
275
|
+ url:'/store/shop-decoration-hotProducts',
|
|
|
276
|
+ data: {
|
|
|
277
|
+ "shopsId": jsonMain.shopsId,
|
|
|
278
|
+ "size": 20
|
|
|
279
|
+ }
|
|
|
280
|
+ },function(rs){
|
|
|
281
|
+ if(rs.data.product_list){
|
|
|
282
|
+ jsonMain.resources.allHotProducts_APP.data = rs.data.product_list;
|
|
|
283
|
+ }
|
220
|
},true);
|
284
|
},true);
|
221
|
}
|
285
|
}
|
222
|
//Ajax保存,暂存:100,提交审核:200
|
286
|
//Ajax保存,暂存:100,提交审核:200
|
223
|
function saveDecoration(submitStatus){
|
287
|
function saveDecoration(submitStatus){
|
|
|
288
|
+ console.log(jsonMain);
|
224
|
common.util.__ajax({
|
289
|
common.util.__ajax({
|
225
|
url:'/store/shop-decoration-save',
|
290
|
url:'/store/shop-decoration-save',
|
226
|
data: {
|
291
|
data: {
|
227
|
"submitStatus": submitStatus,
|
292
|
"submitStatus": submitStatus,
|
228
|
"shopsId": jsonMain.shopsId,
|
293
|
"shopsId": jsonMain.shopsId,
|
229
|
"platform": jsonMain.platform,
|
294
|
"platform": jsonMain.platform,
|
230
|
- "templateName": jsonMain.templateName,
|
295
|
+ "templateType": jsonMain.templateType,
|
231
|
"resources": JSON.stringify(jsonMain.resources)
|
296
|
"resources": JSON.stringify(jsonMain.resources)
|
232
|
}
|
297
|
}
|
233
|
},function(rs){
|
298
|
},function(rs){
|
234
|
if(rs.data){
|
299
|
if(rs.data){
|
235
|
- //console.log(rs.data);
|
|
|
236
|
if(submitStatus == 100){
|
300
|
if(submitStatus == 100){
|
237
|
jsonMain = rs.data;
|
301
|
jsonMain = rs.data;
|
238
|
jsonClone = $.extend(true,{},jsonMain);
|
302
|
jsonClone = $.extend(true,{},jsonMain);
|
|
@@ -247,7 +311,7 @@ function saveDecoration(submitStatus){ |
|
@@ -247,7 +311,7 @@ function saveDecoration(submitStatus){ |
247
|
}
|
311
|
}
|
248
|
//Ajax审核,审核通过:300,驳回:900
|
312
|
//Ajax审核,审核通过:300,驳回:900
|
249
|
function checkDecoration(checkStatus,comment){
|
313
|
function checkDecoration(checkStatus,comment){
|
250
|
- if(comment){
|
314
|
+ if(comment){ //驳回
|
251
|
common.util.__ajax({
|
315
|
common.util.__ajax({
|
252
|
url:'/store/shop-decoration-check',
|
316
|
url:'/store/shop-decoration-check',
|
253
|
data: {
|
317
|
data: {
|
|
@@ -256,12 +320,12 @@ function checkDecoration(checkStatus,comment){ |
|
@@ -256,12 +320,12 @@ function checkDecoration(checkStatus,comment){ |
256
|
"comment": comment
|
320
|
"comment": comment
|
257
|
}
|
321
|
}
|
258
|
},function(rs){
|
322
|
},function(rs){
|
259
|
- common.util.__tip("审核通过成功!","success");
|
323
|
+ common.util.__tip("审核驳回成功!","success");
|
260
|
setTimeout(function() {
|
324
|
setTimeout(function() {
|
261
|
location.href="/supplier/check/index";
|
325
|
location.href="/supplier/check/index";
|
262
|
}, 1000);
|
326
|
}, 1000);
|
263
|
},true);
|
327
|
},true);
|
264
|
- }else{
|
328
|
+ }else{ //通过
|
265
|
common.util.__ajax({
|
329
|
common.util.__ajax({
|
266
|
url:'/store/shop-decoration-check',
|
330
|
url:'/store/shop-decoration-check',
|
267
|
data: {
|
331
|
data: {
|
|
@@ -269,7 +333,7 @@ function checkDecoration(checkStatus,comment){ |
|
@@ -269,7 +333,7 @@ function checkDecoration(checkStatus,comment){ |
269
|
"checkStatus": checkStatus
|
333
|
"checkStatus": checkStatus
|
270
|
}
|
334
|
}
|
271
|
},function(rs){
|
335
|
},function(rs){
|
272
|
- common.util.__tip("审核驳回成功!","success");
|
336
|
+ common.util.__tip("审核通过成功!","success");
|
273
|
setTimeout(function() {
|
337
|
setTimeout(function() {
|
274
|
location.href="/supplier/check/index";
|
338
|
location.href="/supplier/check/index";
|
275
|
}, 1000);
|
339
|
}, 1000);
|
|
@@ -284,28 +348,51 @@ function gridInit(id){ |
|
@@ -284,28 +348,51 @@ function gridInit(id){ |
284
|
switch (id){
|
348
|
switch (id){
|
285
|
//店铺顶部banner
|
349
|
//店铺顶部banner
|
286
|
case "editor-banner":
|
350
|
case "editor-banner":
|
287
|
- g = new common.grid({
|
|
|
288
|
- hash: false,
|
|
|
289
|
- el:"#"+id,
|
|
|
290
|
- columns:[
|
|
|
291
|
- {display:"店铺banner图片", render:function(item){
|
|
|
292
|
- return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
|
|
|
293
|
- }},
|
|
|
294
|
- {display:"是否显示店铺名称", render:function(item){
|
|
|
295
|
- if(item.isShowShopName == "Y"){
|
|
|
296
|
- return "<lable><input type='radio' name='isShowShopName' value='Y' checked='checked'>显示店铺名称</lable><br>" +
|
|
|
297
|
- "<lable><input type='radio' name='isShowShopName' value='N'>不显示店铺名称</lable>";
|
|
|
298
|
- }else{
|
|
|
299
|
- return "<lable><input type='radio' name='isShowShopName' value='Y'>显示店铺名称</lable><br>" +
|
|
|
300
|
- "<lable><input type='radio' name='isShowShopName' value='N' checked='checked'>不显示店铺名称</lable>";
|
|
|
301
|
- }
|
|
|
302
|
- }},
|
|
|
303
|
- {display:"商品详情页banner图片", render:function(item){
|
|
|
304
|
- return "<input type=file name='DetailbannerImage' id='DetailbannerImage_"+item.__index+"' value='"+item.detailSrc+"' />";
|
|
|
305
|
- }}
|
|
|
306
|
- ]
|
|
|
307
|
- });
|
|
|
308
|
- g.__rows=""||jsonClone.resources.shopTopBanner.data;
|
351
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
352
|
+ g = new common.grid({
|
|
|
353
|
+ hash: false,
|
|
|
354
|
+ el:"#"+id,
|
|
|
355
|
+ columns:[
|
|
|
356
|
+ {display:"店铺banner图片", render:function(item){
|
|
|
357
|
+ return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
|
|
|
358
|
+ }},
|
|
|
359
|
+ {display:"是否显示店铺名称", render:function(item){
|
|
|
360
|
+ if(item.isShowShopName == "Y"){
|
|
|
361
|
+ return "<lable><input type='radio' name='isShowShopName' value='Y' checked='checked'>显示店铺名称</lable><br>" +
|
|
|
362
|
+ "<lable><input type='radio' name='isShowShopName' value='N'>不显示店铺名称</lable>";
|
|
|
363
|
+ }else{
|
|
|
364
|
+ return "<lable><input type='radio' name='isShowShopName' value='Y'>显示店铺名称</lable><br>" +
|
|
|
365
|
+ "<lable><input type='radio' name='isShowShopName' value='N' checked='checked'>不显示店铺名称</lable>";
|
|
|
366
|
+ }
|
|
|
367
|
+ }},
|
|
|
368
|
+ {display:"商品详情页banner图片", render:function(item){
|
|
|
369
|
+ return "<input type=file name='DetailbannerImage' id='DetailbannerImage_"+item.__index+"' value='"+item.detailSrc+"' />";
|
|
|
370
|
+ }}
|
|
|
371
|
+ ]
|
|
|
372
|
+ });
|
|
|
373
|
+ g.__rows=""||jsonClone.resources.shopTopBanner.data;
|
|
|
374
|
+ }
|
|
|
375
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
376
|
+ g = new common.grid({
|
|
|
377
|
+ hash: false,
|
|
|
378
|
+ el:"#"+id,
|
|
|
379
|
+ columns:[
|
|
|
380
|
+ {display:"店铺banner图片", render:function(item){
|
|
|
381
|
+ return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
|
|
|
382
|
+ }},
|
|
|
383
|
+ {display:"是否显示店铺名称", render:function(item){
|
|
|
384
|
+ if(item.isShowShopName == "Y"){
|
|
|
385
|
+ return "<lable><input type='radio' name='isShowShopName' value='Y' checked='checked'>显示店铺名称</lable><br>" +
|
|
|
386
|
+ "<lable><input type='radio' name='isShowShopName' value='N'>不显示店铺名称</lable>";
|
|
|
387
|
+ }else{
|
|
|
388
|
+ return "<lable><input type='radio' name='isShowShopName' value='Y'>显示店铺名称</lable><br>" +
|
|
|
389
|
+ "<lable><input type='radio' name='isShowShopName' value='N' checked='checked'>不显示店铺名称</lable>";
|
|
|
390
|
+ }
|
|
|
391
|
+ }}
|
|
|
392
|
+ ]
|
|
|
393
|
+ });
|
|
|
394
|
+ g.__rows=""||jsonClone.resources.shopTopBanner_APP.data;
|
|
|
395
|
+ }
|
309
|
g.init(g.__rows);
|
396
|
g.init(g.__rows);
|
310
|
break;
|
397
|
break;
|
311
|
|
398
|
|
|
@@ -316,7 +403,7 @@ function gridInit(id){ |
|
@@ -316,7 +403,7 @@ function gridInit(id){ |
316
|
el:"#"+id,
|
403
|
el:"#"+id,
|
317
|
columns:[
|
404
|
columns:[
|
318
|
{display:"编号", render:function(item){
|
405
|
{display:"编号", render:function(item){
|
319
|
- return item.__index+1;
|
406
|
+ return item.__index+1;
|
320
|
}},
|
407
|
}},
|
321
|
{display:"名称", render:function(item){
|
408
|
{display:"名称", render:function(item){
|
322
|
return "<input class='form-control inputChange' type=text name='name' value='"+item.name+"' data-index='"+item.__index+"' maxlength='5' />";
|
409
|
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){ |
|
@@ -332,20 +419,26 @@ function gridInit(id){ |
332
|
|
419
|
|
333
|
//店铺大图资源位
|
420
|
//店铺大图资源位
|
334
|
case "editor-largePic":
|
421
|
case "editor-largePic":
|
|
|
422
|
+ $('.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");
|
335
|
g = new common.grid({
|
423
|
g = new common.grid({
|
336
|
hash: false,
|
424
|
hash: false,
|
337
|
el:"#"+id,
|
425
|
el:"#"+id,
|
338
|
columns:[
|
426
|
columns:[
|
339
|
{display:"排序", render:function(item){
|
427
|
{display:"排序", render:function(item){
|
|
|
428
|
+ item.position=item.position || (item.__index+1);
|
340
|
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
|
429
|
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
|
341
|
}},
|
430
|
}},
|
342
|
- {
|
|
|
343
|
- 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> " +
|
|
|
344
|
- "<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>",
|
431
|
+ {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> " +
|
|
|
432
|
+ "<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>",
|
345
|
render: function (item) {
|
433
|
render: function (item) {
|
346
|
return resourcesHtmlInit(item,"largePic");
|
434
|
return resourcesHtmlInit(item,"largePic");
|
347
|
}
|
435
|
}
|
348
|
- }
|
436
|
+ },
|
|
|
437
|
+ {display:"操作", render:function(item){
|
|
|
438
|
+ if(g.__rows.length > 1){
|
|
|
439
|
+ return "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' />";
|
|
|
440
|
+ }
|
|
|
441
|
+ }}
|
349
|
]
|
442
|
]
|
350
|
});
|
443
|
});
|
351
|
g.__rows=""||jsonClone.resources.largeSlideImg.data;
|
444
|
g.__rows=""||jsonClone.resources.largeSlideImg.data;
|
|
@@ -370,7 +463,12 @@ function gridInit(id){ |
|
@@ -370,7 +463,12 @@ function gridInit(id){ |
370
|
}
|
463
|
}
|
371
|
]
|
464
|
]
|
372
|
});
|
465
|
});
|
373
|
- g.__rows=""||jsonClone.resources.oneRowTwoColImages.data;
|
466
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
467
|
+ g.__rows=""||jsonClone.resources.oneRowTwoColImages.data;
|
|
|
468
|
+ }
|
|
|
469
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
470
|
+ g.__rows=""||jsonClone.resources.oneRowTwoColImages_APP.data;
|
|
|
471
|
+ }
|
374
|
g.init(g.__rows);
|
472
|
g.init(g.__rows);
|
375
|
break;
|
473
|
break;
|
376
|
|
474
|
|
|
@@ -460,7 +558,7 @@ function gridInit(id){ |
|
@@ -460,7 +558,7 @@ function gridInit(id){ |
460
|
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
|
558
|
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
|
461
|
}},
|
559
|
}},
|
462
|
{display:"图片", render:function(item){
|
560
|
{display:"图片", render:function(item){
|
463
|
- return "<input type=file name='signboardImage' id='signboardImage_"+item.__index+"' value='"+item.src+"' />";
|
561
|
+ return "<input type=file name='signboardImage' id='hotRecommendImage_"+item.__index+"' value='"+item.src+"' />";
|
464
|
}},
|
562
|
}},
|
465
|
{display:"链接", render:function(item){
|
563
|
{display:"链接", render:function(item){
|
466
|
return "<input class='form-control inputChange' type=text name='url' value='"+item.url+"' data-index='"+item.__index+"' />";
|
564
|
return "<input class='form-control inputChange' type=text name='url' value='"+item.url+"' data-index='"+item.__index+"' />";
|
|
@@ -492,6 +590,7 @@ function gridInit(id){ |
|
@@ -492,6 +590,7 @@ function gridInit(id){ |
492
|
|
590
|
|
493
|
//水牌signboard
|
591
|
//水牌signboard
|
494
|
case "editor-signboard":
|
592
|
case "editor-signboard":
|
|
|
593
|
+ $('.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");
|
495
|
g = new common.grid({
|
594
|
g = new common.grid({
|
496
|
hash: false,
|
595
|
hash: false,
|
497
|
el:"#"+id,
|
596
|
el:"#"+id,
|
|
@@ -500,34 +599,16 @@ function gridInit(id){ |
|
@@ -500,34 +599,16 @@ function gridInit(id){ |
500
|
item.position=item.position || (item.__index+1);
|
599
|
item.position=item.position || (item.__index+1);
|
501
|
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
|
600
|
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
|
502
|
}},
|
601
|
}},
|
503
|
- {display:"图片", render:function(item){
|
|
|
504
|
- return "<input type=file name='signboardImage' id='signboardImage_"+item.__index+"' value='"+item.src+"' />";
|
|
|
505
|
- }},
|
|
|
506
|
- {display:"链接", render:function(item){
|
|
|
507
|
- return "<input class='form-control inputChange' type=text name='url' value='"+item.url+"' data-index='"+item.__index+"' />";
|
|
|
508
|
- }},
|
|
|
509
|
- {display:"开始时间", render:function(item){
|
|
|
510
|
- 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+"' />";
|
|
|
511
|
- }},
|
|
|
512
|
- {display:"结束时间", render:function(item){
|
|
|
513
|
- 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+"' />";
|
|
|
514
|
- }},
|
|
|
515
|
- {display:"状态", render:function(item){
|
|
|
516
|
- return "<span style='white-space: nowrap'>" + (item.publishStatus==0?"未发布":"已发布") + "</span>";
|
|
|
517
|
- }},
|
|
|
518
|
- {display:"操作", render:function(item){
|
|
|
519
|
- var htmlPic = "",i=item.__index;
|
|
|
520
|
- if(i == (g.__rows.length-1) && g.__rows.length > 1){
|
|
|
521
|
- htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' /><br>";
|
|
|
522
|
- htmlPic += "<input type=button class='btn btn-info btn-xs addBtn' style='margin-top: 10px' value='添加一条' data-index='"+item.__index+"' />";
|
|
|
523
|
- }
|
|
|
524
|
- if(i < (g.__rows.length-1) && g.__rows.length > 1){
|
|
|
525
|
- htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' />";
|
602
|
+ {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> " +
|
|
|
603
|
+ "<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>",
|
|
|
604
|
+ render: function (item) {
|
|
|
605
|
+ return resourcesHtmlInit(item,"signboard");
|
526
|
}
|
606
|
}
|
527
|
- if(i == (g.__rows.length-1) && g.__rows.length == 1){
|
|
|
528
|
- htmlPic += "<input type=button class='btn btn-info btn-xs addBtn' value='添加一条' data-index='"+item.__index+"' />";
|
607
|
+ },
|
|
|
608
|
+ {display:"操作", render:function(item){
|
|
|
609
|
+ if(g.__rows.length > 1){
|
|
|
610
|
+ return "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' />";
|
529
|
}
|
611
|
}
|
530
|
- return htmlPic;
|
|
|
531
|
}}
|
612
|
}}
|
532
|
]
|
613
|
]
|
533
|
});
|
614
|
});
|
|
@@ -634,12 +715,7 @@ function gridInit(id){ |
|
@@ -634,12 +715,7 @@ function gridInit(id){ |
634
|
//新品上架
|
715
|
//新品上架
|
635
|
case "editor-newProduct":
|
716
|
case "editor-newProduct":
|
636
|
$("#"+id).html("<div id='editor-newProduct-grid' style='width: 500px; float: left'></div><div class='top20List' style='float: left;margin-left: 40px'></div> ");
|
717
|
$("#"+id).html("<div id='editor-newProduct-grid' style='width: 500px; float: left'></div><div class='top20List' style='float: left;margin-left: 40px'></div> ");
|
637
|
- if(topNewProducts){
|
|
|
638
|
- $("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),topNewProducts));
|
|
|
639
|
- }else{
|
|
|
640
|
- $("#"+id+" .top20List").html("最新上架20条加载失败,请重新加载!");
|
|
|
641
|
- }
|
|
|
642
|
-
|
718
|
+ //左侧已选商品
|
643
|
g = new common.grid({
|
719
|
g = new common.grid({
|
644
|
hash: false,
|
720
|
hash: false,
|
645
|
el:"#editor-newProduct-grid",
|
721
|
el:"#editor-newProduct-grid",
|
|
@@ -659,18 +735,19 @@ function gridInit(id){ |
|
@@ -659,18 +735,19 @@ function gridInit(id){ |
659
|
});
|
735
|
});
|
660
|
g.__rows=""||jsonClone.resources.newProducts.data;
|
736
|
g.__rows=""||jsonClone.resources.newProducts.data;
|
661
|
g.init(g.__rows);
|
737
|
g.init(g.__rows);
|
662
|
- productTopDataLink(g.__rows);
|
738
|
+ //右侧热销排名前20商品
|
|
|
739
|
+ if(jsonMain.resources.allNewProducts.data.length > 0){
|
|
|
740
|
+ $("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),jsonMain.resources.allNewProducts));
|
|
|
741
|
+ productTopDataLink(g.__rows);
|
|
|
742
|
+ }else{
|
|
|
743
|
+ $("#"+id+" .top20List").html("<font color='red'>* 最新上架20条加载失败,请重新加载页面!</font>");
|
|
|
744
|
+ }
|
663
|
break;
|
745
|
break;
|
664
|
|
746
|
|
665
|
//人气单品
|
747
|
//人气单品
|
666
|
case "editor-hotProduct":
|
748
|
case "editor-hotProduct":
|
667
|
$("#"+id).html("<div id='editor-hotProduct-grid' style='width: 500px; float: left'></div><div class='top20List' style='float: left;margin-left: 40px'></div> ");
|
749
|
$("#"+id).html("<div id='editor-hotProduct-grid' style='width: 500px; float: left'></div><div class='top20List' style='float: left;margin-left: 40px'></div> ");
|
668
|
- if(topHotProducts){
|
|
|
669
|
- $("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),topHotProducts));
|
|
|
670
|
- }else{
|
|
|
671
|
- $("#"+id+" .top20List").html("最新上架20条加载失败,请重新加载!");
|
|
|
672
|
- }
|
|
|
673
|
-
|
750
|
+ //左侧已选商品
|
674
|
g = new common.grid({
|
751
|
g = new common.grid({
|
675
|
hash: false,
|
752
|
hash: false,
|
676
|
el:"#editor-hotProduct-grid",
|
753
|
el:"#editor-hotProduct-grid",
|
|
@@ -688,9 +765,27 @@ function gridInit(id){ |
|
@@ -688,9 +765,27 @@ function gridInit(id){ |
688
|
}}
|
765
|
}}
|
689
|
]
|
766
|
]
|
690
|
});
|
767
|
});
|
691
|
- g.__rows=""||jsonClone.resources.hotProducts.data;
|
768
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
769
|
+ g.__rows=""||jsonClone.resources.hotProducts.data;
|
|
|
770
|
+ //右侧热销排名前20商品
|
|
|
771
|
+ if(jsonMain.resources.allHotProducts.data.length > 0){
|
|
|
772
|
+ $("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),jsonMain.resources.allHotProducts));
|
|
|
773
|
+ productTopDataLink(g.__rows);
|
|
|
774
|
+ }else{
|
|
|
775
|
+ $("#"+id+" .top20List").html("<font color='red'>* 最新上架20条加载失败,请重新加载页面!</font>");
|
|
|
776
|
+ }
|
|
|
777
|
+ }
|
|
|
778
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
779
|
+ g.__rows=""||jsonClone.resources.hotProducts_APP.data;
|
|
|
780
|
+ //右侧热销排名前20商品
|
|
|
781
|
+ if(jsonMain.resources.allHotProducts_APP.data.length > 0){
|
|
|
782
|
+ $("#"+id+" .top20List").html(common.util.__template2($("#top20Products").html(),jsonMain.resources.allHotProducts_APP));
|
|
|
783
|
+ productTopDataLink(g.__rows);
|
|
|
784
|
+ }else{
|
|
|
785
|
+ $("#"+id+" .top20List").html("<font color='red'>* 最新上架20条加载失败,请重新加载页面!</font>");
|
|
|
786
|
+ }
|
|
|
787
|
+ }
|
692
|
g.init(g.__rows);
|
788
|
g.init(g.__rows);
|
693
|
- productTopDataLink(g.__rows);
|
|
|
694
|
break;
|
789
|
break;
|
695
|
|
790
|
|
696
|
default :
|
791
|
default :
|
|
@@ -703,9 +798,24 @@ function freshJson(id,data,status){ |
|
@@ -703,9 +798,24 @@ function freshJson(id,data,status){ |
703
|
case "editor-banner":
|
798
|
case "editor-banner":
|
704
|
if(status == 1){
|
799
|
if(status == 1){
|
705
|
data[0].isShowShopName = $("input[name='isShowShopName']:checked").val();
|
800
|
data[0].isShowShopName = $("input[name='isShowShopName']:checked").val();
|
706
|
- cloneArr(data,jsonMain.resources.shopTopBanner.data);
|
801
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
802
|
+ jsonMain.resources.shopTopBanner_APP.isUsed = "Y";
|
|
|
803
|
+ cloneArr(data,jsonMain.resources.shopTopBanner_APP.data);
|
|
|
804
|
+ }
|
|
|
805
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
806
|
+ cloneArr(data,jsonMain.resources.shopTopBanner.data);
|
|
|
807
|
+ if(jsonMain.resources.shopTopBanner_APP.isUsed == "N"){
|
|
|
808
|
+ cloneArr(data,jsonMain.resources.shopTopBanner_APP.data);
|
|
|
809
|
+ cloneArr(data,jsonClone.resources.shopTopBanner_APP.data);
|
|
|
810
|
+ }
|
|
|
811
|
+ }
|
707
|
}else if(status == 0){
|
812
|
}else if(status == 0){
|
708
|
- cloneArr(jsonMain.resources.shopTopBanner.data,data);
|
813
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
814
|
+ cloneArr(jsonMain.resources.shopTopBanner_APP.data,data);
|
|
|
815
|
+ }
|
|
|
816
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
817
|
+ cloneArr(jsonMain.resources.shopTopBanner.data,data);
|
|
|
818
|
+ }
|
709
|
}
|
819
|
}
|
710
|
break;
|
820
|
break;
|
711
|
|
821
|
|
|
@@ -727,9 +837,24 @@ function freshJson(id,data,status){ |
|
@@ -727,9 +837,24 @@ function freshJson(id,data,status){ |
727
|
|
837
|
|
728
|
case "editor-smallPic":
|
838
|
case "editor-smallPic":
|
729
|
if(status == 1){
|
839
|
if(status == 1){
|
730
|
- cloneArr(sortJson(data,1),jsonMain.resources.oneRowTwoColImages.data);
|
840
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
841
|
+ jsonMain.resources.oneRowTwoColImages_APP.isUsed = "Y";
|
|
|
842
|
+ cloneArr(sortJson(data,1),jsonMain.resources.oneRowTwoColImages_APP.data);
|
|
|
843
|
+ }
|
|
|
844
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
845
|
+ cloneArr(sortJson(data,1),jsonMain.resources.oneRowTwoColImages.data);
|
|
|
846
|
+ if(jsonMain.resources.oneRowTwoColImages_APP.isUsed == "N"){
|
|
|
847
|
+ cloneArr(sortJson(data,1),jsonMain.resources.oneRowTwoColImages_APP.data);
|
|
|
848
|
+ cloneArr(sortJson(data,1),jsonClone.resources.oneRowTwoColImages_APP.data);
|
|
|
849
|
+ }
|
|
|
850
|
+ }
|
731
|
}else if(status == 0){
|
851
|
}else if(status == 0){
|
732
|
- cloneArr(jsonMain.resources.oneRowTwoColImages.data,data);
|
852
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
853
|
+ cloneArr(jsonMain.resources.oneRowTwoColImages_APP.data,data);
|
|
|
854
|
+ }
|
|
|
855
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
856
|
+ cloneArr(jsonMain.resources.oneRowTwoColImages.data,data);
|
|
|
857
|
+ }
|
733
|
}
|
858
|
}
|
734
|
break;
|
859
|
break;
|
735
|
|
860
|
|
|
@@ -793,9 +918,24 @@ function freshJson(id,data,status){ |
|
@@ -793,9 +918,24 @@ function freshJson(id,data,status){ |
793
|
|
918
|
|
794
|
case "editor-hotProduct":
|
919
|
case "editor-hotProduct":
|
795
|
if(status == 1){
|
920
|
if(status == 1){
|
796
|
- cloneArr(sortJson(data,1),jsonMain.resources.hotProducts.data);
|
921
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
922
|
+ jsonMain.resources.hotProducts_APP.isUsed = "Y";
|
|
|
923
|
+ cloneArr(sortJson(data,1),jsonMain.resources.hotProducts_APP.data);
|
|
|
924
|
+ }
|
|
|
925
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
926
|
+ cloneArr(sortJson(data,1),jsonMain.resources.hotProducts.data);
|
|
|
927
|
+ if(jsonMain.resources.hotProducts_APP.isUsed == "N"){
|
|
|
928
|
+ cloneArr(sortJson(data,1),jsonMain.resources.hotProducts_APP.data);
|
|
|
929
|
+ cloneArr(sortJson(data,1),jsonClone.resources.hotProducts_APP.data);
|
|
|
930
|
+ }
|
|
|
931
|
+ }
|
797
|
}else if(status == 0){
|
932
|
}else if(status == 0){
|
798
|
- cloneArr(jsonMain.resources.hotProducts.data,data);
|
933
|
+ if(curPlatform == "shopWeb-app"){
|
|
|
934
|
+ cloneArr(jsonMain.resources.hotProducts_APP.data,data);
|
|
|
935
|
+ }
|
|
|
936
|
+ if(curPlatform == "shopWeb-pc"){
|
|
|
937
|
+ cloneArr(jsonMain.resources.hotProducts.data,data);
|
|
|
938
|
+ }
|
799
|
}
|
939
|
}
|
800
|
break;
|
940
|
break;
|
801
|
|
941
|
|
|
@@ -965,9 +1105,13 @@ function showEditorIconEvent(){ |
|
@@ -965,9 +1105,13 @@ function showEditorIconEvent(){ |
965
|
var _this = $(this);
|
1105
|
var _this = $(this);
|
966
|
var editorModelId = $(this).attr("data-toggle");
|
1106
|
var editorModelId = $(this).attr("data-toggle");
|
967
|
var editorModelTitle = $(this).attr("data-title");
|
1107
|
var editorModelTitle = $(this).attr("data-title");
|
968
|
-
|
|
|
969
|
- var editorIcon = "<div class='editorBorder'></div>" +
|
|
|
970
|
- "<a class='editorIcon' href='javascrip:'>编辑</a>"
|
1108
|
+ var editorIcon = "";
|
|
|
1109
|
+ if(editorModelId == "editor-brand-app" || editorModelId == "editor-largePic-app" || editorModelId == "editor-recommend-app"){
|
|
|
1110
|
+ editorIcon += "<div class='editorBorder' style='border: 5px solid #ff69b4'></div>"
|
|
|
1111
|
+ }else{
|
|
|
1112
|
+ editorIcon += "<div class='editorBorder'></div>"
|
|
|
1113
|
+ }
|
|
|
1114
|
+ editorIcon += "<a class='editorIcon' href='javascript:'>编辑</a>"
|
971
|
_this.append(editorIcon);
|
1115
|
_this.append(editorIcon);
|
972
|
//编辑事件
|
1116
|
//编辑事件
|
973
|
editorIconEvent(editorModelTitle,editorModelId);
|
1117
|
editorIconEvent(editorModelTitle,editorModelId);
|
|
@@ -1006,14 +1150,18 @@ function untilEditorEvent(id){ |
|
@@ -1006,14 +1150,18 @@ function untilEditorEvent(id){ |
1006
|
var _index = obj.key.replace(/^file_onComplete_recommendImage_/,'');
|
1150
|
var _index = obj.key.replace(/^file_onComplete_recommendImage_/,'');
|
1007
|
g.__rows[_index].src = obj.data;
|
1151
|
g.__rows[_index].src = obj.data;
|
1008
|
}
|
1152
|
}
|
|
|
1153
|
+ if(/^file_onComplete_hotRecommendImage_/.test(obj.key)){
|
|
|
1154
|
+ var _index = obj.key.replace(/^file_onComplete_hotRecommendImage_/,'');
|
|
|
1155
|
+ g.__rows[_index].src = obj.data;
|
|
|
1156
|
+ }
|
1009
|
if(/^file_onComplete_signboardImage_/.test(obj.key)){
|
1157
|
if(/^file_onComplete_signboardImage_/.test(obj.key)){
|
1010
|
var _index = obj.key.replace(/^file_onComplete_signboardImage_/,'');
|
1158
|
var _index = obj.key.replace(/^file_onComplete_signboardImage_/,'');
|
1011
|
- g.__rows[_index].src = obj.data;
|
1159
|
+ var _indexList = _index.split("_");
|
|
|
1160
|
+ g.__rows[_indexList[0]].data[_indexList[1]].src = obj.data;
|
1012
|
}
|
1161
|
}
|
1013
|
});
|
1162
|
});
|
1014
|
$("#"+id+" nav").hide();
|
1163
|
$("#"+id+" nav").hide();
|
1015
|
- $(".modal-dialog").css("width","900px");
|
|
|
1016
|
- $(".modal-dialog .modal-body .editor-dialog").css("max-height","650px");
|
1164
|
+ $(".modal-dialog").css("width","960px");
|
1017
|
$(".modal-dialog .modal-body .editor-dialog").css("overflow-y","auto");
|
1165
|
$(".modal-dialog .modal-body .editor-dialog").css("overflow-y","auto");
|
1018
|
$(".modal-dialog .modal-body .editor-dialog").css("overflow-x","hidden");
|
1166
|
$(".modal-dialog .modal-body .editor-dialog").css("overflow-x","hidden");
|
1019
|
}
|
1167
|
}
|
|
@@ -1025,11 +1173,16 @@ function resourcesHtmlInit(item,resName){ |
|
@@ -1025,11 +1173,16 @@ function resourcesHtmlInit(item,resName){ |
1025
|
htmlPic += "<div class='row'>" +
|
1173
|
htmlPic += "<div class='row'>" +
|
1026
|
"<div class='col-sm-2'><input type=file name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' /></div>" +
|
1174
|
"<div class='col-sm-2'><input type=file name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' /></div>" +
|
1027
|
"<div class='col-sm-3'><input type=text class='form-control inputChange' name='url' value='"+ picList[i].url +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
|
1175
|
"<div class='col-sm-3'><input type=text class='form-control inputChange' name='url' value='"+ picList[i].url +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
|
1028
|
- "<div class='col-sm-2'>" +
|
|
|
1029
|
- "<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>" +
|
|
|
1030
|
- "<div class='col-sm-2'>" +
|
|
|
1031
|
- "<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>" +
|
|
|
1032
|
- "<div class='col-sm-1'><span style='white-space: nowrap;'>"+ (picList[i].publishStatus==0?"未发布":"已发布") +"</span></div>" +
|
1176
|
+ "<div class='col-sm-2'>";
|
|
|
1177
|
+ if(i>0){
|
|
|
1178
|
+ 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 +"' />" +
|
|
|
1179
|
+ "<span style='color: #999; font-size: 12px'>*上一条结束时间</span>";
|
|
|
1180
|
+ }else{
|
|
|
1181
|
+ 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 +"' />";
|
|
|
1182
|
+ }
|
|
|
1183
|
+ htmlPic += "</div><div class='col-sm-2'>" +
|
|
|
1184
|
+ "<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>" +
|
|
|
1185
|
+ "<div class='col-sm-1'><span class='publishStatus' style='white-space: nowrap; line-height: 40px'>"+ checkdate(picList[i].startTime,picList[i].endTime) +"</span></div>" +
|
1033
|
"<div class='col-sm-2'>";
|
1186
|
"<div class='col-sm-2'>";
|
1034
|
if(i == (picList.length-1) && picList.length > 1){
|
1187
|
if(i == (picList.length-1) && picList.length > 1){
|
1035
|
htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+ item.__index +"_"+ i +"' /><br>";
|
1188
|
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){ |
|
@@ -1088,6 +1241,41 @@ function cloneArr(arr1,arr2){ |
1088
|
}
|
1241
|
}
|
1089
|
return arr2;
|
1242
|
return arr2;
|
1090
|
}
|
1243
|
}
|
|
|
1244
|
+//时间校验
|
|
|
1245
|
+function checkdate(startDate,endDate){
|
|
|
1246
|
+ if (endDate) {
|
|
|
1247
|
+ var endDateTemp = endDate.split(" ");
|
|
|
1248
|
+ var arrEndDate = endDateTemp[0].split("-");
|
|
|
1249
|
+ var arrEndTime = endDateTemp[1].split(":");
|
|
|
1250
|
+ var allEndDate = new Date(arrEndDate[0], parseInt(arrEndDate[1])-1, arrEndDate[2], arrEndTime[0], arrEndTime[1], arrEndTime[2]);
|
|
|
1251
|
+ }
|
|
|
1252
|
+ if(startDate){
|
|
|
1253
|
+ var startDateTemp = startDate.split(" ");
|
|
|
1254
|
+ var arrStartDate = startDateTemp[0].split("-");
|
|
|
1255
|
+ var arrStartTime = startDateTemp[1].split(":");
|
|
|
1256
|
+ var allStartDate = new Date(arrStartDate[0], parseInt(arrStartDate[1])-1, arrStartDate[2], arrStartTime[0], arrStartTime[1], arrStartTime[2]);
|
|
|
1257
|
+ }
|
|
|
1258
|
+ var nowDate = new Date();
|
|
|
1259
|
+
|
|
|
1260
|
+ if(startDate && endDate){
|
|
|
1261
|
+ if(nowDate > allEndDate) {
|
|
|
1262
|
+ return "<b style='color: #ec971f'>已过期</b>";
|
|
|
1263
|
+ }else if(allStartDate > nowDate){
|
|
|
1264
|
+ return "<b style='color: #428bca'>未发布</b>";
|
|
|
1265
|
+ }else{
|
|
|
1266
|
+ return "<b style='color: #5cb85c'>发布中</b>";
|
|
|
1267
|
+ }
|
|
|
1268
|
+ }else if(!startDate && endDate){
|
|
|
1269
|
+ if(nowDate > allEndDate) {
|
|
|
1270
|
+ return "<b style='color: #ec971f'>已过期</b>";
|
|
|
1271
|
+ }else{
|
|
|
1272
|
+ return "<b style='color: #5cb85c'>发布中</b>";
|
|
|
1273
|
+ }
|
|
|
1274
|
+ }else{
|
|
|
1275
|
+ return "<b style='color: #428bca'>未发布</b>";
|
|
|
1276
|
+ }
|
|
|
1277
|
+ return true;
|
|
|
1278
|
+}
|
1091
|
|
1279
|
|
1092
|
/********************事件绑定*********************/
|
1280
|
/********************事件绑定*********************/
|
1093
|
|
1281
|
|
|
@@ -1109,20 +1297,18 @@ $(document).on("click","input[name=brandLevel]",function(){ |
|
@@ -1109,20 +1297,18 @@ $(document).on("click","input[name=brandLevel]",function(){ |
1109
|
})
|
1297
|
})
|
1110
|
//选择使用模板
|
1298
|
//选择使用模板
|
1111
|
$(document).on("change","#templateSelect",function(){
|
1299
|
$(document).on("change","#templateSelect",function(){
|
1112
|
- jsonMain.templateName = $(this).val();
|
1300
|
+ jsonMain.templateType = $(this).val();
|
|
|
1301
|
+ $(this).removeClass("error");
|
1113
|
})
|
1302
|
})
|
1114
|
//暂存模板
|
1303
|
//暂存模板
|
1115
|
$(document).on("click","#saveModule",function(){
|
1304
|
$(document).on("click","#saveModule",function(){
|
1116
|
- if(jsonMain.templateName == "0"){
|
|
|
1117
|
- common.util.__tip("请选择展示使用模板!");
|
|
|
1118
|
- return;
|
|
|
1119
|
- }
|
|
|
1120
|
saveDecoration(100);
|
1305
|
saveDecoration(100);
|
1121
|
})
|
1306
|
})
|
1122
|
//提交审核
|
1307
|
//提交审核
|
1123
|
$(document).on("click","#submitModule",function(){
|
1308
|
$(document).on("click","#submitModule",function(){
|
1124
|
- if(jsonMain.templateName == "0"){
|
1309
|
+ if(jsonMain.templateType == "0"){
|
1125
|
common.util.__tip("请选择展示使用模板!");
|
1310
|
common.util.__tip("请选择展示使用模板!");
|
|
|
1311
|
+ $("#templateSelect").focus().addClass("error");
|
1126
|
return;
|
1312
|
return;
|
1127
|
}
|
1313
|
}
|
1128
|
saveDecoration(200);
|
1314
|
saveDecoration(200);
|
|
@@ -1181,12 +1367,27 @@ $(document).on("click",".addBtn",function(){ |
|
@@ -1181,12 +1367,27 @@ $(document).on("click",".addBtn",function(){ |
1181
|
|
1367
|
|
1182
|
if(indexList.length > 1){
|
1368
|
if(indexList.length > 1){
|
1183
|
g.__rows[indexList[0]].data.push($.extend({},ENUM[curDialogId]));
|
1369
|
g.__rows[indexList[0]].data.push($.extend({},ENUM[curDialogId]));
|
|
|
1370
|
+ if(curDialogId == "editor-largePic" || curDialogId == "editor-smallPic" || curDialogId == "editor-signboard"){
|
|
|
1371
|
+ (g.__rows[indexList[0]].data)[(parseInt(indexList[1]) + 1)].startTime = (g.__rows[indexList[0]].data)[indexList[1]].endTime;
|
|
|
1372
|
+ }
|
1184
|
}else{
|
1373
|
}else{
|
1185
|
g.__rows.push($.extend({},ENUM[curDialogId]));
|
1374
|
g.__rows.push($.extend({},ENUM[curDialogId]));
|
1186
|
}
|
1375
|
}
|
1187
|
g.init(g.__rows);
|
1376
|
g.init(g.__rows);
|
1188
|
untilEditorEvent(curDialogId);
|
1377
|
untilEditorEvent(curDialogId);
|
1189
|
});
|
1378
|
});
|
|
|
1379
|
+//资源位大图,水牌添加一条资源位
|
|
|
1380
|
+$(document).on("click",".addBtn2",function(){
|
|
|
1381
|
+ if( curDialogId == "editor-largePic" && g.__rows.length > 4){
|
|
|
1382
|
+ $(".largePicAddTip").text("* 最多只能添加5个资源位大图!").css("color","#ff0000");
|
|
|
1383
|
+ return;
|
|
|
1384
|
+ }else{
|
|
|
1385
|
+ $(".largePicAddTip").empty();
|
|
|
1386
|
+ g.__rows.push($.extend(true,{},ENUM["editor-largePic2"]));
|
|
|
1387
|
+ g.init(g.__rows);
|
|
|
1388
|
+ untilEditorEvent(curDialogId);
|
|
|
1389
|
+ }
|
|
|
1390
|
+});
|
1190
|
//input change同时更新json
|
1391
|
//input change同时更新json
|
1191
|
$(document).on("change",".inputChange",function(){
|
1392
|
$(document).on("change",".inputChange",function(){
|
1192
|
var _index = $(this).attr("data-index");
|
1393
|
var _index = $(this).attr("data-index");
|
|
@@ -1198,6 +1399,23 @@ $(document).on("change",".inputChange",function(){ |
|
@@ -1198,6 +1399,23 @@ $(document).on("change",".inputChange",function(){ |
1198
|
}else{
|
1399
|
}else{
|
1199
|
g.__rows[indexList[0]][_name] = $(this).val();
|
1400
|
g.__rows[indexList[0]][_name] = $(this).val();
|
1200
|
}
|
1401
|
}
|
|
|
1402
|
+ if(curDialogId == "editor-largePic" || curDialogId == "editor-smallPic" || curDialogId == "editor-signboard"){
|
|
|
1403
|
+ if($(this).attr("name") == "endTime"){
|
|
|
1404
|
+ if(g.__rows[indexList[0]].data.length - 1 > indexList[1]){
|
|
|
1405
|
+ (g.__rows[indexList[0]].data)[(parseInt(indexList[1]) + 1)].startTime = $(this).val();
|
|
|
1406
|
+ $(this).parents(".row").next().children().find("input[name='startTime']").val($(this).val());
|
|
|
1407
|
+
|
|
|
1408
|
+ var endDate = $(this).parents(".row").next().children().find("input[name='endTime']").val();
|
|
|
1409
|
+ $(this).parents(".row").next().children().find(".publishStatus").html(checkdate($(this).val(),endDate));
|
|
|
1410
|
+ }
|
|
|
1411
|
+ var startDate = $(this).parents(".row").find("input[name='startTime']").val();
|
|
|
1412
|
+ $(this).parents(".row").find(".publishStatus").html(checkdate(startDate,$(this).val()));
|
|
|
1413
|
+ }
|
|
|
1414
|
+ if($(this).attr("name") == "startTime"){
|
|
|
1415
|
+ var endDate = $(this).parents(".row").find("input[name='endTime']").val();
|
|
|
1416
|
+ $(this).parents(".row").find(".publishStatus").html(checkdate($(this).val(),endDate));
|
|
|
1417
|
+ }
|
|
|
1418
|
+ }
|
1201
|
$(this).removeClass("error");
|
1419
|
$(this).removeClass("error");
|
1202
|
});
|
1420
|
});
|
1203
|
//checkBox change同时更新json
|
1421
|
//checkBox change同时更新json
|
|
@@ -1219,12 +1437,13 @@ $(document).on("click",".topAdd",function(){ |
|
@@ -1219,12 +1437,13 @@ $(document).on("click",".topAdd",function(){ |
1219
|
item.src = $(this).find('img').attr("src");
|
1437
|
item.src = $(this).find('img').attr("src");
|
1220
|
item.productId = $(this).attr("data-productId");
|
1438
|
item.productId = $(this).attr("data-productId");
|
1221
|
item.productName = $(this).attr("data-productName");
|
1439
|
item.productName = $(this).attr("data-productName");
|
1222
|
- item.productPrice = $(this).attr("data-productPrice");
|
1440
|
+ item.salesPrice = $(this).attr("data-productPrice");
|
|
|
1441
|
+ item.productSkn = $(this).attr("data-productSkn");
|
1223
|
|
1442
|
|
1224
|
g.__rows.push(item);
|
1443
|
g.__rows.push(item);
|
1225
|
g.init(g.__rows);
|
1444
|
g.init(g.__rows);
|
1226
|
untilEditorEvent(curDialogId);
|
1445
|
untilEditorEvent(curDialogId);
|
1227
|
-
|
1446
|
+ productTopDataLink(g.__rows);
|
1228
|
$(".topTip span").text("已经勾选"+ g.__rows.length +"件,最多勾选8件商品!");
|
1447
|
$(".topTip span").text("已经勾选"+ g.__rows.length +"件,最多勾选8件商品!");
|
1229
|
}
|
1448
|
}
|
1230
|
}else{
|
1449
|
}else{
|