公会#邮件

This commit is contained in:
wh_zcy 2022-11-03 11:27:24 +08:00
parent 3d25cbe2ed
commit 0e7e84706e
2 changed files with 41 additions and 9 deletions

View File

@ -32,8 +32,9 @@ type SociatyMineView struct {
flag_apply bool
applyListFun func()
memberListFun func()
sociaty *pb.DBSociaty // 公会
job pb.SociatyJob // 职位
sociaty *pb.DBSociaty // 公会
master *pb.SociatyMemberInfo //公会会长
job pb.SociatyJob // 职位
uid string
flag_memeber bool
flag_log bool
@ -137,6 +138,9 @@ func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
// 活跃度
activityBtn := widget.NewButton("活跃度", this.showActivityWin)
//会长信息
card := widget.NewCard("", "", nil)
defer func() {
this.loadSociaty()
time.Sleep(time.Millisecond * 30) //必须要延迟,否则职位获取不到
@ -144,12 +148,39 @@ func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
// dialog.ShowInformation("提示", "还没有加入任何公会", this.w)
return
}
//会长信息
pName := widget.NewEntry()
pName.Text = this.master.Name
pAvatr := widget.NewEntry()
pAvatr.Text = this.master.Avatar
pLv := widget.NewEntry()
pLv.Text = cast.ToString(this.master.Lv)
pOfftime := widget.NewEntry()
if this.master.OfflineTime != 0 {
t := time.Unix(this.master.OfflineTime, 0)
pOfftime.Text = t.Format("2006/01/02 15:04:05")
} else {
pOfftime.Text = cast.ToString(this.master.OfflineTime)
}
form := widget.NewForm(
widget.NewFormItem("会长", pName),
widget.NewFormItem("头像", pAvatr),
widget.NewFormItem("等级", pLv),
widget.NewFormItem("离线", pOfftime),
)
card.SetContent(form)
card.Refresh()
form.Refresh()
//管理或副会长权限
if this.job == pb.SociatyJob_ADMIN ||
this.job == pb.SociatyJob_VICEPRESIDENT {
btns.Add(applyListBtn)
}
//会长
//会长权限
if this.job == pb.SociatyJob_PRESIDENT {
btns.Add(applyListBtn)
btns.Add(jiesanBtn)
@ -189,7 +220,7 @@ func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
}
this.form.SubmitText = "保存修改"
c := container.NewBorder(btns, nil, nil, nil, this.form)
c := container.NewBorder(btns, card, nil, nil, this.form)
this.dataListener(item)
return c
@ -235,6 +266,7 @@ func (this *SociatyMineView) dataListener(item *entryItem) {
}
this.sociaty = rsp.Sociaty
this.master = rsp.Master
//设置成员职位
for _, m := range rsp.Sociaty.Members {

View File

@ -339,11 +339,11 @@ func (this *ModelSociaty) addMember(uid string, sociaty *pb.DBSociaty) error {
// 发邮件给公会成员
func (this *ModelSociaty) sendMail(receiver []string) error {
if module, err := this.moduleSociaty.service.GetModule(comm.ModuleMail); err == nil {
if mail, ok := module.(comm.Imail); ok {
mail.SendNewMail(&pb.DBMailData{}, receiver...)
}
}
// if module, err := this.moduleSociaty.service.GetModule(comm.ModuleMail); err == nil {
// if mail, ok := module.(comm.Imail); ok {
// mail.SendNewMail(&pb.DBMailData{}, receiver...)
// }
// }
return nil
}