更新云信和公益咨询相关代码
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { patientDbManager } from "@itcast/basic"
|
||||
|
||||
export class UserUtils {
|
||||
static async getAvatarName(account: string,names:string){
|
||||
let patient =await patientDbManager.getPatientByUuid(account)
|
||||
if(patient!=null)
|
||||
{
|
||||
if(patient.nickname!=null&&patient.nickname!='')
|
||||
{
|
||||
return patient.nickname
|
||||
}
|
||||
if(patient.realName!=null&&patient.realName!='')
|
||||
{
|
||||
return patient.realName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return String(names)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
* found in the LICENSE file.
|
||||
*
|
||||
*/
|
||||
|
||||
import { authStore, BasicConstant, patientDbManager } from '@itcast/basic';
|
||||
@ComponentV2
|
||||
export struct CommonAvatar {
|
||||
/**
|
||||
@@ -29,24 +29,48 @@ export struct CommonAvatar {
|
||||
if (this.item != null) {
|
||||
|
||||
if (this.item.avatarUrl == null || this.item.avatarUrl.toString().length <= 0) {
|
||||
Stack() {
|
||||
Column() {
|
||||
}.width('100%').height('100%').backgroundColor(this.item.color)
|
||||
Image(BasicConstant.urlHtml+authStore.getUser().photo)
|
||||
.onError(() => {
|
||||
if(this.item!=null)
|
||||
{
|
||||
this.item.avatarUrl = $r('app.media.icon_touxiang_persion_new');
|
||||
}
|
||||
|
||||
})
|
||||
.syncLoad(true)
|
||||
.borderRadius(this.roundRadius)
|
||||
.onGestureJudgeBegin(() => {
|
||||
return GestureJudgeResult.CONTINUE;
|
||||
}).parallelGesture(LongPressGesture().onAction(event => {
|
||||
this.longPressGesture?.(event)
|
||||
}
|
||||
))
|
||||
// Stack() {
|
||||
// Column() {
|
||||
// }.width('100%').height('100%').backgroundColor(this.item.color)
|
||||
// .borderRadius(this.roundRadius)
|
||||
//
|
||||
// Text(this.item.name)
|
||||
// .fontSize(this.textSize)
|
||||
// .fontColor(this.textColor)
|
||||
// .ellipsisMode(EllipsisMode.END)
|
||||
// .textAlign(TextAlign.Center)
|
||||
// .margin({
|
||||
// left: 6, right: 6
|
||||
// })
|
||||
// .width('100%')
|
||||
// .maxLines(1)
|
||||
// }.gesture(LongPressGesture().onAction(this.longPressGesture))
|
||||
|
||||
Text(this.item.name)
|
||||
.fontSize(this.textSize)
|
||||
.fontColor(this.textColor)
|
||||
.ellipsisMode(EllipsisMode.END)
|
||||
.textAlign(TextAlign.Center)
|
||||
.margin({
|
||||
left: 6, right: 6
|
||||
})
|
||||
.width('100%')
|
||||
.maxLines(1)
|
||||
}.gesture(LongPressGesture().onAction(this.longPressGesture))
|
||||
} else {
|
||||
Image(this.item.avatarUrl)
|
||||
.onError(() => {
|
||||
if(this.item!=null)
|
||||
{
|
||||
this.item.avatarUrl = $r('app.media.icon_touxiang_persion_new');
|
||||
}
|
||||
|
||||
})
|
||||
.syncLoad(true)
|
||||
.borderRadius(this.roundRadius)
|
||||
.onGestureJudgeBegin(() => {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Reference in New Issue
Block a user