feat: add page (discover journal)

mack-mac
mackt 8 months ago
parent 956a36378b
commit 367da6a389

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7555 5.29102C13.058 5.18671 13.3933 5.28579 13.5906 5.53774L17 9.89314L20.4094 5.53774C20.6067 5.28579 20.942 5.18671 21.2445 5.29102C21.547 5.39534 21.75 5.68007 21.75 6.00004V13C21.75 13.4143 21.4142 13.75 21 13.75C20.5858 13.75 20.25 13.4143 20.25 13V8.17487L17.5906 11.5722C17.4484 11.7538 17.2306 11.8599 17 11.8599C16.7694 11.8599 16.5516 11.7538 16.4094 11.5722L13.75 8.17487V13C13.75 13.4143 13.4142 13.75 13 13.75C12.5858 13.75 12.25 13.4143 12.25 13V6.00004C12.25 5.68007 12.453 5.39534 12.7555 5.29102ZM11.8529 17.2646C11.95 17.2452 12.05 17.2452 12.1471 17.2646L17.1471 18.2646C17.5533 18.3458 17.8167 18.741 17.7354 19.1471C17.6542 19.5533 17.2591 19.8167 16.8529 19.7355L12 18.7649L7.14709 19.7355C6.74092 19.8167 6.3458 19.5533 6.26456 19.1471C6.18333 18.741 6.44674 18.3458 6.85291 18.2646L11.8529 17.2646ZM3 5.25004C2.58579 5.25004 2.25 5.58583 2.25 6.00004V9.42679V13C2.25 13.4143 2.58579 13.75 3 13.75C3.41421 13.75 3.75 13.4143 3.75 13V10.1768H9C9.41421 10.1768 9.75 9.84101 9.75 9.42679C9.75 9.01258 9.41421 8.67679 9 8.67679H3.75V6.75004H10C10.4142 6.75004 10.75 6.41426 10.75 6.00004C10.75 5.58583 10.4142 5.25004 10 5.25004H3Z" fill="black" fill-opacity="0.7"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20.5 12C20.5034 13.3199 20.195 14.6219 19.6 15.8C18.8944 17.2117 17.8097 18.3992 16.4674 19.2293C15.1251 20.0594 13.5782 20.4994 12 20.5C10.6801 20.5034 9.37812 20.195 8.20001 19.6L4.10714 19.8929L4.40003 15.8C3.80496 14.6219 3.49659 13.3199 3.50003 12C3.50064 10.4218 3.94064 8.87486 4.77074 7.53257C5.60085 6.19027 6.78827 5.10559 8.20001 4.40003C9.37812 3.80496 10.6801 3.49659 12 3.50003H12.5C14.5843 3.61502 16.553 4.49479 18.0291 5.97088C19.5052 7.44697 20.385 9.41566 20.5 11.5V12Z" stroke="black" stroke-opacity="0.4" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 707 B

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.612 5.41452C19.1722 4.96607 18.65 4.61034 18.0752 4.36763C17.5005 4.12492 16.8844 4 16.2623 4C15.6401 4 15.0241 4.12492 14.4493 4.36763C13.8746 4.61034 13.3524 4.96607 12.9126 5.41452L11.9998 6.34476L11.087 5.41452C10.1986 4.50912 8.99364 4.00047 7.73725 4.00047C6.48085 4.00047 5.27591 4.50912 4.38751 5.41452C3.4991 6.31992 3 7.5479 3 8.82833C3 10.1088 3.4991 11.3367 4.38751 12.2421L11.9998 20L19.612 12.2421C20.0521 11.7939 20.4011 11.2617 20.6393 10.676C20.8774 10.0902 21 9.46237 21 8.82833C21 8.19428 20.8774 7.56645 20.6393 6.9807C20.4011 6.39494 20.0521 5.86275 19.612 5.41452Z" fill="#B44343" stroke="#B44343" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 804 B

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.612 5.41452C19.1722 4.96607 18.65 4.61034 18.0752 4.36763C17.5005 4.12492 16.8844 4 16.2623 4C15.6401 4 15.0241 4.12492 14.4493 4.36763C13.8746 4.61034 13.3524 4.96607 12.9126 5.41452L11.9998 6.34476L11.087 5.41452C10.1986 4.50912 8.99364 4.00047 7.73725 4.00047C6.48085 4.00047 5.27591 4.50912 4.38751 5.41452C3.4991 6.31992 3 7.5479 3 8.82833C3 10.1088 3.4991 11.3367 4.38751 12.2421L11.9998 20L19.612 12.2421C20.0521 11.7939 20.4011 11.2617 20.6393 10.676C20.8774 10.0902 21 9.46237 21 8.82833C21 8.19428 20.8774 7.56645 20.6393 6.9807C20.4011 6.39494 20.0521 5.86275 19.612 5.41452Z" stroke="black" stroke-opacity="0.4" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 808 B

