Compare commits
10 Commits
b60ed49957
...
8293f6389d
| Author | SHA1 | Date |
|---|---|---|
|
|
8293f6389d | |
|
|
8772be5e7a | |
|
|
e82c5b7009 | |
|
|
824852d128 | |
|
|
5a75164f8d | |
|
|
79c2a5e083 | |
|
|
91e891395c | |
|
|
a5bcb50e1f | |
|
|
05f17e5ffb | |
|
|
1e55baa2f3 |
|
|
@ -9,6 +9,7 @@ import {
|
|||
ObjectType,
|
||||
PostType,
|
||||
PostState,
|
||||
PostMeta,
|
||||
} from '@nice/common';
|
||||
import { MessageService } from '../message/message.service';
|
||||
import { BaseService } from '../base/base.service';
|
||||
|
|
@ -52,6 +53,15 @@ export class PostService extends BaseService<Prisma.PostDelegate> {
|
|||
return result;
|
||||
}
|
||||
async update(args: Prisma.PostUpdateArgs, staff?: UserProfile) {
|
||||
// 确保 meta 字段是一个对象
|
||||
if (args.data.reTime) {
|
||||
// 处理不同类型的 reTime 输入
|
||||
if (typeof args.data.reTime === 'string' || args.data.reTime instanceof Date) {
|
||||
args.data.reTime = {
|
||||
set: new Date(args.data.reTime)
|
||||
};
|
||||
}
|
||||
}
|
||||
args.data.authorId = staff?.id;
|
||||
args.data.updatedAt = new Date();
|
||||
const result = await super.update(args);
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 231 KiB After Width: | Height: | Size: 231 KiB |
|
|
@ -1,3 +1 @@
|
|||
<svg width="64px" height="64px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 4C2.89543 4 2 4.89543 2 6V18C2 19.1046 2.89543 20 4 20H20C21.1046 20 22 19.1046 22 18V6C22 4.89543 21.1046 4 20 4H4ZM20 6L12 11L4 6H20ZM4 8.61803V18H20V8.61803L12 13.618L4 8.61803Z" fill="#4A90E2"/>
|
||||
</svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1744765741176" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5595" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M517.2 149.2c8.5-16.4 26.3-28.9 48-12.3l115.1 114.8c13.8 15 18.3 42.3 0.1 63.2L596 399.6h-0.6V266H441.8v138.9l-92.4-94c-17.5-22-10.3-46.2 5-61.9L464 140.8c17.2-15.6 39.9-16.2 53.2 8.4zM876.1 514c16.4-8.5 28.9-26.3 12.3-48L773.6 350.9c-15-13.8-42.3-18.3-63.2-0.1L622 440.5h139v154.9H626.4l87.9 86.4c22 17.5 46.2 10.3 61.9-5l108.2-109.6c15.7-17.1 16.2-39.8-8.3-53.2z m-727-5.8c-16.4-8.5-28.9-26.3-12.3-48l114.8-115.1c15-13.8 42.3-18.3 63.2-0.1l84.3 84H266.7v154.9h138L310.9 676c-22 17.5-46.2 10.3-61.9-5L140.8 561.3c-15.7-17-16.2-39.7 8.3-53.1z m361.7 367.4c8.5 16.4 26.3 28.9 48 12.3l115.1-114.8c13.8-15 18.3-42.3 0.1-63.2l-90.4-88.3v138.1H430.8v-135L343 713.9c-17.5 22-10.3 46.2 5 61.9L457.7 884c17 15.7 39.8 16.2 53.1-8.4z" fill="#E50012" p-id="5596"></path></svg>
|
||||
|
Before Width: | Height: | Size: 360 B After Width: | Height: | Size: 1.1 KiB |
|
|
@ -1,157 +1,159 @@
|
|||
import React, {
|
||||
useRef,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
useRef,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from "react";
|
||||
import { Carousel, Typography } from "antd";
|
||||
import {
|
||||
TeamOutlined,
|
||||
BookOutlined,
|
||||
StarOutlined,
|
||||
LeftOutlined,
|
||||
RightOutlined,
|
||||
EyeOutlined,
|
||||
TeamOutlined,
|
||||
BookOutlined,
|
||||
StarOutlined,
|
||||
LeftOutlined,
|
||||
RightOutlined,
|
||||
EyeOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import type { CarouselRef } from "antd/es/carousel";
|
||||
import { useAppConfig } from "@nice/client";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
interface PlatformStat {
|
||||
icon: React.ReactNode;
|
||||
value: number;
|
||||
label: string;
|
||||
}
|
||||
// interface PlatformStat {
|
||||
// icon: React.ReactNode;
|
||||
// value: number;
|
||||
// label: string;
|
||||
// }
|
||||
|
||||
const HeroSection = () => {
|
||||
const carouselRef = useRef<CarouselRef>(null);
|
||||
const { statistics, slides, slideLinks = [] } = useAppConfig();
|
||||
const [countStatistics, setCountStatistics] = useState<number>(4);
|
||||
const navigator = useNavigate()
|
||||
const platformStats: PlatformStat[] = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
icon: <TeamOutlined />,
|
||||
value: statistics.staffs,
|
||||
label: "注册学员",
|
||||
},
|
||||
{
|
||||
icon: <StarOutlined />,
|
||||
value: statistics.courses,
|
||||
label: "精品课程",
|
||||
},
|
||||
{
|
||||
icon: <BookOutlined />,
|
||||
value: statistics.lectures,
|
||||
label: "课程章节",
|
||||
},
|
||||
{
|
||||
icon: <EyeOutlined />,
|
||||
value: statistics.reads,
|
||||
label: "播放次数",
|
||||
},
|
||||
];
|
||||
}, [statistics]);
|
||||
const handlePrev = useCallback(() => {
|
||||
carouselRef.current?.prev();
|
||||
}, []);
|
||||
const carouselRef = useRef<CarouselRef>(null);
|
||||
const { statistics, slides, slideLinks = [] } = useAppConfig();
|
||||
const [countStatistics, setCountStatistics] = useState<number>(4);
|
||||
const navigator = useNavigate();
|
||||
// const platformStats: PlatformStat[] = useMemo(() => {
|
||||
// return [
|
||||
// {
|
||||
// icon: <TeamOutlined />,
|
||||
// value: statistics.staffs,
|
||||
// label: "注册学员",
|
||||
// },
|
||||
// {
|
||||
// icon: <StarOutlined />,
|
||||
// value: statistics.courses,
|
||||
// label: "精品课程",
|
||||
// },
|
||||
// {
|
||||
// icon: <BookOutlined />,
|
||||
// value: statistics.lectures,
|
||||
// label: "课程章节",
|
||||
// },
|
||||
// {
|
||||
// icon: <EyeOutlined />,
|
||||
// value: statistics.reads,
|
||||
// label: "播放次数",
|
||||
// },
|
||||
// ];
|
||||
// }, [statistics]);
|
||||
const handlePrev = useCallback(() => {
|
||||
carouselRef.current?.prev();
|
||||
}, []);
|
||||
|
||||
const handleNext = useCallback(() => {
|
||||
carouselRef.current?.next();
|
||||
}, []);
|
||||
const handleNext = useCallback(() => {
|
||||
carouselRef.current?.next();
|
||||
}, []);
|
||||
|
||||
const countNonZeroValues = (statistics: Record<string, number>): number => {
|
||||
return Object.values(statistics).filter((value) => value !== 0).length;
|
||||
};
|
||||
const countNonZeroValues = (statistics: Record<string, number>): number => {
|
||||
return Object.values(statistics).filter((value) => value !== 0).length;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const count = countNonZeroValues(statistics);
|
||||
console.log(count);
|
||||
setCountStatistics(count);
|
||||
}, [statistics]);
|
||||
return (
|
||||
<section className="relative ">
|
||||
<div className="group">
|
||||
<Carousel
|
||||
ref={carouselRef}
|
||||
autoplay
|
||||
effect="fade"
|
||||
className="h-[600px] mb-24"
|
||||
dots={{
|
||||
className: "carousel-dots !bottom-32 !z-20",
|
||||
}}>
|
||||
{Array.isArray(slides) ? (
|
||||
slides.map((item, index) => (
|
||||
<div key={index} className="relative h-[600px] cursor-pointer"
|
||||
onClick={()=>{
|
||||
if(slideLinks?.[index])window.open(slideLinks?.[index],"_blank")
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="absolute inset-0 bg-cover bg-center transform transition-[transform,filter] duration-[2000ms] group-hover:scale-105 group-hover:brightness-110 will-change-[transform,filter]"
|
||||
style={{
|
||||
//backgroundImage: `url(https://s.cn.bing.net/th?id=OHR.GiantCuttlefish_ZH-CN0670915878_1920x1080.webp&qlt=50)`,
|
||||
backgroundImage: `url(${item})`,
|
||||
backfaceVisibility: "hidden",
|
||||
}}
|
||||
/>
|
||||
{/* <div
|
||||
className={`absolute inset-0 bg-gradient-to-r ${item.color} to-transparent opacity-90 mix-blend-overlay transition-opacity duration-500`}
|
||||
/> */}
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-black/50 to-transparent" />
|
||||
useEffect(() => {
|
||||
const count = countNonZeroValues(statistics);
|
||||
console.log(count);
|
||||
setCountStatistics(count);
|
||||
}, [statistics]);
|
||||
return (
|
||||
<section className="relative ">
|
||||
<div className="group">
|
||||
<Carousel
|
||||
ref={carouselRef}
|
||||
autoplay
|
||||
// effect="fade"
|
||||
className="h-[600px] mb-24"
|
||||
adaptiveHeight={true}
|
||||
speed={1500}
|
||||
dotPosition="right"
|
||||
dots={{
|
||||
className: "carousel-dots !bottom-32 !z-20",
|
||||
}}
|
||||
>
|
||||
{Array.isArray(slides) ? (
|
||||
slides.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="relative h-[600px] cursor-pointer"
|
||||
onClick={() => {
|
||||
if (slideLinks?.[index])
|
||||
window.open(slideLinks?.[index], "_blank");
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="absolute inset-0 bg-cover bg-center transform transition-[transform,filter] duration-[2000ms] group-hover:brightness-110 will-change-[transform,filter]"
|
||||
style={{
|
||||
//backgroundImage: `url(https://s.cn.bing.net/th?id=OHR.GiantCuttlefish_ZH-CN0670915878_1920x1080.webp&qlt=50)`,
|
||||
backgroundImage: `url(${item})`,
|
||||
backfaceVisibility: "hidden",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
</Carousel>
|
||||
|
||||
{/* Content Container */}
|
||||
<div className="relative h-full max-w-7xl mx-auto px-6 lg:px-8"></div>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
</Carousel>
|
||||
{/* Navigation Buttons */}
|
||||
<button
|
||||
onClick={handlePrev}
|
||||
className="absolute left-4 md:left-8 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover:opacity-100 transition-all duration-300 bg-black/20 hover:bg-black/30 w-12 h-12 flex items-center justify-center rounded-full transform hover:scale-110 hover:shadow-lg"
|
||||
aria-label="Previous slide"
|
||||
>
|
||||
<LeftOutlined className="text-white text-xl" />
|
||||
</button>
|
||||
<button
|
||||
onClick={handleNext}
|
||||
className="absolute right-4 md:right-8 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover:opacity-100 transition-all duration-300 bg-black/20 hover:bg-black/30 w-12 h-12 flex items-center justify-center rounded-full transform hover:scale-110 hover:shadow-lg"
|
||||
aria-label="Next slide"
|
||||
>
|
||||
<RightOutlined className="text-white text-xl" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Navigation Buttons */}
|
||||
<button
|
||||
onClick={handlePrev}
|
||||
className="absolute left-4 md:left-8 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover:opacity-100 transition-all duration-300 bg-black/20 hover:bg-black/30 w-12 h-12 flex items-center justify-center rounded-full transform hover:scale-110 hover:shadow-lg"
|
||||
aria-label="Previous slide">
|
||||
<LeftOutlined className="text-white text-xl" />
|
||||
</button>
|
||||
<button
|
||||
onClick={handleNext}
|
||||
className="absolute right-4 md:right-8 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover:opacity-100 transition-all duration-300 bg-black/20 hover:bg-black/30 w-12 h-12 flex items-center justify-center rounded-full transform hover:scale-110 hover:shadow-lg"
|
||||
aria-label="Next slide">
|
||||
<RightOutlined className="text-white text-xl" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Stats Container */}
|
||||
{countStatistics > 1 && (
|
||||
<div className="absolute -bottom-20 left-1/2 -translate-x-1/2 w-3/5 max-w-6xl px-4">
|
||||
<div
|
||||
className={`rounded-2xl grid grid-cols-${countStatistics} lg:grid-cols-${countStatistics} md:grid-cols-${countStatistics} gap-4 md:gap-8 p-6 md:p-8 bg-white border shadow-xl hover:shadow-2xl transition-shadow duration-500 will-change-[transform,box-shadow]`}>
|
||||
{platformStats.map((stat, index) => {
|
||||
return stat.value ? (
|
||||
<div
|
||||
key={index}
|
||||
className="text-center transform hover:-translate-y-1 hover:scale-105 transition-transform duration-300 ease-out">
|
||||
<div className="inline-flex items-center justify-center w-16 h-16 mb-4 rounded-full bg-primary-50 text-primary-600 text-3xl transition-colors duration-300 group-hover:text-primary-700">
|
||||
{stat.icon}
|
||||
</div>
|
||||
<div className="text-2xl font-bold bg-gradient-to-r from-gray-800 to-gray-600 bg-clip-text text-transparent mb-1.5">
|
||||
{stat.value}
|
||||
</div>
|
||||
<div className="text-gray-600 font-medium">
|
||||
{stat.label}
|
||||
</div>
|
||||
</div>
|
||||
) : null;
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
{/* Stats Container */}
|
||||
{/* {countStatistics > 1 && (
|
||||
<div className="absolute -bottom-20 left-1/2 -translate-x-1/2 w-3/5 max-w-6xl px-4">
|
||||
<div
|
||||
className={`rounded-2xl grid grid-cols-${countStatistics} lg:grid-cols-${countStatistics} md:grid-cols-${countStatistics} gap-4 md:gap-8 p-6 md:p-8 bg-white border shadow-xl hover:shadow-2xl transition-shadow duration-500 will-change-[transform,box-shadow]`}
|
||||
>
|
||||
{/* {platformStats.map((stat, index) => {
|
||||
return stat.value ? (
|
||||
<div
|
||||
key={index}
|
||||
className="text-center transform hover:-translate-y-1 hover:scale-105 transition-transform duration-300 ease-out"
|
||||
>
|
||||
<div className="inline-flex items-center justify-center w-16 h-16 mb-4 rounded-full bg-primary-50 text-primary-600 text-3xl transition-colors duration-300 group-hover:text-primary-700">
|
||||
{stat.icon}
|
||||
</div>
|
||||
<div className="text-2xl font-bold bg-gradient-to-r from-gray-800 to-gray-600 bg-clip-text text-transparent mb-1.5">
|
||||
{stat.value}
|
||||
</div>
|
||||
<div className="text-gray-600 font-medium">{stat.label}</div>
|
||||
</div>
|
||||
) : null;
|
||||
})} */}
|
||||
{/* </div>
|
||||
</div>
|
||||
)} */}
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export default HeroSection;
|
||||
|
|
|
|||
|
|
@ -1,38 +1,60 @@
|
|||
import { useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
import { Form } from "antd";
|
||||
import { Form, message } from "antd";
|
||||
import { CopyOutlined } from "@ant-design/icons";
|
||||
|
||||
export default function SubmissionSuccess() {
|
||||
const [searchParams] = useSearchParams();
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, []);
|
||||
const [searchParams] = useSearchParams();
|
||||
const [messageApi, contextHolder] = message.useMessage();
|
||||
const ownCode = searchParams.get("ownCode");
|
||||
|
||||
return (
|
||||
<div className="bg-white min-h-screen flex flex-col items-center rounded-xl p-40">
|
||||
<h1 className="text-3xl font-bold mb-8 text-green-700">信件投递成功</h1>
|
||||
{/* 投递时间 */}
|
||||
<Form className="w-full max-w-2xl"> {/* 新增宽度容器 */}
|
||||
<Form.Item
|
||||
className="grid grid-cols-[1fr_2fr] items-center pb-2 gap-4 w-full"
|
||||
>
|
||||
<span className="text-gray-600">投递时间:</span>
|
||||
<span className="text-min text-left text-gray-600">
|
||||
{searchParams.get("submitTime")}
|
||||
</span>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
{/* 回执编号 */}
|
||||
<div className="bg-blue-100 p-6 rounded-lg mb-8 w-full max-w-2xl"> {/* 已有相同宽度 */}
|
||||
<div className="text-4xl font-mono text-center text-blue-600 font-bold">
|
||||
{searchParams.get("ownCode")}
|
||||
</div>
|
||||
</div>
|
||||
<Form className="w-full max-w-2xl space-y-4 mb-8 text-center">
|
||||
<span className="mt-8 text-gray-500 text-sm">
|
||||
请妥善保管您的信件密钥,以便用于进度查询
|
||||
</span>
|
||||
</Form>
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, []);
|
||||
|
||||
const copyToClipboard = () => {
|
||||
navigator.clipboard
|
||||
.writeText(ownCode || "")
|
||||
.then(() => {
|
||||
messageApi.success("复制成功");
|
||||
})
|
||||
.catch(() => {
|
||||
messageApi.error("复制失败,请手动复制");
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="bg-white min-h-screen flex flex-col items-center rounded-xl p-40">
|
||||
{contextHolder}
|
||||
<h1 className="text-3xl font-bold mb-8 text-green-700">信件投递成功</h1>
|
||||
{/* 投递时间 */}
|
||||
<Form className="w-full max-w-2xl">
|
||||
{" "}
|
||||
{/* 新增宽度容器 */}
|
||||
<Form.Item className="grid grid-cols-[1fr_2fr] items-center pb-2 gap-4 w-full">
|
||||
<span className="text-gray-600">投递时间:</span>
|
||||
<span className="text-min text-left text-gray-600">
|
||||
{searchParams.get("submitTime")}
|
||||
</span>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
{/* 回执编号 */}
|
||||
<div className="bg-blue-100 p-6 rounded-lg mb-8 w-full max-w-2xl flex items-center justify-between">
|
||||
<div className="text-4xl font-mono text-center text-blue-600 font-bold flex-grow">
|
||||
{ownCode}
|
||||
</div>
|
||||
);
|
||||
<div
|
||||
className="cursor-pointer p-2 hover:bg-blue-200 rounded-md transition-colors duration-300"
|
||||
onClick={copyToClipboard}
|
||||
>
|
||||
<CopyOutlined className="text-2xl text-blue-600" />
|
||||
</div>
|
||||
</div>
|
||||
<Form className="w-full max-w-2xl space-y-4 mb-8 text-center">
|
||||
<span className="mt-8 text-gray-500 text-sm">
|
||||
请妥善保管您的信件密钥,以便用于进度查询
|
||||
</span>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ export function Header() {
|
|||
{/* 主标题区域 */}
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-wider text-white">
|
||||
我的信件
|
||||
我的悄悄话
|
||||
</h1>
|
||||
{/* <p className="mt-2 text-blue-100 text-lg">
|
||||
及时查看 • 快速处理 • 高效反馈
|
||||
|
|
@ -27,7 +27,7 @@ export function Header() {
|
|||
d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"
|
||||
/>
|
||||
</svg>
|
||||
<span>随时查看收到的信件</span>
|
||||
<span>随时查看</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<svg
|
||||
|
|
@ -42,7 +42,7 @@ export function Header() {
|
|||
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
||||
/>
|
||||
</svg>
|
||||
<span>快速处理信件内容</span>
|
||||
<span>快速处理</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<svg
|
||||
|
|
@ -57,7 +57,7 @@ export function Header() {
|
|||
d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"
|
||||
/>
|
||||
</svg>
|
||||
<span>高效反馈处理结果</span>
|
||||
<span>高效反馈</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ export function StaffCard({ staff }: StaffCardProps) {
|
|||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Content Container */}
|
||||
<div className="flex-1 p-4 flex flex-col justify-center gap-2">
|
||||
<h3 className="text-xl font-semibold text-primary">
|
||||
|
|
@ -56,7 +55,7 @@ export function StaffCard({ staff }: StaffCardProps) {
|
|||
lineHeight: 14,
|
||||
boxShadow: "none",
|
||||
}}>
|
||||
我要写信
|
||||
我要咨询
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue