diff --git a/src/components/button/MyButton.tsx b/src/components/button/MyButton.tsx index 1554561..76c0d90 100644 --- a/src/components/button/MyButton.tsx +++ b/src/components/button/MyButton.tsx @@ -1,5 +1,5 @@ import {CSSProperties, FC} from "react"; -import {Button} from "@tarojs/components"; +import {Button, View} from "@tarojs/components"; import styles from './myButton.module.scss' import {ButtonProps} from "@tarojs/components/types/Button"; @@ -33,12 +33,14 @@ const MyButton: FC = (props) => { } return ( - + + + ) } export default MyButton diff --git a/src/components/button/myButton.module.scss b/src/components/button/myButton.module.scss index 8350b86..1f4537c 100644 --- a/src/components/button/myButton.module.scss +++ b/src/components/button/myButton.module.scss @@ -1,13 +1,18 @@ .Mybutton { - line-height: 76rpx; background: #45D4A8; border-radius: 10rpx; color: #fff; font-size: 32rpx; border: none !important; outline: none !important; - position: static; + position: absolute; margin: 0; padding: 0; box-sizing: border-box; } + +.MybuttonBox { + position: relative; + height: 76rpx; + line-height: 76rpx; +} diff --git a/src/components/popPut/popPut.tsx b/src/components/popPut/popPut.tsx index 56a619d..ebc6489 100644 --- a/src/components/popPut/popPut.tsx +++ b/src/components/popPut/popPut.tsx @@ -58,7 +58,7 @@ const PopPut: FC = ({title, chevron, content, image, isProp, children, sh { isProp - && setShow(false)}> + && setShow(false)}> {children} } diff --git a/src/pages/business/userInfo/userInfo.tsx b/src/pages/business/userInfo/userInfo.tsx index b86aaeb..2bf8f9b 100644 --- a/src/pages/business/userInfo/userInfo.tsx +++ b/src/pages/business/userInfo/userInfo.tsx @@ -2,7 +2,7 @@ import {useState} from "react"; import {Profile} from '@/store' import avatar from "@/static/img/avatar.png" import PopPut from "@/components/popPut/popPut"; -import {Button, Input, View} from "@tarojs/components"; +import {Input, View} from "@tarojs/components"; import Taro from "@tarojs/taro"; import {userApi} from "@/api"; import styles from './userInfo.module.scss' @@ -29,8 +29,8 @@ const List = () => { } async function putName() { - if (!name) { - Taro.showToast({title: "名称不能为空", icon: 'error'}) + if (!name && name.length < 2) { + Taro.showToast({title: "名称不能小于2个字", icon: 'error'}) return } const res = await userApi.putName(user?.id!, name) @@ -41,6 +41,15 @@ const List = () => { } } + function outLogin() { + Taro.showModal({ + title: '是否确定退出登录', + success({confirm}) { + confirm && empty() + } + }) + } + return ( <> @@ -48,7 +57,7 @@ const List = () => { - + 修改昵称 { cursorSpacing={110} value={name} /> - 限制4-20个字符,可由中英文、数字、“_”、“-”组成 - + 限制2-20个字符,可由中英文、数字、“_”、“-”组成 + 确定 - 退出登录 + 退出登录 ) diff --git a/src/static/css/module.scss b/src/static/css/module.scss index 33e1f73..6b4bd46 100644 --- a/src/static/css/module.scss +++ b/src/static/css/module.scss @@ -13,10 +13,9 @@ body { } .input { - height: 84rpx; background: #F5F8F7; border-radius: 8px; - padding: 0 20px; + padding: 10rpx 20rpx; } .form {