20
This commit is contained in:
@@ -44,37 +44,42 @@
|
||||
return this.isGroup ? defaultGroupIcon : defaultUserIcon;
|
||||
},
|
||||
},
|
||||
watch:{
|
||||
src(nv,ov){
|
||||
this.init(nv);
|
||||
},
|
||||
desc() {
|
||||
//this.redirectShow();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//_this.cachesrc = plus.io.convertAbsoluteFileSystem();
|
||||
const _this = this;
|
||||
if (this.src) {
|
||||
util.cacheFile(util.cdn(this.src),'avatar').then(res=>{
|
||||
_this.avatarText=""
|
||||
_this.cachesrc = res;
|
||||
//_this.cachesrc = plus.io.convertAbsoluteFileSystem(res);
|
||||
//console.log(_this.cachesrc);
|
||||
});
|
||||
return ;
|
||||
}
|
||||
if (this.isGroup) {
|
||||
_this.cachesrc = defaultGroupIcon;
|
||||
return ;
|
||||
}
|
||||
if (this.isNotify) {
|
||||
_this.cachesrc = defaultNotifyIcon;
|
||||
return ;
|
||||
}
|
||||
this.avatarText = this.desc ? this.desc.slice(0, 1) : "未知";
|
||||
return "";
|
||||
this.init(this.src);
|
||||
},
|
||||
methods: {
|
||||
errorHandle() {
|
||||
init(nv){
|
||||
const _this = this;
|
||||
//console.log(nv);
|
||||
if (nv) {
|
||||
util.cacheFile(util.cdn(nv),'avatar').then(res=>{
|
||||
_this.avatarText=""
|
||||
_this.cachesrc = res;
|
||||
//_this.cachesrc = plus.io.convertAbsoluteFileSystem(res);
|
||||
//console.log(_this.cachesrc);
|
||||
});
|
||||
return ;
|
||||
}
|
||||
if (this.isGroup) {
|
||||
_this.cachesrc = defaultGroupIcon;
|
||||
return ;
|
||||
}
|
||||
if (this.isNotify) {
|
||||
_this.cachesrc = defaultNotifyIcon;
|
||||
return ;
|
||||
}
|
||||
this.avatarText = this.desc ? this.desc.slice(0, 1) : "未知";
|
||||
},
|
||||
redirectShow() {
|
||||
if (this.avatarText) {
|
||||
this.avatarText = undefined;
|
||||
}
|
||||
errorHandle() {
|
||||
this.avatarText = this.desc ? this.desc.slice(0, 1) : "未知";
|
||||
},
|
||||
click() {
|
||||
this.$emit("click");
|
||||
@@ -82,16 +87,7 @@
|
||||
longpress() {
|
||||
this.$emit("longpress");
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
src(nv,ov) {
|
||||
this.redirectShow();
|
||||
},
|
||||
desc() {
|
||||
this.redirectShow();
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user