diff --git a/src/components/CommonPopup/CommonPopup.tsx b/src/components/CommonPopup/CommonPopup.tsx new file mode 100644 index 0000000..e3f75ef --- /dev/null +++ b/src/components/CommonPopup/CommonPopup.tsx @@ -0,0 +1,81 @@ +import React from 'react' +import { View, Text } from '@tarojs/components' +import { Popup, Button } from '@nutui/nutui-react-taro' +import styles from './index.module.scss' + +export interface CommonPopupProps { + visible: boolean + onClose: () => void + title?: React.ReactNode + showHeader?: boolean + hideFooter?: boolean + cancelText?: string + confirmText?: string + onCancel?: () => void + onConfirm?: () => void + position?: 'center' | 'bottom' | 'top' | 'left' | 'right' + round?: boolean + zIndex?: number + children?: React.ReactNode + className?: string +} + +const CommonPopup: React.FC = ({ + visible, + onClose, + className, + title, + showHeader = true, + hideFooter = false, + cancelText = '返回', + confirmText = '完成', + onCancel, + onConfirm, + position = 'bottom', + round = true, + zIndex, + children +}) => { + const handleCancel = () => { + if (onCancel) { + onCancel() + } else { + onClose() + } + } + + return ( + + {showHeader && ( + + {typeof title === 'string' ? {title} : title} + + )} + + + {children} + + + {!hideFooter && ( + + + + + )} + + ) +} + +export default CommonPopup \ No newline at end of file diff --git a/src/components/CommonPopup/index.module.scss b/src/components/CommonPopup/index.module.scss new file mode 100644 index 0000000..0b38b73 --- /dev/null +++ b/src/components/CommonPopup/index.module.scss @@ -0,0 +1,49 @@ +@use '~@/scss/themeColor.scss' as theme; + +.common-popup { + padding: 0; + box-sizing: border-box; + max-height: 80vh; + display: flex; + flex-direction: column; + background-color: theme.$page-background-color; + .common-popup__header { + padding: 12px 16px; + font-size: 16px; + font-weight: 600; + color: #1f2329; + border-bottom: 1px solid #f0f1f5; + } + + .common-popup__title { + display: inline-block; + } + + .common-popup__body { + padding: 16px; + overflow: auto; + -webkit-overflow-scrolling: touch; + flex: 1 1 auto; + } + + .common-popup__footer { + padding: 12px 16px; + display: flex; + gap: 12px; + border-top: 1px solid #f0f1f5; + } + + .common-popup__btn { + flex: 1; + } + + .common-popup__btn-cancel { + background: #f5f6f7; + color: #1f2329; + border: none; + } + + .common-popup__btn-confirm { + /* 使用按钮组件的 primary 样式 */ + } +} \ No newline at end of file diff --git a/src/components/CommonPopup/index.ts b/src/components/CommonPopup/index.ts new file mode 100644 index 0000000..0391839 --- /dev/null +++ b/src/components/CommonPopup/index.ts @@ -0,0 +1,3 @@ +import CommonPopup from './CommonPopup' +export default CommonPopup +export * from './CommonPopup' \ No newline at end of file diff --git a/src/components/FormSwitch/index.scss b/src/components/FormSwitch/index.scss index 9c4c1c8..9e50057 100644 --- a/src/components/FormSwitch/index.scss +++ b/src/components/FormSwitch/index.scss @@ -32,13 +32,13 @@ } .info-popover { position: absolute; - top: 22px; - left: 0; - width: 50%; - padding: 8px 10px; - background: rgba(0, 0, 0, 0.85); + bottom: 22px; + left: -65px; + width: 130px; + padding:12px; + background: rgba(57, 59, 68, 0.90); color: #fff; - border-radius: 6px; + border-radius: 8px; font-size: 12px; line-height: 1.6; z-index: 1001; @@ -47,6 +47,17 @@ overflow-wrap: break-word; box-shadow: 0 2px 8px rgba(0,0,0,0.15); } + .info-popover::before { + content: ''; + position: absolute; + bottom: -6px; + left: 68px; /* 对齐图标(宽12px),可按需微调 */ + width: 0; + height: 0; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid rgba(57, 59, 68, 0.90); + } } } diff --git a/src/components/SelectStadium/SelectStadium.tsx b/src/components/SelectStadium/SelectStadium.tsx index d688c67..f61dbe3 100644 --- a/src/components/SelectStadium/SelectStadium.tsx +++ b/src/components/SelectStadium/SelectStadium.tsx @@ -3,6 +3,7 @@ import { View, Text, Input, ScrollView } from '@tarojs/components' import { Popup } from '@nutui/nutui-react-taro' import Taro from '@tarojs/taro' import StadiumDetail from './StadiumDetail' +import CommonPopup from '../CommonPopup' import './SelectStadium.scss' export interface Stadium { @@ -133,14 +134,18 @@ const SelectStadium: React.FC = ({ // 显示球馆列表 return ( - + + {/* 搜索框 */} @@ -181,20 +186,8 @@ const SelectStadium: React.FC = ({ ))} - - {/* 底部按钮 */} - - - - 取消 - - - 完成 - - - - + ) } diff --git a/src/components/index.ts b/src/components/index.ts index f3493b1..60d168e 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -8,6 +8,7 @@ import ParticipantsControl from './ParticipantsControl' import { SelectStadium, StadiumDetail } from './SelectStadium' import TimeSelector from './TimeSelector' import TitleInput from './TitleInput' +import CommonPopup from './CommonPopup' export { ActivityTypeSwitch, @@ -20,6 +21,7 @@ export { SelectStadium, TimeSelector, TitleInput, - StadiumDetail + StadiumDetail, + CommonPopup } diff --git a/src/config/formSchema/publishBallFormSchema.ts b/src/config/formSchema/publishBallFormSchema.ts index 61da349..da2fb70 100644 --- a/src/config/formSchema/publishBallFormSchema.ts +++ b/src/config/formSchema/publishBallFormSchema.ts @@ -132,6 +132,7 @@ export const publishBallFormSchema: FormFieldConfig[] = [ defaultValue: 1, props: { showSummary: true, + summary: '最少1人,最多4人', }, rules: [ { min: 1, message: '最少参与人数不能为0' }, diff --git a/src/static/publishBall/icon-arror-small.svg b/src/static/publishBall/icon-arror-small.svg new file mode 100644 index 0000000..ce29dbe --- /dev/null +++ b/src/static/publishBall/icon-arror-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/static/publishBall/icon-map-search.svg b/src/static/publishBall/icon-map-search.svg new file mode 100644 index 0000000..257d6ad --- /dev/null +++ b/src/static/publishBall/icon-map-search.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/static/publishBall/icon-map.svg b/src/static/publishBall/icon-map.svg new file mode 100644 index 0000000..4e87b05 --- /dev/null +++ b/src/static/publishBall/icon-map.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/static/publishBall/icon-search.svg b/src/static/publishBall/icon-search.svg new file mode 100644 index 0000000..a94ff45 --- /dev/null +++ b/src/static/publishBall/icon-search.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/static/publishBall/icon-stadium.svg b/src/static/publishBall/icon-stadium.svg new file mode 100644 index 0000000..dd6ffe6 --- /dev/null +++ b/src/static/publishBall/icon-stadium.svg @@ -0,0 +1,7 @@ + + + + + + +