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