diff --git a/zlt-web/react-web-next/src/pages/orders/Tourism/components/QrcodeTourismForm.tsx b/zlt-web/react-web-next/src/pages/orders/Tourism/components/QrcodeTourismForm.tsx index d221e43f..124c6db8 100644 --- a/zlt-web/react-web-next/src/pages/orders/Tourism/components/QrcodeTourismForm.tsx +++ b/zlt-web/react-web-next/src/pages/orders/Tourism/components/QrcodeTourismForm.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { ModalForm, ProForm, ProFormDigit, ProFormSelect, ProFormText } from '@ant-design/pro-components'; import { ordersApi } from '@/services/orders'; import { deviceApi } from '@/services/device'; @@ -15,9 +15,9 @@ export interface QrcodeTourismFormProps { } const QrcodeTourismForm: React.FC = ({ open, title, initialValues, onOpenChange, onFinish, defaultTourismId }) => { - // 统一默认值,解决新增/编辑缺省字段的问题 + // 统一默认值,解决新增/编辑缺省字段问题 const DEFAULTS: Partial = { - status: 0, // 状态:0=禁用,1=启用 + status: 0, // 状态:0=禁用 1=启用 enableVideoEdit: 0, // 是否开启一键成片:0=否 1=是 isTest: 0, // 是否测试二维码:0=否 1=是 qrcodeType: 1, // 二维码类型:1=游客扫码 2=临时扫码 3=自定义 @@ -60,6 +60,17 @@ const QrcodeTourismForm: React.FC = ({ open, title, init }; }, [open, tourismIdForFetch]); + // 景区素材类型字典(按业务提供) + const TYPE_LABEL: Record = { + 5: '视频', + 6: '首页 Banner', + 4: '展示图片', + 3: '景区详情', + 2: '景区小图展示', + 1: '活动', + }; + const typeName = (t: any) => TYPE_LABEL[Number(t)] || '其他'; + return ( title={title} @@ -91,7 +102,7 @@ const QrcodeTourismForm: React.FC = ({ open, title, init labelWrap colProps={{ span: 12 }} > - {/* 小程序商户(仅显示支持支付的类型) */} + {/* 小程序商户(仅显示支持支付的类型)*/} = ({ open, title, init colProps={{ span: 12 }} /> - {/* 统计项 */} + {/* 统计 */} @@ -244,11 +255,10 @@ const QrcodeTourismForm: React.FC = ({ open, title, init
- {/* 景区素材(移除查询条件;支持多选;无上限;保留“全部选择/取消全选”) */} + {/* 景区素材(移除查询条件;支持多选;无上限;保留“全部选择/取消选择”) */} {({ getFieldValue, setFieldsValue }) => { const selected: number[] = getFieldValue('tourismFileIds') || []; - const typeName = (t: any) => (t === 2 ? '视频' : t === 1 ? '图片' : '其他'); if (!tourismIdForFetch) { return
请选择景区后加载素材
; } @@ -271,16 +281,15 @@ const QrcodeTourismForm: React.FC = ({ open, title, init return (
- {/* 仅保留“全部选择 / 取消全选” */} + {/* 操作:全部选择 / 取消选择(左对齐,与“景区素材”同起点) */}
-
- - + +
{/* 统计信息 */}
- 已选 {selected.length} 个;共 {list.length} 个 + 已选{selected.length} 个;共{list.length} 个
{/* 网格容器:自适应列 + 滚动 */} @@ -297,11 +306,11 @@ const QrcodeTourismForm: React.FC = ({ open, title, init style={{ borderWidth: 2, borderStyle: 'solid', - borderColor: isSel ? '#1677ff' : '#f0f0f0', + borderColor: isSel ? '#52c41a' : '#f0f0f0', borderRadius: 6, cursor: 'pointer', background: '#fff', - boxShadow: isSel ? '0 0 0 2px rgba(22,119,255,0.1) inset' : 'none', + boxShadow: isSel ? '0 0 0 2px rgba(82,196,26,0.12) inset' : 'none', overflow: 'hidden', display: 'flex', flexDirection: 'column', @@ -314,7 +323,7 @@ const QrcodeTourismForm: React.FC = ({ open, title, init
无图片
)} {isSel ? ( -
+
) : null}