|
@@ -10,6 +10,7 @@ require('../../../common/util/datepicker'); |
|
@@ -10,6 +10,7 @@ require('../../../common/util/datepicker'); |
10
|
var resources = [];
|
10
|
var resources = [];
|
11
|
var times = [];
|
11
|
var times = [];
|
12
|
var currIndex = 0;
|
12
|
var currIndex = 0;
|
|
|
13
|
+var lockStatus = 0;
|
13
|
//资源id
|
14
|
//资源id
|
14
|
var param = location.href.substring(location.href.lastIndexOf("/") + 1);
|
15
|
var param = location.href.substring(location.href.lastIndexOf("/") + 1);
|
15
|
common.util.__ajax({
|
16
|
common.util.__ajax({
|
|
@@ -20,6 +21,13 @@ common.util.__ajax({ |
|
@@ -20,6 +21,13 @@ common.util.__ajax({ |
20
|
resources = res.data;
|
21
|
resources = res.data;
|
21
|
console.log(resources);
|
22
|
console.log(resources);
|
22
|
}, true);
|
23
|
}, true);
|
|
|
24
|
+common.util.__ajax({
|
|
|
25
|
+ url: "/resources/updateLock",
|
|
|
26
|
+ data: {id: param,
|
|
|
27
|
+ status:1},
|
|
|
28
|
+ async: false
|
|
|
29
|
+}, function (res) {
|
|
|
30
|
+}, true);
|
23
|
|
31
|
|
24
|
/*配置模块*/
|
32
|
/*配置模块*/
|
25
|
var edit = new common.edit2(".modal-body", {
|
33
|
var edit = new common.edit2(".modal-body", {
|
|
@@ -68,6 +76,9 @@ var Bll = { |
|
@@ -68,6 +76,9 @@ var Bll = { |
68
|
value: "保存",
|
76
|
value: "保存",
|
69
|
callback: function () {
|
77
|
callback: function () {
|
70
|
console.log(module.contentData);
|
78
|
console.log(module.contentData);
|
|
|
79
|
+ if(!checkLockStatus()){
|
|
|
80
|
+ return false;
|
|
|
81
|
+ }
|
71
|
var couponFlag = true;
|
82
|
var couponFlag = true;
|
72
|
if (Validate[module.contentData.template_name]) {
|
83
|
if (Validate[module.contentData.template_name]) {
|
73
|
Validate[module.contentData.template_name].forEach(function (item) {
|
84
|
Validate[module.contentData.template_name].forEach(function (item) {
|
|
@@ -297,7 +308,6 @@ function Unique(Array,key) { |
|
@@ -297,7 +308,6 @@ function Unique(Array,key) { |
297
|
Bll.__render("#content-list", "content-template", resources[currIndex]);
|
308
|
Bll.__render("#content-list", "content-template", resources[currIndex]);
|
298
|
Bll.__render(".contents", "template_content_btns", {btns: Button});
|
309
|
Bll.__render(".contents", "template_content_btns", {btns: Button});
|
299
|
Bll.__render("#times-list", "times-template", {times:times, selected:0});
|
310
|
Bll.__render("#times-list", "times-template", {times:times, selected:0});
|
300
|
-
|
|
|
301
|
/*第二部,把楼层数据转化成数组*/
|
311
|
/*第二部,把楼层数据转化成数组*/
|
302
|
for(var i = 0; i < resources.length; i++) {
|
312
|
for(var i = 0; i < resources.length; i++) {
|
303
|
Bll.contentDatas[i] = [];
|
313
|
Bll.contentDatas[i] = [];
|
|
@@ -441,6 +451,9 @@ $(document).on("change", ".observe", function () { |
|
@@ -441,6 +451,9 @@ $(document).on("change", ".observe", function () { |
441
|
|
451
|
|
442
|
/*删除*/
|
452
|
/*删除*/
|
443
|
$(document).on("click", ".del", function () {//删除
|
453
|
$(document).on("click", ".del", function () {//删除
|
|
|
454
|
+ if(!checkLockStatus()){
|
|
|
455
|
+ return false;
|
|
|
456
|
+ }
|
444
|
var index = $(this).data("index");
|
457
|
var index = $(this).data("index");
|
445
|
common.dialog.confirm("警告",
|
458
|
common.dialog.confirm("警告",
|
446
|
common.util.__template2("是否确认删除?", {}),
|
459
|
common.util.__template2("是否确认删除?", {}),
|
|
@@ -556,6 +569,7 @@ function secondsToStrDate(seconds) { |
|
@@ -556,6 +569,7 @@ function secondsToStrDate(seconds) { |
556
|
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
|
569
|
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
|
557
|
}
|
570
|
}
|
558
|
|
571
|
|
|
|
572
|
+
|
559
|
function dateStrToSeconds(date) {
|
573
|
function dateStrToSeconds(date) {
|
560
|
if(date) {
|
574
|
if(date) {
|
561
|
return new Date(date).getTime() / 1000;
|
575
|
return new Date(date).getTime() / 1000;
|
|
@@ -564,6 +578,23 @@ function dateStrToSeconds(date) { |
|
@@ -564,6 +578,23 @@ function dateStrToSeconds(date) { |
564
|
return 0;
|
578
|
return 0;
|
565
|
}
|
579
|
}
|
566
|
|
580
|
|
|
|
581
|
+
|
|
|
582
|
+function checkLockStatus(){
|
|
|
583
|
+ common.util.__ajax({
|
|
|
584
|
+ url: "/resources/checkLock",
|
|
|
585
|
+ data: {id: param},
|
|
|
586
|
+ async: false
|
|
|
587
|
+ }, function (res) {
|
|
|
588
|
+ lockStatus = res.data;
|
|
|
589
|
+ }, true);
|
|
|
590
|
+ if(lockStatus == '2') {
|
|
|
591
|
+ common.util.__tip("该资源位已被锁定,不能操作");
|
|
|
592
|
+ return false;
|
|
|
593
|
+ }else{
|
|
|
594
|
+ return true;
|
|
|
595
|
+ }
|
|
|
596
|
+}
|
|
|
597
|
+
|
567
|
//获取品牌
|
598
|
//获取品牌
|
568
|
Bll.getBrands();
|
599
|
Bll.getBrands();
|
569
|
//打开品牌选择模态
|
600
|
//打开品牌选择模态
|
|
@@ -642,6 +673,9 @@ $(document).on("click", '.icon-number', function () { |
|
@@ -642,6 +673,9 @@ $(document).on("click", '.icon-number', function () { |
642
|
//**********************************************************************************/
|
673
|
//**********************************************************************************/
|
643
|
//复制
|
674
|
//复制
|
644
|
$(document).on("click", "#copyTab", function() {
|
675
|
$(document).on("click", "#copyTab", function() {
|
|
|
676
|
+ if(!checkLockStatus()){
|
|
|
677
|
+ return false;
|
|
|
678
|
+ }
|
645
|
common.util.__ajax({
|
679
|
common.util.__ajax({
|
646
|
url: "/resources/copyResContent",
|
680
|
url: "/resources/copyResContent",
|
647
|
data: {rId:resources[currIndex].resource.id}
|
681
|
data: {rId:resources[currIndex].resource.id}
|
|
@@ -651,6 +685,9 @@ $(document).on("click", "#copyTab", function() { |
|
@@ -651,6 +685,9 @@ $(document).on("click", "#copyTab", function() { |
651
|
});
|
685
|
});
|
652
|
//保存时间
|
686
|
//保存时间
|
653
|
$(document).on("click", "#saveTime", function() {
|
687
|
$(document).on("click", "#saveTime", function() {
|
|
|
688
|
+ if(!checkLockStatus()){
|
|
|
689
|
+ return false;
|
|
|
690
|
+ }
|
654
|
if(times[currIndex].status == "进行中") {
|
691
|
if(times[currIndex].status == "进行中") {
|
655
|
common.util.__tip("进行中的页面不能更改时间");
|
692
|
common.util.__tip("进行中的页面不能更改时间");
|
656
|
return false;
|
693
|
return false;
|
|
@@ -722,6 +759,9 @@ $(document).on("click", "#delTab", function() { |
|
@@ -722,6 +759,9 @@ $(document).on("click", "#delTab", function() { |
722
|
|
759
|
|
723
|
/*保存事件*/
|
760
|
/*保存事件*/
|
724
|
$(document).on("click", "#sub_btn", function () {
|
761
|
$(document).on("click", "#sub_btn", function () {
|
|
|
762
|
+ if(!checkLockStatus()){
|
|
|
763
|
+ return false;
|
|
|
764
|
+ }
|
725
|
var data = {
|
765
|
var data = {
|
726
|
"content": {},
|
766
|
"content": {},
|
727
|
"data_id": {},
|
767
|
"data_id": {},
|