Commit 112cb462 authored by liwei's avatar liwei

修改了bug

parent 16c1070c
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
import ItemVue from './Item.vue'; import ItemVue from './Item.vue';
import empty from '@/components/empty.vue'; import empty from '@/components/empty.vue';
import {topicList} from "../../../api/topic"; 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 {getCity, getValue} from "../../../common/options";
import {calculateAge, parseDate} from "../../../common"; import {calculateAge, parseDate} from "../../../common";
export default { export default {
...@@ -141,22 +141,41 @@ ...@@ -141,22 +141,41 @@
const list = res.data.data const list = res.data.data
list.forEach(item => { list.forEach(item => {
//处理头像 //处理头像
if (item.memAvatar != null){ if (item.avatarId !== null){
item.memAvatar = item.memAvatar.replace(/\\/g, '/') getOssUrl(item.avatarId).then(res => {
//必须要用单独的变量接 不然会有bug
item.memAvatar = res.data.data
})
} }
//处理动态照片 //处理动态照片
if (item.url != null){ if (item.pictureId != null){
item.url = item.url.replace(/\\/g, '/').split(',') 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
} }
//处理性别 //处理性别
if (item.memSex != null && item.memSex !== ''){
item.memSex = getValue('sex',item.memSex) item.memSex = getValue('sex',item.memSex)
}
//通过生日计算年龄 //通过生日计算年龄
if (item.memBirthday != null && item.memBirthday !== ''){
const dataItem = parseDate(item.memBirthday) const dataItem = parseDate(item.memBirthday)
item.memAge = calculateAge(dataItem.year,dataItem.month,dataItem.day) item.memAge = calculateAge(dataItem.year,dataItem.month,dataItem.day)
}
//处理地址 //处理地址
if (item.memResidenceProvince != null && item.memResidenceProvince !== '' && item.memResidenceCity != null && item.memResidenceCity !== ''){
item.city = getCity(item.memResidenceProvince,item.memResidenceCity) item.city = getCity(item.memResidenceProvince,item.memResidenceCity)
}
//处理教育经历 //处理教育经历
if (item.memMaxEducation != null && item.memMaxEducation !== ''){
item.memMaxEducation = getValue('education',item.memMaxEducation) item.memMaxEducation = getValue('education',item.memMaxEducation)
}
}) })
this.$refs.paging.complete(list); this.$refs.paging.complete(list);
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment