Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
沈志敏
9 years ago
Commit
f0fbb1fd7014d107d2bde6624768420d832f1d2a
1 parent
924a1905
fix bug
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
public/vue/me/home.vue
public/vue/me/mydetails.vue
public/vue/me/home.vue
View file @
f0fbb1f
...
...
@@ -4,7 +4,7 @@
</cheader>
<div class="my-header">
<a class="user-info auth" id="user-info" href='/me/mydetails'>
<
span class="user-avatar" :style="data.headIco ? 'background-image: url(' + data.headIco + ')' : ''"></span
>
<
img class="user-avatar" :src="headIco" @error="imgerror"
>
</a>
<span class="username">{{ data.nickName }}</span>
</div>
...
...
@@ -81,13 +81,18 @@
module.exports = {
data() {
return {
data: {}
data: {},
headIco: ''
};
},
components: {
cheader
},
methods: {
imgerror() {
// 图片报错时,给个默认透明图片
this.headIco = 'data:image/png;base64,R0lGODlhFAAUAIAAAP///wAAACH5BAEAAAAALAAAAAAUABQAAAIRhI+py+0Po5y02ouz3rz7rxUAOw==';
},
reload() {
$('#address').off('click', this.addressClick);
$('.auth').off('click', this.authClick);
...
...
@@ -99,8 +104,7 @@
}).then(result => {
this.data = result || {};
if (this.data.headIco) {
// 头像ico的域名 有可能没有购买证书,只能使用http
this.data.headIco = 'http:' + this.data.headIco;
this.headIco = this.data.headIco;
}
});
...
...
public/vue/me/mydetails.vue
View file @
f0fbb1f
...
...
@@ -3,7 +3,7 @@
<li>
<label @click="setAvatar">头像
<span class="details-icon">
<
span class="head-portrait user-avatar" :style='icoStyle'></span
>
<
img class="head-portrait user-avatar" :src="head_ico" @error="imgerror"
>
<span class="icon icon-right"></span>
</span>
</label>
...
...
@@ -46,8 +46,7 @@
props: ['head_ico', 'nickname', 'gender', 'birthday'],
data() {
return {
currentval: this.nickname,
icoStyle: this.head_ico ? 'background-image:url(' + this.head_ico + ');' : ''
currentval: this.nickname
};
},
computed: {
...
...
@@ -58,6 +57,10 @@
}
},
methods: {
imgerror: function() {
// 图片报错时,给个默认透明图片
this.head_ico = 'data:image/png;base64,R0lGODlhFAAUAIAAAP///wAAACH5BAEAAAAALAAAAAAUABQAAAIRhI+py+0Po5y02ouz3rz7rxUAOw==';
},
setAvatar: function() {
yoho.goSetAvatar();
},
...
...
Please
register
or
login
to post a comment