开发钱包相关页面,调试提现接口

This commit is contained in:
2025-09-27 23:08:32 +08:00
parent a1be43e02b
commit d6fb08eee4
13 changed files with 972 additions and 207 deletions

View File

@@ -4,6 +4,7 @@ import { View, Text, Input, Button } from "@tarojs/components";
import "./index.scss";
import httpService from "@/services/httpService";
import { useUserInfo } from "@/store/userStore";
interface FormFields {
phone?: string;
@@ -11,8 +12,9 @@ interface FormFields {
}
const ValidPhone: React.FC = () => {
const userInfo = useUserInfo();
const [formData, setFormData] = useState<FormFields>({
phone: "",
phone: userInfo.phone || "",
sms_code: "",
});
@@ -22,21 +24,32 @@ const ValidPhone: React.FC = () => {
const handleConfirm = async () => {
// TODO: 校验验证码
Taro.navigateTo({ url: "/user_pages/setTransactionPassword/index?type=find" });
Taro.navigateTo({ url: `/user_pages/setTransactionPassword/index?type=reset&phone=${formData.phone}&sms_code=${formData.sms_code}` });
};
const getSMSCode = async () => {
const { phone } = formData;
try {
await httpService.post("/wallet/send_reset_password_sms", { phone });
Taro.showToast({ title: "验证码已发送", icon: "none" });
} catch (error) {
console.log(error);
Taro.showToast({ title: "获取验证码失败", icon: "none" });
}
};
return (
<View className="set-transaction-password-page">
<View className="form-item">
<Text className="form-label"></Text>
<Input defaultValue={"15708469466"} type="number" disabled></Input>
<Input defaultValue={formData.phone} type="number" disabled></Input>
</View>
<View className="form-item">
<Text className="form-label"></Text>
<Input placeholder="请输入验证码" type="number" onInput={(e) => { handleInput(e, "sms_code") }}></Input>
<Button className="btn" ></Button>
<Button className="btn" onClick={getSMSCode}></Button>
</View>
<Button className="btn bottom-btn" onClick={handleConfirm}></Button>
<Button className="btn bottom-btn" disabled={!formData.sms_code} onClick={handleConfirm}></Button>
</View>
);
};