This commit is contained in:
cansnow
2026-01-09 09:15:59 +08:00
parent 78386d4cc1
commit 7913a63a39
51 changed files with 1048 additions and 449 deletions
+32 -36
View File
@@ -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>