@ -1,29 +1,29 @@
.halo {
position: absolute;
top: 160px;
left: 240px;
width: 560px;
height: 280px;
margin-left: 30px;
background: linear-gradient(135.88deg, rgba(255, 240, 240, 0.0126) 31.88%, rgba(255, 53, 53, 0.06) 75.38%);
filter: blur(50px);
transform: matrix(1, -0.09, -0.02, 1, 0, 0);
}
.weibo {
position: relative;
color: #000;
font-size: 20px;
line-height: 28px;
}
.weibo::after {
content: '';
display: block;
left: 83px;
bottom: 0;
position: absolute;
width: 24px;
height: 24px;
background: url('/img/icon/arrow-right.svg');
}
.halo {
position: absolute;
top: 160px;
left: 240px;
width: 560px;
height: 280px;
margin-left: 30px;
background: linear-gradient(135.88deg, rgba(255, 240, 240, 0.0126) 31.88%, rgba(255, 53, 53, 0.06) 75.38%);
filter: blur(50px);
transform: matrix(1, -0.09, -0.02, 1, 0, 0);
}
.weibo {
position: relative;
color: #000;
font-size: 20px;
line-height: 28px;
}
.weibo::after {
content: '';
display: block;
left: 83px;
bottom: 2px;
position: absolute;
width: 24px;
height: 24px;
background: url('/img/icon/arrow-right.svg');
}

@ -1,16 +0,0 @@
import Image from 'next/image';
import { ContributorCardType } from '../page';
export default function ContributorCard({ nickname, avatarUrl, occupation }: ContributorCardType) {
return (
<div className="col-span-1 w-[178px] h-[260px] mt-[26px] pt-[36px] pb-[44px] rounded-[6px] flex flex-col bg-[#fff]">
<div className="w-[92px] h-[92px] mx-auto rounded-[50%] bg-[#fff] overflow-hidden">
{/* <Image width={92} height={92} src={avatarUrl} alt={`${nickname}-avatar`} /> */}
<Image width={130} height={130} unoptimized src={avatarUrl} alt="wechat qrCode"></Image>
</div>
<p className="mt-[31px] mb-[13px] text-[18px] leading-[25px] text-[rgba(0,0,0,0.95)] text-center">{nickname}</p>
<p className="text-[15px] leading-[18px] text-[rgba(0,0,0,0.4)] text-center">{occupation}</p>
</div>
);
}

