等待后端更新接口
This commit is contained in:
@@ -390,7 +390,7 @@
|
||||
var mapLink = '';
|
||||
var actions = '';
|
||||
|
||||
if (!ceremony) return '<div class="api-empty">未找到该活动</div>';
|
||||
if (!ceremony) return '';
|
||||
if (ceremony.longitude !== undefined && ceremony.latitude !== undefined) {
|
||||
mapLink = ' <a class="pill" target="_blank" rel="noopener noreferrer" href="https://uri.amap.com/marker?position=' +
|
||||
encodeURIComponent(ceremony.longitude + ',' + ceremony.latitude) + '&name=' +
|
||||
@@ -432,8 +432,8 @@
|
||||
function renderGiftList(data) {
|
||||
var gifts = Array.isArray(data) ? data.map(normalizeCeremonyGift) : [];
|
||||
|
||||
if (gifts.some(function (gift) { return !gift; })) return '<div class="api-empty">祭品响应字段不完整</div>';
|
||||
if (!gifts.length) return '<div class="api-empty">暂无祭品记录</div>';
|
||||
if (gifts.some(function (gift) { return !gift; })) return '';
|
||||
if (!gifts.length) return '';
|
||||
return gifts.map(function (gift) {
|
||||
var action = canEditContent
|
||||
? '<button class="pill is-danger" type="button" data-ceremony-gift-delete-id="' +
|
||||
@@ -450,8 +450,8 @@
|
||||
function renderInvitationList(data) {
|
||||
var invitations = normalizeList(data, normalizeInvitation);
|
||||
|
||||
if (!Array.isArray(data) || (data.length && !invitations.length)) return '<div class="api-empty">邀请响应字段不完整</div>';
|
||||
if (!invitations.length) return '<div class="api-empty">暂无邀请记录</div>';
|
||||
if (!Array.isArray(data) || (data.length && !invitations.length)) return '';
|
||||
if (!invitations.length) return '';
|
||||
return invitations.map(function (invitation) {
|
||||
var option = inviteeOptionsByUserId[invitation.inviteeUserId];
|
||||
var label = option && (option.memberName || option.appUserNickName) || '已邀请成员';
|
||||
@@ -486,10 +486,23 @@
|
||||
else if (root.alert) root.alert(message);
|
||||
}
|
||||
|
||||
function setStatus(selector, message) {
|
||||
function getApiStateType(error) {
|
||||
return isForbidden(error) ? 'forbidden' : 'error';
|
||||
}
|
||||
|
||||
function setStatus(selector, message, type) {
|
||||
var target = query(selector);
|
||||
|
||||
if (target) target.textContent = message || '';
|
||||
if (!target) return;
|
||||
if (!message) {
|
||||
target.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
if (type && root.ProfileUI && root.ProfileUI.setApiState) {
|
||||
root.ProfileUI.setApiState(target, type, message);
|
||||
return;
|
||||
}
|
||||
target.textContent = message;
|
||||
}
|
||||
|
||||
function syncLinks() {
|
||||
@@ -518,10 +531,13 @@
|
||||
function renderNoContext() {
|
||||
var message = '请先选择家谱,再查看或维护祭祀活动。';
|
||||
|
||||
if (query('[data-ceremony-list]')) query('[data-ceremony-list]').innerHTML = '<div class="api-empty">' + message + '</div>';
|
||||
if (query('[data-ceremony-detail]')) query('[data-ceremony-detail]').innerHTML = '<div class="api-empty">当前没有家谱上下文。</div>';
|
||||
setStatus('[data-ceremony-list]', message, 'empty');
|
||||
setStatus('[data-ceremony-detail]', '当前没有家谱上下文。', 'empty');
|
||||
setStatus('[data-ceremony-gift-list]', '当前没有家谱上下文。', 'empty');
|
||||
setStatus('[data-ceremony-invitation-list]', '当前没有家谱上下文。', 'empty');
|
||||
setStatus('[data-ceremony-invitee-options]', '当前没有家谱上下文。', 'empty');
|
||||
setEditorEnabled(false, message);
|
||||
setStatus('[data-ceremony-form-status]', message);
|
||||
setStatus('[data-ceremony-form-status]', message, 'forbidden');
|
||||
}
|
||||
|
||||
function requireGenealogyId() {
|
||||
@@ -531,10 +547,14 @@
|
||||
return genealogyId;
|
||||
}
|
||||
|
||||
function canEditCeremonies(genealogy) {
|
||||
return Boolean(genealogy && (genealogy.canEditContent === true || genealogy.canManage === true));
|
||||
}
|
||||
|
||||
async function loadCapability(api, genealogyId) {
|
||||
var detail = await api.genealogyDetail(genealogyId);
|
||||
|
||||
canEditContent = Boolean(detail && (detail.canEditContent || detail.canManage));
|
||||
canEditContent = canEditCeremonies(detail);
|
||||
queryAll('[data-ceremony-create-link], [data-ceremony-editor-action], [data-ceremony-admin-editor]').forEach(function (element) {
|
||||
element.hidden = !canEditContent;
|
||||
});
|
||||
@@ -549,12 +569,14 @@
|
||||
ceremonies.forEach(function (ceremony) { ceremoniesById[ceremony.ceremonyId] = ceremony; });
|
||||
if (!container) return ceremonies;
|
||||
if (!Array.isArray(data) || (data.length && !ceremonies.length)) {
|
||||
container.innerHTML = '<div class="api-empty">活动响应缺少稳定 CeremonyVo 字段,请联系后端核对。</div>';
|
||||
setStatus('[data-ceremony-list]', '活动响应缺少稳定 CeremonyVo 字段,请联系后端核对。', 'error');
|
||||
return [];
|
||||
}
|
||||
container.innerHTML = ceremonies.length
|
||||
? ceremonies.map(renderCeremonyRow).join('')
|
||||
: '<div class="api-empty">暂无祭祀活动</div>';
|
||||
if (!ceremonies.length) {
|
||||
setStatus('[data-ceremony-list]', '暂无祭祀活动', 'empty');
|
||||
return [];
|
||||
}
|
||||
container.innerHTML = ceremonies.map(renderCeremonyRow).join('');
|
||||
return ceremonies;
|
||||
}
|
||||
|
||||
@@ -566,13 +588,17 @@
|
||||
genealogyId = requireGenealogyId();
|
||||
if (!genealogyId) return;
|
||||
syncLinks();
|
||||
setStatus('[data-ceremony-list]', '正在加载祭祀活动…', 'loading');
|
||||
try {
|
||||
await loadCapability(api, genealogyId);
|
||||
renderCeremonies(await api.ceremonies(genealogyId));
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
if (query('[data-ceremony-list]')) query('[data-ceremony-list]').innerHTML = '<div class="api-empty">' +
|
||||
(isForbidden(error) ? '当前账号无权查看该家谱的祭祀活动。' : '活动加载失败,请稍后重试。') + '</div>';
|
||||
setStatus(
|
||||
'[data-ceremony-list]',
|
||||
isForbidden(error) ? '当前账号无权查看该家谱的祭祀活动。' : '活动加载失败,请稍后重试。',
|
||||
getApiStateType(error)
|
||||
);
|
||||
showMessage(isForbidden(error) ? '当前账号无权查看该家谱的祭祀活动。' : (error.message || '活动加载失败'));
|
||||
}
|
||||
}
|
||||
@@ -622,6 +648,7 @@
|
||||
ceremonyId = getCurrentCeremonyId();
|
||||
syncLinks();
|
||||
setEditorEnabled(false, '正在加载活动编辑信息…');
|
||||
setStatus('[data-ceremony-form-status]', '正在读取家谱权限…', 'loading');
|
||||
try {
|
||||
await loadCapability(api, genealogyId);
|
||||
if (!canEditContent) throw { status: 403, message: '当前账号无权维护该家谱的祭祀活动。' };
|
||||
@@ -632,25 +659,38 @@
|
||||
if (query('[data-ceremony-editor-title]')) query('[data-ceremony-editor-title]').textContent = '编辑祭祀活动';
|
||||
}
|
||||
setEditorEnabled(true);
|
||||
setStatus('[data-ceremony-form-status]', '');
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
setEditorEnabled(false, isForbidden(error) ? '当前账号无权维护该家谱的祭祀活动。' : (error.message || '活动编辑信息加载失败'));
|
||||
setStatus('[data-ceremony-form-status]', isForbidden(error) ? '当前账号无权维护该家谱的祭祀活动。' : (error.message || '活动编辑信息加载失败'));
|
||||
setStatus(
|
||||
'[data-ceremony-form-status]',
|
||||
isForbidden(error) ? '当前账号无权维护该家谱的祭祀活动。' : (error.message || '活动编辑信息加载失败'),
|
||||
getApiStateType(error)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function loadGifts(api, genealogyId, ceremonyId) {
|
||||
var data = await api.ceremonyGifts(genealogyId, ceremonyId);
|
||||
var gifts = normalizeList(data, normalizeCeremonyGift);
|
||||
var data;
|
||||
var gifts;
|
||||
var container = query('[data-ceremony-gift-list]');
|
||||
|
||||
setStatus('[data-ceremony-gift-list]', '正在加载祭品…', 'loading');
|
||||
data = await api.ceremonyGifts(genealogyId, ceremonyId);
|
||||
gifts = normalizeList(data, normalizeCeremonyGift);
|
||||
giftsById = Object.create(null);
|
||||
gifts.forEach(function (gift) { giftsById[gift.giftId] = gift; });
|
||||
if (container) {
|
||||
container.innerHTML = !Array.isArray(data) || (data.length && !gifts.length)
|
||||
? '<div class="api-empty">祭品响应缺少稳定 CeremonyGiftVo 字段,请联系后端核对。</div>'
|
||||
: renderGiftList(gifts);
|
||||
if (!container) return gifts;
|
||||
if (!Array.isArray(data) || (data.length && !gifts.length)) {
|
||||
setStatus('[data-ceremony-gift-list]', '祭品响应缺少稳定 CeremonyGiftVo 字段,请联系后端核对。', 'error');
|
||||
return [];
|
||||
}
|
||||
if (!gifts.length) {
|
||||
setStatus('[data-ceremony-gift-list]', '暂无祭品记录', 'empty');
|
||||
return [];
|
||||
}
|
||||
container.innerHTML = renderGiftList(gifts);
|
||||
return gifts;
|
||||
}
|
||||
|
||||
@@ -662,31 +702,48 @@
|
||||
if (invitation.inviteStatus !== 'CANCELED') selected[invitation.inviteeUserId] = true;
|
||||
});
|
||||
if (!container) return;
|
||||
container.innerHTML = options.length ? options.map(function (option) {
|
||||
if (!options.length) {
|
||||
setStatus('[data-ceremony-invitee-options]', '暂无已绑定账号的正常成员', 'empty');
|
||||
return;
|
||||
}
|
||||
container.innerHTML = options.map(function (option) {
|
||||
var label = option.memberName || option.appUserNickName || '家谱成员';
|
||||
return '<label class="editor-choice"><input type="checkbox" data-invitee-user-id="' +
|
||||
escapeHtml(option.appUserId) + '"' + (selected[option.appUserId] ? ' checked' : '') +
|
||||
' /> <span>' + escapeHtml(label) + '</span></label>';
|
||||
}).join('') : '<div class="api-empty">暂无已绑定账号的正常成员</div>';
|
||||
}).join('');
|
||||
}
|
||||
|
||||
async function loadInvitees(api, genealogyId, ceremonyId) {
|
||||
var results = await Promise.all([
|
||||
var results;
|
||||
var options;
|
||||
var invitations;
|
||||
var list = query('[data-ceremony-invitation-list]');
|
||||
|
||||
setStatus('[data-ceremony-invitation-list]', '正在加载邀请记录…', 'loading');
|
||||
setStatus('[data-ceremony-invitee-options]', '正在加载成员选项…', 'loading');
|
||||
results = await Promise.all([
|
||||
api.genealogyMemberOptions(genealogyId),
|
||||
api.ceremonyInvitations(genealogyId, ceremonyId)
|
||||
]);
|
||||
var options = normalizeList(results[0], normalizeInviteeOption);
|
||||
var invitations = normalizeList(results[1], normalizeInvitation);
|
||||
var list = query('[data-ceremony-invitation-list]');
|
||||
options = normalizeList(results[0], normalizeInviteeOption);
|
||||
invitations = normalizeList(results[1], normalizeInvitation);
|
||||
|
||||
inviteeOptionsByUserId = Object.create(null);
|
||||
options.forEach(function (option) { inviteeOptionsByUserId[option.appUserId] = option; });
|
||||
if (!Array.isArray(results[0]) || (results[0].length && !options.length)) {
|
||||
if (query('[data-ceremony-invitee-options]')) query('[data-ceremony-invitee-options]').innerHTML = '<div class="api-empty">成员选项响应字段不完整</div>';
|
||||
setStatus('[data-ceremony-invitee-options]', '成员选项响应字段不完整', 'error');
|
||||
} else {
|
||||
renderInviteeOptions(options, invitations);
|
||||
}
|
||||
if (list) list.innerHTML = renderInvitationList(results[1]);
|
||||
if (!list) return { options: options, invitations: invitations };
|
||||
if (!Array.isArray(results[1]) || (results[1].length && !invitations.length)) {
|
||||
setStatus('[data-ceremony-invitation-list]', '邀请响应字段不完整', 'error');
|
||||
} else if (!invitations.length) {
|
||||
setStatus('[data-ceremony-invitation-list]', '暂无邀请记录', 'empty');
|
||||
} else {
|
||||
list.innerHTML = renderInvitationList(results[1]);
|
||||
}
|
||||
return { options: options, invitations: invitations };
|
||||
}
|
||||
|
||||
@@ -699,10 +756,17 @@
|
||||
genealogyId = requireGenealogyId();
|
||||
ceremonyId = getCurrentCeremonyId();
|
||||
if (!genealogyId || !ceremonyId) {
|
||||
if (genealogyId && query('[data-ceremony-detail]')) query('[data-ceremony-detail]').innerHTML = '<div class="api-empty">缺少有效活动编号。</div>';
|
||||
if (genealogyId) {
|
||||
setStatus('[data-ceremony-detail]', '缺少有效活动编号。', 'error');
|
||||
setStatus('[data-ceremony-gift-list]', '缺少有效活动编号。', 'empty');
|
||||
setStatus('[data-ceremony-invitation-list]', '缺少有效活动编号。', 'empty');
|
||||
setStatus('[data-ceremony-invitee-options]', '缺少有效活动编号。', 'empty');
|
||||
}
|
||||
return;
|
||||
}
|
||||
syncLinks();
|
||||
setStatus('[data-ceremony-detail]', '正在加载活动详情…', 'loading');
|
||||
setStatus('[data-ceremony-gift-list]', '正在加载祭品…', 'loading');
|
||||
try {
|
||||
await loadCapability(api, genealogyId);
|
||||
currentCeremony = normalizeCeremony(await api.ceremonyDetail(genealogyId, ceremonyId));
|
||||
@@ -710,13 +774,62 @@
|
||||
if (query('[data-ceremony-detail]')) query('[data-ceremony-detail]').innerHTML = renderCeremonyDetail(currentCeremony);
|
||||
if (query('[data-ceremony-detail-title]')) query('[data-ceremony-detail-title]').textContent = currentCeremony.ceremonyTitle;
|
||||
if (query('[data-ceremony-editor-action]')) query('[data-ceremony-editor-action]').href = buildEditUrl(genealogyId, ceremonyId);
|
||||
await loadGifts(api, genealogyId, ceremonyId);
|
||||
if (canEditContent) await loadInvitees(api, genealogyId, ceremonyId);
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
if (query('[data-ceremony-detail]')) query('[data-ceremony-detail]').innerHTML = '<div class="api-empty">' +
|
||||
(isForbidden(error) ? '当前账号无权查看该活动。' : escapeHtml(error.message || '活动详情加载失败')) + '</div>';
|
||||
setStatus(
|
||||
'[data-ceremony-detail]',
|
||||
isForbidden(error) ? '当前账号无权查看该活动。' : (error.message || '活动详情加载失败'),
|
||||
getApiStateType(error)
|
||||
);
|
||||
setStatus(
|
||||
'[data-ceremony-gift-list]',
|
||||
isForbidden(error) ? '当前账号无权查看该活动。' : '祭品加载失败,请稍后重试。',
|
||||
getApiStateType(error)
|
||||
);
|
||||
setStatus(
|
||||
'[data-ceremony-invitation-list]',
|
||||
isForbidden(error) ? '当前账号无权查看该活动。' : '邀请记录加载失败,请稍后重试。',
|
||||
getApiStateType(error)
|
||||
);
|
||||
setStatus(
|
||||
'[data-ceremony-invitee-options]',
|
||||
isForbidden(error) ? '当前账号无权查看该活动。' : '成员选项加载失败,请稍后重试。',
|
||||
getApiStateType(error)
|
||||
);
|
||||
showMessage(isForbidden(error) ? '当前账号无权查看该活动。' : (error.message || '活动详情加载失败'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await loadGifts(api, genealogyId, ceremonyId);
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
setStatus(
|
||||
'[data-ceremony-gift-list]',
|
||||
isForbidden(error) ? '当前账号无权查看该活动祭品。' : (error.message || '祭品加载失败'),
|
||||
getApiStateType(error)
|
||||
);
|
||||
showMessage(isForbidden(error) ? '当前账号无权查看该活动祭品。' : (error.message || '祭品加载失败'));
|
||||
}
|
||||
if (!canEditContent) {
|
||||
setStatus('[data-ceremony-invitation-list]', '当前账号无权查看或维护受邀名单。', 'forbidden');
|
||||
setStatus('[data-ceremony-invitee-options]', '当前账号无权查看或维护受邀名单。', 'forbidden');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await loadInvitees(api, genealogyId, ceremonyId);
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
setStatus(
|
||||
'[data-ceremony-invitation-list]',
|
||||
isForbidden(error) ? '当前账号无权查看或维护受邀名单。' : (error.message || '邀请记录加载失败'),
|
||||
getApiStateType(error)
|
||||
);
|
||||
setStatus(
|
||||
'[data-ceremony-invitee-options]',
|
||||
isForbidden(error) ? '当前账号无权查看或维护受邀名单。' : '成员选项加载失败,请稍后重试。',
|
||||
getApiStateType(error)
|
||||
);
|
||||
showMessage(isForbidden(error) ? '当前账号无权查看或维护受邀名单。' : (error.message || '邀请记录加载失败'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -730,11 +843,12 @@
|
||||
var savedId;
|
||||
var verified;
|
||||
|
||||
if (writePending || !genealogyId || redirectUnauthorized(api)) return;
|
||||
if (writePending || !canEditContent || !genealogyId || redirectUnauthorized(api)) return;
|
||||
if (root.AppRichEditor && root.AppRichEditor.syncAll) root.AppRichEditor.syncAll();
|
||||
body = buildCeremonyBody(getFormValues(form));
|
||||
validation = validateCeremonyBody(body);
|
||||
if (validation) {
|
||||
setStatus('[data-ceremony-form-status]', validation);
|
||||
setStatus('[data-ceremony-form-status]', validation, 'error');
|
||||
return;
|
||||
}
|
||||
delete body.invalidLongitude;
|
||||
@@ -742,7 +856,7 @@
|
||||
delete body.invalidCoverOssId;
|
||||
delete body.invalidSortOrder;
|
||||
setWritePending(true);
|
||||
setStatus('[data-ceremony-form-status]', '正在保存活动…');
|
||||
setStatus('[data-ceremony-form-status]', '正在保存活动…', 'loading');
|
||||
try {
|
||||
saved = normalizeCeremony(ceremonyId
|
||||
? await api.updateCeremony(genealogyId, ceremonyId, body)
|
||||
@@ -754,7 +868,11 @@
|
||||
if (root.location) root.location.href = buildDetailUrl(genealogyId, savedId);
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
setStatus('[data-ceremony-form-status]', isForbidden(error) ? '当前账号无权保存该活动。' : (error.message || '活动保存失败'));
|
||||
setStatus(
|
||||
'[data-ceremony-form-status]',
|
||||
isForbidden(error) ? '当前账号无权保存该活动。' : (error.message || '活动保存失败'),
|
||||
getApiStateType(error)
|
||||
);
|
||||
} finally {
|
||||
setWritePending(false);
|
||||
}
|
||||
@@ -768,16 +886,16 @@
|
||||
var validation;
|
||||
var saved;
|
||||
|
||||
if (writePending || !genealogyId || !ceremonyId || redirectUnauthorized(api)) return;
|
||||
if (writePending || !canEditContent || !genealogyId || !ceremonyId || redirectUnauthorized(api)) return;
|
||||
body = buildCeremonyGiftBody(getFormValues(form));
|
||||
validation = validateCeremonyGiftBody(body);
|
||||
if (validation) {
|
||||
setStatus('[data-ceremony-gift-status]', validation);
|
||||
setStatus('[data-ceremony-gift-status]', validation, 'error');
|
||||
return;
|
||||
}
|
||||
delete body.invalidGiftAmount;
|
||||
setWritePending(true);
|
||||
setStatus('[data-ceremony-gift-status]', '正在添加祭品…');
|
||||
setStatus('[data-ceremony-gift-status]', '正在添加祭品…', 'loading');
|
||||
try {
|
||||
saved = normalizeCeremonyGift(await api.createCeremonyGift(genealogyId, ceremonyId, body));
|
||||
if (!saved || saved.ceremonyId !== ceremonyId) throw new Error('添加祭品响应缺少稳定 giftId');
|
||||
@@ -788,7 +906,11 @@
|
||||
setStatus('[data-ceremony-gift-status]', '祭品已添加');
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
setStatus('[data-ceremony-gift-status]', isForbidden(error) ? '当前账号无权添加祭品。' : (error.message || '祭品添加失败'));
|
||||
setStatus(
|
||||
'[data-ceremony-gift-status]',
|
||||
isForbidden(error) ? '当前账号无权添加祭品。' : (error.message || '祭品添加失败'),
|
||||
getApiStateType(error)
|
||||
);
|
||||
} finally {
|
||||
setWritePending(false);
|
||||
}
|
||||
@@ -800,19 +922,23 @@
|
||||
var ceremonyId = getCurrentCeremonyId();
|
||||
var body;
|
||||
|
||||
if (writePending || !genealogyId || !ceremonyId || redirectUnauthorized(api)) return;
|
||||
if (writePending || !canEditContent || !genealogyId || !ceremonyId || redirectUnauthorized(api)) return;
|
||||
body = buildInviteesBody(queryAll('[data-invitee-user-id]:checked').map(function (input) {
|
||||
return input.getAttribute('data-invitee-user-id');
|
||||
}));
|
||||
setWritePending(true);
|
||||
setStatus('[data-ceremony-invitee-status]', '正在更新受邀人…');
|
||||
setStatus('[data-ceremony-invitee-status]', '正在更新受邀人…', 'loading');
|
||||
try {
|
||||
await api.replaceCeremonyInvitees(genealogyId, ceremonyId, body.inviteeUserIds);
|
||||
await loadInvitees(api, genealogyId, ceremonyId);
|
||||
setStatus('[data-ceremony-invitee-status]', '受邀名单已更新');
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
setStatus('[data-ceremony-invitee-status]', isForbidden(error) ? '当前账号无权维护受邀名单。' : (error.message || '受邀名单更新失败'));
|
||||
setStatus(
|
||||
'[data-ceremony-invitee-status]',
|
||||
isForbidden(error) ? '当前账号无权维护受邀名单。' : (error.message || '受邀名单更新失败'),
|
||||
getApiStateType(error)
|
||||
);
|
||||
} finally {
|
||||
setWritePending(false);
|
||||
}
|
||||
@@ -823,7 +949,7 @@
|
||||
var genealogyId = requireGenealogyId();
|
||||
var ceremony = ceremoniesById[ceremonyId] || currentCeremony;
|
||||
|
||||
if (writePending || !genealogyId || !normalizeId(ceremonyId) || redirectUnauthorized(api)) return;
|
||||
if (writePending || !canEditContent || !genealogyId || !normalizeId(ceremonyId) || redirectUnauthorized(api)) return;
|
||||
if (root.confirm && !root.confirm('确认删除“' + (ceremony ? ceremony.ceremonyTitle : '该活动') + '”吗?删除后不可恢复。')) return;
|
||||
setWritePending(true);
|
||||
try {
|
||||
@@ -844,7 +970,7 @@
|
||||
var ceremonyId = getCurrentCeremonyId();
|
||||
var gift = giftsById[giftId];
|
||||
|
||||
if (writePending || !genealogyId || !ceremonyId || !normalizeId(giftId) || redirectUnauthorized(api)) return;
|
||||
if (writePending || !canEditContent || !genealogyId || !ceremonyId || !normalizeId(giftId) || redirectUnauthorized(api)) return;
|
||||
if (root.confirm && !root.confirm('确认删除“' + (gift && (gift.giverName || gift.giverNickName) || '该祭品') + '”的记录吗?')) return;
|
||||
setWritePending(true);
|
||||
try {
|
||||
@@ -911,6 +1037,7 @@
|
||||
normalizeInvitation: normalizeInvitation,
|
||||
normalizeInviteeOption: normalizeInviteeOption,
|
||||
buildInviteesBody: buildInviteesBody,
|
||||
canEditCeremonies: canEditCeremonies,
|
||||
renderCeremonyDetail: renderCeremonyDetail,
|
||||
renderGiftList: renderGiftList,
|
||||
shouldRedirectToLogin: shouldRedirectToLogin,
|
||||
|
||||
Reference in New Issue
Block a user