wechat login

This commit is contained in:
wang_yp 2024-05-22 14:04:13 +08:00
parent dc37129ad3
commit 27cfbbd201
4 changed files with 41 additions and 52 deletions

View File

@ -1,28 +1,29 @@
import { Form, Select } from "antd";
import { FormDatas } from "./interface";
import { useEffect, useState } from "react";
import baseHttp from "@/service/base";
const { Option } = Select;
import { useState } from "react";
export const FormSelect = (v: FormDatas) => {
const [list, setList] = useState([]);
useEffect(() => {
baseHttp
.get(`${v.selectUrl}/?pageSize=100&pageNum=1` ?? "", "")
.then((res) => {
setList(res.data.list ?? []);
});
}, [v.selectUrl]);
const [list] = useState([
{
value: 1,
label: "卡片一",
},
{
value: 2,
label: "卡片二",
},
{
value: 3,
label: "卡片三",
},
{
value: 4,
label: "卡片四",
},
]);
return (
<Form.Item key={v.label} label={v.label} name={v.name} rules={v.rules}>
<Select placeholder="">
{list?.map((v: any) => {
return (
<Option key={v.id} value={v.id}>
{v.productTypeName}
</Option>
);
})}
</Select>
<Select placeholder="" options={list} value={v.value} />
</Form.Item>
);
};

View File

@ -1,4 +1,4 @@
import { Checkbox, DatePicker, Form, Input, Radio } from "antd";
import { Checkbox, DatePicker, Form, Input, Radio, Switch } from "antd";
import { useEffect } from "react";
import { SimpleFormData } from "./interface";
import { FormSelect } from "./select";
@ -6,7 +6,6 @@ import AliUpload from "../aliUpload";
const { TextArea } = Input;
const SimpleForm = (props: SimpleFormData) => {
const [form] = Form.useForm();
const { RangePicker } = DatePicker;
const onFinish = (values: any) => {
props.onFinish(values);
};
@ -117,6 +116,17 @@ const SimpleForm = (props: SimpleFormData) => {
</Radio.Group>
</Form.Item>
);
case "switch":
return (
<Form.Item
key={v.label}
label={v.label}
name={v.name}
rules={v.rules}
>
<Switch/>
</Form.Item>
);
case "Date":
return (
<Form.Item
@ -128,6 +138,7 @@ const SimpleForm = (props: SimpleFormData) => {
<DatePicker />
</Form.Item>
);
default:
return (
<Form.Item

View File

@ -22,30 +22,6 @@ const Active = (props: Store) => {
title: "活动标题",
dataIndex: "activeName",
},
// {
// title: "活动描述",
// dataIndex: "desc",
// },
// {
// title: "活动图片",
// dataIndex: "activeIcon",
// ellipsis: {
// showTitle: false,
// },
// render: (address) => (
// <Tooltip placement="topLeft" title={address}>
// {address}
// </Tooltip>
// ),
// },
// {
// title: "活动人数",
// dataIndex: "peopleNum",
// },
// {
// title: "活动地址",
// dataIndex: "address",
// },
{
title: "折扣",
dataIndex: "discount",
@ -67,11 +43,6 @@ const Active = (props: Store) => {
</div>
),
},
// {
// title: "发起人",
// dataIndex: "userId",
// },
{
title: "操作",
dataIndex: "id",
@ -158,6 +129,12 @@ const Active = (props: Store) => {
name: "endTime",
value: "",
},
{
type: "switch",
label: "是否开启",
name: "status",
value: false,
},
];
useEffect(() => {

View File

@ -112,7 +112,7 @@ const CardPageList = (props) => {
type: "select",
label: "请选择卡片类型",
name: "cardType",
value: "",
value: ""
},
]