@ -1,183 +1,105 @@
import Image from 'next/image';
import styles from './about.module.css';
import ContributorCard from './components/contributor-card';
export interface ContributorCardType {
nickname: string;
avatarUrl: string;
occupation: string;
}
const contributorList: ContributorCardType[] = [
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
{
nickname: 'Blaksder',
avatarUrl: '/img/about/avatar.png',
occupation: '前端工程师',
},
];
export default function Download() {
return (
<div className="w-full bg-[#F2F3F7]">
<main className="w-[1200px] mx-auto flex flex-col items-left pt-[80px] pb-[104px] ">
{/* about */}
<div className="w-full pt-[110px]">
<h2 className="text-[36px] leading-[50px] font-bold"></h2>
<p className="mt-[6px] mb-[41px] text-[rgba(0,0,0,0.4)] text-[15px] leading-[24px]">APP</p>
<div className="text-[15px] leading-[24px]">
<p className="font-bold">
</p>
<p className="mt-[9px]">
<br />
Indie but not in die
</p>
</div>
</div>
{/* contributor */}
<div className="relative w-full mt-[120px]">
<h2 className="text-[36px] leading-[50px] font-bold"></h2>
<div className={styles.halo} />
<Image
className="mx-auto mt-[70px] mb-[39px]"
width={355}
height={171}
src="/img/about/thank.svg"
alt="贡献者"
/>
<div className="text-[15px] leading-[24px]">
<p>
</p>
<br />
<p>
<span></span>
<br />
<span className="font-bold">
</span>
</p>
<br />
<p className="mt-[9px] text-[15px] leading-[24px]">
<span className="text-[#B44343]">indier</span>
<br />
</p>
<br />
<p className="text-right">- </p>
</div>
<div className="grid grid-cols-6 gap-6 mt-[26px]">
{contributorList.map((card) => (
<ContributorCard key={card.nickname} {...card} />
))}
</div>
{/* contributor wall */}
</div>
{/* 联系我们 */}
<div className="w-full pt-[110px]">
<h2 className="text-[36px] leading-[50px] font-bold"></h2>
<div className="mt-[46px]">
<p className="mb-[6px] text-[15px] leading-[21px] text-[rgba(0,0,0,0.7)]"></p>
<p className="text-[20px] leading-[28px] text-[#000]">rock@indie.cn</p>
</div>
<div className="mt-[36px]">
<p className="mb-[6px] text-[15px] leading-[21px] text-[rgba(0,0,0,0.7)]">Weibo</p>
<p className={styles.weibo}></p>
</div>
<div className="flex flex-col items-center w-[130px] mt-[38px] mb-[102px]">
<Image width={130} height={130} src="/img/about/qrcode-wechat.svg" alt="wechat qrCode"></Image>
<p className="mt-[4px] text-[15px] leading-[21px] text-[rgba(0,0,0,0.7)]"></p>
</div>
</div>
</main>
</div>
);
}
import Image from 'next/image';
import styles from './about.module.css';
import ContributorCard from '@/components';
import { apiThanks } from '@/services/server/about';
export interface ContributorCardType {
id: number;
nickName: string;
avatar: string;
contributorRole: string;
}
export default async function Download() {
const contributorList: ContributorCardType[] = await apiThanks();
return (
<div className="w-full bg-[#F2F3F7]">
<main className="w-[1200px] mx-auto flex flex-col items-left pt-[80px] pb-[104px] ">
{/* about */}
<div className="w-full pt-[110px]">
<h2 className="text-[36px] leading-[50px] font-bold"></h2>
<p className="mt-[6px] mb-[41px] text-[rgba(0,0,0,0.4)] text-[15px] leading-[24px]">APP</p>
<div className="text-[15px] leading-[24px]">
<p className="font-bold">
</p>
<p className="mt-[9px]">
<br />
Indie but not in die
</p>
</div>
</div>
{/* contributor */}
<div className="relative w-full mt-[120px]">
<h2 className="text-[36px] leading-[50px] font-bold"></h2>
<div className={styles.halo} />
<Image
className="mx-auto mt-[70px] mb-[39px]"
width={355}
height={171}
src="/img/about/thank.svg"
alt="贡献者"
/>
<div className="text-[15px] leading-[24px]">
<p>
</p>
<br />
<p>
<span></span>
<br />
<span className="font-bold">
</span>
</p>
<br />
<p className="mt-[9px] text-[15px] leading-[24px]">
&nbsp;
<span className="text-[#B44343]">indier</span>
&nbsp; <br />
</p>
<br />
<p className="text-right">- </p>
</div>
<div className="grid grid-cols-6 gap-6 mt-[26px]">
{contributorList.map((card) => (
<ContributorCard key={card.id} {...card} />
))}
</div>
{/* contributor wall */}
</div>
{/* 联系我们 */}
<div className="w-full pt-[110px]">
<h2 className="text-[36px] leading-[50px] font-bold"></h2>
<div className="mt-[46px]">
<p className="mb-[6px] text-[15px] leading-[21px] text-[rgba(0,0,0,0.7)]"></p>
<p className="text-[20px] leading-[28px] text-[#000]">rock@indie.cn</p>
</div>
<div className="mt-[36px]">
<p className="mb-[6px] text-[15px] leading-[21px] text-[rgba(0,0,0,0.7)]">Weibo</p>
<p className={styles.weibo}></p>
</div>
<div className="flex flex-col items-center w-[130px] mt-[38px] mb-[102px]">
<Image width={130} height={130} src="/img/about/qrcode-wechat.svg" alt="wechat qrCode" />
<p className="mt-[6px] text-[15px] leading-[21px] text-[rgba(0,0,0,0.7)]"></p>
</div>
</div>
</main>
</div>
);
}

