更新世界任务bingo

This commit is contained in:
wh_zcy 2022-12-08 18:27:08 +08:00
parent 9223e1648f
commit 838ef9e2de
2 changed files with 7 additions and 11 deletions

View File

@ -46,7 +46,7 @@ func (this *BingoView) CreateView(t *model.TestCase) fyne.CanvasObject {
aSel = &widget.Select{}
gridContainer = container.NewGridWithColumns(3, aSel, tEntry, nEntry)
aSel.Options = []string{"选择", "attr", "item", "hero", "equi", "mapid", "pataid", "worldtask", "sociatyexp", "sociatyactivity"}
aSel.Options = []string{"选择", "attr", "item", "hero", "equi", "mapid", "pataid", "alltask", "worldtask", "sociatyexp", "sociatyactivity"}
aSel.SetSelected("选择")
aSel.OnChanged = func(s string) {
if s == "attr" {
@ -62,7 +62,9 @@ func (this *BingoView) CreateView(t *model.TestCase) fyne.CanvasObject {
this.form.OnSubmit = func() {
var bingo string
if ttxt == "" {
if ttxt == "" && nEntry.Text == "" {
bingo = fmt.Sprintf("bingo:%s", aSel.Selected)
} else if ttxt == "" {
bingo = fmt.Sprintf("bingo:%s,%s", aSel.Selected, nEntry.Text)
} else {
bingo = fmt.Sprintf("bingo:%s,%s,%s", aSel.Selected, ttxt, nEntry.Text)

View File

@ -163,12 +163,11 @@ func (this *Worldtask) GetMyWorldtask(uid string) *pb.DBWorldtask {
func (this *Worldtask) BingoAllTask(session comm.IUserSession) error {
uid := session.GetUserId()
mytask := &pb.DBWorldtask{}
mytask := &pb.DBWorldtask{Uid: uid}
mytask.LastTaskIds = make(map[int32]*pb.Worldtask)
tasklist := this.worldtaskConf.GetDataList()
// 更新数据
update := map[string]interface{}{}
for _, conf := range tasklist {
//世界任务配置
if conf.Des == 2 {
@ -181,12 +180,7 @@ func (this *Worldtask) BingoAllTask(session comm.IUserSession) error {
}
}
update = map[string]interface{}{
"lastTaskIds": mytask.LastTaskIds,
"taskList": mytask.TaskList,
}
if err := this.modelWorldtask.Change(uid, update); err != nil {
if err := this.modelWorldtask.Add(uid, mytask); err != nil {
return err
}