Skip to content

Commit 0610d62

Browse files
committed
2 parents 5da1ce1 + 4bda12d commit 0610d62

File tree

8 files changed

+442
-303
lines changed

8 files changed

+442
-303
lines changed

components/Sakura.js

+7-184
Large diffs are not rendered by default.

lib/config.js

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const siteConfig = (key, defaultVal = null, extendConfig = null) => {
3131
if (global) {
3232
val = global.NOTION_CONFIG?.[key]
3333
siteInfo = global.siteInfo
34-
// console.log('当前变量', key, val)
3534
}
3635

3736
if (!val) {

public/js/sakura.js

+186
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/qrcode.png

2.25 KB
Loading

themes/commerce/components/Footer.js

+199-91
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,229 @@
11
import { siteConfig } from '@/lib/config'
22
import Link from 'next/link'
3+
import CONFIG from '../config'
34

45
/**
56
* 页脚
67
* @param {*} param0
78
* @returns
89
*/
9-
const Footer = (props) => {
10+
const Footer = props => {
1011
const d = new Date()
1112
const currentYear = d.getFullYear()
1213
const since = siteConfig('SINCE')
13-
const copyrightDate = parseInt(since) < currentYear ? since + '-' + currentYear : currentYear
14+
const copyrightDate =
15+
parseInt(since) < currentYear ? since + '-' + currentYear : currentYear
1416
const { categoryOptions, customMenu } = props
1517

16-
return <footer id="footer-wrapper" className='relative bg-[#2A2A2A] justify-center w-full leading-6 text-gray-300 text-sm p-10'>
17-
18-
<div id='footer-container' className='w-full mx-auto max-w-screen-xl'>
19-
20-
<div className='flex'>
21-
<div className='hidden md:flex flex-grow my-6 space-x-20 text-lg '>
18+
return (
19+
<footer
20+
id='footer-wrapper'
21+
className='relative bg-[#2A2A2A] justify-center w-full leading-6 text-gray-300 text-sm p-10'>
22+
<div id='footer-container' className='w-full mx-auto max-w-screen-xl'>
23+
<div className='flex'>
24+
{/* 页脚左侧菜单组 */}
25+
<div className='hidden md:flex flex-grow my-6 space-x-20 text-lg '>
26+
{/* 分类菜单 */}
27+
<div>
28+
<div className='font-bold mb-4 text-white'>
29+
{siteConfig('COMMERCE_TEXT_FOOTER_MENU_1', 'Product Center')}
30+
</div>
31+
<nav
32+
id='home-nav-button'
33+
className={'flex flex-col space-y-2 text-start'}>
34+
{categoryOptions?.map(category => {
35+
return (
36+
<Link
37+
key={`${category.name}`}
38+
title={`${category.name}`}
39+
href={`/category/${category.name}`}
40+
passHref>
41+
{category.name}
42+
</Link>
43+
)
44+
})}
45+
</nav>
46+
</div>
2247

23-
{/* 分类菜单 */}
48+
{/* 系统菜单 */}
49+
<div>
50+
<div className='font-bold mb-4 text-white'>
51+
{siteConfig('COMMERCE_TEXT_FOOTER_MENU_2', 'About US')}
52+
</div>
53+
<nav
54+
id='home-nav-button'
55+
className={'flex flex-col space-y-2 text-start'}>
56+
{customMenu?.map(menu => {
57+
return (
58+
<Link
59+
key={`${menu.name}`}
60+
title={`${menu.name}`}
61+
href={`${menu.to}`}
62+
passHref>
63+
{menu.name}
64+
</Link>
65+
)
66+
})}
67+
</nav>
68+
</div>
69+
</div>
70+
71+
{/* 页脚中部联系方式 */}
72+
{
73+
<div className='md:border-l pl-4 border-gray-600 my-6 whitespace-pre-line text-left flex-grow'>
74+
<div className='font-bold text-l text-white mb-6'>
75+
{siteConfig('COMMERCE_TEXT_FOOTER_TITLE', 'Contact US', CONFIG)}
76+
</div>
77+
<div className='space-y-4'>
78+
<div className='flex space-x-4 text-2xl'>
79+
{JSON.parse(
80+
siteConfig('COMMERCE_CONTACT_WHATSAPP_SHOW', null, CONFIG),
81+
true
82+
) && (
2483
<div>
25-
<div className='font-bold mb-4 text-white'>{siteConfig('COMMERCE_TEXT_FOOTER_MENU_1', 'Product Center')}</div>
26-
<nav id='home-nav-button' className={'flex flex-col space-y-2 text-start'}>
27-
{categoryOptions?.map(category => {
28-
return (
29-
<Link
30-
key={`${category.name}`}
31-
title={`${category.name}`}
32-
href={`/category/${category.name}`}
33-
passHref>
34-
{category.name}
35-
</Link>
36-
)
37-
})}
38-
</nav>
84+
{
85+
<a
86+
target='_blank'
87+
rel='noreferrer'
88+
href={siteConfig('CONTACT_WHATSAPP', '#', CONFIG)}
89+
title={'telegram'}>
90+
<i className='transform hover:scale-125 duration-150 fa-brands fa-whatsapp dark:hover:text-red-400 hover:text-red-600' />
91+
</a>
92+
}
3993
</div>
94+
)}
4095

41-
{/* 系统菜单 */}
96+
{JSON.parse(
97+
siteConfig('COMMERCE_CONTACT_TELEGRAM_SHOW', true, CONFIG)
98+
) && (
4299
<div>
43-
<div className='font-bold mb-4 text-white'>{siteConfig('COMMERCE_TEXT_FOOTER_MENU_2', 'About US')}</div>
44-
<nav id='home-nav-button' className={'flex flex-col space-y-2 text-start'}>
45-
{customMenu?.map(menu => {
46-
return (
47-
<Link
48-
key={`${menu.name}`}
49-
title={`${menu.name}`}
50-
href={`${menu.to}`}
51-
passHref>
52-
{menu.name}
53-
</Link>
54-
)
55-
})}
56-
</nav>
100+
{
101+
<a
102+
target='_blank'
103+
rel='noreferrer'
104+
href={siteConfig('CONTACT_TELEGRAM', '#', CONFIG)}
105+
title={'telegram'}>
106+
<i className='transform hover:scale-125 duration-150 fab fa-telegram dark:hover:text-red-400 hover:text-red-600' />
107+
</a>
108+
}
57109
</div>
110+
)}
58111
</div>
59-
60-
{<div className='md:border-l pl-4 border-gray-600 my-6 whitespace-pre-line text-left flex-grow'>
61-
<div className='font-bold text-l text-white mb-6'>{siteConfig('COMMERCE_TEXT_FOOTER_TITLE', 'Contact US')}</div>
62-
<div className='space-y-4'>
63-
<div className='flex space-x-4 text-2xl'>
64-
{JSON.parse(siteConfig('COMMERCE_CONTACT_WHATSAPP_SHOW'), true) && <div>
65-
{<a target='_blank' rel='noreferrer' href={siteConfig('CONTACT_WHATSAPP', '#')} title={'telegram'} >
66-
<i className='transform hover:scale-125 duration-150 fa-brands fa-whatsapp dark:hover:text-red-400 hover:text-red-600' />
67-
</a>}
68-
</div>
69-
}
70-
71-
{JSON.parse(siteConfig('COMMERCE_CONTACT_TELEGRAM_SHOW', true)) && <div>
72-
{<a target='_blank' rel='noreferrer' href={siteConfig('CONTACT_TELEGRAM', '#')} title={'telegram'} >
73-
<i className='transform hover:scale-125 duration-150 fab fa-telegram dark:hover:text-red-400 hover:text-red-600' />
74-
</a>}
75-
</div>}
76-
77-
</div>
78-
<div className='text-lg'> {siteConfig('CONTACT_EMAIL') && <a target='_blank' rel='noreferrer' title={'email'} href={`mailto:${siteConfig('CONTACT_EMAIL')}`} >
79-
<i className='transform hover:scale-125 duration-150 fas fa-envelope dark:hover:text-red-400 hover:text-red-600' /> {siteConfig('CONTACT_EMAIL')}
80-
</a>}</div>
81-
<div className='text-lg'> {siteConfig('CONTACT_PHONE') && <div>
82-
<i className='transform hover:scale-125 duration-150 fas fa-user dark:hover:text-red-400 hover:text-red-600' /> {siteConfig('CONTACT_PHONE')}
83-
</div>}</div>
84-
</div>
85-
</div>}
86-
</div>
87-
88-
{/* 底部版权相关 */}
89-
<div id='footer-copyright-wrapper' className='flex flex-col md:flex-row justify-between border-t border-gray-600 pt-8'>
90-
<div className='text-start space-y-1'>
91-
92-
{/* 网站所有者 */}
93-
<div> Copyright <i className='fas fa-copyright' /> {`${copyrightDate}`} <a href={siteConfig('LINK')} className='underline font-bold dark:text-gray-300 '>{siteConfig('AUTHOR')}</a> All Rights Reserved.</div>
94-
95-
{/* 技术支持 */}
96-
<div className='text-xs text-light-500 dark:text-gray-700'>Powered by <a href='https://github.com/tangly1024/NotionNext' className='dark:text-gray-300'>NotionNext {siteConfig('VERSION')}</a>.</div>
97-
98-
{/* 站点统计 */}
112+
<div className='text-lg'>
113+
{' '}
114+
{siteConfig('CONTACT_EMAIL') && (
115+
<a
116+
target='_blank'
117+
rel='noreferrer'
118+
title={'email'}
119+
href={`mailto:${siteConfig('CONTACT_EMAIL', CONFIG)}`}>
120+
<i className='transform hover:scale-125 duration-150 fas fa-envelope dark:hover:text-red-400 hover:text-red-600' />{' '}
121+
{siteConfig('CONTACT_EMAIL')}
122+
</a>
123+
)}
124+
</div>
125+
<div className='text-lg'>
126+
{' '}
127+
{siteConfig('CONTACT_PHONE', null, CONFIG) && (
99128
<div>
100-
<span className='hidden busuanzi_container_site_pv'>
101-
<i className='fas fa-eye' /><span className='px-1 busuanzi_value_site_pv'> </span> </span>
102-
<span className='pl-2 hidden busuanzi_container_site_uv'>
103-
<i className='fas fa-users' /> <span className='px-1 busuanzi_value_site_uv'> </span> </span>
129+
<i className='transform hover:scale-125 duration-150 fas fa-user dark:hover:text-red-400 hover:text-red-600' />{' '}
130+
{siteConfig('CONTACT_PHONE', null, CONFIG)}
104131
</div>
132+
)}
105133
</div>
134+
</div>
135+
</div>
136+
}
137+
138+
{/* 页脚右侧图片二维码和文字描述 */}
139+
{
140+
<div className='pl-4 border-gray-600 my-6 whitespace-pre-line text-center flex-grow'>
141+
<div className='font-bold text-l text-white mb-6 text-center'>
142+
{/* eslint-disable-next-line @next/next/no-img-element */}
143+
<img
144+
className='h-36'
145+
src={siteConfig(
146+
'COMMERCE_FOOTER_RIGHT_IMG_URL',
147+
null,
148+
CONFIG
149+
)}></img>
150+
</div>
151+
<div className='space-y-4'>
152+
<div
153+
className='flex space-x-4 text-center'
154+
dangerouslySetInnerHTML={{
155+
__html: siteConfig(
156+
'COMMERCE_FOOTER_RIGHT_TEXT',
157+
null,
158+
CONFIG
159+
)
160+
}}></div>
161+
</div>
162+
</div>
163+
}
164+
</div>
106165

107-
{/* 右边公司名字 */}
108-
<div className='md:text-right'>
109-
<h1 className='text-xs pt-4 text-light-400 dark:text-gray-400'>{siteConfig('TITLE')} {siteConfig('BIO')}</h1>
110-
<h2> {siteConfig('DESCRIPTION')}</h2>
111-
{/* 可选备案信息 */}
112-
{siteConfig('BEI_AN') && <><i className='fas fa-shield-alt' /> <a href='https://beian.miit.gov.cn/' className='mr-2'>{siteConfig('BEI_AN')}</a></>}
113-
</div>
166+
{/* 底部版权相关 */}
167+
<div
168+
id='footer-copyright-wrapper'
169+
className='flex flex-col md:flex-row justify-between border-t border-gray-600 pt-8'>
170+
<div className='text-start space-y-1'>
171+
{/* 网站所有者 */}
172+
<div>
173+
{' '}
174+
Copyright <i className='fas fa-copyright' /> {`${copyrightDate}`}{' '}
175+
<a
176+
href={siteConfig('LINK')}
177+
className='underline font-bold dark:text-gray-300 '>
178+
{siteConfig('AUTHOR')}
179+
</a>{' '}
180+
All Rights Reserved.
114181
</div>
115182

116-
</div>
183+
{/* 技术支持 */}
184+
<div className='text-xs text-light-500 dark:text-gray-700'>
185+
Powered by{' '}
186+
<a
187+
href='https://github.com/tangly1024/NotionNext'
188+
className='dark:text-gray-300'>
189+
NotionNext {siteConfig('VERSION')}
190+
</a>
191+
.
192+
</div>
117193

118-
</footer >
194+
{/* 站点统计 */}
195+
<div>
196+
<span className='hidden busuanzi_container_site_pv'>
197+
<i className='fas fa-eye' />
198+
<span className='px-1 busuanzi_value_site_pv'> </span>{' '}
199+
</span>
200+
<span className='pl-2 hidden busuanzi_container_site_uv'>
201+
<i className='fas fa-users' />{' '}
202+
<span className='px-1 busuanzi_value_site_uv'> </span>{' '}
203+
</span>
204+
</div>
205+
</div>
206+
207+
{/* 右边公司名字 */}
208+
<div className='md:text-right'>
209+
<h1 className='text-xs pt-4 text-light-400 dark:text-gray-400'>
210+
{siteConfig('TITLE')} {siteConfig('BIO')}
211+
</h1>
212+
<h2> {siteConfig('DESCRIPTION')}</h2>
213+
{/* 可选备案信息 */}
214+
{siteConfig('BEI_AN') && (
215+
<>
216+
<i className='fas fa-shield-alt' />{' '}
217+
<a href='https://beian.miit.gov.cn/' className='mr-2'>
218+
{siteConfig('BEI_AN')}
219+
</a>
220+
</>
221+
)}
222+
</div>
223+
</div>
224+
</div>
225+
</footer>
226+
)
119227
}
120228

121229
export default Footer
+35-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { siteConfig } from '@/lib/config'
2+
import CONFIG from '../config'
23
import ProductCard from './ProductCard'
34
import ProductCategories from './ProductCategories'
45

@@ -9,25 +10,42 @@ import ProductCategories from './ProductCategories'
910
*/
1011
export default function ProductCenter(props) {
1112
const { allNavPages } = props
12-
const posts = allNavPages.slice(0, parseInt(siteConfig('COMMERCE_HOME_POSTS_COUNT', 9)))
13-
14-
return <div className='w-full my-4 mx-4'>
15-
<div className='w-full text-center text-4xl font-bold'>{siteConfig('COMMERCE_TEXT_CENTER_TITLE', 'Product Center')}</div>
16-
{siteConfig('COMMERCE_TEXT_CENTER_DESCRIPTION') && <div className='w-full text-center text-lg my-3 text-gray-500'>{siteConfig('COMMERCE_TEXT_CENTER_DESCRIPTION')}</div>}
17-
18-
<div className='flex'>
19-
20-
<ProductCategories {...props} />
13+
const posts = allNavPages.slice(
14+
0,
15+
parseInt(siteConfig('COMMERCE_HOME_POSTS_COUNT', 9))
16+
)
17+
const COMMERCE_TEXT_CENTER_TITLE = siteConfig(
18+
'COMMERCE_TEXT_CENTER_TITLE',
19+
'Product Center',
20+
CONFIG
21+
)
22+
return (
23+
<div className='w-full my-4 mx-4'>
24+
<div className='w-full text-center text-4xl font-bold'>
25+
{COMMERCE_TEXT_CENTER_TITLE}
26+
</div>
27+
{siteConfig('COMMERCE_TEXT_CENTER_DESCRIPTION') && (
28+
<div className='w-full text-center text-lg my-3 text-gray-500'>
29+
{siteConfig('COMMERCE_TEXT_CENTER_DESCRIPTION')}
30+
</div>
31+
)}
2132

22-
<div className='w-full p-4 mx-2'>
23-
{/* 文章列表 */}
24-
<div className="grid md:grid-cols-3 grid-cols-2 gap-5">
25-
{posts?.map(post => (
26-
<ProductCard index={posts.indexOf(post)} key={post.id} post={post} />
27-
))}
28-
</div>
33+
<div className='flex'>
34+
<ProductCategories {...props} />
2935

30-
</div>
36+
<div className='w-full p-4 mx-2'>
37+
{/* 文章列表 */}
38+
<div className='grid md:grid-cols-3 grid-cols-2 gap-5'>
39+
{posts?.map(post => (
40+
<ProductCard
41+
index={posts.indexOf(post)}
42+
key={post.id}
43+
post={post}
44+
/>
45+
))}
46+
</div>
3147
</div>
48+
</div>
3249
</div>
50+
)
3351
}

0 commit comments

Comments
 (0)