@ -0,0 +1,21 @@
import { TagCategory, JournalList } from '@/components';
export default function Home() {
return (
<main className="flex flex-row justify-between w-[1200px] mx-auto items-left pt-[80px] pb-[104px] ">
{/* 左侧 */}
<div className="w-[712px] mt-[50px]">
{/* category */}
<TagCategory />
{/* 期刊列表 */}
<JournalList />
</div>
{/* 右侧 */}
<div className="w-[346px] mt-[217px]">
<p className="text-[17px] leading-[23.8px]"></p>
<div></div>
</div>
</main>
);
}

@ -0,0 +1,3 @@
export default function Loading() {
return <div>Loading...</div>;
}

@ -1,3 +1,24 @@
export default function Home() {
return <main />;
}
import { useState, useEffect } from 'react';
import { TagCategory } from '@/components';
import { getTagName } from '@/store';
export default function Home() {
return (
<main className="flex flex-row justify-between w-[1200px] mx-auto items-left pt-[80px] pb-[104px] ">
{/* 左侧 */}
<div className="w-[712px] mt-[50px]">
{/* category */}
<TagCategory />
{/* 期刊列表 */}
</div>
{/* 右侧 */}
<div className="w-[346px] mt-[217px]">
<p className="text-[17px] leading-[23.8px]"></p>
<div></div>
</div>
</main>
);
}

