Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟
cust-app
Commits
112cb462
Commit
112cb462
authored
Jan 17, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了bug
parent
16c1070c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
List.vue
pages/components/article/List.vue
+29
-10
No files found.
pages/components/article/List.vue
View file @
112cb462
...
...
@@ -37,7 +37,7 @@
import
ItemVue
from
'./Item.vue'
;
import
empty
from
'@/components/empty.vue'
;
import
{
topicList
}
from
"../../../api/topic"
;
import
{
articleList
,
like
}
from
"../../../api/article"
;
import
{
articleList
,
getOssUrl
,
like
}
from
"../../../api/article"
;
import
{
getCity
,
getValue
}
from
"../../../common/options"
;
import
{
calculateAge
,
parseDate
}
from
"../../../common"
;
export
default
{
...
...
@@ -141,22 +141,41 @@
const
list
=
res
.
data
.
data
list
.
forEach
(
item
=>
{
//处理头像
if
(
item
.
memAvatar
!=
null
){
item
.
memAvatar
=
item
.
memAvatar
.
replace
(
/
\\
/g
,
'/'
)
if
(
item
.
avatarId
!==
null
){
getOssUrl
(
item
.
avatarId
).
then
(
res
=>
{
//必须要用单独的变量接 不然会有bug
item
.
memAvatar
=
res
.
data
.
data
})
}
//处理动态照片
if
(
item
.
url
!=
null
){
item
.
url
=
item
.
url
.
replace
(
/
\\
/g
,
'/'
).
split
(
','
)
if
(
item
.
pictureId
!=
null
){
const
urlArray
=
JSON
.
parse
(
item
.
pictureId
)
let
arr
=
[]
urlArray
.
id
.
forEach
(
item
=>
{
getOssUrl
(
item
).
then
(
res
=>
{
//必须要用单独的变量接 不然会有bug
arr
.
push
(
res
.
data
.
data
)
})
})
item
.
url
=
arr
}
//处理性别
item
.
memSex
=
getValue
(
'sex'
,
item
.
memSex
)
if
(
item
.
memSex
!=
null
&&
item
.
memSex
!==
''
){
item
.
memSex
=
getValue
(
'sex'
,
item
.
memSex
)
}
//通过生日计算年龄
const
dataItem
=
parseDate
(
item
.
memBirthday
)
item
.
memAge
=
calculateAge
(
dataItem
.
year
,
dataItem
.
month
,
dataItem
.
day
)
if
(
item
.
memBirthday
!=
null
&&
item
.
memBirthday
!==
''
){
const
dataItem
=
parseDate
(
item
.
memBirthday
)
item
.
memAge
=
calculateAge
(
dataItem
.
year
,
dataItem
.
month
,
dataItem
.
day
)
}
//处理地址
item
.
city
=
getCity
(
item
.
memResidenceProvince
,
item
.
memResidenceCity
)
if
(
item
.
memResidenceProvince
!=
null
&&
item
.
memResidenceProvince
!==
''
&&
item
.
memResidenceCity
!=
null
&&
item
.
memResidenceCity
!==
''
){
item
.
city
=
getCity
(
item
.
memResidenceProvince
,
item
.
memResidenceCity
)
}
//处理教育经历
item
.
memMaxEducation
=
getValue
(
'education'
,
item
.
memMaxEducation
)
if
(
item
.
memMaxEducation
!=
null
&&
item
.
memMaxEducation
!==
''
){
item
.
memMaxEducation
=
getValue
(
'education'
,
item
.
memMaxEducation
)
}
})
this
.
$refs
.
paging
.
complete
(
list
);
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment