Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit958818e

Browse files
authored
feat: support us page (#1148)
* chore: wip* chore: wip* style: adjust* refactor: cashier js -> ts* chore: update header menu* chore: cashier workflow adjust
1 parent137cc36 commit958818e

File tree

61 files changed

+666
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+666
-604
lines changed

‎cypress/integration/friends/layout.spec.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
describe('friends page: ',()=>{
1+
describe('support-us page: ',()=>{
22
// beforeEach(() => {
33
before(()=>{
4-
cy.visit('/friends')
4+
cy.visit('/support-us')
55
})
66

77
it('basic layout',()=>{
88
cy.id('header').should('be.visible')
99
cy.id('header-search').should('be.visible')
1010
cy.id('header-search-icon').should('be.visible')
1111

12-
cy.id('friends-content').should('be.visible')
12+
cy.id('support-us-content').should('be.visible')
1313

1414
// cypress can not load dynamic Footer
1515
// cy.id('footer').should('be.visible')

‎server/routes.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ router.route('/sponsor/:slug?').get((req, res) => {
3737
returnrenderAndCache({ req, res,path:'/sponsor'})
3838
})
3939

40-
//友情链接
41-
router.route('/friends/:slug?').get((req,res)=>{
42-
returnrenderAndCache({ req, res,path:'/friends'})
40+
//支持我们
41+
router.route('/support-us/:slug?').get((req,res)=>{
42+
returnrenderAndCache({ req, res,path:'/support-us'})
4343
})
4444

4545
// 升级账户

‎src/components/BuyMeChuanChuan/ChuanSelector.js‎

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import{FC,memo}from'react'
2+
3+
import{ICON_CMD}from'@/config'
4+
import{
5+
SelectBox,
6+
ChuanChuanIcon,
7+
Selectors,
8+
By,
9+
Circle,
10+
}from'./styles/chuan_selector'
11+
12+
typeTProps={
13+
active:number
14+
onSelect:(howMany:number)=>void
15+
}
16+
17+
constChuanSelector:FC<TProps>=({ active, onSelect})=>{
18+
constoptions=[1,5,10,50,100]
19+
20+
return(
21+
<SelectBox>
22+
<ChuanChuanIconsrc={`${ICON_CMD}/chuanchuan.svg`}/>
23+
24+
<Selectors>
25+
<By>x</By>
26+
{options.map((item)=>(
27+
<Circlekey={item}active={item===1}onClick={()=>onSelect(item)}>
28+
1
29+
</Circle>
30+
))}
31+
</Selectors>
32+
</SelectBox>
33+
)
34+
}
35+
36+
exportdefaultmemo(ChuanSelector)

‎src/components/BuyMeChuanChuan/PaymentFooter.js‎

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import{FC,memo}from'react'
2+
3+
import{ICON_CMD}from'@/config'
4+
importButtonfrom'@/components/Buttons/Button'
5+
6+
import{
7+
Wrapper,
8+
PayDesc,
9+
AliPay,
10+
Weixin,
11+
MoneyNum,
12+
PaymentIcon,
13+
}from'./styles/payment_footer'
14+
15+
typeTProps={
16+
num:number
17+
onPay:(m:number)=>void
18+
}
19+
20+
constPaymentFooter:FC<TProps>=({ num, onPay})=>{
21+
return(
22+
<Wrapper>
23+
<PayDesc>
24+
支持:
25+
<AliPay>
26+
<PaymentIconsrc={`${ICON_CMD}/alipay-color.svg`}/>
27+
</AliPay>
28+
|
29+
<Weixin>
30+
<PaymentIconsrc={`${ICON_CMD}/weichat-color.svg`}/>
31+
</Weixin>
32+
</PayDesc>
33+
<Buttontype="red"onClick={()=>onPay(num*10.24)}>
34+
资助<MoneyNum>{num*10.24}</MoneyNum>
35+
</Button>
36+
</Wrapper>
37+
)
38+
}
39+
40+
exportdefaultmemo(PaymentFooter)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import{FC,memo}from'react'
2+
3+
// import { ICON_CMD } from '@/config'
4+
import{Wrapper,LoginLabel}from'./styles/unlogin_note'
5+
6+
typeTProps={
7+
onLogin:()=>void
8+
}
9+
10+
constUnLoginNote:FC<TProps>=({ onLogin})=>{
11+
return(
12+
<Wrapper>
13+
下一步操作前, 请先
14+
<LoginLabelonClick={onLogin}>登录</LoginLabel>
15+
你的账号
16+
</Wrapper>
17+
)
18+
}
19+
20+
exportdefaultmemo(UnLoginNote)

‎src/components/BuyMeChuanChuan/UnloginNote.js‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎src/components/BuyMeChuanChuan/index.js‎renamed to ‎src/components/BuyMeChuanChuan/index.tsx‎

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
*
55
*/
66

7-
importReact,{useState}from'react'
8-
importTfrom'prop-types'
7+
import{FC,useState,memo}from'react'
98

109
import{ICON_CMD,GITHUB_CPS_TEAM}from'@/config'
1110
import{buildLog}from'@/utils/logger'
11+
import{useAccount}from'@/stores/init'
1212

1313
importModalfrom'@/components/Modal'
1414
importUserCellfrom'@/components/UserCell'
1515

16-
importUnLoginNotefrom'./UnloginNote'
16+
importUnLoginNotefrom'./UnLoginNote'
1717
importChuanSelectorfrom'./ChuanSelector'
1818
importPaymentFooterfrom'./PaymentFooter'
1919

@@ -34,7 +34,20 @@ import {
3434
/* eslint-disable-next-line */
3535
constlog=buildLog('c:Footer:index')
3636

37-
constBuyMeChuanChuan=({ show, accountInfo, onClose, onLogin, onPay})=>{
37+
typeTProps={
38+
show?:boolean
39+
onClose?:()=>void
40+
onLogin?:()=>void
41+
onPay?:(m:number)=>void
42+
}
43+
44+
constBuyMeChuanChuan:FC<TProps>=({
45+
show=false,
46+
onClose=log,
47+
onLogin=log,
48+
onPay=log,
49+
})=>{
50+
constaccountInfo=useAccount()
3851
const[activeChuan,setActiveChuan]=useState(1)
3952

4053
return(
@@ -66,8 +79,7 @@ const BuyMeChuanChuan = ({ show, accountInfo, onClose, onLogin, onPay }) => {
6679
</SelectTitle>
6780

6881
<SelectDesc>
69-
你的资助将主要用于 coderplanets
70-
网站的开发和维护,使之更加稳定可靠。开源项目的巨大时间和物质成本无法仅靠情怀支撑,望理解。
82+
你的远程投喂将有助于开发团队在饱腹状态下工作, Cheers!
7183
</SelectDesc>
7284

7385
<ChuanSelectoractive={activeChuan}onSelect={setActiveChuan}/>
@@ -81,26 +93,4 @@ const BuyMeChuanChuan = ({ show, accountInfo, onClose, onLogin, onPay }) => {
8193
)
8294
}
8395

84-
BuyMeChuanChuan.propTypes={
85-
// https://www.npmjs.com/package/prop-types
86-
accountInfo:T.shape({
87-
id:T.string,
88-
avatar:T.string,
89-
nickname:T.string,
90-
isLogin:T.bool,
91-
}),
92-
show:T.bool,
93-
onClose:T.func,
94-
onLogin:T.func,
95-
onPay:T.func,
96-
}
97-
98-
BuyMeChuanChuan.defaultProps={
99-
accountInfo:{},
100-
show:false,
101-
onClose:log,
102-
onLogin:log,
103-
onPay:log,
104-
}
105-
106-
exportdefaultReact.memo(BuyMeChuanChuan)
96+
exportdefaultmemo(BuyMeChuanChuan)

‎src/components/BuyMeChuanChuan/styles/chuan_selector.ts‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,27 @@ export const Selectors = styled.div`
3333
${css.flex()};
3434
`
3535
exportconstBy=styled.div`
36+
${css.size(40)};
3637
${css.flex('align-both')};
3738
38-
${css.size(40)};
39-
font-size: 1.6rem;
40-
color:${theme('font')};
41-
margin-left: -10px;
39+
font-size: 30px;
40+
color:${theme('thread.articleDigest')};
41+
margin-left: -20px;
42+
padding-bottom: 8px;
43+
transform: scaleY(0.8);
44+
opacity: 0.9;
4245
`
43-
4446
exportconstCircle=styled.div<TActive>`
45-
${css.flex('align-both')};
4647
${css.circle(38)};
48+
${css.flex('align-both')};
4749
border: 1px solid;
4850
border-color:${theme('font')};
4951
margin-right: 10px;
50-
color:${({ active})=>(active ?'white' :'#51abb2')};
52+
color:${({ active})=>(active ?'white' :theme('thread.articleTitle'))};
5153
background-color:${({ active})=>(active ?theme('font') :'')};
5254
&:hover {
5355
cursor: pointer;
54-
animation:${animate.pulse} 0.4s linear;
56+
animation:${animate.pulse} 0.3s linear;
5557
}
56-
transition: background-color 0.3s ease-out;
58+
transition: background-color 0.2s ease-out;
5759
`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp