Commit 83eb0dae authored by liwei's avatar liwei

用户详情增加了条件判断

parent 81ed5d2f
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
//查看会员详情 //查看会员详情
gotoUserDetail(item){ gotoUserDetail(item){
uni.navigateTo({ uni.navigateTo({
url: '/pagesUser/userInfo?id='+item.businessId url: '/pagesUser/userInfo?memberId='+item.businessId
}) })
}, },
//左上角的搜索 //左上角的搜索
......
...@@ -116,22 +116,30 @@ export default { ...@@ -116,22 +116,30 @@ export default {
const list = res.data.data const list = res.data.data
list.forEach(item => { list.forEach(item => {
//处理头像 //处理头像
if (item.memAvatar != null){ if (item.memAvatar !== null && item.memAvatar !== ''){
item.memAvatar = item.memAvatar.replace(/\\/g, '/') item.memAvatar = item.memAvatar.replace(/\\/g, '/')
} }
//处理动态照片 //处理动态照片
if (item.url != null){ if (item.url !== null && item.url !== ''){
item.url = item.url.replace(/\\/g, '/').split(',') item.url = item.url.replace(/\\/g, '/').split(',')
} }
//处理性别 //处理性别
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);
}) })
......
...@@ -342,30 +342,48 @@ ...@@ -342,30 +342,48 @@
//获取用户详情 //获取用户详情
getUserDetail(){ getUserDetail(){
userDetail(this.memberId).then(res => { userDetail(this.memberId).then(res => {
if (res.data.data !== null && res.data.data !== ''){
this.userData = res.data.data this.userData = res.data.data
this.userId = this.userData.userId this.userId = this.userData.userId
//处理头像 //处理头像
if (res.data.data.avatarUrl !== '' && res.data.data.avatarUrl !== null){
this.imgList.push(res.data.data.avatarUrl.replace(/\\/g, '/')) this.imgList.push(res.data.data.avatarUrl.replace(/\\/g, '/'))
}
//处理星座 //处理星座
if (res.data.data.memConstellation !== '' && res.data.data.memConstellation !== null){
this.userData.memConstellation = getValue('constellation',res.data.data.memConstellation) this.userData.memConstellation = getValue('constellation',res.data.data.memConstellation)
}
//通过生日计算年龄 //通过生日计算年龄
if (res.data.data.memBirthday !== '' && res.data.data.memBirthday !== null){
const dataItem = parseDate(res.data.data.memBirthday) const dataItem = parseDate(res.data.data.memBirthday)
this.userData.memAge = calculateAge(dataItem.year,dataItem.month,dataItem.day) this.userData.memAge = calculateAge(dataItem.year,dataItem.month,dataItem.day)
}
//处理学历 //处理学历
if (res.data.data.memMaxEducation !== '' && res.data.data.memMaxEducation !== null){
this.userData.memMaxEducation = getValue('education',res.data.data.memMaxEducation) this.userData.memMaxEducation = getValue('education',res.data.data.memMaxEducation)
}
//处理性别 //处理性别
if (res.data.data.memSex !== '' && res.data.data.memSex !== null){
this.userData.memSex = getValue('sex',res.data.data.memSex) this.userData.memSex = getValue('sex',res.data.data.memSex)
}
//处理实名 //处理实名
if (res.data.data.memRealAuthen !== '' && res.data.data.memRealAuthen !== null){
this.userData.memRealAuthen = getValue('realAuthen',res.data.data.memRealAuthen) this.userData.memRealAuthen = getValue('realAuthen',res.data.data.memRealAuthen)
}
//处理动态 //处理动态
if (res.data.data.articleContent !== '' && res.data.data.articleContent !== null){
this.userData.articleContent = '我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼' this.userData.articleContent = '我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼我喜欢吃鱼'
this.userData.articleImg = [ this.userData.articleImg = [
'http://192.168.1.7/upload/CmsActivity/20241230/E3994EF11C524D48AD88D383A2B5786B.jpg', 'http://192.168.1.7/upload/CmsActivity/20241230/E3994EF11C524D48AD88D383A2B5786B.jpg',
'http://192.168.1.7/upload/CmsBanner/20241230/18E63B570FF04DB3A8EFE277D58256C4.jpg', 'http://192.168.1.7/upload/CmsBanner/20241230/18E63B570FF04DB3A8EFE277D58256C4.jpg',
'http://192.168.1.7/upload/CmsBanner/20241230/18E63B570FF04DB3A8EFE277D58256C4.jpg' 'http://192.168.1.7/upload/CmsBanner/20241230/18E63B570FF04DB3A8EFE277D58256C4.jpg'
] ]
}
//处理地址 //处理地址
if (res.data.data.memResidenceProvince !== '' && res.data.data.memResidenceProvince !== null && res.data.data.memResidenceCity !== '' && res.data.data.memResidenceCity !== null){
this.userData.city = getCity(res.data.data.memResidenceProvince,res.data.data.memResidenceCity) this.userData.city = getCity(res.data.data.memResidenceProvince,res.data.data.memResidenceCity)
}
}
}) })
}, },
confirm() { confirm() {
......
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