From 2b4691aa2f0f5aa50ae4c83aa9af21087db71632 Mon Sep 17 00:00:00 2001 From: wikiboss Date: Mon, 21 Sep 2026 15:38:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(mpuniapp):=20=E4=BC=98=E5=8C=96=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=E6=8A=BD=E5=B1=89=E5=A4=9A=E8=A1=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E5=B9=B6=E6=96=B0=E5=A2=9E=E5=90=8D=E7=89=87?= =?UTF-8?q?/=E9=9C=80=E6=B1=82=E7=85=A7=E7=89=87=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mpuniapp/pages/portal/index.uvue | 2 +- mpuniapp/tests/appointment.test.ts | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/mpuniapp/pages/portal/index.uvue b/mpuniapp/pages/portal/index.uvue index f9833c4..98cacae 100644 --- a/mpuniapp/pages/portal/index.uvue +++ b/mpuniapp/pages/portal/index.uvue @@ -753,7 +753,7 @@ async function submitAppointmentForm(): Promise { 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}`; diff --git a/mpuniapp/tests/appointment.test.ts b/mpuniapp/tests/appointment.test.ts index 1df60df..8ac5abc 100644 --- a/mpuniapp/tests/appointment.test.ts +++ b/mpuniapp/tests/appointment.test.ts @@ -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(' { +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、输入框防缩放与 '预约提交按钮必须具备独立规范样式类' ); }); +