32 lines
696 B
Go
32 lines
696 B
Go
package formview
|
|
|
|
import (
|
|
"go_dreamfactory/cmd/v2/lib/common"
|
|
"go_dreamfactory/cmd/v2/model"
|
|
"go_dreamfactory/cmd/v2/service"
|
|
"go_dreamfactory/pb"
|
|
|
|
"fyne.io/fyne/v2"
|
|
"fyne.io/fyne/v2/widget"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
type FriendApplyView struct {
|
|
BaseformView
|
|
}
|
|
|
|
func (this *FriendApplyView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|
friendId := widget.NewEntry()
|
|
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_LABEL_FID, friendId))
|
|
|
|
this.form.OnSubmit = func() {
|
|
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.FriendApplyReq{
|
|
FriendId: friendId.Text,
|
|
}); err != nil {
|
|
logrus.Error(err)
|
|
}
|
|
|
|
}
|
|
return this.form
|
|
}
|