|
@@ -858,16 +858,10 @@
|
|
|
var infoImageList = [];
|
|
|
var productImageList = [];
|
|
|
var productIds = '';
|
|
|
-
|
|
|
$(function () {
|
|
|
$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
|
|
|
$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
|
|
|
$('.upload-content .conList').find('.cancel-upload').hide();
|
|
|
- var observeEle = document.getElementsByClassName('upload-content')[0];
|
|
|
- var observeEle1 = document.getElementsByClassName('upload-content')[1];
|
|
|
- var observeEle2 = document.getElementsByClassName('upload-content')[2];
|
|
|
- var observeEle3 = document.getElementsByClassName('upload-content')[3];
|
|
|
- var observeEle4 = document.getElementsByClassName('upload-content')[4];
|
|
|
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
|
var MutationObserverConfig = {
|
|
|
childList: true,
|
|
@@ -889,12 +883,10 @@
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
- observer.observe(observeEle, MutationObserverConfig);
|
|
|
- observer.observe(observeEle1, MutationObserverConfig);
|
|
|
- observer.observe(observeEle2, MutationObserverConfig);
|
|
|
- observer.observe(observeEle3, MutationObserverConfig);
|
|
|
- observer.observe(observeEle4, MutationObserverConfig);
|
|
|
-
|
|
|
+ for (var i = 0; i < 10; i++) {
|
|
|
+ var observeEle = document.getElementsByClassName('upload-content')[i];
|
|
|
+ observer.observe(observeEle, MutationObserverConfig)
|
|
|
+ }
|
|
|
$('body').on('click', '.cancel-upload', function () {
|
|
|
var wrapper = $(this).closest('.conList');
|
|
|
wrapper.find('li').css('z-index', '-1');
|
|
@@ -911,49 +903,23 @@
|
|
|
});
|
|
|
$(window).on("load", function () {
|
|
|
setTimeout(function () {
|
|
|
- $("#pcAdsImage1").find("input.input-xlarge").each(function (i, ele) {
|
|
|
- if ($(ele).val()) {
|
|
|
- $(ele).next().find("li").css("z-index", "99");
|
|
|
- $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
- $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
- }
|
|
|
- })
|
|
|
- $("#appletsAdsImage1").find("input.input-xlarge").each(function (i, ele) {
|
|
|
- if ($(ele).val()) {
|
|
|
- $(ele).next().find("li").css("z-index", "99");
|
|
|
- $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
- $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
- }
|
|
|
- })
|
|
|
- $("#pcAdsImage2").find("input.input-xlarge").each(function (i, ele) {
|
|
|
- if ($(ele).val()) {
|
|
|
- $(ele).next().find("li").css("z-index", "99");
|
|
|
- $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
- $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
- }
|
|
|
- })
|
|
|
- $("#appletsAdsImage2").find("input.input-xlarge").each(function (i, ele) {
|
|
|
- if ($(ele).val()) {
|
|
|
- $(ele).next().find("li").css("z-index", "99");
|
|
|
- $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
- $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
- }
|
|
|
- })
|
|
|
- $("#pcAdsImage3").find("input.input-xlarge").each(function (i, ele) {
|
|
|
- if ($(ele).val()) {
|
|
|
- $(ele).next().find("li").css("z-index", "99");
|
|
|
- $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
- $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
- }
|
|
|
- })
|
|
|
- $("#appletsAdsImage3").find("input.input-xlarge").each(function (i, ele) {
|
|
|
- if ($(ele).val()) {
|
|
|
- $(ele).next().find("li").css("z-index", "99");
|
|
|
- $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
- $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
- }
|
|
|
- })
|
|
|
- }, 500);
|
|
|
+ for (var i = 1; i <= 5; i++) {
|
|
|
+ $("#pcAdsImage" + i).find("input.input-xlarge").each(function (i, ele) {
|
|
|
+ if ($(ele).val()) {
|
|
|
+ $(ele).next().find("li").css("z-index", "99");
|
|
|
+ $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
+ $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $("#appletsAdsImage" + i).find("input.input-xlarge").each(function (i, ele) {
|
|
|
+ if ($(ele).val()) {
|
|
|
+ $(ele).next().find("li").css("z-index", "99");
|
|
|
+ $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
+ $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
});
|
|
|
|
|
|
var templateType = $("input[type='radio']:checked").val();
|
|
@@ -974,7 +940,7 @@
|
|
|
</c:forEach>
|
|
|
} else if (templateType == 3 || templateType == 4 || templateType == 5 || templateType == 6) {
|
|
|
<c:forEach items="${floorContent.floorImageList}" var="floorImage" varStatus="index">
|
|
|
- adsImageList.push({
|
|
|
+ infoImageList.push({
|
|
|
id: "${floorImage.id}",
|
|
|
name: "${floorImage.name}",
|
|
|
image: "${floorImage.image}",
|
|
@@ -1010,6 +976,7 @@
|
|
|
|
|
|
//展示选中模板对应的表单
|
|
|
function showContent(templateClassify) {
|
|
|
+ debugger
|
|
|
var list = [];
|
|
|
var type;
|
|
|
for (var i = 1; i < 22; i++) {
|
|
@@ -1028,7 +995,7 @@
|
|
|
$('.Image3').hide();
|
|
|
$('.Image4').hide();
|
|
|
$('.Image5').hide();
|
|
|
- if (templateType != undefined) {
|
|
|
+ if (!isNaN(templateType)) {
|
|
|
if ('pc' == templateClassify) {
|
|
|
toTop(list, '#pcTemplate', $("#pcTemplate" + templateType))
|
|
|
} else {
|
|
@@ -1208,175 +1175,66 @@
|
|
|
|
|
|
//相关图片列表数据
|
|
|
function appendShopOrderHead(data, index) {
|
|
|
- var html;
|
|
|
- var type = $("#type").val();
|
|
|
- if (type == 'adsImage') {
|
|
|
- html = '<tr id ="ads' + index + '">' +
|
|
|
- '<td>' +
|
|
|
- '<input class="check-item" type="checkbox" name="info" value="' + index + '"/>' + (index + 1) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<img src="' + data.image + '" width="60px" border="none" title="启用">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<input value="' + data.link + '" onchange="changeLink(' + index + ',this)">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<img src="' + data.adsImage + '" width="60px" border="none" title="启用">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.pcStatus == 1 ? (
|
|
|
- '<font color="green">已启用</font> ' +
|
|
|
- '<a href="javascript:void(0);" onclick="updatePcStatus(0,' + index + ');" >' +
|
|
|
- '停用</a>'
|
|
|
- ) : (
|
|
|
- '<font color="red">已停用</font> ' +
|
|
|
- '<a href="javascript:void(0)" onclick="updatePcStatus(1,' + index + ');">' +
|
|
|
- '启用</a>'
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.appletsStatus == 1 ? (
|
|
|
- '<font color="green">已启用</font> ' +
|
|
|
- '<a href="javascript:void(0);" onclick="updateAppletsStatus(0,' + index + ');" >' +
|
|
|
- '停用</a>'
|
|
|
- ) : (
|
|
|
- '<font color="red">已停用</font> ' +
|
|
|
- '<a href="javascript:void(0)" onclick="updateAppletsStatus(1,' + index + ');">' +
|
|
|
- '启用</a>'
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<input name="sort" style="width:50px;" value="' + data.sort + '" onkeyup="onlynum(this)" onchange="changeSort(' + index + ',this)"></td>' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.createDate == '' ? (
|
|
|
- '<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd HH:mm:ss"/>'
|
|
|
- ) : (
|
|
|
- data.createDate
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<a href="javascript:;" onclick="delect(' + index + ')">删除</a>' +
|
|
|
- '</td>' +
|
|
|
- '</tr>';
|
|
|
- } else if (type == 'infoImage') {
|
|
|
- html = '<tr id ="ads' + index + '">' +
|
|
|
- '<td>' +
|
|
|
- '<input class="check-item" type="checkbox" name="info" value="' + index + '"/>' + (index + 1) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<img src="' + data.image + '" width="60px" border="none" title="启用">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<input value="' + data.name + '" onchange="changeName(' + index + ',this)">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<input value="' + data.content + '" onchange="changeContent(' + index + ',this)">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<input value="' + data.link + '" onchange="changeLink(' + index + ',this)">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<img src="' + data.adsImage + '" width="60px" border="none" title="启用">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.pcStatus == 1 ? (
|
|
|
- '<font color="green">已启用</font> ' +
|
|
|
- '<a href="javascript:void(0);" onclick="updatePcStatus(0,' + index + ');" >' +
|
|
|
- '停用</a>'
|
|
|
- ) : (
|
|
|
- '<font color="red">已停用</font> ' +
|
|
|
- '<a href="javascript:void(0)" onclick="updatePcStatus(1,' + index + ');">' +
|
|
|
- '启用</a>'
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.appletsStatus == 1 ? (
|
|
|
- '<font color="green">已启用</font> ' +
|
|
|
- '<a href="javascript:void(0);" onclick="updateAppletsStatus(0,' + index + ');" >' +
|
|
|
- '停用</a>'
|
|
|
- ) : (
|
|
|
- '<font color="red">已停用</font> ' +
|
|
|
- '<a href="javascript:void(0)" onclick="updateAppletsStatus(1,' + index + ');">' +
|
|
|
- '启用</a>'
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<input name="sort" style="width:50px;" value="' + data.sort + '" onkeyup="onlynum(this)" onchange="changeSort(' + index + ',this)"></td>' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.createDate == '' ? (
|
|
|
- '<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd HH:mm:ss"/>'
|
|
|
- ) : (
|
|
|
- data.createDate
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<a href="javascript:;" onclick="delect(' + index + ')">删除</a>' +
|
|
|
- '</td>' +
|
|
|
- '</tr>';
|
|
|
- } else {
|
|
|
- html = '<tr id ="product' + index + '">' +
|
|
|
- '<td>' +
|
|
|
- '<input class="check-item" type="checkbox" name="info" value="' + index + '"/>' + (index + 1) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<img src="' + data.image + '" width="60px" border="none" title="启用">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.productId == '' ? (
|
|
|
- '<input name="name" value="' + data.name + '" onchange="changeName(' + index + ',this)">'
|
|
|
- ) : (data.name)) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.productId == '' ? (
|
|
|
- '<input value="' + data.link + '" onchange="changeLink(' + index + ',this)">'
|
|
|
- ) : ('------')) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.productId == '' ? (
|
|
|
- '<input value="' + data.label + '" onchange="changeLabel(' + index + ',this)" maxlength = "10">'
|
|
|
- ) : ('------')) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.pcStatus == 1 ? (
|
|
|
- '<font color="green">已启用</font> ' +
|
|
|
- '<a href="javascript:void(0);" onclick="updatePcStatus(0,' + index + ');" >' +
|
|
|
- '停用</a>'
|
|
|
- ) : (
|
|
|
- '<font color="red">已停用</font> ' +
|
|
|
- '<a href="javascript:void(0)" onclick="updatePcStatus(1,' + index + ');">' +
|
|
|
- '启用</a>'
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.appletsStatus == 1 ? (
|
|
|
- '<font color="green">已启用</font> ' +
|
|
|
- '<a href="javascript:void(0);" onclick="updateAppletsStatus(0,' + index + ');" >' +
|
|
|
- '停用</a>'
|
|
|
- ) : (
|
|
|
- '<font color="red">已停用</font> ' +
|
|
|
- '<a href="javascript:void(0)" onclick="updateAppletsStatus(1,' + index + ');">' +
|
|
|
- '启用</a>'
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<input name="sort" style="width:50px;" value="' + data.sort + '" onkeyup="onlynum(this)" onchange="changeSort(' + index + ',this)"></td>' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.createDate == '' ? (
|
|
|
- '<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd HH:mm:ss"/>'
|
|
|
- ) : (
|
|
|
- data.createDate
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<a href="javascript:;" onclick="delect(' + index + ')">删除</a>' +
|
|
|
- '</td>' +
|
|
|
- '</tr>';
|
|
|
- }
|
|
|
|
|
|
+ var type = $("#type").val();
|
|
|
+ var html = '<tr id ="ads' + index + '">' +
|
|
|
+ '<td>' +
|
|
|
+ '<input class="check-item" type="checkbox" name="info" value="' + index + '"/>' + (index + 1) +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ '<img src="' + data.image + '" width="60px" border="none" title="启用">' +
|
|
|
+ '</td>' +
|
|
|
+ (type == 'infoImage' ? (
|
|
|
+ ('<td>' + '<input value="' + data.name + '" onchange="changeName(' + index + ',this)">' + '</td>') +
|
|
|
+ ('<td>' + '<input value="' + data.content + '" onchange="changeContent(' + index + ',this)">' + '</td>')
|
|
|
+ ) : '') +
|
|
|
+ (type == 'productImage' ?
|
|
|
+ ('<td>' + (data.productId == '' ? ('<input name="name" value="' + data.name + '" onchange="changeName(' + index + ',this)">') : (data.name)) + '</td>') : '') +
|
|
|
+ (type == 'adsImage' || type == 'infoImage' ? (
|
|
|
+ ('<td>' + '<input value="' + data.link + '" onchange="changeLink(' + index + ',this)">' + '</td>') +
|
|
|
+ ('<td>' + '<img src="' + data.adsImage + '" width="60px" border="none" title="启用">' + '</td>')
|
|
|
+ ) :
|
|
|
+ (
|
|
|
+ ('<td>' + (data.productId == '' ? ('<input value="' + data.link + '" onchange="changeLink(' + index + ',this)">') : ('------')) + '</td>') +
|
|
|
+ ('<td>' + (data.productId == '' ? ('<input value="' + data.label + '" onchange="changeLabel(' + index + ',this)" maxlength = "10">') : ('------')) + '</td>')
|
|
|
+ )
|
|
|
+ ) +
|
|
|
+ '<td>' +
|
|
|
+ (data.pcStatus == 1 ? (
|
|
|
+ '<font color="green">已启用</font> ' +
|
|
|
+ '<a href="javascript:void(0);" onclick="updatePcStatus(0,' + index + ');" >' +
|
|
|
+ '停用</a>'
|
|
|
+ ) : (
|
|
|
+ '<font color="red">已停用</font> ' +
|
|
|
+ '<a href="javascript:void(0)" onclick="updatePcStatus(1,' + index + ');">' +
|
|
|
+ '启用</a>'
|
|
|
+ )) +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ (data.appletsStatus == 1 ? (
|
|
|
+ '<font color="green">已启用</font> ' +
|
|
|
+ '<a href="javascript:void(0);" onclick="updateAppletsStatus(0,' + index + ');" >' +
|
|
|
+ '停用</a>'
|
|
|
+ ) : (
|
|
|
+ '<font color="red">已停用</font> ' +
|
|
|
+ '<a href="javascript:void(0)" onclick="updateAppletsStatus(1,' + index + ');">' +
|
|
|
+ '启用</a>'
|
|
|
+ )) +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ '<input name="sort" style="width:50px;" value="' + data.sort + '" onkeyup="onlynum(this)" onchange="changeSort(' + index + ',this)"></td>' +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ (data.createDate == '' ? (
|
|
|
+ '<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd HH:mm:ss"/>'
|
|
|
+ ) : (
|
|
|
+ data.createDate
|
|
|
+ )) +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ '<a href="javascript:;" onclick="delect(' + index + ')">删除</a>' +
|
|
|
+ '</td>' +
|
|
|
+ '</tr>';
|
|
|
return html;
|
|
|
}
|
|
|
|
|
@@ -1446,9 +1304,9 @@
|
|
|
}
|
|
|
|
|
|
function changeContent(index, nameThis) {
|
|
|
- var name = nameThis.value;
|
|
|
+ var content = nameThis.value;
|
|
|
var image = infoImageList[index];
|
|
|
- image.name = name;
|
|
|
+ image.content = content;
|
|
|
}
|
|
|
|
|
|
function changeLink(index, linkThis) {
|
|
@@ -1625,15 +1483,15 @@
|
|
|
if (1 == source) {
|
|
|
$("#pcTemplate").removeClass("hide");
|
|
|
$("#appletsTemplate").addClass("hide");
|
|
|
- $('input:radio[value='+templateType+']').attr('checked', false);
|
|
|
+ $('input:radio[value=' + templateType + ']').attr('checked', false);
|
|
|
templateType = templateType - 50;
|
|
|
- $('input:radio[value='+templateType+']').attr('checked', true);
|
|
|
+ $('input:radio[value=' + templateType + ']').attr('checked', true);
|
|
|
} else if (2 == source) {
|
|
|
$("#appletsTemplate").removeClass("hide");
|
|
|
$("#pcTemplate").addClass("hide");
|
|
|
- $('input:radio[value='+templateType+']').attr('checked', false);
|
|
|
+ $('input:radio[value=' + templateType + ']').attr('checked', false);
|
|
|
templateType = templateType + 50;
|
|
|
- $('input:radio[value='+templateType+']').attr('checked', true);
|
|
|
+ $('input:radio[value=' + templateType + ']').attr('checked', true);
|
|
|
}
|
|
|
showContent(1 == source ? 'pc' : 'applets');
|
|
|
}
|