feat: 打卡签到
This commit is contained in:
@@ -2,6 +2,7 @@ export default {
|
||||
pages: [
|
||||
// "pages/index/index",
|
||||
"pages/home/index",
|
||||
"pages/home/components/CheckIn/index",
|
||||
"pages/activityList/index",
|
||||
"pages/formSubmit/index",
|
||||
"pages/activityList/components/details/index",
|
||||
@@ -12,6 +13,8 @@ export default {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
],
|
||||
|
||||
window: {
|
||||
|
||||
3
src/pages/home/components/CheckIn/index.scss
Normal file
3
src/pages/home/components/CheckIn/index.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
.CheckIn{
|
||||
padding: 20px;
|
||||
}
|
||||
77
src/pages/home/components/CheckIn/index.tsx
Normal file
77
src/pages/home/components/CheckIn/index.tsx
Normal file
@@ -0,0 +1,77 @@
|
||||
import {
|
||||
Button,
|
||||
CellGroup,
|
||||
Dialog,
|
||||
Field,
|
||||
Form,
|
||||
Image,
|
||||
FormItem,
|
||||
Icon,
|
||||
} from "@antmjs/vantui";
|
||||
import { Input, View } from "@tarojs/components";
|
||||
import React, { useCallback, useEffect } from "react";
|
||||
import './index.scss'
|
||||
|
||||
const CheckIn = () => {
|
||||
const formIt = Form.useForm();
|
||||
useEffect(() => {
|
||||
// 设置标题
|
||||
definePageConfig({
|
||||
navigationBarTitleText: "打卡签到",
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<View className="CheckIn">
|
||||
<Form
|
||||
initialValues={{
|
||||
// userName: "我是初始值",
|
||||
singleSelect: "1",
|
||||
rate: 2,
|
||||
slider: "50",
|
||||
}}
|
||||
form={formIt}
|
||||
onFinish={(errs, res) => console.info(errs, res)}
|
||||
>
|
||||
<View>
|
||||
<Image
|
||||
width="100%"
|
||||
height="180px"
|
||||
fit="cover"
|
||||
src="https://img.yzcdn.cn/vant/cat.jpeg"
|
||||
/>
|
||||
</View>
|
||||
<FormItem
|
||||
label="留言"
|
||||
name="userName"
|
||||
required
|
||||
layout='vertical'
|
||||
// rules={{
|
||||
// rule: /[\u4e00-\u9fa5]/,
|
||||
// message: '用户名仅支持中文',
|
||||
// }}
|
||||
trigger="onInput"
|
||||
validateTrigger="onBlur"
|
||||
// taro的input的onInput事件返回对应表单的最终值为e.detail.value
|
||||
valueFormat={(e) => e.detail.value}
|
||||
// renderRight={<Icon name="user-o" />}
|
||||
>
|
||||
<Field
|
||||
// label="留言"
|
||||
type="textarea"
|
||||
placeholder="请输入留言"
|
||||
autosize={{ minHeight: "30px" }}
|
||||
border={false}
|
||||
/>
|
||||
</FormItem>
|
||||
|
||||
<Button type="primary" block>
|
||||
提交
|
||||
</Button>
|
||||
<Dialog id="form-demo3" />
|
||||
</Form>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default CheckIn;
|
||||
@@ -78,13 +78,13 @@ const Home = () => {
|
||||
>
|
||||
<View className="tagArr">
|
||||
{[
|
||||
{ city: "深圳" ,color:""},
|
||||
{ city: "北京" ,color:"#8c8c8c"},
|
||||
{ city: "上海" ,color:"#8c8c8c"},
|
||||
{ city: "广州" ,color:"#8c8c8c"},
|
||||
{ city: "武汉" ,color:"#8c8c8c"},
|
||||
{ city: "杭州" ,color:"#8c8c8c"},
|
||||
{ city: "成都" ,color:"#8c8c8c"},
|
||||
{ city: "深圳", color: "" },
|
||||
{ city: "北京", color: "#8c8c8c" },
|
||||
{ city: "上海", color: "#8c8c8c" },
|
||||
{ city: "广州", color: "#8c8c8c" },
|
||||
{ city: "武汉", color: "#8c8c8c" },
|
||||
{ city: "杭州", color: "#8c8c8c" },
|
||||
{ city: "成都", color: "#8c8c8c" },
|
||||
// { city: "武汉" },
|
||||
].map((item: any) => {
|
||||
return (
|
||||
@@ -150,16 +150,21 @@ const Home = () => {
|
||||
text="打卡"
|
||||
className="iconStyle"
|
||||
onClick={() => {
|
||||
Toast.success({
|
||||
message: "打卡成功",
|
||||
selector: "#vanToast-demo2",
|
||||
// Toast.success({
|
||||
// message: "打卡成功",
|
||||
// selector: "#vanToast-demo2",
|
||||
// });
|
||||
|
||||
// 跳转到目的页面,打开新页面
|
||||
Taro.navigateTo({
|
||||
url: "/pages/home/components/CheckIn/index",
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<GridItem
|
||||
icon="like"
|
||||
className="iconStyle"
|
||||
text="十峰"
|
||||
text="深圳十峰"
|
||||
onClick={() => {
|
||||
// 跳转到目的页面,打开新页面
|
||||
Taro.navigateTo({
|
||||
@@ -182,7 +187,7 @@ const Home = () => {
|
||||
<GridItem
|
||||
icon="manager"
|
||||
className="iconStyle"
|
||||
text="招募"
|
||||
text="组队"
|
||||
onClick={() => {
|
||||
// 跳转到目的页面,打开新页面
|
||||
Taro.navigateTo({
|
||||
|
||||
Reference in New Issue
Block a user