|
|
@@ -95,6 +95,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
|
|
|
//隔一秒检查是否开始
|
|
|
Future<void> getNowStatus() async {
|
|
|
+ print('检查执行');
|
|
|
Result res = await HttpManager.get('houseInfo/getPlayerNum', data: {'id': widget.roomId});
|
|
|
if (res.success) {
|
|
|
if (houseInfo.statusFlag == 0 && res.data['statusFlag'] == 2) {
|
|
|
@@ -110,6 +111,8 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
|
|
|
if (houseInfo.statusFlag == 4) {
|
|
|
checkJoinInfo();
|
|
|
+ } else if (!isJoin) {
|
|
|
+ checkJoinInfo();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -211,6 +214,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
int time = houseInfo.beginTime + 1 * 3600 * 1000 - DateTime.now().millisecondsSinceEpoch;
|
|
|
var nowTime = (time ~/ 1000 ~/ 60) % 60;
|
|
|
setState(() {
|
|
|
+ showHelloWord = false;
|
|
|
roomTipsList.add([
|
|
|
{"value": '你已完成本次比赛,当前完成人数 ', "type": 0},
|
|
|
{"value": res.data.toString(), "type": 1},
|
|
|
@@ -248,17 +252,19 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
changeScroll();
|
|
|
}
|
|
|
|
|
|
- setState(() {
|
|
|
- showHelloWord = true;
|
|
|
- });
|
|
|
+ if (!showHelloWord) {
|
|
|
+ setState(() {
|
|
|
+ showHelloWord = true;
|
|
|
+ });
|
|
|
|
|
|
- // if (isJoin) {
|
|
|
- // roomTipsList.add([{
|
|
|
- // "value":'亲爱的玩家:',
|
|
|
- // }]);
|
|
|
- // }
|
|
|
+ // if (isJoin) {
|
|
|
+ // roomTipsList.add([{
|
|
|
+ // "value":'亲爱的玩家:',
|
|
|
+ // }]);
|
|
|
+ // }
|
|
|
|
|
|
- changeScroll();
|
|
|
+ changeScroll();
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
// if (houseInfo.statusFlag == 0) {
|
|
|
@@ -314,9 +320,17 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
}
|
|
|
|
|
|
if (isJoin && houseInfo.statusFlag != 4 || houseInfo.statusFlag == 0) {
|
|
|
+ print('检查1');
|
|
|
+ if (timer != null) {
|
|
|
+ timer.cancel();
|
|
|
+ }
|
|
|
timer = Timer.periodic(Duration(seconds: 1), (timer) {
|
|
|
print('检查');
|
|
|
- getNowStatus();
|
|
|
+ if (houseInfo.statusFlag == 4) {
|
|
|
+ timer.cancel();
|
|
|
+ } else {
|
|
|
+ getNowStatus();
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -324,6 +338,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
setState(() {
|
|
|
showJiexie = true;
|
|
|
});
|
|
|
+ //申诉
|
|
|
HttpManager.get('appealInfo/getOne', data: {
|
|
|
'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
|
|
|
'playerInfoId': playerInfo.id,
|
|
|
@@ -358,33 +373,33 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
}
|
|
|
|
|
|
MyDialog.showDialog(context, '加入房间后再次退出则示为自动放弃比赛', submitText: '确认加入', isCancel: true, onsubmit: () async {
|
|
|
- bool hasPermission = await ScreenStreamPlugin.checkPermission();
|
|
|
- if (!hasPermission) {
|
|
|
- showDialog(
|
|
|
- context: context,
|
|
|
- builder: (context) => AlertDialog(
|
|
|
- title: Text('需要悬浮窗权限'),
|
|
|
- contentTextStyle: TextStyle(color: Colors.black87),
|
|
|
- content: Text('请在点击确定后,勾选"允许显示在其他应用的上层"'),
|
|
|
- actions: <Widget>[
|
|
|
- FlatButton(
|
|
|
- child: Text('确定'),
|
|
|
- onPressed: () {
|
|
|
- Navigator.of(context).pop();
|
|
|
- ScreenStreamPlugin.requestPermission();
|
|
|
- },
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
- return;
|
|
|
- }
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
Result res = await HttpManager.post('houseInfo/join', data: {'houseId': widget.roomId, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
|
|
|
Toast.hide();
|
|
|
if (res.success) {
|
|
|
- Toast.show(context, '加入成功', 1500, 'success');
|
|
|
- checkJoinInfo();
|
|
|
+ bool hasPermission = await ScreenStreamPlugin.checkPermission();
|
|
|
+ if (!hasPermission) {
|
|
|
+ showDialog(
|
|
|
+ context: context,
|
|
|
+ builder: (context) => AlertDialog(
|
|
|
+ title: Text('需要悬浮窗权限'),
|
|
|
+ contentTextStyle: TextStyle(color: Colors.black87),
|
|
|
+ content: Text('请在点击确定后,勾选"允许显示在其他应用的上层"'),
|
|
|
+ actions: <Widget>[
|
|
|
+ FlatButton(
|
|
|
+ child: Text('确定'),
|
|
|
+ onPressed: () {
|
|
|
+ Navigator.of(context).pop();
|
|
|
+ ScreenStreamPlugin.requestPermission();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ Toast.show(context, '加入成功', 1500, 'success');
|
|
|
+ }
|
|
|
} else {
|
|
|
Toast.show(context, res.error, 1500, 'info');
|
|
|
}
|
|
|
@@ -456,6 +471,10 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
userInfo = StoreProvider.of<AppState>(context).state.userInfo;
|
|
|
// showStart();
|
|
|
});
|
|
|
+
|
|
|
+ if (timer != null) {
|
|
|
+ timer.cancel();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
@@ -745,7 +764,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
timeStr != ''
|
|
|
? Container(
|
|
|
decoration: BoxDecoration(
|
|
|
- color: Color.fromARGB(10, 212, 80, 75),
|
|
|
+ color: Color(0xFF3E3348),
|
|
|
borderRadius: BorderRadius.all(Radius.circular(4)),
|
|
|
),
|
|
|
margin: EdgeInsets.fromLTRB(15, 15, 15, 0),
|
|
|
@@ -774,7 +793,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
))
|
|
|
: Container(),
|
|
|
|
|
|
- showHelloWord
|
|
|
+ statuFlag != 4 && showHelloWord
|
|
|
? Container(
|
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.all(15),
|
|
|
@@ -833,11 +852,13 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
height: 40,
|
|
|
decoration: BoxDecoration(color: Color(0xFF3E3348), borderRadius: BorderRadius.all(Radius.circular(4))),
|
|
|
child: Text(
|
|
|
- playerInfo.houseRank < 4
|
|
|
- ? '恭喜您,您获得了第${playerInfo.houseRank}名!'
|
|
|
- : (playerInfo.statusFlag != 7 && playerInfo.statusFlag != 9 && !playerInfo.dataError
|
|
|
- ? '很遗憾您未能进入前三名,下次加油!'
|
|
|
- : '很遗憾您本次上传的比赛结果解析失败'),
|
|
|
+ playerInfo.statusFlag == 7 ||
|
|
|
+ playerInfo.statusFlag == 9 ||
|
|
|
+ playerInfo.dataError ||
|
|
|
+ playerInfo.statusFlag == 6 ||
|
|
|
+ playerInfo.killNumber < playerInfo.needkill
|
|
|
+ ? (playerInfo.statusFlag == 6 ? '很遗憾您本次未参赛' : '很遗憾您本次任务失败,下次加油!')
|
|
|
+ : (playerInfo.houseRank < 4 ? '恭喜您,您获得了第${playerInfo.houseRank}名!' : '很遗憾您未能进入前三名,下次加油!'),
|
|
|
style: prefix0.TextStyle(
|
|
|
color: Color(0xFFD4504B),
|
|
|
fontSize: 15,
|
|
|
@@ -845,7 +866,11 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
textAlign: TextAlign.center,
|
|
|
),
|
|
|
),
|
|
|
- ((playerInfo.statusFlag != 7 && playerInfo.statusFlag != 9 && !playerInfo.dataError) || playerInfo.houseRank < 4)
|
|
|
+ (playerInfo.statusFlag != 7 &&
|
|
|
+ playerInfo.statusFlag != 9 &&
|
|
|
+ !playerInfo.dataError &&
|
|
|
+ playerInfo.statusFlag != 6 &&
|
|
|
+ playerInfo.killNumber >= playerInfo.needkill)
|
|
|
? Container(
|
|
|
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
padding: EdgeInsets.all(15),
|
|
|
@@ -891,48 +916,80 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
],
|
|
|
),
|
|
|
)
|
|
|
- : Container(
|
|
|
- margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
- padding: EdgeInsets.all(15),
|
|
|
- // height: 239,
|
|
|
- width: double.infinity,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Color(0xFF3A3E61),
|
|
|
- borderRadius: BorderRadius.only(
|
|
|
- topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: <Widget>[
|
|
|
- Text(
|
|
|
- '造成此情况等原因可能是:',
|
|
|
- style: TextStyle(color: Colors.white54, fontSize: 13),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 10,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- '1、没有实际进行游戏比赛 ',
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
- ),
|
|
|
- Text(
|
|
|
- '2、使用作弊手段进行游戏 ',
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
- ),
|
|
|
- Text(
|
|
|
- '3、手机性能或电量过低,在运行和平精英游戏时自动将我们平台APP从后台进程中退掉 ',
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ : playerInfo.statusFlag == 6
|
|
|
+ ? Container(
|
|
|
+ margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
+ padding: EdgeInsets.all(15),
|
|
|
+ // height: 239,
|
|
|
+ width: double.infinity,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Color(0xFF3A3E61),
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: <Widget>[
|
|
|
+ Text(
|
|
|
+ '造成此情况等原因可能是:',
|
|
|
+ style: TextStyle(color: Colors.white54, fontSize: 13),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 10,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '1、倒计时结束内未点击开始',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
- Text(
|
|
|
- '4、游戏时间过长,没有在最大时间内返回平台APP点击结束游戏 ',
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ )
|
|
|
+ : Container(
|
|
|
+ margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
+ padding: EdgeInsets.all(15),
|
|
|
+ // height: 239,
|
|
|
+ width: double.infinity,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Color(0xFF3A3E61),
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: <Widget>[
|
|
|
+ Text(
|
|
|
+ '造成此情况等原因可能是:',
|
|
|
+ style: TextStyle(color: Colors.white54, fontSize: 13),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 10,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '1、游戏中杀戮人数未到房间任务要求',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '2、没有实际进行游戏比赛 ',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '3、使用作弊手段进行游戏 ',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '4、手机性能或电量过低,在运行和平精英游戏时自动将我们平台APP从后台进程中退掉 ',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '5、游戏时间过长,没有在最大时间内返回平台APP点击结束游戏 ',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
- )
|
|
|
+ )
|
|
|
],
|
|
|
)
|
|
|
: Container(),
|
|
|
),
|
|
|
+
|
|
|
Container(
|
|
|
width: double.infinity,
|
|
|
height: 78,
|
|
|
@@ -1149,7 +1206,15 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
child: LinearButton(btntext: '预计还有 ' + getSecondsMIn(_time) + ' 结算游戏', colorList: [Color(0xFFB34A4A), Color(0xFFB34A4A)], textColor: Color(0xFF252532)),
|
|
|
);
|
|
|
} else if (statusFlag == 4 && tabIndex == 0) {
|
|
|
- if (isJoin && canAppeal && appealState == 0 && playerInfo != null && (playerInfo.statusFlag == 9 || playerInfo.statusFlag == 7 || playerInfo.dataError)) {
|
|
|
+ if (isJoin &&
|
|
|
+ canAppeal &&
|
|
|
+ appealState == 0 &&
|
|
|
+ playerInfo != null &&
|
|
|
+ (playerInfo.statusFlag == 9 ||
|
|
|
+ playerInfo.statusFlag == 7 ||
|
|
|
+ playerInfo.dataError ||
|
|
|
+ playerInfo.statusFlag == 6 ||
|
|
|
+ playerInfo.killNumber < playerInfo.needkill)) {
|
|
|
return Container(
|
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
@@ -1223,10 +1288,18 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
),
|
|
|
)
|
|
|
: Container(),
|
|
|
- Text(
|
|
|
- '${myRank}',
|
|
|
- style: TextStyle(fontSize: 14, color: Color(0xFF252532), fontWeight: FontWeight.w500),
|
|
|
- )
|
|
|
+ playerInfo != null
|
|
|
+ ? Text(
|
|
|
+ (playerInfo.statusFlag == 7 ||
|
|
|
+ playerInfo.statusFlag == 9 ||
|
|
|
+ playerInfo.dataError ||
|
|
|
+ playerInfo.statusFlag == 6 ||
|
|
|
+ playerInfo.killNumber < playerInfo.needkill)
|
|
|
+ ? '任务失败'
|
|
|
+ : '${playerInfo.houseRank}',
|
|
|
+ style: TextStyle(fontSize: 14, color: Color(0xFF252532), fontWeight: FontWeight.w500),
|
|
|
+ )
|
|
|
+ : Container()
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -1247,7 +1320,7 @@ class TipsListContent extends StatelessWidget {
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return Container(
|
|
|
- margin: EdgeInsets.only(top: 15),
|
|
|
+ // margin: EdgeInsets.only(top: 15),
|
|
|
width: double.infinity,
|
|
|
child: Column(
|
|
|
children: _list(),
|
|
|
@@ -1292,7 +1365,7 @@ class Tips extends StatelessWidget {
|
|
|
list.add(TextSpan(
|
|
|
text: item['value'],
|
|
|
style:
|
|
|
- item['type'] == 0 ? TextStyle(color: Colors.white, fontSize: 13) : TextStyle(color: Color(0xFFFFB726), fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
+ item['type'] == 0 ? TextStyle(color: Colors.white, fontSize: 13) : TextStyle(fontWeight: FontWeight.w600, color: Color(0xFFFFB726), fontSize: 13),
|
|
|
));
|
|
|
}
|
|
|
return Text.rich(TextSpan(children: list));
|