|
@@ -16,6 +16,7 @@ import '../widget/VideoWidget.dart';
|
|
|
import 'dart:async';
|
|
import 'dart:async';
|
|
|
import '../widget/Dialog.dart';
|
|
import '../widget/Dialog.dart';
|
|
|
import 'CompetitionInformation.dart';
|
|
import 'CompetitionInformation.dart';
|
|
|
|
|
+import 'SecondRoomInfo.dart';
|
|
|
|
|
|
|
|
class RoomInfo extends StatefulWidget {
|
|
class RoomInfo extends StatefulWidget {
|
|
|
RoomInfo({Key key, this.roomId}) : super(key: key);
|
|
RoomInfo({Key key, this.roomId}) : super(key: key);
|
|
@@ -38,6 +39,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
bool showBack = false;
|
|
bool showBack = false;
|
|
|
Timer timer;
|
|
Timer timer;
|
|
|
List<List<String>> roomTipsList = [];
|
|
List<List<String>> roomTipsList = [];
|
|
|
|
|
+ ScrollController _tipController;
|
|
|
|
|
|
|
|
//获取房间信息
|
|
//获取房间信息
|
|
|
void getRoomInfo() async {
|
|
void getRoomInfo() async {
|
|
@@ -49,22 +51,20 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
setState(() {
|
|
setState(() {
|
|
|
roomInfo = res.data;
|
|
roomInfo = res.data;
|
|
|
houseInfo = HouseInfo.fromJson(res.data);
|
|
houseInfo = HouseInfo.fromJson(res.data);
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
- if (houseInfo.statusFlag == 0) {
|
|
|
|
|
- timer = Timer.periodic(new Duration(seconds: 1), (timer) {
|
|
|
|
|
- getNowStatus();
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (houseInfo.statusFlag == 0) {
|
|
|
if (StoreProvider.of<AppState>(context).state.userInfo.remindFlag) {
|
|
if (StoreProvider.of<AppState>(context).state.userInfo.remindFlag) {
|
|
|
showNotice();
|
|
showNotice();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
} else {}
|
|
} else {}
|
|
|
|
|
|
|
|
- print('开始时间:' + houseInfo.beginTime.toString());
|
|
|
|
|
- print((1 * 3600 * 1000).toString());
|
|
|
|
|
- print(DateTime.now().millisecondsSinceEpoch.toString());
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
checkJoinInfo();
|
|
checkJoinInfo();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -73,10 +73,10 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
Result res = await HttpManager.get("houseInfo/getPlayerNum",
|
|
Result res = await HttpManager.get("houseInfo/getPlayerNum",
|
|
|
data: {"id": widget.roomId});
|
|
data: {"id": widget.roomId});
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- if (houseInfo.statusFlag == 0 && res.data["statusFlag"] == 2) {
|
|
|
|
|
- showStart();
|
|
|
|
|
- timer.cancel();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (houseInfo.statusFlag == 0 && res.data["statusFlag"] == 2) {
|
|
|
|
|
+ // showStart();
|
|
|
|
|
+ // timer.cancel();
|
|
|
|
|
+ // }
|
|
|
setState(() {
|
|
setState(() {
|
|
|
houseInfo.playerNumber = res.data["playerNumber"];
|
|
houseInfo.playerNumber = res.data["playerNumber"];
|
|
|
houseInfo.statusFlag = res.data["statusFlag"];
|
|
houseInfo.statusFlag = res.data["statusFlag"];
|
|
@@ -156,7 +156,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
getEndTips();
|
|
getEndTips();
|
|
|
|
|
|
|
|
setState(() {
|
|
setState(() {
|
|
|
- playerInfo.statusFlag=3;
|
|
|
|
|
|
|
+ playerInfo.statusFlag = 3;
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -171,13 +171,14 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
DateTime.now().millisecondsSinceEpoch;
|
|
DateTime.now().millisecondsSinceEpoch;
|
|
|
var nowTime = (time ~/ 1000 ~/ 60) % 60;
|
|
var nowTime = (time ~/ 1000 ~/ 60) % 60;
|
|
|
setState(() {
|
|
setState(() {
|
|
|
- roomTipsList.add( [
|
|
|
|
|
|
|
+ roomTipsList.add([
|
|
|
'你已完成本次比赛,当前完成人数 ',
|
|
'你已完成本次比赛,当前完成人数 ',
|
|
|
res.data.toString(),
|
|
res.data.toString(),
|
|
|
- '人,比赛需要等待所有人完成后方可结算奖励 最迟结算时间还剩',
|
|
|
|
|
- nowTime.toString() + '分钟',
|
|
|
|
|
|
|
+ '人,比赛需要等待所有人完成后方可结算奖励',
|
|
|
|
|
+ '',
|
|
|
',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励'
|
|
',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励'
|
|
|
]);
|
|
]);
|
|
|
|
|
+ changeScroll();
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -197,22 +198,18 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
});
|
|
});
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
if (res.data == null) {
|
|
if (res.data == null) {
|
|
|
- if (isPop) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
setState(() {
|
|
setState(() {
|
|
|
isJoin = false;
|
|
isJoin = false;
|
|
|
});
|
|
});
|
|
|
if (houseInfo.statusFlag == 0) {
|
|
if (houseInfo.statusFlag == 0) {
|
|
|
- roomTipsList.add( [
|
|
|
|
|
|
|
+ roomTipsList.add([
|
|
|
'上方奖金为当前本次竞赛的总奖金,根据当前人数的增加,奖金也就越多,竞赛的第一名获得50%,第二名获得30%,第三名获得20%,其他名次算作失败没有奖励,祝你取得好成绩'
|
|
'上方奖金为当前本次竞赛的总奖金,根据当前人数的增加,奖金也就越多,竞赛的第一名获得50%,第二名获得30%,第三名获得20%,其他名次算作失败没有奖励,祝你取得好成绩'
|
|
|
]);
|
|
]);
|
|
|
|
|
+ changeScroll();
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
playerInfo = PlayerInfo.fromJson(res.data);
|
|
playerInfo = PlayerInfo.fromJson(res.data);
|
|
|
- if (isPop) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
setState(() {
|
|
setState(() {
|
|
|
isJoin = true;
|
|
isJoin = true;
|
|
|
});
|
|
});
|
|
@@ -223,13 +220,15 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
.userInfo
|
|
.userInfo
|
|
|
.id
|
|
.id
|
|
|
.toString()) {
|
|
.toString()) {
|
|
|
- roomTipsList.add( [
|
|
|
|
|
|
|
+ roomTipsList.add([
|
|
|
'房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧'
|
|
'房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧'
|
|
|
]);
|
|
]);
|
|
|
|
|
+ changeScroll();
|
|
|
} else {
|
|
} else {
|
|
|
- roomTipsList.add( [
|
|
|
|
|
|
|
+ roomTipsList.add([
|
|
|
'请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
|
|
'请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
|
|
|
]);
|
|
]);
|
|
|
|
|
+ changeScroll();
|
|
|
}
|
|
}
|
|
|
Timer(Duration(seconds: 1), () {
|
|
Timer(Duration(seconds: 1), () {
|
|
|
roomTipsList.add([
|
|
roomTipsList.add([
|
|
@@ -237,8 +236,9 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
'请一定点击“确定”或“允许”此操作',
|
|
'请一定点击“确定”或“允许”此操作',
|
|
|
',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
|
|
',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
|
|
|
'一定要点击查看游戏最后的分数名次结算页面',
|
|
'一定要点击查看游戏最后的分数名次结算页面',
|
|
|
- ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功长传本次成绩,赢取大奖,感谢你的配合'
|
|
|
|
|
|
|
+ ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功长传本次成绩。从游戏开始一小时之内必须返回全民App点击完成比赛,否则判定游戏失败,祝你取得好成绩。'
|
|
|
]);
|
|
]);
|
|
|
|
|
+ changeScroll();
|
|
|
});
|
|
});
|
|
|
} else if (houseInfo.statusFlag != 4) {
|
|
} else if (houseInfo.statusFlag != 4) {
|
|
|
if (playerInfo.statusFlag == 3 ||
|
|
if (playerInfo.statusFlag == 3 ||
|
|
@@ -249,6 +249,12 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if(isJoin&&houseInfo.statusFlag!=4){
|
|
|
|
|
+ timer = Timer.periodic(new Duration(seconds: 1), (timer) {
|
|
|
|
|
+ getNowStatus();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//加入房间
|
|
//加入房间
|
|
@@ -260,26 +266,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
});
|
|
});
|
|
|
Toast.hide();
|
|
Toast.hide();
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- // roomTipsList.add( [
|
|
|
|
|
- // '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
|
|
|
|
|
- // ]);
|
|
|
|
|
- // Timer(Duration(seconds: 1), () {
|
|
|
|
|
- // roomTipsList.add( [
|
|
|
|
|
- // '游戏开始后会有弹窗提示授权进行录屏的操作,',
|
|
|
|
|
- // '请一定点击“确定”或“允许”此操作',
|
|
|
|
|
- // ',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
|
|
|
|
|
- // '一定要点击查看游戏最后的分数名次结算页面',
|
|
|
|
|
- // ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功长传本次成绩,赢取大奖,感谢你的配合'
|
|
|
|
|
- // ]);
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
Toast.show(context, '加入成功', 1500, 'success');
|
|
Toast.show(context, '加入成功', 1500, 'success');
|
|
|
- if (isPop) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- setState(() {
|
|
|
|
|
- isJoin = true;
|
|
|
|
|
- });
|
|
|
|
|
checkJoinInfo();
|
|
checkJoinInfo();
|
|
|
} else {
|
|
} else {
|
|
|
Toast.show(context, res.error, 1500, 'info');
|
|
Toast.show(context, res.error, 1500, 'info');
|
|
@@ -303,6 +290,24 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//改变滚动条
|
|
|
|
|
+ changeScroll() {
|
|
|
|
|
+ Timer(Duration(seconds: 1), () {
|
|
|
|
|
+ _tipController.animateTo(context.size.height,
|
|
|
|
|
+ duration: Duration(milliseconds: 1500), curve: Curves.ease);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //获取分秒
|
|
|
|
|
+ String getSecondsMIn(int time){
|
|
|
|
|
+ if(time==null){
|
|
|
|
|
+ return '';
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ return ((time ~/ 1000 ~/ 60) % 60).toString()+'分'+(time ~/ 1000 % 60).toString()+'秒';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@override
|
|
@override
|
|
|
void initState() {
|
|
void initState() {
|
|
|
super.initState();
|
|
super.initState();
|
|
@@ -314,6 +319,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
length: tabList.length,
|
|
length: tabList.length,
|
|
|
vsync: this,
|
|
vsync: this,
|
|
|
);
|
|
);
|
|
|
|
|
+ _tipController = ScrollController();
|
|
|
roomInfo = {};
|
|
roomInfo = {};
|
|
|
|
|
|
|
|
colorInfo = {
|
|
colorInfo = {
|
|
@@ -390,6 +396,9 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
),
|
|
),
|
|
|
onWillPop: () {
|
|
onWillPop: () {
|
|
|
if (houseInfo == null || (houseInfo.statusFlag != 0) || !isJoin) {
|
|
if (houseInfo == null || (houseInfo.statusFlag != 0) || !isJoin) {
|
|
|
|
|
+ if(timer!=null){
|
|
|
|
|
+ timer.cancel();
|
|
|
|
|
+ }
|
|
|
isPop = true;
|
|
isPop = true;
|
|
|
Toast.hide();
|
|
Toast.hide();
|
|
|
Navigator.of(context).pop();
|
|
Navigator.of(context).pop();
|
|
@@ -437,140 +446,131 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
await new Future.delayed(const Duration(seconds: 1));
|
|
await new Future.delayed(const Duration(seconds: 1));
|
|
|
},
|
|
},
|
|
|
child: SingleChildScrollView(
|
|
child: SingleChildScrollView(
|
|
|
|
|
+ controller: _tipController,
|
|
|
physics: AlwaysScrollableScrollPhysics(),
|
|
physics: AlwaysScrollableScrollPhysics(),
|
|
|
- child: ConstrainedBox(
|
|
|
|
|
- constraints: BoxConstraints(
|
|
|
|
|
- minHeight: 640,
|
|
|
|
|
- maxHeight: viewportConstraints.maxHeight>640?viewportConstraints.maxHeight:640
|
|
|
|
|
- ),
|
|
|
|
|
- child: IntrinsicHeight(
|
|
|
|
|
- child: Column(
|
|
|
|
|
- children: <Widget>[
|
|
|
|
|
- houseInfo != null
|
|
|
|
|
- ? VideoWidget(videoSrc: houseInfo.video)
|
|
|
|
|
- : Container(),
|
|
|
|
|
- // Image.network(topImg, width: double.infinity),
|
|
|
|
|
- Container(
|
|
|
|
|
- padding: EdgeInsets.only(top: 10),
|
|
|
|
|
- child: Row(
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
- children: <Widget>[
|
|
|
|
|
- Container(
|
|
|
|
|
- margin: EdgeInsets.only(left: 30, right: 8),
|
|
|
|
|
- child: Text(
|
|
|
|
|
- roomInfo.containsKey("houseName")
|
|
|
|
|
- ? roomInfo["houseName"]
|
|
|
|
|
- : '',
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- fontSize: 16,
|
|
|
|
|
- fontWeight: FontWeight.w500),
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- Image.network(
|
|
|
|
|
- houseLevelInfo.containsKey("icon")
|
|
|
|
|
- ? houseLevelInfo["icon"]
|
|
|
|
|
- : '',
|
|
|
|
|
- width: 14,
|
|
|
|
|
- ),
|
|
|
|
|
- Text(
|
|
|
|
|
- houseLevelInfo.containsKey("levelName")
|
|
|
|
|
- ? houseLevelInfo["levelName"]
|
|
|
|
|
- : '',
|
|
|
|
|
- style:
|
|
|
|
|
- TextStyle(color: colorInfo[levelName]),
|
|
|
|
|
- )
|
|
|
|
|
- ],
|
|
|
|
|
- )),
|
|
|
|
|
- Container(
|
|
|
|
|
- margin: EdgeInsets.only(top: 6),
|
|
|
|
|
- child: Text(
|
|
|
|
|
- roomInfo.containsKey('houseAbstract')
|
|
|
|
|
- ? roomInfo["houseAbstract"]
|
|
|
|
|
- : "",
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Color(0xFF9BA0AE), fontSize: 12),
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- Row(
|
|
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ children: <Widget>[
|
|
|
|
|
+ houseInfo != null
|
|
|
|
|
+ ? VideoWidget(videoSrc: houseInfo.video)
|
|
|
|
|
+ : Container(),
|
|
|
|
|
+ // Image.network(topImg, width: double.infinity),
|
|
|
|
|
+ Container(
|
|
|
|
|
+ padding: EdgeInsets.only(top: 10),
|
|
|
|
|
+ child: Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
- Image.asset(
|
|
|
|
|
- 'images/icon_renshu.png',
|
|
|
|
|
- width: 20,
|
|
|
|
|
|
|
+ Container(
|
|
|
|
|
+ margin: EdgeInsets.only(left: 30, right: 8),
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ roomInfo.containsKey("houseName")
|
|
|
|
|
+ ? roomInfo["houseName"]
|
|
|
|
|
+ : '',
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ fontSize: 16,
|
|
|
|
|
+ fontWeight: FontWeight.w500),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Image.network(
|
|
|
|
|
+ houseLevelInfo.containsKey("icon")
|
|
|
|
|
+ ? houseLevelInfo["icon"]
|
|
|
|
|
+ : '',
|
|
|
|
|
+ width: 14,
|
|
|
),
|
|
),
|
|
|
Text(
|
|
Text(
|
|
|
- (houseInfo != null
|
|
|
|
|
- ? houseInfo.playerNumber.toString()
|
|
|
|
|
- : '0') +
|
|
|
|
|
- '/' +
|
|
|
|
|
- (houseInfo != null
|
|
|
|
|
- ? houseInfo.maxNumber.toString()
|
|
|
|
|
- : '0'),
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- fontSize: 14,
|
|
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
|
|
- color: Color(0xFFB1B2C0)),
|
|
|
|
|
|
|
+ houseLevelInfo.containsKey("levelName")
|
|
|
|
|
+ ? houseLevelInfo["levelName"]
|
|
|
|
|
+ : '',
|
|
|
|
|
+ style: TextStyle(color: colorInfo[levelName]),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
|
|
+ )),
|
|
|
|
|
+ Container(
|
|
|
|
|
+ margin: EdgeInsets.only(top: 6),
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ roomInfo.containsKey('houseAbstract')
|
|
|
|
|
+ ? roomInfo["houseAbstract"]
|
|
|
|
|
+ : "",
|
|
|
|
|
+ style:
|
|
|
|
|
+ TextStyle(color: Color(0xFF9BA0AE), fontSize: 12),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
+ children: <Widget>[
|
|
|
|
|
+ Image.asset(
|
|
|
|
|
+ 'images/icon_renshu.png',
|
|
|
|
|
+ width: 20,
|
|
|
),
|
|
),
|
|
|
- Container(
|
|
|
|
|
- margin: EdgeInsets.only(top: 14),
|
|
|
|
|
- width: 200,
|
|
|
|
|
- height: 40,
|
|
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- border: Border.all(
|
|
|
|
|
- width: 1,
|
|
|
|
|
- color: PRIMARY_COLOR,
|
|
|
|
|
- style: BorderStyle.solid),
|
|
|
|
|
- borderRadius:
|
|
|
|
|
- BorderRadius.all(Radius.circular(2)),
|
|
|
|
|
- ),
|
|
|
|
|
- child: Row(
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
- children: <Widget>[
|
|
|
|
|
- Text(
|
|
|
|
|
- '奖金',
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: PRIMARY_COLOR,
|
|
|
|
|
- fontSize: 13,
|
|
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- Container(
|
|
|
|
|
- padding: EdgeInsets.only(left: 10, right: 6),
|
|
|
|
|
- child: Image.asset(
|
|
|
|
|
- "images/icon_jinbi_da_hong.png",
|
|
|
|
|
- width: 20,
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- Text(
|
|
|
|
|
- 'X' +
|
|
|
|
|
- (houseInfo != null
|
|
|
|
|
- ? houseInfo.bonus.toString()
|
|
|
|
|
- : '0'),
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: PRIMARY_COLOR,
|
|
|
|
|
- fontSize: 22,
|
|
|
|
|
- fontWeight: FontWeight.w900,
|
|
|
|
|
- ),
|
|
|
|
|
- )
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
-
|
|
|
|
|
- statuFlag != 4
|
|
|
|
|
- ? TipsListContent(tipsList: roomTipsList)
|
|
|
|
|
- : RankContent(
|
|
|
|
|
- roomId: widget.roomId,
|
|
|
|
|
- ),
|
|
|
|
|
- Container(
|
|
|
|
|
- width: double.infinity,
|
|
|
|
|
- height: 78,
|
|
|
|
|
|
|
+ Text(
|
|
|
|
|
+ (houseInfo != null
|
|
|
|
|
+ ? houseInfo.playerNumber.toString()
|
|
|
|
|
+ : '0') +
|
|
|
|
|
+ '/' +
|
|
|
|
|
+ (houseInfo != null
|
|
|
|
|
+ ? houseInfo.maxNumber.toString()
|
|
|
|
|
+ : '0'),
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: 14,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ color: Color(0xFFB1B2C0)),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
- ),
|
|
|
|
|
|
|
+ Container(
|
|
|
|
|
+ margin: EdgeInsets.only(top: 14),
|
|
|
|
|
+ width: 200,
|
|
|
|
|
+ height: 40,
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ border: Border.all(
|
|
|
|
|
+ width: 1,
|
|
|
|
|
+ color: PRIMARY_COLOR,
|
|
|
|
|
+ style: BorderStyle.solid),
|
|
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(2)),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
+ children: <Widget>[
|
|
|
|
|
+ Text(
|
|
|
|
|
+ '奖金',
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: PRIMARY_COLOR,
|
|
|
|
|
+ fontSize: 13,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Container(
|
|
|
|
|
+ padding: EdgeInsets.only(left: 10, right: 6),
|
|
|
|
|
+ child: Image.asset(
|
|
|
|
|
+ "images/icon_jinbi_da_hong.png",
|
|
|
|
|
+ width: 20,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Text(
|
|
|
|
|
+ 'X' +
|
|
|
|
|
+ (houseInfo != null
|
|
|
|
|
+ ? houseInfo.bonus.toString()
|
|
|
|
|
+ : '0'),
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: PRIMARY_COLOR,
|
|
|
|
|
+ fontSize: 22,
|
|
|
|
|
+ fontWeight: FontWeight.w900,
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+
|
|
|
|
|
+ statuFlag != 4
|
|
|
|
|
+ ? TipsListContent(tipsList: roomTipsList)
|
|
|
|
|
+ : RankContent(
|
|
|
|
|
+ roomId: widget.roomId,
|
|
|
|
|
+ ),
|
|
|
|
|
+ Container(
|
|
|
|
|
+ width: double.infinity,
|
|
|
|
|
+ height: 78,
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
))),
|
|
))),
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
@@ -640,6 +640,10 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
} else if (isJoin && statusFlag == 0) {
|
|
} else if (isJoin && statusFlag == 0) {
|
|
|
|
|
+ int _time;
|
|
|
|
|
+ if(houseInfo!=null){
|
|
|
|
|
+ _time=houseInfo.createTime+600000-DateTime.now().millisecondsSinceEpoch;
|
|
|
|
|
+ }
|
|
|
return Container(
|
|
return Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
@@ -648,13 +652,17 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
disabledColor: Color(0xFF914244),
|
|
disabledColor: Color(0xFF914244),
|
|
|
disabledTextColor: Color(0xFF252532),
|
|
disabledTextColor: Color(0xFF252532),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
- '等待开始中',
|
|
|
|
|
|
|
+ '预计'+getSecondsMIn(_time)+'后开始',
|
|
|
style: TextStyle(fontSize: 16),
|
|
style: TextStyle(fontSize: 16),
|
|
|
),
|
|
),
|
|
|
onPressed: null,
|
|
onPressed: null,
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
- } else if (isJoin && statusFlag == 2 && playerStatus >= 3) {
|
|
|
|
|
|
|
+ } else if (isJoin && statusFlag == 2) {
|
|
|
|
|
+ int _time;
|
|
|
|
|
+ if(houseInfo!=null){
|
|
|
|
|
+ _time=houseInfo.beginTime+3600000-DateTime.now().millisecondsSinceEpoch;
|
|
|
|
|
+ }
|
|
|
return Container(
|
|
return Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
@@ -663,13 +671,17 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
disabledColor: Color(0xFF914244),
|
|
disabledColor: Color(0xFF914244),
|
|
|
disabledTextColor: Color(0xFF252532),
|
|
disabledTextColor: Color(0xFF252532),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
- '正在结算中',
|
|
|
|
|
|
|
+ '预计'+getSecondsMIn(_time)+'后结算',
|
|
|
style: TextStyle(fontSize: 16),
|
|
style: TextStyle(fontSize: 16),
|
|
|
),
|
|
),
|
|
|
onPressed: null,
|
|
onPressed: null,
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
} else if (isJoin && statusFlag == 3) {
|
|
} else if (isJoin && statusFlag == 3) {
|
|
|
|
|
+ int _time;
|
|
|
|
|
+ if(houseInfo!=null){
|
|
|
|
|
+ _time=houseInfo.beginTime+3600000-DateTime.now().millisecondsSinceEpoch;
|
|
|
|
|
+ }
|
|
|
return Container(
|
|
return Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
@@ -678,7 +690,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
disabledColor: Color(0xFF914244),
|
|
disabledColor: Color(0xFF914244),
|
|
|
disabledTextColor: Color(0xFF252532),
|
|
disabledTextColor: Color(0xFF252532),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
- '正在结算中',
|
|
|
|
|
|
|
+ '最迟在'+getSecondsMIn(_time)+'后结算',
|
|
|
style: TextStyle(fontSize: 16),
|
|
style: TextStyle(fontSize: 16),
|
|
|
),
|
|
),
|
|
|
onPressed: null,
|
|
onPressed: null,
|
|
@@ -705,57 +717,25 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-class TipsListContent extends StatefulWidget {
|
|
|
|
|
|
|
+//房间的提示信息
|
|
|
|
|
+class TipsListContent extends StatelessWidget {
|
|
|
TipsListContent({Key key, this.tipsList}) : super(key: key);
|
|
TipsListContent({Key key, this.tipsList}) : super(key: key);
|
|
|
final List<List<String>> tipsList;
|
|
final List<List<String>> tipsList;
|
|
|
- @override
|
|
|
|
|
- TipsListContentState createState() => TipsListContentState();
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-class TipsListContentState extends State<TipsListContent> {
|
|
|
|
|
- ScrollController _scrollController;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- @override
|
|
|
|
|
- void initState() {
|
|
|
|
|
- // TODO: implement initState
|
|
|
|
|
- super.initState();
|
|
|
|
|
- _scrollController=new ScrollController();
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @override
|
|
|
|
|
- void didUpdateWidget(TipsListContent oldWidget) {
|
|
|
|
|
- // TODO: implement didChangeDependencies
|
|
|
|
|
- super.didUpdateWidget(oldWidget);
|
|
|
|
|
- print('updtae:' + widget.tipsList.length.toString());
|
|
|
|
|
- _scrollController.animateTo(200.0*widget.tipsList.length,
|
|
|
|
|
- duration: new Duration(seconds: 2), curve: Curves.ease);
|
|
|
|
|
-
|
|
|
|
|
- // _scrollController.position.pixels=_scrollController.position
|
|
|
|
|
- // _scrollController.
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
- return Expanded(
|
|
|
|
|
- flex: 1,
|
|
|
|
|
- child: Container(
|
|
|
|
|
- margin: EdgeInsets.only(top: 15),
|
|
|
|
|
- width: double.infinity,
|
|
|
|
|
- child: SingleChildScrollView(
|
|
|
|
|
- controller: _scrollController,
|
|
|
|
|
- child: Column(
|
|
|
|
|
- children: _list(),
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- ));
|
|
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ margin: EdgeInsets.only(top: 15),
|
|
|
|
|
+ width: double.infinity,
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ children: _list(),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _list() {
|
|
List<Widget> _list() {
|
|
|
List<Tips> myList = [];
|
|
List<Tips> myList = [];
|
|
|
- for (var item in widget.tipsList) {
|
|
|
|
|
|
|
+ for (var item in tipsList) {
|
|
|
myList.add(Tips(
|
|
myList.add(Tips(
|
|
|
content: item,
|
|
content: item,
|
|
|
));
|
|
));
|
|
@@ -822,6 +802,7 @@ class Tips extends StatelessWidget {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//比赛结束排名
|
|
|
class RankContent extends StatefulWidget {
|
|
class RankContent extends StatefulWidget {
|
|
|
RankContent({Key key, this.roomId}) : super(key: key);
|
|
RankContent({Key key, this.roomId}) : super(key: key);
|
|
|
final String roomId; // 用来储存传递过来的值
|
|
final String roomId; // 用来储存传递过来的值
|
|
@@ -872,7 +853,10 @@ class RankContentState extends State<RankContent> {
|
|
|
|
|
|
|
|
Widget _rankItem(int _num) {
|
|
Widget _rankItem(int _num) {
|
|
|
if (_num > topList.length) {
|
|
if (_num > topList.length) {
|
|
|
- return Container();
|
|
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ width: 107,
|
|
|
|
|
+ height: 60,
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
List colorList = [
|
|
List colorList = [
|
|
|
[Color(0xFFD48E00), Color(0xFFFECF01)],
|
|
[Color(0xFFD48E00), Color(0xFFFECF01)],
|
|
@@ -959,153 +943,3 @@ class RankContentState extends State<RankContent> {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-class SecondPage extends StatefulWidget {
|
|
|
|
|
- SecondPage({Key key, this.roomId, this.status}) : super(key: key);
|
|
|
|
|
- final String roomId; // 用来储存传递过来的值
|
|
|
|
|
- final int status;
|
|
|
|
|
- @override
|
|
|
|
|
- SecondPageState createState() => SecondPageState();
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-class SecondPageState extends State<SecondPage> {
|
|
|
|
|
- List<PlayerInfo> joinList = [];
|
|
|
|
|
- int currentPage = 1;
|
|
|
|
|
- bool ismore = true;
|
|
|
|
|
- ScrollController _perController;
|
|
|
|
|
-
|
|
|
|
|
- //获取房间用户
|
|
|
|
|
- getPlayerPage() async {
|
|
|
|
|
- ismore = false;
|
|
|
|
|
- Toast.show(context, '加载中', -1, 'loading');
|
|
|
|
|
- Result res = await HttpManager.get("playerInfo/rankPage", data: {
|
|
|
|
|
- "houseId": widget.roomId,
|
|
|
|
|
- "currentPage": currentPage,
|
|
|
|
|
- "pageNumber": 20
|
|
|
|
|
- });
|
|
|
|
|
- Toast.hide();
|
|
|
|
|
- List<PlayerInfo> list = joinList;
|
|
|
|
|
- if (currentPage == 1) {
|
|
|
|
|
- list = [];
|
|
|
|
|
- }
|
|
|
|
|
- if (res.success) {
|
|
|
|
|
- for (var item in res.data['pp']) {
|
|
|
|
|
- PlayerInfo jonPlayer = PlayerInfo.fromJson(item);
|
|
|
|
|
- list.add(jonPlayer);
|
|
|
|
|
- }
|
|
|
|
|
- if (res.data['page']['currentPage'] < res.data['page']['totalPage']) {
|
|
|
|
|
- ismore = true;
|
|
|
|
|
- }
|
|
|
|
|
- } else {}
|
|
|
|
|
- setState(() {
|
|
|
|
|
- joinList = list;
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @override
|
|
|
|
|
- void initState() {
|
|
|
|
|
- super.initState();
|
|
|
|
|
- _perController = ScrollController();
|
|
|
|
|
- currentPage = 1;
|
|
|
|
|
- Future.delayed(Duration.zero, () {
|
|
|
|
|
- getPlayerPage();
|
|
|
|
|
- _perController.addListener(() {
|
|
|
|
|
- if (_perController.position.pixels ==
|
|
|
|
|
- _perController.position.maxScrollExtent) {
|
|
|
|
|
- if (ismore) {
|
|
|
|
|
- currentPage++;
|
|
|
|
|
- getPlayerPage();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @override
|
|
|
|
|
- void dispose() {
|
|
|
|
|
- super.dispose();
|
|
|
|
|
- _perController.dispose();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @override
|
|
|
|
|
- Widget build(BuildContext context) {
|
|
|
|
|
- return RefreshIndicator(
|
|
|
|
|
- color: PRIMARY_COLOR,
|
|
|
|
|
- backgroundColor: Colors.white,
|
|
|
|
|
- displacement: 10,
|
|
|
|
|
- onRefresh: () async {
|
|
|
|
|
- await new Future.delayed(const Duration(seconds: 1));
|
|
|
|
|
- currentPage = 1;
|
|
|
|
|
- getPlayerPage();
|
|
|
|
|
- },
|
|
|
|
|
- child: ListView.builder(
|
|
|
|
|
- physics: AlwaysScrollableScrollPhysics(),
|
|
|
|
|
- controller: _perController,
|
|
|
|
|
- itemCount: joinList.length + 1,
|
|
|
|
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
- if (index < joinList.length) {
|
|
|
|
|
- return person_item(joinList[index], index);
|
|
|
|
|
- } else {
|
|
|
|
|
- return Container(
|
|
|
|
|
- padding: EdgeInsets.all(15),
|
|
|
|
|
- child: Text(
|
|
|
|
|
- '其他人员正在火速赶来中...',
|
|
|
|
|
- style: TextStyle(color: Colors.white30),
|
|
|
|
|
- textAlign: TextAlign.center,
|
|
|
|
|
- ),
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- }),
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Widget person_item(PlayerInfo info, int index) {
|
|
|
|
|
- return Container(
|
|
|
|
|
- width: double.infinity,
|
|
|
|
|
- height: 60,
|
|
|
|
|
- color: Color(0xFF2B2B42),
|
|
|
|
|
- margin: EdgeInsets.only(top: index == 0 ? 10 : 0),
|
|
|
|
|
- padding: EdgeInsets.only(left: 15, right: 15),
|
|
|
|
|
- child: Container(
|
|
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- border: Border(
|
|
|
|
|
- bottom: BorderSide(
|
|
|
|
|
- width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
|
|
|
|
|
- child: Row(
|
|
|
|
|
- children: <Widget>[
|
|
|
|
|
- Container(
|
|
|
|
|
- margin: EdgeInsets.only(right: 12),
|
|
|
|
|
- width: 36,
|
|
|
|
|
- height: 36,
|
|
|
|
|
- child: info.userInfo != null
|
|
|
|
|
- ? CircleAvatar(
|
|
|
|
|
- backgroundImage: NetworkImage(info.userInfo.icon),
|
|
|
|
|
- )
|
|
|
|
|
- : Container(),
|
|
|
|
|
- ),
|
|
|
|
|
- Expanded(
|
|
|
|
|
- flex: 1,
|
|
|
|
|
- child: Text(
|
|
|
|
|
- info.userInfo != null ? info.userInfo.nickname : '',
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- fontSize: 14,
|
|
|
|
|
- ),
|
|
|
|
|
- maxLines: 1,
|
|
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- widget.status == 4 && index < 3
|
|
|
|
|
- ? Image.asset(
|
|
|
|
|
- 'images/icon_paihangbang_0' +
|
|
|
|
|
- (index + 1).toString() +
|
|
|
|
|
- '.png',
|
|
|
|
|
- width: 32,
|
|
|
|
|
- )
|
|
|
|
|
- : Container()
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|