弹劾倒计时读配置
This commit is contained in:
parent
06021546df
commit
300d33c777
@ -35,6 +35,7 @@ func (this *SociatyListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
|
||||
this.itemList.ItemList.OnSelected = func(id widget.ListItemID) {
|
||||
item := this.itemList.CachedList.Items[id]
|
||||
this.itemList.SelItemId = item.Id
|
||||
logrus.Debug(item)
|
||||
if s, ok := item.Data.(*pb.DBSociaty); ok {
|
||||
this.res.Text, _ = jsoniter.MarshalToString(s)
|
||||
@ -61,7 +62,7 @@ func (this *SociatyListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
applyBtn := widget.NewButton("申请", func() {
|
||||
selId := this.itemList.SelItemId
|
||||
if selId == "" {
|
||||
common.ShowTip("请选择项目")
|
||||
common.ShowTip("请选择要申请的公会")
|
||||
return
|
||||
}
|
||||
logrus.Debugf("%s", selId)
|
||||
@ -93,33 +94,6 @@ func (this *SociatyListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
}
|
||||
})
|
||||
|
||||
// 明细
|
||||
// item := &entryItem{
|
||||
// sociatyName: widget.NewEntry(),
|
||||
// notice: widget.NewMultiLineEntry(),
|
||||
// icon: widget.NewEntry(),
|
||||
// isApplyCheck: widget.NewCheck("审批", nil),
|
||||
// applyLv: widget.NewEntry(),
|
||||
// }
|
||||
|
||||
// this.form.AppendItem(widget.NewFormItem("公会名称", item.sociatyName))
|
||||
// this.form.AppendItem(widget.NewFormItem("公告", item.notice))
|
||||
// this.form.AppendItem(widget.NewFormItem("图标", item.icon))
|
||||
// this.form.AppendItem(widget.NewFormItem("审批", item.isApplyCheck))
|
||||
// this.form.AppendItem(widget.NewFormItem("入会等级", item.applyLv))
|
||||
// this.formdataListen(item)
|
||||
|
||||
// detailBtn := widget.NewButton("明细", func() {
|
||||
// if err := service.GetPttService().SendToClient(
|
||||
// string(comm.ModuleSociaty),
|
||||
// sociaty.SociatySubTypeMine,
|
||||
// &pb.SociatyMineReq{}); err != nil {
|
||||
// logrus.Error(err)
|
||||
// }
|
||||
|
||||
// defer this.showSociatyDetailWin()
|
||||
// })
|
||||
|
||||
//过滤
|
||||
filter := widget.NewSelect([]string{"全部", "满足条件", "无需审批", "申请中"}, func(s string) {
|
||||
this.itemList.Reset()
|
||||
|
@ -129,6 +129,27 @@ func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
}, this.w)
|
||||
})
|
||||
|
||||
// 取消解散
|
||||
cancelJiesanBtn := widget.NewButton("解散取消", func() {
|
||||
dialog.ShowConfirm("提示", "确定取消解散公会?", func(b bool) {
|
||||
if !b {
|
||||
return
|
||||
}
|
||||
if err := service.GetPttService().SendToClient(
|
||||
t.MainType,
|
||||
sociaty.SociatySubTypeDismiss,
|
||||
&pb.SociatyDismissReq{
|
||||
Dismiss: 1, //取消
|
||||
},
|
||||
); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
item = &entryItem{}
|
||||
}, this.w)
|
||||
})
|
||||
|
||||
//申请列表
|
||||
applyListBtn := widget.NewButton("申请审批", this.showSociatyApplyListWin)
|
||||
|
||||
@ -184,6 +205,7 @@ func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
if this.job == pb.SociatyJob_PRESIDENT {
|
||||
btns.Add(applyListBtn)
|
||||
btns.Add(jiesanBtn)
|
||||
btns.Add(cancelJiesanBtn)
|
||||
} else {
|
||||
btns.Add(quitBtn)
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ func (this *apiComp) Dismiss(session comm.IUserSession, req *pb.SociatyDismissRe
|
||||
update["dismissTime"] = utils.AddHour(24).Unix()
|
||||
} else {
|
||||
if req.Dismiss == 1 { //取消解散
|
||||
update := map[string]interface{}{}
|
||||
if utils.IsInCDHour(int64(sociaty.DismissCD)) {
|
||||
code = pb.ErrorCode_SociatyCDLimit
|
||||
return
|
||||
|
@ -543,10 +543,15 @@ func (this *ModelSociaty) accuse(sociaty *pb.DBSociaty) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ggd := this.moduleSociaty.configure.GetGlobalConf()
|
||||
if ggd == nil {
|
||||
return errors.New("config not found")
|
||||
}
|
||||
|
||||
//会长离线时间
|
||||
now := time.Now().Unix()
|
||||
left := now - user.Offlinetime
|
||||
if left < 72*3600 || user.Offlinetime == 0 {
|
||||
if left < int64(ggd.GuildImpeachmentCountDown*3600) || user.Offlinetime == 0 {
|
||||
return errors.New("会长很称职,无需弹劾")
|
||||
} else {
|
||||
//更新会长的弹劾时间
|
||||
|
Loading…
Reference in New Issue
Block a user