|
|
|
@ -1,5 +1,17 @@
|
|
|
|
|
<template> |
|
|
|
|
<view class="personal-data"> |
|
|
|
|
<view class="header"> |
|
|
|
|
<cu-custom :isBack="true" :isCenter="true"> |
|
|
|
|
<block slot="backText"> |
|
|
|
|
<view class="backImg"> |
|
|
|
|
<image src="@/static/images/back-btn.png" mode=""></image> |
|
|
|
|
</view> |
|
|
|
|
</block> |
|
|
|
|
<block slot="content"> |
|
|
|
|
<view class="tab-title">个人资料</view> |
|
|
|
|
</block> |
|
|
|
|
</cu-custom> |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="wrapper"> --> |
|
|
|
|
<view class="wrapList acea-row row-between-wrapper"> |
|
|
|
|
<!-- <view class="item acea-row row-between-wrapper on"> --> |
|
|
|
@ -42,12 +54,11 @@
|
|
|
|
|
<view class="item acea-row row-between-wrapper"> |
|
|
|
|
<view>生日</view> |
|
|
|
|
<view class="input"> |
|
|
|
|
<picker mode="date" :value="birth" @change="bindDateChange"> |
|
|
|
|
<view v-if="!birth" class="empty">点击完善生日</view> |
|
|
|
|
<view v-else> |
|
|
|
|
{{birth}} |
|
|
|
|
</view> |
|
|
|
|
<picker v-if="!userInfo.birthday" mode="date" :value="birthday" @change="bindDateChange"> |
|
|
|
|
<view v-if="!birthday" class="empty">点击完善生日</view> |
|
|
|
|
<view v-else>{{birthday}}</view> |
|
|
|
|
</picker> |
|
|
|
|
<view v-else>{{birthday}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item acea-row row-between-wrapper"> |
|
|
|
@ -109,12 +120,13 @@
|
|
|
|
|
currentAccounts: 0, |
|
|
|
|
switchUserInfo: [], |
|
|
|
|
userIndex: 0, |
|
|
|
|
birth: '', |
|
|
|
|
birthday: '', |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: mapGetters(["userInfo"]), |
|
|
|
|
mounted: function() { |
|
|
|
|
this.avatar = this.userInfo.avatar; |
|
|
|
|
this.birthday = this.userInfo.birthday; |
|
|
|
|
this.isWeixin = isWeixin(); |
|
|
|
|
// this.getUserInfo(); |
|
|
|
|
}, |
|
|
|
@ -239,7 +251,7 @@
|
|
|
|
|
}, |
|
|
|
|
bindDateChange(e) { |
|
|
|
|
console.log(e) |
|
|
|
|
this.birth = e.detail.value; |
|
|
|
|
this.birthday = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
// 绑定微信用户手机号 |
|
|
|
|
phoneLogin(e) { |
|
|
|
@ -248,7 +260,6 @@
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '绑定中', |
|
|
|
|
}) |
|
|
|
|
// this.wxappBindPhone(e, e.mp.detail.code) |
|
|
|
|
uni.login({ |
|
|
|
|
success: (loginRes) => { |
|
|
|
|
wxappBindingPhone({ |
|
|
|
@ -288,14 +299,10 @@
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
wxappBindPhone(e, code) { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
submit: function() { |
|
|
|
|
|
|
|
|
|
let userInfo = this.userInfo; |
|
|
|
|
console.log(userInfo, '=============='); |
|
|
|
|
// console.log(userInfo, '=============='); |
|
|
|
|
let data = { |
|
|
|
|
nickname: '', |
|
|
|
|
avatar: '' |
|
|
|
@ -306,6 +313,10 @@
|
|
|
|
|
if (this.avatar) { |
|
|
|
|
data.avatar = this.avatar; |
|
|
|
|
} |
|
|
|
|
if(this.birthday) { |
|
|
|
|
data.birthday = this.birthday; |
|
|
|
|
} |
|
|
|
|
if (!this.userInfo.nickname && !this.avatar && !this.birthday) return |
|
|
|
|
postUserEdit(data).then( |
|
|
|
|
(res) => { |
|
|
|
|
this.$store.dispatch("userInfo", true); |
|
|
|
@ -353,6 +364,25 @@
|
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
<style lang="less" scoped> |
|
|
|
|
.header { |
|
|
|
|
.tab-title { |
|
|
|
|
font-size: 32rpx; |
|
|
|
|
font-family: PingFang SC; |
|
|
|
|
font-weight: 600; |
|
|
|
|
color: #2DB5AE; |
|
|
|
|
line-height: 42rpx; |
|
|
|
|
} |
|
|
|
|
.backImg { |
|
|
|
|
width: 88rpx; |
|
|
|
|
height: 62rpx; |
|
|
|
|
padding-left: 26rpx; |
|
|
|
|
image { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.wrapList { |
|
|
|
|
padding: 20rpx 32rpx 32rpx; |
|
|
|
|
|
|
|
|
@ -429,4 +459,4 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
</style> |
|
|
|
|