|
|
@@ -101,10 +101,8 @@ class OpenRoomState extends State<OpenRoom> {
|
|
|
|
|
|
@override
|
|
|
void initState() {
|
|
|
- // TODO: implement initState
|
|
|
super.initState();
|
|
|
editRoomInfo['houseType'] = widget.roomFlag;
|
|
|
- //获取游戏列表
|
|
|
getInfo();
|
|
|
}
|
|
|
|
|
|
@@ -113,26 +111,26 @@ class OpenRoomState extends State<OpenRoom> {
|
|
|
print(res.data);
|
|
|
if (res.success) {
|
|
|
if (res.data.length > 0) {
|
|
|
- editRoomInfo['gameId'] = res.data[0].id;
|
|
|
+ editRoomInfo['gameId'] = res.data[0]['id'];
|
|
|
}
|
|
|
setState(() {
|
|
|
print(res.data);
|
|
|
gameList = res.data;
|
|
|
- editRoomInfo['gameId'] = res.data[0].id;
|
|
|
+ editRoomInfo['gameId'] = res.data[0]['id'];
|
|
|
});
|
|
|
|
|
|
} else {}
|
|
|
|
|
|
- // Result res2 = await HttpManager.get("gameInfo/all");
|
|
|
- // if (res2.success) {
|
|
|
- // setState(() {
|
|
|
- // levelList = res2.data;
|
|
|
- // if (levelList.length > 0) {
|
|
|
- // editRoomInfo['houseLevel'] = levelList[0]['id'];
|
|
|
- // editRoomInfo['playerNumber'] = levelList[0]['minNumber'];
|
|
|
- // }
|
|
|
- // });
|
|
|
- // } else {}
|
|
|
+ Result res2 = await HttpManager.get("gameInfo/all");
|
|
|
+ if (res2.success) {
|
|
|
+ setState(() {
|
|
|
+ levelList = res2.data;
|
|
|
+ if (levelList.length > 0) {
|
|
|
+ editRoomInfo['houseLevel'] = levelList[0]['id'];
|
|
|
+ editRoomInfo['playerNumber'] = levelList[0]['minNumber'];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {}
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
@@ -144,6 +142,7 @@ class OpenRoomState extends State<OpenRoom> {
|
|
|
chooseGameInfo = item;
|
|
|
}
|
|
|
}
|
|
|
+ print(chooseGameInfo);
|
|
|
|
|
|
Map chooseLevelInfo = {};
|
|
|
for (var item in levelList) {
|
|
|
@@ -154,7 +153,6 @@ class OpenRoomState extends State<OpenRoom> {
|
|
|
|
|
|
print(chooseGameInfo);
|
|
|
|
|
|
- // TODO: implement build
|
|
|
return WillPopScope(
|
|
|
child: Scaffold(
|
|
|
appBar: AppBar(
|