修改经纬度

This commit is contained in:
筱野
2025-09-07 22:32:58 +08:00
parent 549f704c53
commit 26d36c2676
6 changed files with 57 additions and 10 deletions

View File

@@ -98,8 +98,8 @@ const StadiumDetail = forwardRef<StadiumDetailRef, StadiumDetailProps>(({
const [formData, setFormData] = useState({
name: stadium.name,
address: stadium.address,
latitude: stadium.longitude,
longitude: stadium.latitude,
latitude: stadium.latitude,
longitude: stadium.longitude,
istance: stadium.distance_km,
court_type: court_type[0] || '',
court_surface: court_surface[0] || '',

View File

@@ -11,13 +11,23 @@ interface FormSwitchProps {
const FormSwitch: React.FC<FormSwitchProps> = ({ value, onChange, subTitle, wechatId }) => {
const [editWechat, setEditWechat] = useState(false)
const [wechatIdValue, setWechatIdValue] = useState('')
const [wechat, setWechat] = useState(wechatId)
const editWechatId = () => {
setEditWechat(true)
}
const setWechatId = useCallback((e: any) => {
const value = e.target.value
onChange(value)
}, [])
onChange && onChange(value)
setWechatIdValue(value)
}, [onChange])
const fillWithPhone = () => {
if (wechat) {
setWechatIdValue(wechat)
}
}
return (
<>
<View className={styles['wechat-contact-section']}>
@@ -32,7 +42,7 @@ const FormSwitch: React.FC<FormSwitchProps> = ({ value, onChange, subTitle, wech
</View>
</View>
{
wechatId && (
!editWechat && wechatId && (
<View className={styles['wechat-contact-id']}>
<Text className={styles['wechat-contact-text']}>: {wechatId.replace(/(\d{3})(\d{4})(\d{4})/, '$1 $2 $3')}</Text>
<View className={styles['wechat-contact-edit']} onClick={editWechatId}></View>
@@ -41,8 +51,11 @@ const FormSwitch: React.FC<FormSwitchProps> = ({ value, onChange, subTitle, wech
}
{
editWechat && (
<View className={styles['wechat-contact-edit']}>
<Input value={wechatId} onInput={setWechatId} />
<View className={styles['wechat-contact-id']}>
<View className={styles['wechat-contact-edit-input']}>
<Input value={wechatIdValue} onInput={setWechatId} placeholder='请输入正确微信号' />
</View>
<View className={styles['wechat-contact-edit']} onClick={fillWithPhone}>{wechat}</View>
</View>
)
}

View File

@@ -1,3 +1,5 @@
@use '~@/scss/themeColor.scss' as theme;
.wechat-contact-section {
background: #fff;
border-radius: 12px;
@@ -86,6 +88,13 @@
border-radius: 100px;
border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.wechat-contact-edit-input {
max-width: 200px;
font-size: 12px;
.input-placeholder{
color: theme.$textarea-placeholder-color;
}
}
}
}