@ -1,8 +1,18 @@
import Image from 'next/image';
const Avatar = ({ src, alt, size }: { src: string; alt: string; size: number }) => {
const Avatar = ({
src,
alt = 'avatar',
size,
className = '',
}: {
src: string;
alt?: string;
size: number;
className?: string;
}) => {
return (
<div className={`rounded-[50%] bg-[#fff] overflow-hidden`} style={{ width: size, height: size }}>
<div className={`rounded-[50%] bg-[#fff] overflow-hidden ${className}`} style={{ width: size, height: size }}>
<Image className="w-full h-full object-cover" width={size} height={size} src={src} alt={alt} unoptimized />
</div>
);

@ -0,0 +1,13 @@
import Avatar from '@/components/Avatar';
import { ContributorCardType } from '../app/about/page';
export default function ContributorCard({ nickName, avatar, contributorRole }: ContributorCardType) {
return (
<div className="flex flex-col items-center w-[178px] h-[260px] mt-[26px] pt-[36px] pb-[44px] rounded-[6px] bg-[#fff]">
<Avatar size={92} src={avatar} alt={`${nickName}-avatar`} />
<p className="mt-[31px] mb-[13px] text-[18px] leading-[25px] text-[rgba(0,0,0,0.95)] text-center">{nickName}</p>
<p className="text-[15px] leading-[18px] text-[rgba(0,0,0,0.4)] text-center">{contributorRole}</p>
</div>
);
}

@ -0,0 +1,78 @@
import Image from 'next/image';
import Avatar from '@/components/Avatar';
export default function JournalCard({
journalNo,
title,
image,
summary,
haveCollect,
totalCommentReply,
commentList,
}: JournalInfo) {
console.log({ commentList });
return (
<div className="flex flex-col w-[712px] rounded-[6px] bg-[#fff] ">
{/* banner container */}
<div className={`relative w-full h-[420px] rounded-[6px] overflow-hidden bg-[url(${image})]`}>
{/* 左上角标 */}
<div className="flex flex-col justify-between absolute top-0 left-0 w-[64px] h-[64px] mt-[16px] ml-[16px] pt-[9.35px] pb-[9.2px] px-[11.13px] rounded-[2px] bg-[rgba(255,255,255,0.9)] z-2">
<p className="h-[23.2px] w-full text-[16px] leading-[23.2px] text-[#000] text-left">{journalNo}</p>
<div className="w-[37.1px] h-[1.4px] bg-gradient-to-r from-red-700 via-red-700 to-transparent" />
<p className="w-full text-[10px] leading-[18px] text-[rgba(0,0,0,0.4)]">VOL</p>
</div>
{/* banner */}
<Image
width={712}
height={420}
src={image}
unoptimized
alt={title}
className="absolute bottom-0 cursor-pointer"
/>
{/* 标题 */}
<p className="absolute bottom-[23px] left-[23px] text-[#fff] text-[24px] leading-[33.6px]">{title}</p>
</div>
{/* 摘要 */}
<p className="w-full mt-[15px] mb-[12px] text-[17px] leading-[23.8px] text-[#000] overflow-hidden whitespace-nowrap overflow-ellipsis truncate">
{summary}
</p>
{/* 评论 */}
{commentList.length && (
<div className="flex flex-row mb-[24px]">
<div className={`flex flex-row relative w-[25px] h-[15px] mr-[9px]`}>
{commentList?.[0]?.avatar && <Avatar className="absolute" size={15} src={commentList[0].avatar} />}
{commentList?.[1]?.avatar && (
<div className=" flex justify-center items-center absolute left-[9px] w-[16px] h-[16px] rounded-[50%] bg-[#fff] overflow-hidden">
<Avatar size={15} src={commentList[1].avatar} />
</div>
)}
</div>
<p className="w-[270px] text-[14px] leading-[20px] text-[rgba(0,0,0,0.7)] overflow-hidden whitespace-nowrap overflow-ellipsis truncate">
{commentList[0].content}
</p>
</div>
)}
{/* 评论 & 收藏 */}
<div className="flex flex-row items-center">
<Image
width={24}
height={24}
src={haveCollect ? '/img/icon/love-active.svg' : '/img/icon/love.svg'}
alt="love"
unoptimized
/>
<p className="w-[42px] ml-[6px] mr-[24px] text-[14px] leading-[16px] text-[rgba(0,0,0,0.4)]">
{totalCommentReply}
</p>
<Image width={24} height={24} src={'/img/icon/comment.svg'} alt="comment" unoptimized />
<p className="ml-[6px] text-[14px] leading-[16px] text-[rgba(0,0,0,0.4)]">{totalCommentReply}</p>
</div>
</div>
);
}

@ -0,0 +1,46 @@
import Image from 'next/image';
import JournalCard from './JournalCard';
import { apiJournalList } from '@/services/server/journal';
const JournalList = async ({
categoryId,
journalNoRange,
pageNum,
pageSize,
}: {
categoryId?: string;
journalNoRange?: string;
pageNum?: number;
pageSize?: number;
}) => {
const journalList: JournalList = await apiJournalList({
categoryId,
journalNoRange,
pageNum,
pageSize,
});
return (
<div className="flex flex-col mt-[33px]">
{/* 分类 & 电台 */}
<div className="flex flex-row items-center justify-between">
<div className="text-[17px] leading-[23.8px]">{'摇滚'}</div>
<div className="flex flex-row items-center cursor-pointer">
<Image className="mr-[6px]" width={24} height={24} src={'/img/icon/fm.svg'} alt="FM" />
<p className="text-[15px] leading-[21px]"></p>
</div>
</div>
{/* 期刊 list */}
<div className="flex flex-col gap-[60px] mt-[17px]">
{journalList.rows.map((item: JournalInfo) => (
<JournalCard key={item.id} {...item} />
))}
</div>
</div>
);
};
export default JournalList;

@ -2,21 +2,22 @@
import React, { useState } from 'react';
import Input from '@/components/common/Input';
import { Input, Button } from '@/components';
import { useDebounce } from '@/hooks';
export default function LoginForm({ onClose }: { onClose: () => void }) {
const [phone, setPhone] = useState('');
const [authCode, seAuthCode] = useState('');
const [phone, setPhone] = useState(''); // 手机号
const [authCode, seAuthCode] = useState(''); // 验证码
const handleLogin = () => {
const handleGetAuthCode = () => {
console.log('handleGetAuthCode');
event.preventDefault();
console.log(phone, authCode);
onClose();
};
const handleGetAuthCode = () => {
const handleLogin = (event: Event) => {
console.log('handleLogin');
event.preventDefault();
console.log('获取验证码');
// onClose();
};
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>, fn: (text: string) => void) => {
@ -29,7 +30,6 @@ export default function LoginForm({ onClose }: { onClose: () => void }) {
};
return (
// <form className="space-y-4" onSubmit={handleSubmit(onSubmit)} autoComplete="off">
<form autoComplete="off">
<div className="w-full flex flex-col">
<Input
@ -45,22 +45,29 @@ export default function LoginForm({ onClose }: { onClose: () => void }) {
className="w-full"
type="text"
value={authCode}
maxLength={4}
maxLength={6}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleInputChange(e, seAuthCode)}
placeholder="输入验证码"
/>
<button
className="absolute top-[6px] right-[6px] w-[123px] h-[44px] rounded-[100px] bg-[#000] color-[#fff] font-size-[14px] leading-[20px]"
onClick={handleGetAuthCode}
<Button
type="black"
className="absolute top-[6px] right-[6px] w-[123px] h-[44px] rounded-[100px] font-size-[14px] leading-[20px]"
disabled={phone.length !== 11}
onClick={useDebounce(handleGetAuthCode, 3000)}
>
</button>
</Button>
</div>
</div>
<button className="w-full h-[56px] mt-[30px] rounded-[100px] bg-[#B44343] color-[#fff]" onClick={handleLogin}>
<Button
type="primary"
className="w-full h-[56px] mt-[30px] rounded-[100px] font-size-[14px] leading-[20px]"
disabled={!(phone.length === 11 && authCode.length === 6)}
onClick={useDebounce(handleLogin, 10000)}
>
</button>
</Button>
</form>
);
}

@ -0,0 +1,21 @@
import { apiTagName } from '@/services/server/journal';
const Avatar = async () => {
const tagNameList = await apiTagName({ level: 1, state: 1 });
return (
<div className={`grid grid-cols-8`}>
{tagNameList.map((item: TagName) => (
<div
key={item.id}
// className={`w-[80px] h-[35px] mt-[10px] rounded-[120px] text-[13px] leading-[18px] text-center leading-[35px] cursor-pointer ${current === item.id ? 'bg-[#B44343] text-[#fff]' : 'bg-[#F2F3F7] text-[#000]'}`}
className={`w-[80px] h-[35px] mt-[10px] rounded-[120px] text-[13px] leading-[18px] text-center leading-[35px] cursor-pointer bg-[#F2F3F7] text-[#000]`}
>
{item.nameCh}
</div>
))}
</div>
);
};
export default Avatar;

@ -0,0 +1,36 @@
import React from 'react';
interface ButtonProps {
type?: 'default' | 'primary' | 'black';
disabled?: boolean;
className?: string;
children: React.ReactNode;
[key: string]: any;
}
const Button: React.FC<ButtonProps> = ({
type = 'default',
disabled = false,
className = '',
children,
...restPropps
}) => {
const buttonColorList = {
default: { default: 'bg-blue text-[#000]', disabled: 'opacity-50' },
primary: { default: 'bg-[#B44343] text-[#fff]', disabled: 'opacity-50' },
black: { default: 'bg-[#000] text-[#fff]', disabled: 'opacity-10' },
};
return (
<button
className={`${buttonColorList[type].default} ${disabled && buttonColorList[type].disabled} ${className}
`}
disabled={disabled}
{...restPropps}
>
{children}
</button>
);
};
export default Button;

@ -2,8 +2,14 @@ export { default as Logo } from './Logo';
export { default as Header } from './Header';
export { default as Footer } from './Footer';
// Home
export { default as TagCategory } from './TagCategory';
export { default as JournalList } from './JournalList';
export { default as ContributorCard } from './ContributorCard';
export { default as LoginModal } from './Login/LoginModal';
export { default as LoginForm } from './Login/LoginForm';
// Common
export { default as Input } from './common/Input';
export { default as Button } from './common/Button';

@ -1,68 +1,30 @@
// 期刊
import { request, verifyResponse } from '@/utils';
export interface journalList {
total: number;
row: JournalInfo[];
}
export interface Comment {
_id: string;
avatar: string;
commentCount: number;
content: string;
journalId: string;
location: string;
nickName: string;
parentId: string;
publishTime: string;
state: number;
thumbupCount: number;
userId: string;
}
export interface JournalInfo {
/** 期刊评论top5 */
commentList: Comment[];
/** 文案 */
content: string;
/** 编辑日期 */
date: string;
/** 编辑人 */
editor: string;
/** 已收藏 */
haveCollect: boolean;
id: string;
/** 期刊封面 */
image: string;
/** 期刊发布于 */
ipLocation: string;
/** 剘刊号 */
journalNo: string;
/** 概要 */
summary: string;
/** 期刊标签 */
tags: string[];
/** 期刊名 */
title: string;
/** 期刊总评论数,大于99显示99+ */
totalCommentReply: string;
/** 期刊总评论数 int */
totalCommentReplyInt: number;
}
/**
* @description 10
*/
export const getJournalList = async () => {
const result = await request('/luoo-music/journal/list');
return result;
export const apiJournalList = async ({
categoryId = '',
journalNoRange = '',
pageNum = 1,
pageSize = 10,
}: {
categoryId?: string;
journalNoRange?: string;
pageNum?: number;
pageSize?: number;
}) => {
const result: FetchResponse<JournalList> = await request(
`/luoo-music/journal/list?categoryId=${categoryId}&journalNoRange=${journalNoRange}&pageNum=${pageNum}&pageSize=${pageSize}`,
);
return verifyResponse(result);
};
/**
* @description
*/
export const getJournalFilter = async () => {
export const apiJournalFilter = async () => {
const result = await request('/luoo-music/journal/filter');
return result;
};
@ -82,6 +44,8 @@ export const apiTagName = async ({
parentId?: string;
state?: number;
}) => {
const result = await request(`/luoo-tag/tag/name?level=${level}&parentId=${parentId}&state=${state}`);
const result: FetchResponse<TagName[]> = await request(
`/luoo-tag/tag/name?level=${level}&parentId=${parentId}&state=${state}`,
);
return verifyResponse(result);
};

@ -3,3 +3,71 @@ declare interface FetchResponse<T> {
message: string;
data: T;
}
declare interface TagName {
/** ID */
id: string;
/** 是否显示 */
isShow: number;
/** 等级 */
level: number;
/** 中文名称 */
nameCh: string;
/** 英文名称 */
nameEn: string;
/** 父类别ID */
parentId: string;
/** 状态 */
state: number;
}
declare interface JournalList {
total: number;
rows: JournalInfo[];
}
declare interface Comment {
_id: string;
avatar: string;
commentCount: number;
content: string;
journalId: string;
location: string;
nickName: string;
parentId: string;
publishTime: string;
state: number;
thumbupCount: number;
userId: string;
}
declare interface JournalInfo {
/** 期刊评论top5 */
commentList: Comment[];
/** 文案 */
content: string;
/** 编辑日期 */
date: string;
/** 编辑人 */
editor: string;
/** 已收藏 */
haveCollect: boolean;
/** ID */
id: string;
/** 期刊封面 */
image: string;
/** 期刊发布于 */
ipLocation: string;
/** 剘刊号 */
journalNo: string;
/** 概要 */
summary: string;
/** 期刊标签 */
tags: string[];
/** 期刊名 */
title: string;
/** 期刊总评论数,大于99显示99+ */
totalCommentReply: string;
/** 期刊总评论数 int */
totalCommentReplyInt: number;
}

16
src/types/tag.d.ts vendored

@ -1,16 +0,0 @@
declare interface TagName {
/** ID */
id: string;
/** 是否显示 */
isShow: number;
/** 等级 */
level: number;
/** 中文名称 */
nameCh: string;
/** 英文名称 */
nameEn: string;
/** 父类别ID */
parentId: string;
/** 状态 */
state: number;
}
Loading…
Cancel
Save