Showing
1 changed file
with
15 additions
and
6 deletions
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <!-- 公共组件-每个页面必须引入 --> |
4 | 4 | <public-module></public-module> |
5 | 5 | <view @click="upAvatar" class="u-flex set-main"> |
6 | - <view class="main-image"><image class="image" :src="avatar || '/static/logo.png'"></image></view> | |
6 | + <view class="main-image"><image class="image" :src="avatar || '../../static/logo.png'"></image></view> | |
7 | 7 | <view class="main-right-image"><image class="image" src="../../static/arrow-right.png"></image></view> |
8 | 8 | </view> |
9 | 9 | <view class="u-m-t-20 basic-text"><text class="text">基本资料</text></view> |
... | ... | @@ -46,8 +46,12 @@ |
46 | 46 | </u--form> |
47 | 47 | </view> |
48 | 48 | <view class="basic-bottom u-flex"> |
49 | - <view class="item" v-if="info.data.isToken"><button class="submit" size="default" @click="clearAccountFunc" :style="{ background: InfoColor }">解绑</button></view> | |
50 | - <view class="item" style="margin-right: 60rpx;"><button class="submit" size="default" @click="onSubmitFunc" :style="{ background: PrimaryColor }">确认</button></view> | |
49 | + <view class="item" v-if="info.data.isThirdLogin"> | |
50 | + <button class="submit" size="default" @click="clearAccountFunc" :style="{ background: InfoColor }"><text class="un-bind-text">解绑</text></button> | |
51 | + </view> | |
52 | + <view class="item" style="margin-right: 60rpx;" :style="[{ position: info.data.isThirdLogin ? '' : 'relative' }, { right: info.data.isThirdLogin ? '' : '-158rpx' }]"> | |
53 | + <button class="submit" size="default" @click="onSubmitFunc" :style="{ background: PrimaryColor }"><text class="un-bind-text">确认</text></button> | |
54 | + </view> | |
51 | 55 | </view> |
52 | 56 | <!-- #ifdef MP --> |
53 | 57 | <view class="u-m-t-40"><text style="visibility: hidden;">#</text></view> |
... | ... | @@ -67,12 +71,14 @@ |
67 | 71 | </template> |
68 | 72 | |
69 | 73 | <script> |
74 | +import { mapMutations } from 'vuex'; | |
75 | + | |
70 | 76 | export default { |
71 | 77 | data() { |
72 | 78 | return { |
73 | 79 | showBind: false, |
74 | 80 | PrimaryColor: '#377DFF', //主题色 |
75 | - InfoColor: '#E3E4E5', //主题色 | |
81 | + InfoColor: '#00C9A7', //主题色 | |
76 | 82 | myInfoModel: { |
77 | 83 | userInfo: { |
78 | 84 | realName: '', |
... | ... | @@ -87,7 +93,8 @@ export default { |
87 | 93 | avatar: '', |
88 | 94 | id: '', |
89 | 95 | info: {}, |
90 | - openIds: '' | |
96 | + openIds: '', | |
97 | + isUpdatePersonOrLoginInfo: false | |
91 | 98 | }; |
92 | 99 | }, |
93 | 100 | onLoad(e) { |
... | ... | @@ -99,7 +106,7 @@ export default { |
99 | 106 | this.myInfoModel.userInfo.username = params.data.username; |
100 | 107 | this.myInfoModel.userInfo.email = params.data.email; |
101 | 108 | this.myInfoModel.userInfo.accountExpireTime = params.data.accountExpireTime; |
102 | - this.avatar = params.data.avatar == undefined ? '../../static/avatar-test.png' : params.data.avatar; | |
109 | + this.avatar = params.data.avatar == undefined ? '../../static/logo.png' : params.data.avatar; | |
103 | 110 | this.id = params.data.userId; |
104 | 111 | } |
105 | 112 | }, |
... | ... | @@ -110,6 +117,7 @@ export default { |
110 | 117 | } |
111 | 118 | }, |
112 | 119 | methods: { |
120 | + ...mapMutations(['setUserInfo']), | |
113 | 121 | confrimBind(e) { |
114 | 122 | if (e) { |
115 | 123 | //解绑 |
... | ... | @@ -192,6 +200,7 @@ export default { |
192 | 200 | .put('/yt/user/center', httpData) |
193 | 201 | .then(res => { |
194 | 202 | if (res) { |
203 | + this.setUserInfo(res); | |
195 | 204 | uni.showToast({ |
196 | 205 | title: '更新个人资料成功~', |
197 | 206 | icon: 'none' | ... | ... |