|
|
@@ -1,6 +1,8 @@
|
|
|
import 'dart:async';
|
|
|
import 'dart:ui';
|
|
|
+import 'package:flutter/cupertino.dart' as prefix0;
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter/material.dart' as prefix1;
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
import 'package:battery/battery.dart';
|
|
|
@@ -23,6 +25,7 @@ import 'VideoPlayer.dart';
|
|
|
import '../model/UserInfo.dart';
|
|
|
import '../widget/LinearButton.dart';
|
|
|
import '../widget/ScoreType.dart';
|
|
|
+import 'Appeal.dart';
|
|
|
|
|
|
class RoomInfo extends StatefulWidget {
|
|
|
RoomInfo({Key key, this.roomId}) : super(key: key);
|
|
|
@@ -50,9 +53,12 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
UserInfo userInfo;
|
|
|
int myRank = 0;
|
|
|
String mymedal = '';
|
|
|
+ bool canAppeal = false;
|
|
|
+ int appealState = 0;
|
|
|
|
|
|
//获取房间信息
|
|
|
- Future<void> getRoomInfo() async {
|
|
|
+ Future<void> getRoomInfo(type) async {
|
|
|
+ print('现在时间:' + DateTime.now().millisecondsSinceEpoch.toString());
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
Result res = await HttpManager.get('houseInfo/getOne', data: {'id': widget.roomId});
|
|
|
Toast.hide();
|
|
|
@@ -65,8 +71,13 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
if (houseInfo.statusFlag == 0 && houseInfo.userId != StoreProvider.of<AppState>(context).state.userInfo.id) {
|
|
|
showNotice();
|
|
|
}
|
|
|
- } else {}
|
|
|
|
|
|
+ if (houseInfo.statusFlag < 2 && type == 'first') {
|
|
|
+ final battery = Battery();
|
|
|
+ final batteryLevel = await battery.batteryLevel;
|
|
|
+ await MyDialog.showDialog(context, (batteryLevel < 50 ? '系统检测到你的电量低于50%' : '') + ' 为了正常上传比赛结果,建议插上电源线保持电量充足', submitText: '知道了');
|
|
|
+ }
|
|
|
+ } else {}
|
|
|
checkJoinInfo();
|
|
|
}
|
|
|
|
|
|
@@ -119,6 +130,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
if (result) {
|
|
|
success = await ScreenStreamPlugin.start(playerInfo.id.toString());
|
|
|
if (success) {
|
|
|
+ data['beginTime'] = DateTime.now().millisecondsSinceEpoch;
|
|
|
data['statusFlag'] = 2;
|
|
|
data['played'] = true;
|
|
|
} else {
|
|
|
@@ -163,7 +175,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
//开始录屏提示框
|
|
|
void showSucessInfo() {
|
|
|
MyDialog.showDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖', title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
|
|
|
- HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': 3});
|
|
|
+ HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': 3, 'endTime': DateTime.now().millisecondsSinceEpoch});
|
|
|
bool success = await ScreenStreamPlugin.stop();
|
|
|
|
|
|
Timer(Duration(seconds: 1), () {
|
|
|
@@ -204,18 +216,25 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
});
|
|
|
if (houseInfo.statusFlag == 0) {
|
|
|
if (houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
|
|
|
- roomTipsList.add(['房间创建成功,待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧']);
|
|
|
+ roomTipsList.add(['房间创建成功,待人数满员时会自动开启比赛,房主也可以手动开启比赛,同时,你也可以加入本次比赛']);
|
|
|
changeScroll();
|
|
|
- } else {
|
|
|
- roomTipsList.add(['待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛,已支付门票概不退换,快快点击右上角分享给好友加入战局吧']);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isJoin) {
|
|
|
+ roomTipsList
|
|
|
+ .add(['待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛。', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
|
|
|
}
|
|
|
|
|
|
changeScroll();
|
|
|
}
|
|
|
} else {
|
|
|
+ if (houseInfo.statusFlag == 0) {
|
|
|
+ roomTipsList
|
|
|
+ .add(['待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛。', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
|
|
|
+ }
|
|
|
playerInfo = PlayerInfo.fromJson(res.data);
|
|
|
|
|
|
- if (res.data.containsKey('medal')) {
|
|
|
+ if (playerInfo.medal != null) {
|
|
|
mymedal = res.data['medal'];
|
|
|
}
|
|
|
|
|
|
@@ -261,11 +280,35 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isJoin && houseInfo.statusFlag != 4 || isJoin == 0) {
|
|
|
+ if (isJoin && houseInfo.statusFlag != 4 || houseInfo.statusFlag == 0) {
|
|
|
timer = Timer.periodic(Duration(seconds: 1), (timer) {
|
|
|
+ print('检查');
|
|
|
getNowStatus();
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ if (isJoin && houseInfo.statusFlag == 4) {
|
|
|
+ HttpManager.get('appealInfo/getOne', data: {
|
|
|
+ 'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
|
|
|
+ 'playerInfoId': playerInfo.id,
|
|
|
+ }).then((res) {
|
|
|
+ if (res.success && res.data != null) {
|
|
|
+ setState(() {
|
|
|
+ canAppeal = true;
|
|
|
+ appealState = 1;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ setState(() {
|
|
|
+ canAppeal = true;
|
|
|
+ appealState = 0;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (houseInfo.statusFlag == 2 && playerInfo.beginTime != null && playerInfo.endTime == null) {
|
|
|
+ showSucessInfo();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//加入房间
|
|
|
@@ -368,11 +411,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
};
|
|
|
|
|
|
Future.delayed(Duration.zero, () async {
|
|
|
- final battery = Battery();
|
|
|
- final batteryLevel = await battery.batteryLevel;
|
|
|
- await MyDialog.showDialog(context, (batteryLevel < 50 ? '系统检测到你的电量低于50%' : '') + ' 为了正常上传比赛结果,建议插上电源线保持电量充足', submitText: '知道了');
|
|
|
-
|
|
|
- getRoomInfo();
|
|
|
+ getRoomInfo('first');
|
|
|
userInfo = StoreProvider.of<AppState>(context).state.userInfo;
|
|
|
// showStart();
|
|
|
});
|
|
|
@@ -469,6 +508,33 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ String timeStr = '';
|
|
|
+ int _time;
|
|
|
+ if (houseInfo == null) {
|
|
|
+ } else if (houseInfo.statusFlag == 0) {
|
|
|
+ //房价未开始比赛
|
|
|
+ _time = houseInfo.createTime + 600000 - DateTime.now().millisecondsSinceEpoch;
|
|
|
+ timeStr = '最迟 ${getSecondsMIn(_time)} 后自动开始比赛';
|
|
|
+ }
|
|
|
+ // else if (isJoin && (houseInfo.statusFlag == 2 || houseInfo.statusFlag == 3)) {
|
|
|
+ // _time = houseInfo.beginTime + 3600000 - DateTime.now().millisecondsSinceEpoch;
|
|
|
+ // timeStr = '最迟 ${getSecondsMIn(_time)} 后结算';
|
|
|
+ // }
|
|
|
+ List jiangpaiImg = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png', 'images/jiangpai_bojin.png'];
|
|
|
+
|
|
|
+ String img = '';
|
|
|
+ if (playerInfo != null) {
|
|
|
+ if (playerInfo.medal == 'platinum') {
|
|
|
+ img = jiangpaiImg[3];
|
|
|
+ } else if (playerInfo.medal == 'gold') {
|
|
|
+ img = jiangpaiImg[0];
|
|
|
+ } else if (playerInfo.medal == 'silver') {
|
|
|
+ img = jiangpaiImg[1];
|
|
|
+ } else if (playerInfo.medal == 'bronze') {
|
|
|
+ img = jiangpaiImg[2];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return LayoutBuilder(
|
|
|
builder: (BuildContext context, BoxConstraints viewportConstraints) {
|
|
|
return Container(
|
|
|
@@ -479,12 +545,11 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
onRefresh: () async {
|
|
|
await Future.delayed(const Duration(seconds: 1));
|
|
|
},
|
|
|
- child: SingleChildScrollView(
|
|
|
- controller: _tipController,
|
|
|
- physics: AlwaysScrollableScrollPhysics(),
|
|
|
- child: Stack(
|
|
|
- children: <Widget>[
|
|
|
- Column(
|
|
|
+ child: houseInfo != null
|
|
|
+ ? SingleChildScrollView(
|
|
|
+ controller: _tipController,
|
|
|
+ physics: AlwaysScrollableScrollPhysics(),
|
|
|
+ child: Column(
|
|
|
children: <Widget>[
|
|
|
houseInfo != null ? VideoWidget(videoSrc: houseInfo.video) : Container(),
|
|
|
// Image.network(topImg, width: double.infinity),
|
|
|
@@ -495,7 +560,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
children: <Widget>[
|
|
|
Container(
|
|
|
child: Text(
|
|
|
- roomInfo.containsKey('houseName') ? roomInfo['houseName'] : '',
|
|
|
+ houseInfo != null ? houseInfo.houseName : '',
|
|
|
style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
|
|
),
|
|
|
),
|
|
|
@@ -543,73 +608,152 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
// )
|
|
|
],
|
|
|
)),
|
|
|
- Container(
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 15),
|
|
|
- child: Row(
|
|
|
- // mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: <Widget>[
|
|
|
- Image.asset(
|
|
|
- 'images/icon_renshu.png',
|
|
|
- width: 20,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- (houseInfo != null ? (houseInfo.playerNumber ?? 0).toString() : '0') +
|
|
|
- '/' +
|
|
|
- (houseInfo != null ? houseInfo.maxNumber.toString() : '0'),
|
|
|
- style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
|
|
|
- ),
|
|
|
- Text('房间ID:' + (houseInfo.houseCode != null ? houseInfo.houseCode : ''))
|
|
|
- ],
|
|
|
- ),),
|
|
|
- // 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(
|
|
|
- // '×' +
|
|
|
- // (houseInfo != null
|
|
|
- // ? houseInfo.bonus.toString()
|
|
|
- // : '0'),
|
|
|
- // style: TextStyle(
|
|
|
- // color: PRIMARY_COLOR,
|
|
|
- // fontSize: 22,
|
|
|
- // fontWeight: FontWeight.w900,
|
|
|
- // ),
|
|
|
- // )
|
|
|
- // ],
|
|
|
- // ),
|
|
|
- // ),
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 15),
|
|
|
+ child: Row(
|
|
|
+ // mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ Image.asset(
|
|
|
+ 'images/icon_renshu.png',
|
|
|
+ width: 20,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ (houseInfo != null ? (houseInfo.playerNumber ?? 0).toString() : '0') +
|
|
|
+ '/' +
|
|
|
+ (houseInfo != null ? houseInfo.maxNumber.toString() : '0'),
|
|
|
+ style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ width: 30,
|
|
|
+ ),
|
|
|
+ Text.rich(TextSpan(children: [
|
|
|
+ TextSpan(text: "模式 ", style: TextStyle(color: Colors.white30, fontSize: 14)),
|
|
|
+ TextSpan(text: houseInfo.houseType == 0 ? '评分模式' : '吃鸡模式', style: TextStyle(color: Colors.white70, fontSize: 14)),
|
|
|
+ ])),
|
|
|
+ Container(
|
|
|
+ width: 30,
|
|
|
+ ),
|
|
|
+ Text.rich(TextSpan(children: [
|
|
|
+ TextSpan(text: "房间ID ", style: TextStyle(color: Colors.white30, fontSize: 14)),
|
|
|
+ TextSpan(text: houseInfo.houseCode != null ? houseInfo.houseCode : '', style: TextStyle(color: Colors.white70, fontSize: 14)),
|
|
|
+ ])),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+
|
|
|
+ timeStr != ''
|
|
|
+ ? Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Color.fromARGB(10, 212, 80, 75),
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(4)),
|
|
|
+ ),
|
|
|
+ margin: EdgeInsets.fromLTRB(15, 15, 15, 0),
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 10),
|
|
|
+ height: 40,
|
|
|
+ width: double.infinity,
|
|
|
+ child: Text(timeStr,
|
|
|
+ textAlign: TextAlign.center, style: TextStyle(fontSize: 15, color: Color(0xFFD4504B), fontWeight: FontWeight.w500)),
|
|
|
+ )
|
|
|
+ : Container(),
|
|
|
|
|
|
statuFlag != 4
|
|
|
? TipsListContent(tipsList: roomTipsList, houseInfo: houseInfo)
|
|
|
- : RankContent(
|
|
|
- roomId: widget.roomId,
|
|
|
+ : Container(
|
|
|
+ child: playerInfo != null
|
|
|
+ ? Column(
|
|
|
+ children: <Widget>[
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
+ padding: EdgeInsets.all(15),
|
|
|
+ height: 80,
|
|
|
+ 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,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: <Widget>[
|
|
|
+ Text('和平精英游戏结果', style: TextStyle(color: Colors.white54, fontSize: 13)),
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: <Widget>[
|
|
|
+ Text.rich(TextSpan(children: [
|
|
|
+ TextSpan(text: "名次 ", style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
+ TextSpan(
|
|
|
+ text: '${myRank}',
|
|
|
+ style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14)),
|
|
|
+ ])),
|
|
|
+ Text.rich(TextSpan(children: [
|
|
|
+ TextSpan(text: "时长 ", style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
+ TextSpan(
|
|
|
+ text: playerInfo.liveTime != null ? '${playerInfo.liveTime}' : '0',
|
|
|
+ style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14)),
|
|
|
+ ])),
|
|
|
+ Text.rich(TextSpan(children: [
|
|
|
+ TextSpan(text: "评分 ", style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
+ TextSpan(
|
|
|
+ text: '${playerInfo.score}',
|
|
|
+ style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14)),
|
|
|
+ ])),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
+ padding: EdgeInsets.all(15),
|
|
|
+ height: 140,
|
|
|
+ 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,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: <Widget>[
|
|
|
+ Text('比赛结果', style: TextStyle(color: Colors.white54, fontSize: 13)),
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: <Widget>[
|
|
|
+ Text("参数成员 ", style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
+ Text("${houseInfo.playerNumber}人 ",
|
|
|
+ style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: <Widget>[
|
|
|
+ Text("是否吃鸡 ", style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
+ Text(playerInfo.ranking == 1 ? '是' : '否',
|
|
|
+ style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: <Widget>[
|
|
|
+ Text("获得奖牌 ", style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
+ img != ''
|
|
|
+ ? Row(
|
|
|
+ children: <Widget>[
|
|
|
+ prefix1.Image.asset(
|
|
|
+ img,
|
|
|
+ width: 20,
|
|
|
+ ),
|
|
|
+ Text("+1",
|
|
|
+ style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ : Text("无", style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ : Container(),
|
|
|
),
|
|
|
Container(
|
|
|
width: double.infinity,
|
|
|
@@ -617,24 +761,8 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
)
|
|
|
],
|
|
|
),
|
|
|
- roomInfo.isNotEmpty
|
|
|
- ? Positioned(
|
|
|
- left: 0,
|
|
|
- top: 20,
|
|
|
- child: Container(
|
|
|
- padding: EdgeInsets.fromLTRB(4, 6, 15, 6),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Theme.of(context).primaryColor.withOpacity(0.76),
|
|
|
- borderRadius: BorderRadius.only(topRight: Radius.circular(30), bottomRight: Radius.circular(30))),
|
|
|
- child: Text(
|
|
|
- '房间号:' + (houseInfo.houseCode != null ? houseInfo.houseCode : ''),
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
- ),
|
|
|
- ),
|
|
|
- )
|
|
|
- : Container()
|
|
|
- ],
|
|
|
- ))),
|
|
|
+ )
|
|
|
+ : Container()),
|
|
|
);
|
|
|
},
|
|
|
);
|
|
|
@@ -771,12 +899,12 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
child: Text.rich(TextSpan(children: [
|
|
|
TextSpan(
|
|
|
text: '开始比赛',
|
|
|
- style: TextStyle(fontSize: 16),
|
|
|
+ style: TextStyle(fontSize: 16, color: Colors.white),
|
|
|
),
|
|
|
- TextSpan(
|
|
|
- text: '(${getSecondsMIn(_time)}秒后将自动开始)',
|
|
|
- style: TextStyle(fontSize: 12),
|
|
|
- )
|
|
|
+ // TextSpan(
|
|
|
+ // text: '(${getSecondsMIn(_time)}秒后将自动开始)',
|
|
|
+ // style: TextStyle(fontSize: 12),
|
|
|
+ // )
|
|
|
])),
|
|
|
),
|
|
|
onTapHomeMenu: () {
|
|
|
@@ -811,7 +939,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
height: 88,
|
|
|
- child: LinearButton(btntext: '预计' + getSecondsMIn(_time) + '后开始', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)));
|
|
|
+ child: LinearButton(btntext: '等待开始中', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)));
|
|
|
}
|
|
|
} else if (isJoin && statusFlag == 8) {
|
|
|
return Container(
|
|
|
@@ -838,23 +966,37 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
height: 88,
|
|
|
- child: LinearButton(btntext: '最迟在' + getSecondsMIn(_time) + '后结算', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)),
|
|
|
+ child: LinearButton(btntext: '预计还有 ' + getSecondsMIn(_time) + ' 结算', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)),
|
|
|
);
|
|
|
} else if (statusFlag == 4 && tabIndex == 0) {
|
|
|
- return Container(
|
|
|
- width: double.infinity,
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
- height: 88,
|
|
|
- child: RaisedButton(
|
|
|
- disabledColor: Color(0xFF727785),
|
|
|
- disabledTextColor: Color(0xFF15151D),
|
|
|
- child: Text(
|
|
|
- '已结束',
|
|
|
- style: TextStyle(fontSize: 16),
|
|
|
- ),
|
|
|
- onPressed: null,
|
|
|
- ),
|
|
|
- );
|
|
|
+ if (isJoin && canAppeal && appealState == 0) {
|
|
|
+ return Container(
|
|
|
+ width: double.infinity,
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
+ height: 88,
|
|
|
+ child: LinearButton(
|
|
|
+ btntext: '申诉结果',
|
|
|
+ colorList: [Color(0xFFAF4946), Color(0xFFAF4946)],
|
|
|
+ textColor: Colors.white,
|
|
|
+ onTapHomeMenu: () async {
|
|
|
+ final success = await Navigator.push(context, CupertinoPageRoute(builder: (context) => Appeal(playerInfo)));
|
|
|
+ if (success != null && success) {
|
|
|
+ Toast.show(context, '提交成功', 1500, 'success');
|
|
|
+ setState(() {
|
|
|
+ appealState = 1;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ));
|
|
|
+ } else if (isJoin && canAppeal && appealState == 1) {
|
|
|
+ return Container(
|
|
|
+ width: double.infinity,
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
+ height: 88,
|
|
|
+ child: LinearButton(btntext: '已提交申诉', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)));
|
|
|
+ } else {
|
|
|
+ return Container();
|
|
|
+ }
|
|
|
} else if (statusFlag == 4 && tabIndex == 1) {
|
|
|
return Container(
|
|
|
height: 48,
|
|
|
@@ -969,34 +1111,6 @@ class Tips extends StatelessWidget {
|
|
|
style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
)
|
|
|
: _textList(),
|
|
|
- showTongzhi
|
|
|
- ? FlatButton(
|
|
|
- padding: EdgeInsets.all(0),
|
|
|
- textColor: PRIMARY_COLOR,
|
|
|
- highlightColor: Colors.transparent,
|
|
|
- splashColor: Colors.transparent,
|
|
|
- child: Text(
|
|
|
- '查看竞赛须知',
|
|
|
- style: TextStyle(
|
|
|
- decoration: TextDecoration.underline,
|
|
|
- ),
|
|
|
- ),
|
|
|
- onPressed: () => {
|
|
|
- Navigator.of(context).push(PageRouteBuilder(
|
|
|
- opaque: false,
|
|
|
- transitionDuration: Duration(milliseconds: 300),
|
|
|
- transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
|
|
- return FadeTransition(
|
|
|
- opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
|
|
|
- child: child,
|
|
|
- );
|
|
|
- },
|
|
|
- pageBuilder: (BuildContext context, _, __) {
|
|
|
- return CompetitionInformation(houseInfo);
|
|
|
- }))
|
|
|
- },
|
|
|
- )
|
|
|
- : Container()
|
|
|
],
|
|
|
));
|
|
|
}
|
|
|
@@ -1009,7 +1123,7 @@ class Tips extends StatelessWidget {
|
|
|
),
|
|
|
TextSpan(
|
|
|
text: content[1],
|
|
|
- style: TextStyle(color: Color(0xFFC2524D), fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
+ style: TextStyle(color: Color(0xFFFFB726), fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
),
|
|
|
TextSpan(
|
|
|
text: content[2],
|
|
|
@@ -1017,7 +1131,7 @@ class Tips extends StatelessWidget {
|
|
|
),
|
|
|
TextSpan(
|
|
|
text: content[3],
|
|
|
- style: TextStyle(color: Color(0xFFC2524D), fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
+ style: TextStyle(color: Color(0xFFFFB726), fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
),
|
|
|
TextSpan(
|
|
|
text: content[4],
|