永久会员与模板库后台化:预览门控、轻量首页与 Admin CRUD
- 会员改为永久激活方案;云端文件不再拦截非会员;预览弹窗内导出/打印才校验 - 首页最近文件支持本地记录,登录后与云端合并;移除独立会员页与订阅页 - 模板库入库管理:soon_templates 表、Admin 上传 CRUD、/templates 轻量列表与按需下载 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
// 将 display_func 附加到 window 对象,确保全局可访问
|
||||
window.display_func = function display_func(img1, img2, img3) {
|
||||
if (typeof window.soonGuardMemberPreview === 'function' && !window.soonGuardMemberPreview()) return;
|
||||
$('#base_control').hide()
|
||||
$('#line_control').hide()
|
||||
$('#pic_control').hide()
|
||||
@@ -356,29 +354,55 @@ window.display_func = function display_func(img1, img2, img3) {
|
||||
</div>
|
||||
</div>`,
|
||||
btn: btns, //'导出'
|
||||
btn1: function (index, layero) {
|
||||
if (typeof window.savePdf === 'function') {
|
||||
btn1: function () {
|
||||
if (typeof window.soonGuardPreviewDeliver === 'function') {
|
||||
window.soonGuardPreviewDeliver('导出', function () {
|
||||
if (typeof window.savePdf === 'function') window.savePdf(pdfBlob);
|
||||
});
|
||||
} else if (typeof window.savePdf === 'function') {
|
||||
window.savePdf(pdfBlob);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
btn2: function () {
|
||||
if (window.platformBridge && window.platformBridge.printPdf && (printPath3.indexOf('data:') === 0 || printPath4.indexOf('data:') === 0)) {
|
||||
if (typeof window.soonGuardPreviewDeliver === 'function') {
|
||||
window.soonGuardPreviewDeliver('打印', function () {
|
||||
if (window.platformBridge && window.platformBridge.printPdf && (printPath3.indexOf('data:') === 0 || printPath4.indexOf('data:') === 0)) {
|
||||
if (btns[1] === '打印正面') window.platformBridge.printPdf(pdfBlob);
|
||||
else if (btns[1] === '打印背面') window.platformBridge.printPdf(pdfBlob);
|
||||
return;
|
||||
}
|
||||
if (btns[1] === '打印正面') {
|
||||
printJS({ printable: printPath3, type: 'image', style: 'img { width: 100%; height: auto; }' });
|
||||
} else if (btns[1] === '打印背面') {
|
||||
printJS({ printable: printPath4, type: 'image', style: 'img { width: 100%; height: auto; }' });
|
||||
}
|
||||
});
|
||||
} else if (window.platformBridge && window.platformBridge.printPdf && (printPath3.indexOf('data:') === 0 || printPath4.indexOf('data:') === 0)) {
|
||||
if (btns[1] === '打印正面') window.platformBridge.printPdf(pdfBlob);
|
||||
else if (btns[1] === '打印背面') window.platformBridge.printPdf(pdfBlob);
|
||||
return;
|
||||
}
|
||||
if (btns[1] === '打印正面') {
|
||||
} else if (btns[1] === '打印正面') {
|
||||
printJS({ printable: printPath3, type: 'image', style: 'img { width: 100%; height: auto; }' });
|
||||
} else if (btns[1] === '打印背面') {
|
||||
printJS({ printable: printPath4, type: 'image', style: 'img { width: 100%; height: auto; }' });
|
||||
}
|
||||
return false;
|
||||
},
|
||||
btn3: function () {
|
||||
if (window.platformBridge && window.platformBridge.printPdf) {
|
||||
if (typeof window.soonGuardPreviewDeliver === 'function') {
|
||||
window.soonGuardPreviewDeliver('打印', function () {
|
||||
if (window.platformBridge && window.platformBridge.printPdf) {
|
||||
window.platformBridge.printPdf(pdfBlob);
|
||||
return;
|
||||
}
|
||||
printJS({ printable: printPath4, type: 'image', style: 'img { width: 100%; height: auto; }' });
|
||||
});
|
||||
} else if (window.platformBridge && window.platformBridge.printPdf) {
|
||||
window.platformBridge.printPdf(pdfBlob);
|
||||
return;
|
||||
} else {
|
||||
printJS({ printable: printPath4, type: 'image', style: 'img { width: 100%; height: auto; }' });
|
||||
}
|
||||
printJS({ printable: printPath4, type: 'image', style: 'img { width: 100%; height: auto; }' });
|
||||
return false;
|
||||
},
|
||||
end: function () {
|
||||
// 预览窗口关闭后,恢复所有对象的 selectable 和 evented 状态
|
||||
@@ -406,7 +430,6 @@ window.display_func = function display_func(img1, img2, img3) {
|
||||
|
||||
// 将 output 附加到 window 对象,确保全局可访问
|
||||
window.output = function output(callback = null, _save = save) {
|
||||
if (typeof window.soonGuardMemberExport === 'function' && !window.soonGuardMemberExport()) return;
|
||||
// 类型改变
|
||||
fabric.Image.fromURL(soonAsset('op_2.png'), function (i1) {
|
||||
i1.left = background_image.left
|
||||
@@ -1215,7 +1238,6 @@ function save(op1, callback) {
|
||||
}
|
||||
|
||||
window.saveHistory = function saveHistory() {
|
||||
if (typeof window.soonIsWebPortal === 'function' && window.soonIsWebPortal()) return;
|
||||
function doWrite(j) {
|
||||
var currentPath = openAs.name;
|
||||
if (!currentPath) return;
|
||||
|
||||
Reference in New Issue
Block a user