feat(payment): 新增「售后策略」配置与前台售后弹窗链路
- 后台「支付&付费 → 售后策略」:售后功能开关、申请时效、超时效提示(HTML)、 预置原因、申请售后说明、所需材料、申请说明占位文案、可上传图片开关; PHP schema 与 SPA schema 1:1 对齐,group 字段支持拖拽排序 - PaymentRuntime 新增售后设置解析(缺键回退 schema 默认、HTML 走 kses、 中文原因稳定 slug)与 after_sale_expired 时效判定(支付时间起算) - 售后工单支持举证图片(order_aftersale.images 列,最多 3 张, 复用评论图片上传校验)与上传路由;订单视图模型输出 after_sale 按钮状态 - 前台申请 / 超时效提示 / 售后详细三个独立弹窗(modal-mini + 蓝色炫彩头), 订单详情弹窗不再内嵌售后表单并清理相关死代码 - 新增 after-sale-policy 契约测试与运行时 harness,527 项契约测试通过
This commit is contained in:
1 parent
b447c41f13
commit
1a9a2762f3
19 files changed
+1835
-86
No files matched your search
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* 售后策略 — 售后开关、申请时效、超时效提示与申请表单配置。
|
||||
*
|
||||
* 字段键、顺序、类型与默认值需与 src/Admin/Schema/SchemaPayment.php 的
|
||||
* after_sale 分区保持 1:1(tests/widget-system/after-sale-policy-contract.test.cjs 守护)。
|
||||
*/
|
||||
export const afterSaleSchema = {
|
||||
key: 'payment.after_sale',
|
||||
title: '售后策略',
|
||||
icon: 'fa fas fa-undo-alt',
|
||||
description: '售后功能开关、申请时效、超时效提示与申请表单(预置原因、申请说明、所需材料、图片上传)配置。',
|
||||
defaults: {
|
||||
after_sale_s: true,
|
||||
after_sale_time_limit: 7,
|
||||
after_sale_expired_text: '<div>抱歉,您的订单已超过售后申请时效</div>',
|
||||
after_sale_reasons: [
|
||||
{ t: '质量问题' },
|
||||
{ t: '假冒品牌' },
|
||||
{ t: '其他原因' },
|
||||
],
|
||||
after_sale_desc: '',
|
||||
after_sale_materials: [
|
||||
{ t: '联系邮箱' },
|
||||
{ t: '联系电话' },
|
||||
],
|
||||
after_sale_reason_placeholder: '必填,请您详细填写申请原因',
|
||||
after_sale_img_s: true,
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'main',
|
||||
title: '售后功能',
|
||||
icon: 'fa fas fa-undo-alt',
|
||||
fields: [
|
||||
{ key: 'after_sale_s', label: '售后功能', type: 'switch', default: true, help: '开启后用户可以申请售后;关闭后不再处理售后,前台「我的订单」不再显示申请售后按钮' },
|
||||
{ key: 'after_sale_time_limit', label: '申请售后时效(天)', type: 'number', default: 7, min: 0, max: 3650, help: '订单支付后多少天内可以申请售后,超过时效将无法申请;0 表示不限制' },
|
||||
{ key: 'after_sale_expired_text', label: '超过时效提示', type: 'textarea', sanitize_type: 'html', default: '<div>抱歉,您的订单已超过售后申请时效</div>', rows: 3, help: '订单超过售后时效后,用户点击申请售后时弹窗提示的内容(支持HTML代码,请注意代码规范)' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'form',
|
||||
title: '申请表单',
|
||||
icon: 'fa fas fa-file-alt',
|
||||
fields: [
|
||||
{
|
||||
key: 'after_sale_reasons',
|
||||
label: '预置原因',
|
||||
type: 'group',
|
||||
button_title: '添加原因',
|
||||
help: '用户申请售后时可选择的原因',
|
||||
default: [
|
||||
{ t: '质量问题' },
|
||||
{ t: '假冒品牌' },
|
||||
{ t: '其他原因' },
|
||||
],
|
||||
fields: [
|
||||
{ key: 't', label: '原因', type: 'input', default: '' },
|
||||
],
|
||||
},
|
||||
{ key: 'after_sale_desc', label: '申请售后说明', type: 'textarea', sanitize_type: 'html', default: '', rows: 5, help: '用户申请售后时显示的内容(支持HTML代码,请注意代码规范)' },
|
||||
{
|
||||
key: 'after_sale_materials',
|
||||
label: '申请所需材料',
|
||||
type: 'group',
|
||||
button_title: '添加材料',
|
||||
help: '用户提交售后申请时需要提供的资料,如联系邮箱、联系电话;此处的信息收集,仅用于售后联系与审核',
|
||||
default: [
|
||||
{ t: '联系邮箱' },
|
||||
{ t: '联系电话' },
|
||||
],
|
||||
fields: [
|
||||
{ key: 't', label: '资料项', type: 'input', default: '' },
|
||||
],
|
||||
},
|
||||
{ key: 'after_sale_reason_placeholder', label: '申请说明占位文案', type: 'input', default: '必填,请您详细填写申请原因', help: '前台申请售后弹窗中「申请说明」输入框的提示文字' },
|
||||
{ key: 'after_sale_img_s', label: '申请售后可上传图片', type: 'switch', default: true, help: '开启后申请售后弹窗中出现图片上传入口(最多上传3张)' },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { revenueSchema } from './revenue.js'
|
||||
import { affiliateSchema } from './affiliate.js'
|
||||
import { gatewaySchema } from './gateway.js'
|
||||
import { withdrawalSchema } from './withdrawal.js'
|
||||
import { afterSaleSchema } from './afterSale.js'
|
||||
|
||||
export const paymentSchemas = {
|
||||
knowledge: knowledgeSchema,
|
||||
@@ -18,4 +19,5 @@ export const paymentSchemas = {
|
||||
affiliate: affiliateSchema,
|
||||
gateway: gatewaySchema,
|
||||
withdrawal: withdrawalSchema,
|
||||
after_sale: afterSaleSchema,
|
||||
}
|
||||
Reference in new issue
Block a user