Commit 83eb0dae authored by liwei's avatar liwei

用户详情增加了条件判断

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