永久会员与模板库后台化:预览门控、轻量首页与 Admin CRUD

- 会员改为永久激活方案;云端文件不再拦截非会员;预览弹窗内导出/打印才校验
- 首页最近文件支持本地记录,登录后与云端合并;移除独立会员页与订阅页
- 模板库入库管理:soon_templates 表、Admin 上传 CRUD、/templates 轻量列表与按需下载

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
24kycj
2026-06-08 23:52:56 +08:00
parent 152228d41f
commit ebe191b06d
45 changed files with 1616 additions and 1259 deletions
+20 -7
View File
@@ -52,9 +52,7 @@ async function saveImageAsPNG(buffer) {
}
}
// 将 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();
@@ -418,16 +416,33 @@ window.display_func = function display_func(img1, img2, img3) {
</div>
</div>`,
btn: [language_str("output"), "打印"],//'导出'
btn1: function (index, layero) {
saveImageAsPNG(buffer);
btn1: function () {
if (typeof window.soonGuardPreviewDeliver === 'function') {
window.soonGuardPreviewDeliver(language_str('output') || '导出', function () {
saveImageAsPNG(buffer);
});
} else {
saveImageAsPNG(buffer);
}
return false;
},
btn2: function () {
if (window.platformBridge && window.platformBridge.printPdf) {
if (typeof window.soonGuardPreviewDeliver === 'function') {
window.soonGuardPreviewDeliver('打印', function () {
if (window.platformBridge && window.platformBridge.printPdf) {
var blob = buffer instanceof Uint8Array ? new Blob([buffer], { type: 'image/png' }) : new Blob([buffer], { type: 'image/png' });
window.platformBridge.printPdf(blob);
} else if (typeof printJS === 'function') {
printJS({ printable: url3, type: 'image', style: 'img { width: 100%; height: auto; }' });
}
});
} else if (window.platformBridge && window.platformBridge.printPdf) {
var blob = buffer instanceof Uint8Array ? new Blob([buffer], { type: 'image/png' }) : new Blob([buffer], { type: 'image/png' });
window.platformBridge.printPdf(blob);
} else if (typeof printJS === 'function') {
printJS({ printable: url3, type: 'image', style: 'img { width: 100%; height: auto; }' });
}
return false;
},
end: function () {
if (printBlobUrl) try { URL.revokeObjectURL(printBlobUrl); } catch (e) {}
@@ -456,7 +471,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_1.png'), function (i1) {
i1.left = background_image.left;
@@ -1395,7 +1409,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;