更新世界任务bingo
This commit is contained in:
parent
9223e1648f
commit
838ef9e2de
@ -46,7 +46,7 @@ func (this *BingoView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
aSel = &widget.Select{}
|
aSel = &widget.Select{}
|
||||||
gridContainer = container.NewGridWithColumns(3, aSel, tEntry, nEntry)
|
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.SetSelected("选择")
|
||||||
aSel.OnChanged = func(s string) {
|
aSel.OnChanged = func(s string) {
|
||||||
if s == "attr" {
|
if s == "attr" {
|
||||||
@ -62,7 +62,9 @@ func (this *BingoView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
|
|
||||||
this.form.OnSubmit = func() {
|
this.form.OnSubmit = func() {
|
||||||
var bingo string
|
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)
|
bingo = fmt.Sprintf("bingo:%s,%s", aSel.Selected, nEntry.Text)
|
||||||
} else {
|
} else {
|
||||||
bingo = fmt.Sprintf("bingo:%s,%s,%s", aSel.Selected, ttxt, nEntry.Text)
|
bingo = fmt.Sprintf("bingo:%s,%s,%s", aSel.Selected, ttxt, nEntry.Text)
|
||||||
|
@ -163,12 +163,11 @@ func (this *Worldtask) GetMyWorldtask(uid string) *pb.DBWorldtask {
|
|||||||
|
|
||||||
func (this *Worldtask) BingoAllTask(session comm.IUserSession) error {
|
func (this *Worldtask) BingoAllTask(session comm.IUserSession) error {
|
||||||
uid := session.GetUserId()
|
uid := session.GetUserId()
|
||||||
mytask := &pb.DBWorldtask{}
|
mytask := &pb.DBWorldtask{Uid: uid}
|
||||||
mytask.LastTaskIds = make(map[int32]*pb.Worldtask)
|
mytask.LastTaskIds = make(map[int32]*pb.Worldtask)
|
||||||
|
|
||||||
tasklist := this.worldtaskConf.GetDataList()
|
tasklist := this.worldtaskConf.GetDataList()
|
||||||
// 更新数据
|
|
||||||
update := map[string]interface{}{}
|
|
||||||
for _, conf := range tasklist {
|
for _, conf := range tasklist {
|
||||||
//世界任务配置
|
//世界任务配置
|
||||||
if conf.Des == 2 {
|
if conf.Des == 2 {
|
||||||
@ -181,12 +180,7 @@ func (this *Worldtask) BingoAllTask(session comm.IUserSession) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update = map[string]interface{}{
|
if err := this.modelWorldtask.Add(uid, mytask); err != nil {
|
||||||
"lastTaskIds": mytask.LastTaskIds,
|
|
||||||
"taskList": mytask.TaskList,
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := this.modelWorldtask.Change(uid, update); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user