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.

Commita83f1b5

Browse files
committed
Merge branch 'pages' into dev
2 parentsf23d526 +2a69fe4 commita83f1b5

File tree

7 files changed

+92
-83
lines changed

7 files changed

+92
-83
lines changed

‎containers/UserBanner/logic.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ const ErrSolver = []
3232

3333
exportfunctioninit(_store){
3434
if(store){
35-
returnloadUser()
35+
returnfalse
36+
// return loadUser()
3637
}
3738
store=_store
3839

3940
debug(store)
4041
if(sub$)sub$.unsubscribe()
4142
sub$=sr71$.data().subscribe($solver(DataSolver,ErrSolver))
42-
loadUser()
43+
//loadUser()
4344
}

‎containers/UserBanner/schema.js‎

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,8 @@
1-
importgqlfrom'graphql-tag'
1+
// import gql from 'graphql-tag'
2+
import{P}from'../schemas'
23

3-
constuserRaw=`
4-
query user($id: ID!, $userHasLogin: Boolean!) {
5-
user(id: $id) {
6-
id
7-
nickname
8-
avatar
9-
bio
10-
sex
11-
location
12-
qq
13-
weibo
14-
weichat
15-
github
16-
zhihu
17-
douban
18-
twitter
19-
facebook
20-
dribble
21-
instagram
22-
pinterest
23-
huaban
24-
followersCount
25-
followingsCount
26-
27-
viewerHasFollowed @include(if: $userHasLogin)
28-
29-
achievement {
30-
reputation
31-
contentsStaredCount
32-
contentsFavoritedCount
33-
sourceContribute {
34-
web
35-
server
36-
}
37-
}
38-
39-
workBackgrounds {
40-
company
41-
title
42-
}
43-
educationBackgrounds {
44-
school
45-
major
46-
}
47-
fromGithub
48-
githubProfile {
49-
htmlUrl
50-
login
51-
}
52-
contributes {
53-
records {
54-
count
55-
date
56-
}
57-
startDate
58-
endDate
59-
totalCount
60-
}
61-
62-
editableCommunities {
63-
entries {
64-
id
65-
logo
66-
title
67-
raw
68-
}
69-
totalCount
70-
}
71-
insertedAt
72-
}
73-
}
74-
`
75-
76-
constuser=gql`
77-
${userRaw}
78-
`
794
constschema={
80-
user,
81-
userRaw,
5+
user:P.user,
826
}
837

848
exportdefaultschema

‎containers/UserContent/DigestBoard.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ const DigestBoard = ({ user, accountId }) => (
4545
<TimeAgodatetime={user.insertedAt}locale="zh_CN"/>
4646
</AttactWrapper>
4747

48+
<AttactWrapper>
49+
<AttactIconsrc={`${ICON_CMD}/user_been_views.svg`}/>
50+
主页被浏览{user.views}
51+
</AttactWrapper>
52+
4853
{anyTrue(user.achievement.sourceContribute) ?(
4954
<SourceContributeInfodata={user.achievement.sourceContribute}/>
5055
) :null}

‎containers/schemas/pages/index.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
importFfrom'../fragments'
2+
23
import{pagedPosts,post}from'./post'
34
import{pagedJobs,job}from'./job'
45
import{pagedVideos,video}from'./video'
56
import{pagedRepos,repo}from'./repo'
7+
import{user}from'./user'
68

79
constP={
810
community:`
@@ -39,6 +41,8 @@ const P = {
3941
// repo
4042
pagedRepos,
4143
repo,
44+
// user
45+
user,
4246
}
4347

4448
exportdefaultP

‎containers/schemas/pages/user.js‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
importFfrom'../fragments'
2+
3+
exportconstuser=`
4+
query user($id: ID!, $userHasLogin: Boolean!) {
5+
user(id: $id) {
6+
${F.author}
7+
views
8+
bio
9+
sex
10+
location
11+
qq
12+
weibo
13+
weichat
14+
github
15+
zhihu
16+
douban
17+
twitter
18+
facebook
19+
dribble
20+
instagram
21+
pinterest
22+
huaban
23+
followersCount
24+
followingsCount
25+
26+
viewerHasFollowed @include(if: $userHasLogin)
27+
28+
achievement {
29+
reputation
30+
contentsStaredCount
31+
contentsFavoritedCount
32+
sourceContribute {
33+
web
34+
server
35+
}
36+
}
37+
38+
workBackgrounds {
39+
company
40+
title
41+
}
42+
educationBackgrounds {
43+
school
44+
major
45+
}
46+
fromGithub
47+
githubProfile {
48+
htmlUrl
49+
login
50+
}
51+
contributes {
52+
records {
53+
count
54+
date
55+
}
56+
startDate
57+
endDate
58+
totalCount
59+
}
60+
61+
editableCommunities {
62+
entries {
63+
${F.community}
64+
}
65+
totalCount
66+
}
67+
insertedAt
68+
}
69+
}
70+
`
71+
72+
exportconstholder=1

‎pages/user.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { Provider } from 'mobx-react'
77
importinitRootStorefrom'../stores/init'
88
import{GAWraper}from'../components'
99

10-
importUserBannerSchemafrom'../containers/UserBanner/schema'
10+
// import UserBannerSchema from '../containers/UserBanner/schema'
11+
import{P}from'../containers/schemas'
12+
1113
import{
1214
ThemeWrapper,
1315
MultiLanguage,
@@ -48,7 +50,7 @@ async function fetchData(props) {
4850
/* console.log('user page props: ', props) */
4951
constuserId=getSubPath(props)
5052
constuser=gqClient
51-
.request(UserBannerSchema.userRaw,{
53+
.request(P.user,{
5254
id:userId,
5355
userHasLogin:nilOrEmpty(token)===false,
5456
})

‎stores/SharedModel/User.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export const User = t.model('User', {
6262
nickname:t.maybeNull(t.string),
6363
bio:t.maybeNull(t.string),
6464
avatar:t.maybeNull(t.string),
65+
views:t.optional(t.number,0),
6566
email:t.maybeNull(t.string),
6667
location:t.maybeNull(t.string),
6768
geoCity:t.maybeNull(t.string),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp