@@ -59,15 +59,32 @@ Page({ | |||
} | |||
}).then(res => { | |||
console.log(res, 'res') | |||
let avatarUrl = null | |||
if (res.data.avatarUrl) { | |||
avatarUrl = res.data.avatarUrl | |||
} else { | |||
avatarUrl = defaultAvatarUrl | |||
} | |||
let gender = null | |||
if (1 * res.data.sex) { | |||
gender = res.data.sex - 1 | |||
} else { | |||
gender = res.data.sex | |||
} | |||
let adress = null | |||
if (res.data.address) { | |||
adress = JSON.parse(res.data.address) | |||
} | |||
this.setData({ | |||
avatarUrl: res.data.avatarUrl, | |||
avatarUrl: avatarUrl, | |||
nickName: res.data.nickName, | |||
username: res.data.name, | |||
gender: res.data.sex, | |||
gender: gender, | |||
sexFlag: 2, | |||
date: util.fmtDate(parseInt(res.data.birthdate)), | |||
dateFlag: res.data.birthdate ? 2 : 1, | |||
@@ -136,7 +153,7 @@ Page({ | |||
avatarUrl: that.data.avatarUrl, | |||
nickName: e.detail.value.nickname, | |||
name: e.detail.value.username, | |||
sex: that.data.gender, | |||
sex: 1 * that.data.gender + 1, | |||
birthdate: birthdate, | |||
height: e.detail.value.height ? e.detail.value.height : that.data.height, | |||
weight: e.detail.value.weight ? e.detail.value.weight : that.data.weight, | |||
@@ -162,14 +179,13 @@ Page({ | |||
}).then(res => { | |||
if (res.code == 200) { | |||
wx.showToast({ | |||
title: "信息提交成功,将在3分钟内生效", | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
title: "信息提交成功", | |||
icon: 'success', | |||
duration: 1500, | |||
}) | |||
setTimeout(() => { | |||
wx.navigateBack() | |||
}, 2000) | |||
}, 1500) | |||
} | |||
}).catch(err => { | |||
console.log(err); | |||
@@ -237,9 +253,9 @@ Page({ | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage() { | |||
// onShareAppMessage() { | |||
}, | |||
// }, | |||
onChooseAvatar(e) { | |||
const that = this | |||
@@ -255,6 +271,7 @@ Page({ | |||
that.setData({ | |||
avatarUrl: JSON.parse(res.data).data.url | |||
}) | |||
console.log(that.data.avatarUrl); | |||
} | |||
}) | |||
@@ -1,5 +1,5 @@ | |||
<view> | |||
<navbar home back color="{{typeLsit.sy_top_f.styleClass}}" background="{{typeLsit.sy_top.styleClass}}" text="头像和昵称"></navbar> | |||
<navbar home back color="{{typeLsit.sy_top_f.styleClass}}" background="{{typeLsit.sy_top.styleClass}}" text="个人信息"></navbar> | |||
<view style="height:{{navigationBarHeight}} "></view> | |||
<view class="container"> | |||
<view class="avatar"> | |||
@@ -97,6 +97,7 @@ | |||
</view> | |||
<button class="submit" type="primary" form-type='submit'>确定</button> | |||
<!-- <button class="submit" type="primary" bindtap="test">测试</button> --> | |||
</form> | |||
</view> | |||
</view> |
@@ -61,6 +61,9 @@ | |||
text-align: right; | |||
padding-left: 20rpx; | |||
width: 400rpx; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
} | |||
.greyFont { | |||
@@ -15,8 +15,8 @@ | |||
<view class='infoLeft' style="{{typeLsit.sy_xxb.styleClass}}"> | |||
<view class="user-avatar1"> | |||
<!-- <open-data class="open" type="userAvatarUrl"></open-data> --> | |||
<image wx:if="{{userAvatarUrl!=''}}" class="userAvatarUrl" bindtap="goSetAvatar" src="{{userAvatarUrl}}"></image> | |||
<image wx:if="{{userAvatarUrl==''}}" class="userAvatarUrl" src="../../../assets/images/default.png"></image> | |||
<image wx:if="{{userAvatarUrl}}" class="userAvatarUrl" bindtap="goSetAvatar" src="{{userAvatarUrl }}"></image> | |||
<image wx:else class="userAvatarUrl" bindtap="goSetAvatar" src="https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0"></image> | |||
</view> | |||
<!-- 成长值--> | |||
<view class="user-data1 fl" style="{{typeLsit.sy_xxb.styleClass}}"> | |||
@@ -3,11 +3,13 @@ | |||
page { | |||
background: #f4f5f9; | |||
} | |||
.temp{ | |||
.temp { | |||
width: 100rpx; | |||
height: 100rpx; | |||
background-color: darkcyan | |||
} | |||
.xia { | |||
width: 24rpx; | |||
height: 14rpx; | |||
@@ -18,7 +20,7 @@ page { | |||
left: 0; | |||
right: 0; | |||
bottom: 0; | |||
/* margin: auto; */ | |||
} | |||
@@ -26,21 +28,22 @@ page { | |||
display: flex; | |||
justify-content: space-around; | |||
} | |||
.goSqunar1 { | |||
display: flex; | |||
justify-content: center; | |||
} | |||
.title { | |||
font-size: 32rpx; | |||
font-family: OPPOSans; | |||
font-weight: bold; | |||
} | |||
.title1 { | |||
max-width:320rpx; | |||
max-width: 320rpx; | |||
font-size: 32rpx; | |||
font-family: OPPOSans; | |||
font-weight: bold; | |||
@@ -53,9 +56,9 @@ page { | |||
width: 24rpx; | |||
/* height: 15rpx; */ | |||
} | |||
.marketName{ | |||
} | |||
.marketName {} | |||
.f { | |||
float: left; | |||
} | |||
@@ -75,6 +78,7 @@ page { | |||
line-height: 26rpx; | |||
font-size: 24rpx; | |||
padding: 4rpx 10rpx; | |||
margin-left: 20rpx; | |||
} | |||
.integralNum { | |||
@@ -95,7 +99,8 @@ page { | |||
} | |||
.color_box { | |||
/* padding-top: 20rpx; *//* background-image: linear-gradient(#DC143C, #F4F5F9); */ | |||
/* padding-top: 20rpx; */ | |||
/* background-image: linear-gradient(#DC143C, #F4F5F9); */ | |||
background-color: #f4f5f9; | |||
} | |||
@@ -209,18 +214,20 @@ page { | |||
padding: 0 38rpx; | |||
} | |||
.section >view, .sellsection>view { | |||
.section>view, | |||
.sellsection>view { | |||
width: 25%; | |||
display: inline-block; | |||
position: relative; | |||
} | |||
.section >view image, .sellsection>view image { | |||
.section>view image, | |||
.sellsection>view image { | |||
display: block; | |||
margin: 0 auto; | |||
} | |||
.section >view image { | |||
.section>view image { | |||
width: 55rpx; | |||
height: 55rpx; | |||
margin-top: 20rpx; | |||
@@ -360,12 +367,14 @@ page { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.noAccredit{ | |||
text-align: center; | |||
height: 80rpx; | |||
font-size: 20rpx; | |||
background-color: rgba(0, 0, 0, 0.3) | |||
.noAccredit { | |||
text-align: center; | |||
height: 80rpx; | |||
font-size: 20rpx; | |||
background-color: rgba(0, 0, 0, 0.3) | |||
} | |||
.user-data { | |||
letter-spacing: 0.64rpx; | |||
line-height: 46rpx; | |||
@@ -828,4 +837,4 @@ i-tabs i-tabs-scroll { | |||
right: 20rpx; | |||
position: fixed; | |||
z-index: 1000000; | |||
} | |||
} |