修改弹窗

This commit is contained in:
筱野
2025-11-23 21:57:20 +08:00
parent 688e1b7e5e
commit 23fba49741
3 changed files with 44 additions and 39 deletions

View File

@@ -3,7 +3,9 @@
.common-popup { .common-popup {
position: fixed; position: fixed;
z-index: 9999 !important; z-index: 9999 !important;
&:global(.nut-popup-bottom.nut-popup-round) {
border-radius: 20px 20px 0 0!important;
}
.common-popup__drag-handle-container { .common-popup__drag-handle-container {
position: position; position: position;
} }

View File

@@ -29,6 +29,7 @@ export interface UploadCoverProps {
maxCount?: number; maxCount?: number;
align?: "center" | "left"; align?: "center" | "left";
tag?: "cover" | "screenshot"; tag?: "cover" | "screenshot";
uploadText?: string
} }
const mergeCoverImages = ( const mergeCoverImages = (
@@ -74,6 +75,7 @@ export default function UploadCover(props: UploadCoverProps) {
align = "center", align = "center",
tag = "cover", tag = "cover",
changePicker, changePicker,
uploadText = '添加活动封面'
} = props; } = props;
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
@@ -121,6 +123,44 @@ export default function UploadCover(props: UploadCoverProps) {
return ( return (
<> <>
<div
className={`upload-cover-root ${
value.length === 0 && align === "center"
? "upload-cover-act-center"
: ""
}`}
>
{value.length < maxCount && (
<div className="upload-cover-act" onClick={() => openPicker(true)}>
<Image className="upload-cover-act-icon" src={img.ICON_ADD} />
<div className="upload-cover-text">{uploadText}</div>
</div>
)}
<div
className={`cover-image-list-container ${
value.length === maxCount ? "full" : ""
}`}
>
<div className="cover-image-list">
{value.map((item) => {
return (
<View className="cover-image-item" key={item.id}>
<Image
className="cover-image-item-image"
src={item.url}
mode="aspectFill"
/>
<Image
className="cover-image-item-delete"
src={img.ICON_REMOVE}
onClick={() => onDelete(item)}
/>
</View>
);
})}
</div>
</div>
</div>
<CommonPopup <CommonPopup
visible={visible} visible={visible}
onClose={() => openPicker(false)} onClose={() => openPicker(false)}
@@ -160,44 +200,6 @@ export default function UploadCover(props: UploadCoverProps) {
</View> </View>
</CommonPopup> </CommonPopup>
<UploadSourcePopup tag={tag} ref={uploadSourcePopupRef} onAdd={onAdd} /> <UploadSourcePopup tag={tag} ref={uploadSourcePopupRef} onAdd={onAdd} />
<div
className={`upload-cover-root ${
value.length === 0 && align === "center"
? "upload-cover-act-center"
: ""
}`}
>
{value.length < maxCount && (
<div className="upload-cover-act" onClick={() => openPicker(true)}>
<Image className="upload-cover-act-icon" src={img.ICON_ADD} />
<div className="upload-cover-text"></div>
</div>
)}
<div
className={`cover-image-list-container ${
value.length === maxCount ? "full" : ""
}`}
>
<div className="cover-image-list">
{value.map((item) => {
return (
<View className="cover-image-item" key={item.id}>
<Image
className="cover-image-item-image"
src={item.url}
mode="aspectFill"
/>
<Image
className="cover-image-item-delete"
src={img.ICON_REMOVE}
onClick={() => onDelete(item)}
/>
</View>
);
})}
</div>
</div>
</div>
</> </>
); );
} }

View File

@@ -234,6 +234,7 @@ const StadiumDetail = forwardRef<StadiumDetailRef, StadiumDetailProps>(({
<UploadCover <UploadCover
value={formData[item.prop]} value={formData[item.prop]}
changePicker={changePicker} changePicker={changePicker}
uploadText="添加截图"
onChange={(value) => { onChange={(value) => {
if (value instanceof Function) { if (value instanceof Function) {
const newValue = value(formData[item.prop]) const newValue = value(formData[item.prop])