...
|
...
|
@@ -10,6 +10,7 @@ require('../../../common/util/datepicker'); |
|
|
var resources = [];
|
|
|
var times = [];
|
|
|
var currIndex = 0;
|
|
|
var lockStatus = 0;
|
|
|
//资源id
|
|
|
var param = location.href.substring(location.href.lastIndexOf("/") + 1);
|
|
|
common.util.__ajax({
|
...
|
...
|
@@ -20,6 +21,13 @@ common.util.__ajax({ |
|
|
resources = res.data;
|
|
|
console.log(resources);
|
|
|
}, true);
|
|
|
common.util.__ajax({
|
|
|
url: "/resources/updateLock",
|
|
|
data: {id: param,
|
|
|
status:1},
|
|
|
async: false
|
|
|
}, function (res) {
|
|
|
}, true);
|
|
|
|
|
|
/*配置模块*/
|
|
|
var edit = new common.edit2(".modal-body", {
|
...
|
...
|
@@ -68,6 +76,9 @@ var Bll = { |
|
|
value: "保存",
|
|
|
callback: function () {
|
|
|
console.log(module.contentData);
|
|
|
if(!checkLockStatus()){
|
|
|
return false;
|
|
|
}
|
|
|
var couponFlag = true;
|
|
|
if (Validate[module.contentData.template_name]) {
|
|
|
Validate[module.contentData.template_name].forEach(function (item) {
|
...
|
...
|
@@ -204,6 +215,7 @@ var Bll = { |
|
|
}
|
|
|
for(var key2 in res.data.brands[key]){
|
|
|
var item=res.data.brands[key][key2];
|
|
|
if (!item) { continue; }
|
|
|
Brand[name] = Brand[name] || [];
|
|
|
Brand[name].push(item);
|
|
|
Bll.Brands1[item.id] = item;
|
...
|
...
|
@@ -296,7 +308,6 @@ function Unique(Array,key) { |
|
|
Bll.__render("#content-list", "content-template", resources[currIndex]);
|
|
|
Bll.__render(".contents", "template_content_btns", {btns: Button});
|
|
|
Bll.__render("#times-list", "times-template", {times:times, selected:0});
|
|
|
|
|
|
/*第二部,把楼层数据转化成数组*/
|
|
|
for(var i = 0; i < resources.length; i++) {
|
|
|
Bll.contentDatas[i] = [];
|
...
|
...
|
@@ -440,6 +451,9 @@ $(document).on("change", ".observe", function () { |
|
|
|
|
|
/*删除*/
|
|
|
$(document).on("click", ".del", function () {//删除
|
|
|
if(!checkLockStatus()){
|
|
|
return false;
|
|
|
}
|
|
|
var index = $(this).data("index");
|
|
|
common.dialog.confirm("警告",
|
|
|
common.util.__template2("是否确认删除?", {}),
|
...
|
...
|
@@ -555,6 +569,7 @@ function secondsToStrDate(seconds) { |
|
|
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
|
|
|
}
|
|
|
|
|
|
|
|
|
function dateStrToSeconds(date) {
|
|
|
if(date) {
|
|
|
return new Date(date).getTime() / 1000;
|
...
|
...
|
@@ -563,6 +578,23 @@ function dateStrToSeconds(date) { |
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
function checkLockStatus(){
|
|
|
common.util.__ajax({
|
|
|
url: "/resources/checkLock",
|
|
|
data: {id: param},
|
|
|
async: false
|
|
|
}, function (res) {
|
|
|
lockStatus = res.data;
|
|
|
}, true);
|
|
|
if(lockStatus == '2') {
|
|
|
common.util.__tip("该资源位已被锁定,不能操作");
|
|
|
return false;
|
|
|
}else{
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取品牌
|
|
|
Bll.getBrands();
|
|
|
//打开品牌选择模态
|
...
|
...
|
@@ -641,6 +673,9 @@ $(document).on("click", '.icon-number', function () { |
|
|
//**********************************************************************************/
|
|
|
//复制
|
|
|
$(document).on("click", "#copyTab", function() {
|
|
|
if(!checkLockStatus()){
|
|
|
return false;
|
|
|
}
|
|
|
common.util.__ajax({
|
|
|
url: "/resources/copyResContent",
|
|
|
data: {rId:resources[currIndex].resource.id}
|
...
|
...
|
@@ -650,6 +685,9 @@ $(document).on("click", "#copyTab", function() { |
|
|
});
|
|
|
//保存时间
|
|
|
$(document).on("click", "#saveTime", function() {
|
|
|
if(!checkLockStatus()){
|
|
|
return false;
|
|
|
}
|
|
|
if(times[currIndex].status == "进行中") {
|
|
|
common.util.__tip("进行中的页面不能更改时间");
|
|
|
return false;
|
...
|
...
|
@@ -721,6 +759,9 @@ $(document).on("click", "#delTab", function() { |
|
|
|
|
|
/*保存事件*/
|
|
|
$(document).on("click", "#sub_btn", function () {
|
|
|
if(!checkLockStatus()){
|
|
|
return false;
|
|
|
}
|
|
|
var data = {
|
|
|
"content": {},
|
|
|
"data_id": {},
|
...
|
...
|
|