feat(mpuniapp): 优化预约抽屉多行文本体验并新增名片/需求照片可选上传

这个提交包含在:
wikiboss
2026-09-21 15:38:25 +08:00
父节点 38506bbd40
当前提交 2b4691aa2f
共有 2 个文件被更改,包括 26 次插入 和 3 次删除

查看文件

@@ -753,7 +753,7 @@ async function submitAppointmentForm(): Promise<void> {
try {
const isEmail = contact.includes('@');
const photoNotes = appointmentForm.photos.length > 0
? `\n附带资料照片: ${appointmentForm.photos.join(' , ')}`
? `\n[附件照片 ${appointmentForm.photos.join(' ')}]`
: '';
const fullNotes = `[商务预约] 期望形式: ${appointmentForm.preferredTime || '未指定'}${appointmentForm.notes.trim() ? `\n需求与议题: ${appointmentForm.notes.trim()}` : ''}${photoNotes}`;

查看文件

@@ -29,6 +29,8 @@ test('1. common/locale.uts 必须覆盖 7 种语言的预约需求表单国际
'portal.appointment_submitting',
'portal.appointment_success_tip',
'portal.appointment_fill_required',
'portal.appointment_photos',
'portal.appointment_photos_tip',
];
for (const key of requiredKeys) {
@@ -39,6 +41,7 @@ test('1. common/locale.uts 必须覆盖 7 种语言的预约需求表单国际
for (const loc of locales) {
assert.ok(content.includes(`'${loc}':`), `必须配置语言 ${loc}`);
assert.ok(content.includes("'portal.appointment_form_title':"), `${loc} 必须包含 portal.appointment_form_title`);
assert.ok(content.includes("'portal.appointment_photos':"), `${loc} 必须包含 portal.appointment_photos`);
assert.ok(content.includes("'portal.appointment_submit':"), `${loc} 必须包含 portal.appointment_submit`);
}
});
@@ -51,9 +54,13 @@ test('2. pages/portal/index.uvue 包含 Bento 预约卡片并唤起需求提报
assert.ok(content.includes('appointment-card'), '必须包含 Bento 预约卡片');
assert.ok(content.includes('openAppointmentSheet'), '必须包含打开预约抽屉的方法 openAppointmentSheet');
assert.ok(content.includes('appointment-sheet'), '必须包含预约需求抽屉');
assert.ok(
content.includes('appointment-sheet-scroll') || content.includes('sheet-scroll-body'),
'预约抽屉必须包含可滚动容器以适配长表单在移动端正常滚动'
);
});
test('3. 抽屉内必须包含完整的姓名、联系方式、公司与业务需求提报字段', () => {
test('3. 抽屉内必须包含多行需求文本框与可选的照片上传组件', () => {
const content = fs.readFileSync(portalIndexUvuePath, 'utf-8');
// 表单字段输入项
@@ -61,16 +68,31 @@ test('3. 抽屉内必须包含完整的姓名、联系方式、公司与业务
assert.ok(content.includes('appointmentForm.contact'), '必须绑定联系方式输入项');
assert.ok(content.includes('appointmentForm.company'), '必须绑定公司输入项');
assert.ok(content.includes('appointmentForm.notes'), '必须绑定需求与议题说明 textarea');
assert.ok(
content.includes('<textarea') && content.includes('sheet-field-textarea'),
'合作需求与议题简述必须使用多行文本框 textarea 并具备防缩放多行样式'
);
// 照片上传可选组件
assert.ok(
content.includes('ImageUploader') || content.includes('image-uploader'),
'必须复用 image-uploader 组件支持可选上传名片或需求照片'
);
assert.ok(content.includes('appointmentForm.photos'), '表单状态必须包含 photos 数组');
assert.ok(content.includes('submitAppointmentForm'), '必须包含提交预约需求方法 submitAppointmentForm');
assert.ok(content.includes('appointmentFormSubmitting'), '必须包含防重复提交状态控制');
});
test('4. 提交预约信息必须直接调用 submitLead 接口将需求提交给名片主', () => {
test('4. 提交预约信息必须直接调用 submitLead 接口将需求与附带照片提交给名片主', () => {
const content = fs.readFileSync(portalIndexUvuePath, 'utf-8');
assert.ok(content.includes('submitLead(') || content.includes('submitLead'), '必须调用 submitLead 接口提交预约线索');
assert.ok(content.includes("touchType: 'appointment'") || content.includes('trackAppointmentAction'), '提交后必须上报 appointment 雷达轨迹');
assert.ok(content.includes('notes:'), '提交数据必须封装预约时间与需求 notes');
assert.ok(
content.includes('photos') && content.includes('appointmentForm.photos'),
'提交备注必须整合访客上传的资料/名片照片'
);
});
test('5. 移动端 UI 规范审查:零非业务 Emoji、输入框防缩放与按钮触控区', () => {
@@ -86,3 +108,4 @@ test('5. 移动端 UI 规范审查:零非业务 Emoji、输入框防缩放与
'预约提交按钮必须具备独立规范样式类'
);
});