...
|
...
|
@@ -15,7 +15,7 @@ function bindListPageEvent() { |
|
|
const $statusSwitch = $('#status-switch');
|
|
|
const $publishForm = $('#publish-form');
|
|
|
const $noticeModal = $('#notice-modal');
|
|
|
const $noticeInput = $noticeModal.find('.notice-input');
|
|
|
const $noticeForm = $noticeModal.find('#notice-form');
|
|
|
|
|
|
const searchFn = function() {
|
|
|
let val = $searchKey.val();
|
...
|
...
|
@@ -108,14 +108,41 @@ function bindListPageEvent() { |
|
|
};
|
|
|
|
|
|
const noticeFn = function() {
|
|
|
let noticeVal = $noticeInput.val() || '';
|
|
|
let n = $noticeForm.serializeArray();
|
|
|
let notice = {};
|
|
|
let noticeVal = {};
|
|
|
|
|
|
$.each(n, function() {
|
|
|
notice[this.name] = this.value;
|
|
|
});
|
|
|
|
|
|
|
|
|
noticeVal.content = notice.content;
|
|
|
|
|
|
noticeVal.miniappBtnName = notice.miniappbtn;
|
|
|
noticeVal.miniappBtnType = notice.miniapptype;
|
|
|
if (+notice.miniapptype === 1) {
|
|
|
noticeVal.miniappTip = notice.miniapptip;
|
|
|
noticeVal.miniappCopy = notice.miniappcopy;
|
|
|
} else {
|
|
|
noticeVal.miniappLink = notice.miniapplink;
|
|
|
}
|
|
|
|
|
|
noticeVal.h5BtnName = notice.h5btn;
|
|
|
noticeVal.h5BtnType = notice.h5type;
|
|
|
if (+notice.h5type === 1) {
|
|
|
noticeVal.h5Tip = notice.h5tip;
|
|
|
noticeVal.h5Copy = notice.h5copy;
|
|
|
} else {
|
|
|
noticeVal.h5Link = notice.h5link;
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
method: 'post',
|
|
|
url: '/admin/activity/zerobuy/notice',
|
|
|
data: {
|
|
|
id: $noticeModal.data('id'),
|
|
|
notice: noticeVal
|
|
|
notice: JSON.stringify(noticeVal)
|
|
|
}
|
|
|
}).then(res => {
|
|
|
if (res.code === 200) {
|
...
|
...
|
@@ -143,6 +170,17 @@ function bindListPageEvent() { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const noticeBtnTypeChangeFn = function() {
|
|
|
let $this = $(this);
|
|
|
let $dom = $this.closest('.form-group').next('.input-switch-group');
|
|
|
|
|
|
if (+$this.val() === 1) {
|
|
|
$dom.removeClass('type-link');
|
|
|
} else {
|
|
|
$dom.addClass('type-link');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
$('#search-btn').on('click', searchFn);
|
|
|
$('.status-switch').on('click', statusFn);
|
|
|
|
...
|
...
|
@@ -156,7 +194,20 @@ function bindListPageEvent() { |
|
|
$confirm.modal('show');
|
|
|
});
|
|
|
$('.btn-notice').on('click', function() {
|
|
|
$noticeInput.val($(this).parent().data('notice') || '');
|
|
|
let notice = $(this).parent().data('notice') || {};
|
|
|
|
|
|
$('input[name="content"]', $noticeForm).val(notice.content || '');
|
|
|
$('input[name="miniappbtn"]', $noticeForm).val(notice.miniappBtnName || '');
|
|
|
$('select[name="miniapptype"]', $noticeForm).val(notice.miniappBtnType || 1).change();
|
|
|
$('input[name="miniapptip"]', $noticeForm).val(notice.miniappTip || '');
|
|
|
$('input[name="miniappcopy"]', $noticeForm).val(notice.miniappCopy || '');
|
|
|
$('input[name="miniapplink"]', $noticeForm).val(notice.miniappLink || '');
|
|
|
$('input[name="h5btn"]', $noticeForm).val(notice.h5BtnName || '');
|
|
|
$('select[name="h5type"]', $noticeForm).val(notice.h5BtnType || 1).change();
|
|
|
$('input[name="h5tip"]', $noticeForm).val(notice.h5Tip || '');
|
|
|
$('input[name="h5copy"]', $noticeForm).val(notice.h5Copy || '');
|
|
|
$('input[name="h5link"]', $noticeForm).val(notice.h5Link || '');
|
|
|
|
|
|
$noticeModal.data('id', $(this).data('id'));
|
|
|
$noticeModal.modal('show');
|
|
|
});
|
...
|
...
|
@@ -164,6 +215,8 @@ function bindListPageEvent() { |
|
|
|
|
|
$('.sure-publish-btn').on('click', publishFn);
|
|
|
$('.sure-notice-btn').on('click', noticeFn);
|
|
|
|
|
|
$('.notice-btn-select').change(noticeBtnTypeChangeFn);
|
|
|
}
|
|
|
|
|
|
let uploadedFn;
|
...
|
...
|
|