Authored by 陶雨

资源内容管理

@@ -6,7 +6,7 @@ var Button=[ @@ -6,7 +6,7 @@ var Button=[
6 template_name:"text" 6 template_name:"text"
7 }, 7 },
8 { 8 {
9 - template_intro:"一张图", 9 + template_intro:"一张图",
10 dialog:"template_dialog_grid", 10 dialog:"template_dialog_grid",
11 template_name:"singleImage", 11 template_name:"singleImage",
12 data:[{ 12 data:[{
@@ -17,7 +17,7 @@ var Button=[ @@ -17,7 +17,7 @@ var Button=[
17 }] 17 }]
18 }, 18 },
19 { 19 {
20 - template_intro:"两张小图", 20 + template_intro:"添加小图",
21 dialog:"template_dialog_grid", 21 dialog:"template_dialog_grid",
22 template_name:"smallPic", 22 template_name:"smallPic",
23 data:[{ 23 data:[{
@@ -33,6 +33,21 @@ var Button=[ @@ -33,6 +33,21 @@ var Button=[
33 }] 33 }]
34 }, 34 },
35 { 35 {
  36 + template_intro:"焦点图",
  37 + template_name:"focus",
  38 + dialog:"",
  39 + data:[
  40 + {
  41 + "src": "",
  42 + "alt": "",
  43 + "url": {},
  44 + "bgColor": "",
  45 + "imgId": ""
  46 + }
  47 + ],
  48 + focus_type:""
  49 + },
  50 + {
36 template_intro:"添加商品", 51 template_intro:"添加商品",
37 dialog:"template_dialog_goods", 52 dialog:"template_dialog_goods",
38 template_name:"goods", 53 template_name:"goods",
@@ -61,13 +76,490 @@ var Button=[ @@ -61,13 +76,490 @@ var Button=[
61 ] 76 ]
62 }, 77 },
63 { 78 {
  79 + "template_name": "appIconList",
  80 + "template_intro": "图标",
  81 + dialog:"icon-template",
  82 + "data": [
  83 + {
  84 + "url": {
  85 + "action": "",
  86 + "url": ""
  87 + },
  88 + "alt": "",
  89 + "src": "",
  90 + "imgId": ""
  91 + }
  92 + ]
  93 + },
  94 + {
  95 + template_intro:"推荐(1T-1L-4R)",
  96 + template_name:"recommendContentOne",
  97 + dialog:"recommendContent-template",
  98 + "data": {
  99 + "title": {
  100 + "name": "",
  101 + "more_name": "",
  102 + "more_url": {
  103 + "action": "",
  104 + "url": ""
  105 + }
  106 + },
  107 + "big_image": [
  108 + {
  109 + "src": "",
  110 + "url": {
  111 + "action": "",
  112 + "url": ""
  113 + },
  114 + "title": ""
  115 + }
  116 + ],
  117 + "list": [
  118 + {
  119 + "src": "",
  120 + "title": "",
  121 + "url": {
  122 + "action": "",
  123 + "url": ""
  124 + }
  125 + },
  126 + {
  127 + "src": "",
  128 + "title": "",
  129 + "url": {
  130 + "action": "",
  131 + "url": ""
  132 + }
  133 + },
  134 + {
  135 + "src": "",
  136 + "title": "",
  137 + "url": {
  138 + "action": "",
  139 + "url": ""
  140 + }
  141 + },
  142 + {
  143 + "src": "",
  144 + "title": "",
  145 + "url": {
  146 + "action": "",
  147 + "url": ""
  148 + }
  149 + }
  150 + ]
  151 + }
  152 + },
  153 + {
  154 + template_intro:"推荐(1T-6F)",
  155 + template_name:"recommendContentTwo",
  156 + dialog:"recommendContent-template",
  157 + "data": {
  158 + "title": {
  159 + "name": "",
  160 + "more_name": "",
  161 + "more_url": {
  162 + "action": "",
  163 + "url": ""
  164 + }
  165 + },
  166 + "big_image": [
  167 + {
  168 + "src": "",
  169 + "url": {
  170 + "action": "",
  171 + "url": ""
  172 + },
  173 + "title": ""
  174 + }
  175 + ],
  176 + "list": [
  177 + {
  178 + "src": "",
  179 + "title": "",
  180 + "url": {
  181 + "action": "",
  182 + "url": ""
  183 + }
  184 + },
  185 + {
  186 + "src": "",
  187 + "title": "",
  188 + "url": {
  189 + "action": "",
  190 + "url": ""
  191 + }
  192 + },
  193 + {
  194 + "src": "",
  195 + "title": "",
  196 + "url": {
  197 + "action": "",
  198 + "url": ""
  199 + }
  200 + },
  201 + {
  202 + "src": "",
  203 + "title": "",
  204 + "url": {
  205 + "action": "",
  206 + "url": ""
  207 + }
  208 + },
  209 + {
  210 + "src": "",
  211 + "title": "",
  212 + "url": {
  213 + "action": "",
  214 + "url": ""
  215 + }
  216 + },
  217 + {
  218 + "src": "",
  219 + "title": "",
  220 + "url": {
  221 + "action": "",
  222 + "url": ""
  223 + }
  224 + }
  225 + ]
  226 + }
  227 + },
  228 + {
  229 + "template_name": "singleNameImage",
  230 + "template_intro": "标题广告",
  231 + dialog:"",
  232 + "data": {
  233 + "title": "",
  234 + "src": "",
  235 + "url": {
  236 + action:"",
  237 + url:""
  238 + },
  239 + "alt": ""
  240 + }
  241 + },
  242 + {
  243 + template_intro:"推荐(1T-12F)",
  244 + template_name:"recommendContentThree",
  245 + dialog:"recommendContent-template",
  246 + "data": {
  247 + "big_image": [
  248 + {
  249 + "src": "",
  250 + "url": {
  251 + "action": "",
  252 + "url": ""
  253 + },
  254 + "title": ""
  255 + }
  256 + ],
  257 + "list": [
  258 + {
  259 + "src": "",
  260 + "title": "",
  261 + "url": {
  262 + "action": "",
  263 + "url": ""
  264 + }
  265 + },
  266 + {
  267 + "src": "",
  268 + "title": "",
  269 + "url": {
  270 + "action": "",
  271 + "url": ""
  272 + }
  273 + },
  274 + {
  275 + "src": "",
  276 + "title": "",
  277 + "url": {
  278 + "action": "",
  279 + "url": ""
  280 + }
  281 + },
  282 + {
  283 + "src": "",
  284 + "title": "",
  285 + "url": {
  286 + "action": "",
  287 + "url": ""
  288 + }
  289 + },
  290 + {
  291 + "src": "",
  292 + "title": "",
  293 + "url": {
  294 + "action": "",
  295 + "url": ""
  296 + }
  297 + },
  298 + {
  299 + "src": "",
  300 + "title": "",
  301 + "url": {
  302 + "action": "",
  303 + "url": ""
  304 + }
  305 + },
  306 + {
  307 + "src": "",
  308 + "title": "",
  309 + "url": {
  310 + "action": "",
  311 + "url": ""
  312 + }
  313 + },
  314 + {
  315 + "src": "",
  316 + "title": "",
  317 + "url": {
  318 + "action": "",
  319 + "url": ""
  320 + }
  321 + },
  322 + {
  323 + "src": "",
  324 + "title": "",
  325 + "url": {
  326 + "action": "",
  327 + "url": ""
  328 + }
  329 + },
  330 + {
  331 + "src": "",
  332 + "title": "",
  333 + "url": {
  334 + "action": "",
  335 + "url": ""
  336 + }
  337 + },
  338 + {
  339 + "src": "",
  340 + "title": "",
  341 + "url": {
  342 + "action": "",
  343 + "url": ""
  344 + }
  345 + },
  346 + {
  347 + "src": "",
  348 + "title": "",
  349 + "url": {
  350 + "action": "",
  351 + "url": ""
  352 + }
  353 + }
  354 + ]
  355 + }
  356 + },
  357 + {
  358 + template_intro:"潮人搭配",
  359 + template_name:"trendsetterCollocation",
  360 + dialog:"noEdit-template",
  361 + data: {}
  362 + },
  363 + {
  364 + template_intro:"潮品话题",
  365 + template_name:"trendgoodsTopic",
  366 + dialog:"noEdit-template",
  367 + data: {}
  368 + },
  369 + {
64 template_intro:"一个连接", 370 template_intro:"一个连接",
65 dialog:"template_dialog_link", 371 dialog:"template_dialog_link",
66 template_name:"link", 372 template_name:"link",
67 data:[ 373 data:[
68 {"url":{"action":"","url":""}} 374 {"url":{"action":"","url":""}}
69 ] 375 ]
70 - } 376 + },
  377 + {
  378 + template_intro:"添加促销",
  379 + dialog:"",
  380 + template_name:"promotion",
  381 + data: {
  382 + "promotionId": ""
  383 + }
  384 + },
  385 + {
  386 + template_intro:"添加楼层",
  387 + dialog:"icon-template",
  388 + template_name:"addfloor",
  389 + data: [
  390 + {
  391 + "url": {},
  392 + "alt": "",
  393 + "altEn": "",
  394 + "src": "",
  395 + "imgId": ""
  396 + }
  397 + ]
  398 + },
  399 + {
  400 + template_intro:"推荐(标题 + 12张图)",
  401 + dialog:"recommendContent-template",
  402 + template_name:"recommendContentFive",
  403 + data: {
  404 + "title": {
  405 + "title": "",
  406 + "is_show": 0
  407 + },
  408 + "list": [
  409 + {
  410 + "src": "",
  411 + "title": "",
  412 + "url": {
  413 + "action": "",
  414 + "url": ""
  415 + }
  416 + },
  417 + {
  418 + "src": "",
  419 + "title": "",
  420 + "url": {
  421 + "action": "",
  422 + "url": ""
  423 + }
  424 + },
  425 + {
  426 + "src": "",
  427 + "title": "",
  428 + "url": {
  429 + "action": "",
  430 + "url": ""
  431 + }
  432 + },
  433 + {
  434 + "src": "",
  435 + "title": "",
  436 + "url": {
  437 + "action": "",
  438 + "url": ""
  439 + }
  440 + },
  441 + {
  442 + "src": "",
  443 + "title": "",
  444 + "url": {
  445 + "action": "",
  446 + "url": ""
  447 + }
  448 + },
  449 + {
  450 + "src": "",
  451 + "title": "",
  452 + "url": {
  453 + "action": "",
  454 + "url": ""
  455 + }
  456 + },
  457 + {
  458 + "src": "",
  459 + "title": "",
  460 + "url": {
  461 + "action": "",
  462 + "url": ""
  463 + }
  464 + },
  465 + {
  466 + "src": "",
  467 + "title": "",
  468 + "url": {
  469 + "action": "",
  470 + "url": ""
  471 + }
  472 + },
  473 + {
  474 + "src": "",
  475 + "title": "",
  476 + "url": {
  477 + "action": "",
  478 + "url": ""
  479 + }
  480 + },
  481 + {
  482 + "src": "",
  483 + "title": "",
  484 + "url": {
  485 + "action": "",
  486 + "url": ""
  487 + }
  488 + },
  489 + {
  490 + "src": "",
  491 + "title": "",
  492 + "url": {
  493 + "action": "",
  494 + "url": ""
  495 + }
  496 + },
  497 + {
  498 + "src": "",
  499 + "title": "",
  500 + "url": {
  501 + "action": "",
  502 + "url": ""
  503 + }
  504 + }
  505 + ]
  506 + }
  507 + },
  508 + {
  509 + template_intro:"新人专享",
  510 + dialog:"newUserFloor-template",
  511 + template_name:"newUserFloor",
  512 + data: {
  513 + "title": {
  514 + "name": "",
  515 + "more_name": "",
  516 + "more_url": {
  517 + "action": "",
  518 + "url": ""
  519 + },
  520 + "active_id": ""
  521 + },
  522 + "banner_image": [
  523 + {
  524 + "src": "",
  525 + "url": {
  526 + "action": "",
  527 + "url": ""
  528 + },
  529 + "title": ""
  530 + }
  531 + ]
  532 + }
  533 + },
  534 + {
  535 + template_intro:"图片广告",
  536 + dialog:"imageGroup-template",
  537 + template_name:"imageGroup",
  538 + data: {
  539 + "title": "",
  540 + "more": "",
  541 + "more_url": "",
  542 + "show_num": "",
  543 + "image_style": "",
  544 + "T1F2": true,
  545 + "list": [
  546 + {
  547 + "src": "",
  548 + "title": "",
  549 + "url": {
  550 + "action": "",
  551 + "url": ""
  552 + }
  553 + }
  554 + ]
  555 + }
  556 + },
  557 + {
  558 + template_intro:"站内公告",
  559 + dialog:"noEdit-template",
  560 + template_name:"announcement",
  561 + data: {}
  562 + },
71 ]; 563 ];
72 564
73 module.exports = Button; 565 module.exports = Button;
@@ -32,6 +32,28 @@ Bll.__render(".contents","template_content_btns",{btns:Button}); @@ -32,6 +32,28 @@ Bll.__render(".contents","template_content_btns",{btns:Button});
32 ViewModel.contentData=ViewModel.contentData; 32 ViewModel.contentData=ViewModel.contentData;
33 33
34 34
  35 +var obj2Arr = function(obj) {
  36 + for(var i in obj) {
  37 + if(!isNaN(i)) {
  38 + var arr = [];
  39 + for(var j in obj) {
  40 + arr[parseInt(j)] = obj[j];
  41 + }
  42 + obj = arr;
  43 + break;
  44 + } else if (typeof obj[i] == "object"){
  45 + obj[i] = obj2Arr(obj[i]);
  46 + }
  47 + }
  48 + return obj;
  49 +}
  50 +
  51 +for(var i = 0; i < ViewModel.contentData.length; i++) {
  52 + ViewModel.contentData[i].contentData = JSON.stringify(obj2Arr(JSON.parse(ViewModel.contentData[i].contentData)));
  53 +}
  54 +console.log(ViewModel);
  55 +
  56 +
35 57
36 58
37 59