下载不做记录,支付中心下的“下载记录”页面及相关链路整体删除。 删除的内容: - src/Admin/Native/PayDownloadLogs.php(页面渲染、批量删除、 令牌查询)整文件移除。 - PayMenus 中的 download_logs 子菜单注册(概览页快捷入口由同一 份 pages() 数组生成,随之消失)。 - functions.php 中的 PayDownloadLogs::init() 接线。 - 各入口跳转链接:付费文章列表的操作按钮、用户列表“积分分成” 列的操作链接、用户列表行操作。 - “保存用户下载记录(条) / 保存文章下载记录(条)”两个设置项及其 消费链:SchemaPayment.php、assets/admin 侧 knowledge.js 的字段 与默认值、PaymentRuntime.php 的 user_log / post_log。 - 前台下载中心登录提示里的“管理下载记录”文案(该处本就没有 可跳转的管理页面)。 未改动内容: - aksrt_dl_token 数据表仍由 DBMigrator 创建、uninstall.php 仍会 删除:存量站点可能留有历史令牌行,属数据而非功能,迁移风险 高于收益。 - 独立下载页面开关(down_alone_page)与远程文件转本地等下载 行为配置保留。 - 资源下载量(_aksrt_res_download_count)仍是只读口径:下载走 普通外链,主题内没有写入方,本次不新增下载统计。 download-direct-contract.test.cjs 中原有“下载记录页面展示历史 令牌”用例反向改写为三项断言:页面与接线已删除、记录数设置项 已注销、下载仍不做记录。 验证:node --test "tests/*/*.test.cjs" 517 项全部通过; php -l 全部改动文件无语法错误;重新构建 admin SPA,确认产物 中不含被移除的字段与菜单。
233 lines
11 KiB
JavaScript
233 lines
11 KiB
JavaScript
/**
|
|
* 知识付费 — 1:1 复刻参考主题对应页面(免登陆购买 / 模块位置 / 优惠码 /
|
|
* 客户服务 / 付费下载 / 商品预置参数),并保留 AKSRT 订单展示与状态文案。
|
|
*/
|
|
export const knowledgeSchema = {
|
|
key: 'payment.knowledge',
|
|
title: '知识付费',
|
|
icon: 'fa fas fa-shopping-bag',
|
|
description: '付费内容总开关、免登陆购买、模块显示、优惠码与商品预置参数配置。',
|
|
defaults: {
|
|
pay_no_logged_in: true,
|
|
pay_cookie_day: 15,
|
|
pay_no_logged_remind: '您当前未登录!建议登陆后购买,可保存购买订单',
|
|
pay_box_position: 'top',
|
|
pay_free_logged_show: true,
|
|
pay_show_user: true,
|
|
pay_show_paycount: true,
|
|
coupon_post_s: false,
|
|
coupon_desc: '',
|
|
pay_mark: '付费',
|
|
payment_show_ip: false,
|
|
payment_show_device: false,
|
|
payment_show_order_no: true,
|
|
payment_show_create_time: true,
|
|
payment_show_pay_time: true,
|
|
payment_order_status_pending: '待支付',
|
|
payment_order_status_paid: '已支付',
|
|
payment_order_status_refunded: '已退款',
|
|
payment_order_status_closed: '已关闭',
|
|
pay_service: [],
|
|
down_alone_page: false,
|
|
down_remote_to_local_s: true,
|
|
down_remote_to_local_size: 2048,
|
|
down_remote_to_local_ext: 'zip,rar,7z,text,png,jpg,jpeg,gif,mp3,mp4,avi,wmv,flv,swf,doc,docx,xls,xlsx,ppt,pptx,pdf',
|
|
down_verify_nonce: true,
|
|
pay_modo_default: '0',
|
|
points_price_default: 0,
|
|
vip_1_points_default: 0,
|
|
vip_2_points_default: 0,
|
|
pay_price_default: '0.01',
|
|
pay_original_price_default: '',
|
|
pay_promotion_tag_default: '<i class="fa fas fa-fw fa-bolt"></i> 限时特惠',
|
|
vip_1_price_default: '0',
|
|
vip_2_price_default: '0',
|
|
pay_rebate_discount: '0',
|
|
pay_cuont_default: { min: 0, max: 0 },
|
|
pay_details_default: '',
|
|
pay_extra_hide_default: '',
|
|
pay_attributes_default: [],
|
|
pay_gallery_show_default: 1,
|
|
},
|
|
groups: [
|
|
{
|
|
key: 'notice',
|
|
title: '说明',
|
|
icon: 'fa fas fa-info-circle',
|
|
fields: [
|
|
{
|
|
key: 'knowledge_notice',
|
|
label: '',
|
|
type: 'content',
|
|
ui_only: true,
|
|
content: '<p><b>知识付费</b></p><ul style="margin:6px 0 0 18px;line-height:1.9"><li>知识付费功能主要分为文章付费、付费会员、余额系统、推广返佣、创作分成等功能组成,您可以根据您的需要开启对应功能</li><li>使用支付功能请先在「收款接口」页配置好收款通道</li></ul>',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
key: 'guest-buy',
|
|
title: '免登陆购买',
|
|
icon: 'fa fas fa-user-clock',
|
|
fields: [
|
|
{ key: 'pay_no_logged_in', label: '免登陆购买', type: 'switch', default: true, help: '开启后如果用户未登录则使用浏览器缓存验证是否购买' },
|
|
{ key: 'pay_cookie_day', label: 'Cookie时间(天)', type: 'number', default: 15, min: 1, max: 31, dependsOn: { key: 'pay_no_logged_in', value: true }, help: '免登陆购买的浏览器缓存有效时间' },
|
|
{ key: 'pay_no_logged_remind', label: '未登录提醒', type: 'textarea', default: '您当前未登录!建议登陆后购买,可保存购买订单', rows: 2, dependsOn: { key: 'pay_no_logged_in', value: true } },
|
|
],
|
|
},
|
|
{
|
|
key: 'box-position',
|
|
title: '模块显示位置',
|
|
icon: 'fa fas fa-arrows-alt',
|
|
fields: [
|
|
{
|
|
key: 'pay_box_position',
|
|
label: '购买模块位置',
|
|
type: 'radio',
|
|
default: 'top',
|
|
options: [
|
|
{ label: '文章模块上方', value: 'box_top' },
|
|
{ label: '文章内容顶部', value: 'top' },
|
|
{ label: '文章内容底部', value: 'bottom' },
|
|
{ label: '文章模块下方', value: 'box_bottom' },
|
|
],
|
|
help: '在文章页面中购买模块的显示位置',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
key: 'display-basic',
|
|
title: '基础显示',
|
|
icon: 'fa fas fa-eye',
|
|
fields: [
|
|
{ key: 'pay_free_logged_show', label: '免费资源登录可见', type: 'switch', default: true, help: '免费资源必须登录后才能查看' },
|
|
{ key: 'pay_show_user', label: '订单数据', type: 'switch', default: true, help: '在用户中心显示订单数据' },
|
|
{ key: 'pay_show_paycount', label: '销量显示', type: 'switch', default: true, help: '商品详情显示销售数量' },
|
|
],
|
|
},
|
|
{
|
|
key: 'coupon',
|
|
title: '商品优惠码',
|
|
icon: 'fa fas fa-ticket-alt',
|
|
fields: [
|
|
{ key: 'coupon_post_s', label: '为所有商品启用优惠券功能', type: 'switch', default: false, help: '开启后将为所有商品显示输入优惠码的功能;也可以单独给任意一个商品开启' },
|
|
{ key: 'coupon_desc', label: '优惠码默认说明', type: 'textarea', default: '', rows: 1, dependsOn: { key: 'coupon_post_s', value: true }, help: '用户填写优惠码时展示的提醒内容,支持HTML代码' },
|
|
],
|
|
},
|
|
{
|
|
key: 'display',
|
|
title: '展示设置',
|
|
icon: 'fa fas fa-list-alt',
|
|
fields: [
|
|
{ key: 'pay_mark', label: '付费标记', type: 'input', default: '付费' },
|
|
{ key: 'payment_show_ip', label: '显示用户IP', type: 'switch', default: false },
|
|
{ key: 'payment_show_device', label: '显示设备信息', type: 'switch', default: false },
|
|
{ key: 'payment_show_order_no', label: '显示订单号', type: 'switch', default: true },
|
|
{ key: 'payment_show_create_time', label: '显示创建时间', type: 'switch', default: true },
|
|
{ key: 'payment_show_pay_time', label: '显示支付时间', type: 'switch', default: true },
|
|
],
|
|
},
|
|
{
|
|
key: 'status',
|
|
title: '状态设置',
|
|
icon: 'fa fas fa-tags',
|
|
fields: [
|
|
{ key: 'payment_order_status_pending', label: '待支付状态文案', type: 'input', default: '待支付' },
|
|
{ key: 'payment_order_status_paid', label: '已支付状态文案', type: 'input', default: '已支付' },
|
|
{ key: 'payment_order_status_refunded', label: '已退款状态文案', type: 'input', default: '已退款' },
|
|
{ key: 'payment_order_status_closed', label: '已关闭状态文案', type: 'input', default: '已关闭' },
|
|
],
|
|
},
|
|
{
|
|
key: 'service',
|
|
title: '客户服务',
|
|
icon: 'fa fas fa-headphones',
|
|
fields: [
|
|
{
|
|
key: 'pay_service',
|
|
label: '用户服务内容',
|
|
type: 'group',
|
|
button_title: '添加服务项',
|
|
default: [],
|
|
fields: [
|
|
{ key: 'value', label: '服务内容', type: 'input', default: '' },
|
|
{ key: 'icon', label: '自定义图标', type: 'icon', default: '' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
key: 'feature',
|
|
title: '商品功能配置',
|
|
icon: 'fa fas fa-cubes',
|
|
fields: [
|
|
{
|
|
key: 'pay_type_option',
|
|
label: '商品功能配置',
|
|
type: 'tabbed',
|
|
tabs: [
|
|
{
|
|
key: 'download',
|
|
title: '付费下载',
|
|
fields: [
|
|
{ key: 'down_alone_page', label: '独立下载页面', type: 'switch', default: false, help: '开启后,付费资源的下载链接会跳转独立页面显示' },
|
|
{ key: 'down_remote_to_local_s', label: '远程文件转本地文件下载', type: 'switch', default: true, help: '当下载地址为外链文件时,先将远程文件下载到本地服务器,再提供给用户下载,可完全隐藏远程下载地址' },
|
|
{ key: 'down_remote_to_local_size', label: '文件大小限制(Kb)', type: 'number', default: 2048, min: 0 },
|
|
{ key: 'down_remote_to_local_ext', label: '文件格式限制', type: 'input', default: 'zip,rar,7z,text,png,jpg,jpeg,gif,mp3,mp4,avi,wmv,flv,swf,doc,docx,xls,xlsx,ppt,pptx,pdf', help: '限制使用此功能的文件格式,多个用英文逗号隔开' },
|
|
{ key: 'down_verify_nonce', label: '下载前检测用户环境', type: 'switch', default: true, help: '防止机器批量扫描下载,有效防止跨站攻击' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
key: 'presets',
|
|
title: '商品预置参数配置',
|
|
icon: 'fa fas fa-sliders-h',
|
|
fields: [
|
|
{
|
|
key: 'presets_notice',
|
|
label: '',
|
|
type: 'content',
|
|
ui_only: true,
|
|
content: '在下方配置的参数新建文章时候会自动填入,方便新建文章的设置。最终以文章配置为准',
|
|
},
|
|
{
|
|
key: 'pay_modo_default',
|
|
label: '支付类型',
|
|
type: 'radio',
|
|
default: '0',
|
|
options: [
|
|
{ label: '普通商品(金钱购买)', value: '0' },
|
|
{ label: '积分商品(积分购买,依赖于用户积分功能)', value: 'points' },
|
|
],
|
|
},
|
|
{ key: 'points_price_default', label: '积分售价(积分)', type: 'number', default: 0, min: 0 },
|
|
{ key: 'vip_1_points_default', label: '一级会员积分售价(积分)', type: 'number', default: 0, min: 0 },
|
|
{ key: 'vip_2_points_default', label: '二级会员积分售价(积分)', type: 'number', default: 0, min: 0 },
|
|
{ key: 'pay_price_default', label: '执行价', type: 'input', sanitize_type: 'money_decimal', default: '0.01', suffix: '元' },
|
|
{ key: 'pay_original_price_default', label: '原价', type: 'input', sanitize_type: 'money_decimal', default: '', suffix: '元', help: '显示在执行价格前面,并划掉' },
|
|
{ key: 'pay_promotion_tag_default', label: '促销标签', type: 'textarea', sanitize_type: 'html', default: '<i class="fa fas fa-fw fa-bolt"></i> 限时特惠', rows: 1 },
|
|
{ key: 'vip_1_price_default', label: '一级会员价格', type: 'input', sanitize_type: 'money_decimal', default: '0', suffix: '元', help: '填0则为一级会员免费' },
|
|
{ key: 'vip_2_price_default', label: '二级会员价格', type: 'input', sanitize_type: 'money_decimal', default: '0', suffix: '元', help: '填0则为二级会员免费' },
|
|
{ key: 'pay_rebate_discount', label: '推广折扣', type: 'input', sanitize_type: 'money_decimal', default: '0', suffix: '元', help: '通过推广链接购买,额外优惠的金额;需开启推广返佣功能,且不能超过实际购买价' },
|
|
{ key: 'pay_cuont_default', label: '销量浮动', type: 'between_number', default: { min: 0, max: 0 }, help: '为真实销量增加或减少的数量,系统会根据此处设置的区间获取随机值作为预置参数' },
|
|
{ key: 'pay_details_default', label: '更多详情', type: 'textarea', sanitize_type: 'html', default: '', rows: 3, help: '可插入任意的HTML代码' },
|
|
{ key: 'pay_extra_hide_default', label: '额外隐藏内容', type: 'textarea', sanitize_type: 'html', default: '', rows: 3, help: '可插入任意的HTML代码' },
|
|
{
|
|
key: 'pay_attributes_default',
|
|
label: '资源属性',
|
|
type: 'group',
|
|
button_title: '添加属性',
|
|
default: [],
|
|
fields: [
|
|
{ key: 'key', label: '属性名称', type: 'input', default: '' },
|
|
{ key: 'value', label: '属性内容', type: 'input', default: '' },
|
|
],
|
|
},
|
|
{ key: 'pay_gallery_show_default', label: '付费图片免费查看数量(张)', type: 'number', default: 1, min: 0, help: '设置付费图片可免费查看前几张图片的数量的默认值' },
|
|
],
|
|
},
|
|
],
|
|
}
|