|
|
@@ -45,7 +45,7 @@
|
|
|
<view class="key flex-col justify-center ">
|
|
|
<text>生日</text>
|
|
|
</view>
|
|
|
- <picker class="picker" @change="birthdayChange" mode='date' range-key="label" >
|
|
|
+ <picker class="picker" :end="endDate" @change="birthdayChange" mode='date' range-key="label" >
|
|
|
<view class="flex-row justify-end groupItemContent">
|
|
|
<text>{{userInfo.birthday || '请选择出生日期' }}</text>
|
|
|
<u-icon name="arrow-right" color="#666" size="18"></u-icon>
|
|
|
@@ -98,19 +98,41 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
},
|
|
|
+ onLoad(){
|
|
|
+ // 用户信息
|
|
|
+ this.userInfo = uni.getStorageSync('userInfo')
|
|
|
+
|
|
|
+ if (this.userInfo.selfPhoto){
|
|
|
+ this.getImgUrlByOssId(this.userInfo.selfPhoto)
|
|
|
+ }
|
|
|
+ },
|
|
|
onShow() {
|
|
|
|
|
|
- // 用户信息
|
|
|
- this.userInfo = uni.getStorageSync('userInfo')
|
|
|
-
|
|
|
- if (this.userInfo.selfPhoto){
|
|
|
- this.getImgUrlByOssId(this.userInfo.selfPhoto)
|
|
|
- }
|
|
|
+ this.userInfo.phone = uni.getStorageSync('userInfo').phone
|
|
|
|
|
|
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ endDate() {
|
|
|
+ return this.getDate('end');
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
-
|
|
|
+ getDate(type) {
|
|
|
+ const date = new Date();
|
|
|
+ let year = date.getFullYear();
|
|
|
+ let month = date.getMonth() + 1;
|
|
|
+ let day = date.getDate();
|
|
|
+
|
|
|
+ if (type === 'start') {
|
|
|
+ year = year - 60;
|
|
|
+ } else if (type === 'end') {
|
|
|
+ year = year ;
|
|
|
+ }
|
|
|
+ month = month > 9 ? month : '0' + month;
|
|
|
+ day = day > 9 ? day : '0' + day;
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
+ },
|
|
|
settingTelphone(){
|
|
|
uni.navigateTo({
|
|
|
url:'/myPages/setting/setting-telphone'
|