|
@@ -20,22 +20,20 @@ import 'SecondRoomInfo.dart';
|
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
import 'VideoPlayer.dart';
|
|
import 'VideoPlayer.dart';
|
|
|
import '../model/UserInfo.dart';
|
|
import '../model/UserInfo.dart';
|
|
|
|
|
+import './CompetitionNotice.dart';
|
|
|
|
|
|
|
|
class RoomInfo extends StatefulWidget {
|
|
class RoomInfo extends StatefulWidget {
|
|
|
- RoomInfo({Key key, this.roomId}) : super(key: key);
|
|
|
|
|
- final String roomId; // 用来储存传递过来的值
|
|
|
|
|
|
|
+ RoomInfo(this.houseInfo, {Key key}) : super(key: key);
|
|
|
|
|
+ final HouseInfo houseInfo; // 用来储存传递过来的值
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
RoomInfoState createState() => RoomInfoState();
|
|
RoomInfoState createState() => RoomInfoState();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-class RoomInfoState extends State<RoomInfo>
|
|
|
|
|
- with SingleTickerProviderStateMixin {
|
|
|
|
|
- List<Map> tabList;
|
|
|
|
|
|
|
+class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin {
|
|
|
TabController mController;
|
|
TabController mController;
|
|
|
Map roomInfo;
|
|
Map roomInfo;
|
|
|
HouseInfo houseInfo;
|
|
HouseInfo houseInfo;
|
|
|
- Map colorInfo;
|
|
|
|
|
bool isJoin = true;
|
|
bool isJoin = true;
|
|
|
PlayerInfo playerInfo;
|
|
PlayerInfo playerInfo;
|
|
|
bool isPop = false;
|
|
bool isPop = false;
|
|
@@ -45,41 +43,30 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
ScrollController _tipController;
|
|
ScrollController _tipController;
|
|
|
String _myUrl;
|
|
String _myUrl;
|
|
|
int tabIndex = 0;
|
|
int tabIndex = 0;
|
|
|
- UserInfo userInfo;
|
|
|
|
|
int myRank = 0;
|
|
int myRank = 0;
|
|
|
|
|
|
|
|
-//获取房间信息
|
|
|
|
|
|
|
+ //获取房间信息
|
|
|
Future<void> getRoomInfo() async {
|
|
Future<void> getRoomInfo() async {
|
|
|
- Toast.show(context, '加载中', -1, 'loading');
|
|
|
|
|
- Result res =
|
|
|
|
|
- await HttpManager.get('houseInfo/getOne', data: {'id': widget.roomId});
|
|
|
|
|
- Toast.hide();
|
|
|
|
|
|
|
+ Result res = await HttpManager.get('houseInfo/getOne', data: {'id': houseInfo.id});
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
setState(() {
|
|
setState(() {
|
|
|
roomInfo = res.data;
|
|
roomInfo = res.data;
|
|
|
houseInfo = HouseInfo.fromJson(res.data);
|
|
houseInfo = HouseInfo.fromJson(res.data);
|
|
|
});
|
|
});
|
|
|
- // showNotice();
|
|
|
|
|
- if (houseInfo.statusFlag == 0) {
|
|
|
|
|
- showNotice();
|
|
|
|
|
- }
|
|
|
|
|
} else {}
|
|
} else {}
|
|
|
-
|
|
|
|
|
checkJoinInfo();
|
|
checkJoinInfo();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//开始比赛
|
|
//开始比赛
|
|
|
Future<void> startGame() async {
|
|
Future<void> startGame() async {
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
- Result res = await HttpManager.post('houseInfo/handBegin',
|
|
|
|
|
- data: {'id': widget.roomId});
|
|
|
|
|
|
|
+ Result res = await HttpManager.post('houseInfo/handBegin', data: {'id': houseInfo.id});
|
|
|
Toast.hide();
|
|
Toast.hide();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//隔一秒检查是否开始
|
|
|
|
|
|
|
+ //隔一秒检查是否开始
|
|
|
Future<void> getNowStatus() async {
|
|
Future<void> getNowStatus() async {
|
|
|
- Result res = await HttpManager.get('houseInfo/getPlayerNum',
|
|
|
|
|
- data: {'id': widget.roomId});
|
|
|
|
|
|
|
+ Result res = await HttpManager.get('houseInfo/getPlayerNum', data: {'id': houseInfo.id});
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
if (houseInfo.statusFlag == 0 && res.data['statusFlag'] == 2) {
|
|
if (houseInfo.statusFlag == 0 && res.data['statusFlag'] == 2) {
|
|
|
showStart();
|
|
showStart();
|
|
@@ -103,8 +90,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
PageRouteBuilder(
|
|
PageRouteBuilder(
|
|
|
opaque: false,
|
|
opaque: false,
|
|
|
transitionDuration: Duration(milliseconds: 300),
|
|
transitionDuration: Duration(milliseconds: 300),
|
|
|
- transitionsBuilder: (BuildContext context, Animation<double> animation,
|
|
|
|
|
- Animation<double> secondaryAnimation, Widget child) {
|
|
|
|
|
|
|
+ transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
|
|
return FadeTransition(
|
|
return FadeTransition(
|
|
|
opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
|
|
opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
|
|
|
child: child,
|
|
child: child,
|
|
@@ -127,9 +113,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
} else {
|
|
} else {
|
|
|
data['statusFlag'] = 6;
|
|
data['statusFlag'] = 6;
|
|
|
}
|
|
}
|
|
|
- Toast.show(context, '加载中', -1, 'loading');
|
|
|
|
|
Result res = await HttpManager.post('playerInfo/update', data: data);
|
|
Result res = await HttpManager.post('playerInfo/update', data: data);
|
|
|
- Toast.hide();
|
|
|
|
|
|
|
|
|
|
// MyDialog.showDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
|
|
// MyDialog.showDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
|
|
|
// Timer(Duration(seconds: 10), () {
|
|
// Timer(Duration(seconds: 10), () {
|
|
@@ -145,8 +129,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
showSucessInfo();
|
|
showSucessInfo();
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- showCustomDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛',
|
|
|
|
|
- submitText: '知道了');
|
|
|
|
|
|
|
+ showCustomDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
|
|
|
Timer(Duration(seconds: 10), () {
|
|
Timer(Duration(seconds: 10), () {
|
|
|
showSucessInfo();
|
|
showSucessInfo();
|
|
|
});
|
|
});
|
|
@@ -161,10 +144,8 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
|
|
|
|
|
//开始录屏提示框
|
|
//开始录屏提示框
|
|
|
void showSucessInfo() {
|
|
void showSucessInfo() {
|
|
|
- showCustomDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖',
|
|
|
|
|
- title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
|
|
|
|
|
- HttpManager.post('playerInfo/update',
|
|
|
|
|
- data: {'id': playerInfo.id, 'statusFlag': 3});
|
|
|
|
|
|
|
+ showCustomDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖', title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
|
|
|
|
|
+ HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': 3});
|
|
|
bool success = await ScreenStreamPlugin.stop();
|
|
bool success = await ScreenStreamPlugin.stop();
|
|
|
|
|
|
|
|
Timer(Duration(seconds: 1), () {
|
|
Timer(Duration(seconds: 1), () {
|
|
@@ -178,40 +159,25 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Future<void> getEndTips() async {
|
|
Future<void> getEndTips() async {
|
|
|
- Result res = await HttpManager.get('playerInfo/endNum',
|
|
|
|
|
- data: {'houseId': widget.roomId});
|
|
|
|
|
|
|
+ Result res = await HttpManager.get('playerInfo/endNum', data: {'houseId': houseInfo.id});
|
|
|
|
|
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- int time = houseInfo.beginTime +
|
|
|
|
|
- 1 * 3600 * 1000 -
|
|
|
|
|
- DateTime.now().millisecondsSinceEpoch;
|
|
|
|
|
|
|
+ int time = houseInfo.beginTime + 1 * 3600 * 1000 - DateTime.now().millisecondsSinceEpoch;
|
|
|
var nowTime = (time ~/ 1000 ~/ 60) % 60;
|
|
var nowTime = (time ~/ 1000 ~/ 60) % 60;
|
|
|
setState(() {
|
|
setState(() {
|
|
|
- roomTipsList.add([
|
|
|
|
|
- '你已完成本次比赛,当前完成人数 ',
|
|
|
|
|
- res.data.toString(),
|
|
|
|
|
- '人,比赛需要等待所有人完成后方可结算奖励',
|
|
|
|
|
- '',
|
|
|
|
|
- ',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励'
|
|
|
|
|
- ]);
|
|
|
|
|
- changeScroll();
|
|
|
|
|
|
|
+ roomTipsList.add(['你已完成本次比赛,当前完成人数 ', res.data.toString(), '人,比赛需要等待所有人完成后方可结算奖励', '', ',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励']);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//未确认比赛弹窗
|
|
//未确认比赛弹窗
|
|
|
void showBackDialog(type) {
|
|
void showBackDialog(type) {
|
|
|
- showCustomDialog(context,
|
|
|
|
|
- (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系统已经判定您放弃比赛,谢谢您的参与。',
|
|
|
|
|
- title: '很遗憾');
|
|
|
|
|
|
|
+ showCustomDialog(context, (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系统已经判定您放弃比赛,谢谢您的参与。', title: '很遗憾');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//检查加入信息
|
|
//检查加入信息
|
|
|
Future<void> checkJoinInfo() async {
|
|
Future<void> checkJoinInfo() async {
|
|
|
- Result res = await HttpManager.get('playerInfo/getOne', data: {
|
|
|
|
|
- 'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
|
|
|
|
|
- 'houseId': widget.roomId
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ Result res = await HttpManager.get('playerInfo/getOne', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'houseId': houseInfo.id});
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
if (res.data == null) {
|
|
if (res.data == null) {
|
|
|
setState(() {
|
|
setState(() {
|
|
@@ -227,8 +193,6 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
'同房间内的玩家进行竞赛,所有吃上鸡的玩家均可获得奖金,即平分总奖金池的${houseInfo.houseLevel.avgRatio}%。注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费, 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金。'
|
|
'同房间内的玩家进行竞赛,所有吃上鸡的玩家均可获得奖金,即平分总奖金池的${houseInfo.houseLevel.avgRatio}%。注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费, 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金。'
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- changeScroll();
|
|
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
playerInfo = PlayerInfo.fromJson(res.data);
|
|
playerInfo = PlayerInfo.fromJson(res.data);
|
|
@@ -238,8 +202,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
print('本地视频' + playerInfo.id.toString());
|
|
print('本地视频' + playerInfo.id.toString());
|
|
|
print(_myUrl);
|
|
print(_myUrl);
|
|
|
|
|
|
|
|
- Result rankRes = await HttpManager.get('playerInfo/userRank',
|
|
|
|
|
- data: {'id': playerInfo.id});
|
|
|
|
|
|
|
+ Result rankRes = await HttpManager.get('playerInfo/userRank', data: {'id': playerInfo.id});
|
|
|
if (rankRes.success) {
|
|
if (rankRes.success) {
|
|
|
myRank = rankRes.data + 1;
|
|
myRank = rankRes.data + 1;
|
|
|
}
|
|
}
|
|
@@ -249,21 +212,12 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
isJoin = true;
|
|
isJoin = true;
|
|
|
});
|
|
});
|
|
|
if (houseInfo.statusFlag == 0) {
|
|
if (houseInfo.statusFlag == 0) {
|
|
|
- if (houseInfo.createUser ==
|
|
|
|
|
- StoreProvider.of<AppState>(context)
|
|
|
|
|
- .state
|
|
|
|
|
- .userInfo
|
|
|
|
|
- .id
|
|
|
|
|
- .toString()) {
|
|
|
|
|
- roomTipsList.add([
|
|
|
|
|
- '房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧'
|
|
|
|
|
- ]);
|
|
|
|
|
- changeScroll();
|
|
|
|
|
|
|
+ if (houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
|
|
|
|
|
+ roomTipsList.add(['房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧']);
|
|
|
} else {
|
|
} else {
|
|
|
// roomTipsList.add([
|
|
// roomTipsList.add([
|
|
|
// '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
|
|
// '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
|
|
|
// ]);
|
|
// ]);
|
|
|
- // changeScroll();
|
|
|
|
|
}
|
|
}
|
|
|
// Timer(Duration(seconds: 1), () {
|
|
// Timer(Duration(seconds: 1), () {
|
|
|
// roomTipsList.add([
|
|
// roomTipsList.add([
|
|
@@ -276,9 +230,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
// changeScroll();
|
|
// changeScroll();
|
|
|
// });
|
|
// });
|
|
|
} else if (houseInfo.statusFlag != 4) {
|
|
} else if (houseInfo.statusFlag != 4) {
|
|
|
- if (playerInfo.statusFlag == 3 ||
|
|
|
|
|
- playerInfo.statusFlag == 8 ||
|
|
|
|
|
- playerInfo.statusFlag == 9) {
|
|
|
|
|
|
|
+ if (playerInfo.statusFlag == 3 || playerInfo.statusFlag == 8 || playerInfo.statusFlag == 9) {
|
|
|
getEndTips();
|
|
getEndTips();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -295,10 +247,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
//加入房间
|
|
//加入房间
|
|
|
Future<void> joinRoom() async {
|
|
Future<void> joinRoom() async {
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
- Result res = await HttpManager.post('houseInfo/join', data: {
|
|
|
|
|
- 'houseId': widget.roomId,
|
|
|
|
|
- 'userId': StoreProvider.of<AppState>(context).state.userInfo.id
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ Result res = await HttpManager.post('houseInfo/join', data: {'houseId': houseInfo.id, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
|
|
|
Toast.hide();
|
|
Toast.hide();
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
Toast.show(context, '加入成功', 1500, 'success');
|
|
Toast.show(context, '加入成功', 1500, 'success');
|
|
@@ -308,52 +257,21 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//展示通知
|
|
|
|
|
- void showNotice() {
|
|
|
|
|
- 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);
|
|
|
|
|
- }));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-//改变滚动条
|
|
|
|
|
- void changeScroll() {
|
|
|
|
|
- Timer(Duration(seconds: 1), () {
|
|
|
|
|
- _tipController.animateTo(context.size.height,
|
|
|
|
|
- duration: Duration(milliseconds: 1500), curve: Curves.ease);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
//获取分秒
|
|
//获取分秒
|
|
|
String getSecondsMIn(int time) {
|
|
String getSecondsMIn(int time) {
|
|
|
if (time == null) {
|
|
if (time == null) {
|
|
|
return '';
|
|
return '';
|
|
|
} else {
|
|
} else {
|
|
|
- return ((time ~/ 1000 ~/ 60) % 60).toString() +
|
|
|
|
|
- '分' +
|
|
|
|
|
- (time ~/ 1000 % 60).toString() +
|
|
|
|
|
- '秒';
|
|
|
|
|
|
|
+ return ((time ~/ 1000 ~/ 60) % 60).toString() + '分' + (time ~/ 1000 % 60).toString() + '秒';
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
void initState() {
|
|
void initState() {
|
|
|
super.initState();
|
|
super.initState();
|
|
|
- tabList = [
|
|
|
|
|
- {'title': '房间信息', 'value': 1},
|
|
|
|
|
- {'title': '人员列表', 'value': 2}
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ houseInfo = widget.houseInfo;
|
|
|
mController = TabController(
|
|
mController = TabController(
|
|
|
- length: tabList.length,
|
|
|
|
|
|
|
+ length: 2,
|
|
|
vsync: this,
|
|
vsync: this,
|
|
|
);
|
|
);
|
|
|
|
|
|
|
@@ -366,15 +284,8 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
_tipController = ScrollController();
|
|
_tipController = ScrollController();
|
|
|
roomInfo = {};
|
|
roomInfo = {};
|
|
|
|
|
|
|
|
- colorInfo = {
|
|
|
|
|
- '黄金': Color(0xFFF9D881),
|
|
|
|
|
- '白银': Color(0xFFAFCAD8),
|
|
|
|
|
- '青铜': Color(0xFFE18D50),
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
Future.delayed(Duration.zero, () {
|
|
Future.delayed(Duration.zero, () {
|
|
|
getRoomInfo();
|
|
getRoomInfo();
|
|
|
- userInfo = StoreProvider.of<AppState>(context).state.userInfo;
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -397,21 +308,19 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
return WillPopScope(
|
|
return WillPopScope(
|
|
|
child: Scaffold(
|
|
child: Scaffold(
|
|
|
appBar: AppBar(
|
|
appBar: AppBar(
|
|
|
- backgroundColor: PRIMARY_COLOR,
|
|
|
|
|
title: Container(
|
|
title: Container(
|
|
|
child: TabBar(
|
|
child: TabBar(
|
|
|
controller: mController,
|
|
controller: mController,
|
|
|
- labelColor: Colors.white,
|
|
|
|
|
- unselectedLabelColor: Colors.white.withOpacity(0.5),
|
|
|
|
|
|
|
+ labelColor: PRIMARY_COLOR,
|
|
|
|
|
+ unselectedLabelColor: Color(0xCCFFFFFF),
|
|
|
labelStyle: TextStyle(fontSize: 16.0),
|
|
labelStyle: TextStyle(fontSize: 16.0),
|
|
|
- indicatorColor: Colors.white,
|
|
|
|
|
|
|
+ indicatorColor: PRIMARY_COLOR,
|
|
|
indicatorWeight: 3,
|
|
indicatorWeight: 3,
|
|
|
indicatorSize: TabBarIndicatorSize.label,
|
|
indicatorSize: TabBarIndicatorSize.label,
|
|
|
- tabs: tabList.map((item) {
|
|
|
|
|
- return Tab(
|
|
|
|
|
- text: item['title'],
|
|
|
|
|
- );
|
|
|
|
|
- }).toList(),
|
|
|
|
|
|
|
+ tabs: <Widget>[
|
|
|
|
|
+ Tab(text: '房间信息'),
|
|
|
|
|
+ Tab(text: '参赛成员'),
|
|
|
|
|
+ ],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
centerTitle: true,
|
|
centerTitle: true,
|
|
@@ -430,10 +339,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
color: BG_SUB_COLOR,
|
|
color: BG_SUB_COLOR,
|
|
|
child: TabBarView(
|
|
child: TabBarView(
|
|
|
controller: mController,
|
|
controller: mController,
|
|
|
- children: [
|
|
|
|
|
- _firstPage(),
|
|
|
|
|
- SecondPage(roomId: widget.roomId, status: status)
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ children: [_firstPage(), SecondPage(houseInfo)],
|
|
|
)),
|
|
)),
|
|
|
floatingActionButton: _joinBtn(),
|
|
floatingActionButton: _joinBtn(),
|
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
@@ -456,24 +362,8 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Widget _firstPage() {
|
|
Widget _firstPage() {
|
|
|
- Map houseLevelInfo = roomInfo.isNotEmpty ? roomInfo['houseLevelInfo'] : {};
|
|
|
|
|
-
|
|
|
|
|
- String levelName = houseLevelInfo.containsKey('levelName')
|
|
|
|
|
- ? houseLevelInfo['levelName']
|
|
|
|
|
- : '黄金';
|
|
|
|
|
-
|
|
|
|
|
- int joinMoney =
|
|
|
|
|
- houseLevelInfo.containsKey('feeRatio') && roomInfo.containsKey('bonus')
|
|
|
|
|
- ? houseLevelInfo['feeRatio'] * roomInfo['bonus']
|
|
|
|
|
- : 0;
|
|
|
|
|
-
|
|
|
|
|
- String topImg =
|
|
|
|
|
- 'http://images.liqucn.com/img/h22/h70/img_localize_8e824debdd9ee29522690f36680e2d8e_600x337.png';
|
|
|
|
|
int statuFlag = 0;
|
|
int statuFlag = 0;
|
|
|
if (houseInfo != null) {
|
|
if (houseInfo != null) {
|
|
|
- if (houseInfo.video != null) {
|
|
|
|
|
- topImg = houseInfo.video;
|
|
|
|
|
- }
|
|
|
|
|
if (houseInfo.statusFlag != null) {
|
|
if (houseInfo.statusFlag != null) {
|
|
|
statuFlag = houseInfo.statusFlag;
|
|
statuFlag = houseInfo.statusFlag;
|
|
|
}
|
|
}
|
|
@@ -494,122 +384,96 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
physics: AlwaysScrollableScrollPhysics(),
|
|
physics: AlwaysScrollableScrollPhysics(),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
- houseInfo != null
|
|
|
|
|
- ? VideoWidget(videoSrc: houseInfo.video)
|
|
|
|
|
- : Container(),
|
|
|
|
|
|
|
+ houseInfo != null ? VideoWidget(videoSrc: houseInfo.video) : Container(),
|
|
|
// Image.network(topImg, width: double.infinity),
|
|
// Image.network(topImg, width: double.infinity),
|
|
|
Container(
|
|
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,
|
|
|
|
|
|
|
+ height: 60,
|
|
|
|
|
+ padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ children: <Widget>[
|
|
|
|
|
+ Expanded(
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ houseInfo.houseName,
|
|
|
|
|
+ style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),
|
|
|
),
|
|
),
|
|
|
- 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(
|
|
|
|
|
+ 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)),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
- 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(
|
|
Container(
|
|
|
- margin: EdgeInsets.only(top: 14),
|
|
|
|
|
- width: 200,
|
|
|
|
|
height: 40,
|
|
height: 40,
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- border: Border.all(
|
|
|
|
|
- width: 1,
|
|
|
|
|
- color: PRIMARY_COLOR,
|
|
|
|
|
- style: BorderStyle.solid),
|
|
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(2)),
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ margin: EdgeInsets.fromLTRB(15, 0, 15, 0),
|
|
|
|
|
+ color: Color(0x1A1990F8),
|
|
|
child: Row(
|
|
child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
- Text(
|
|
|
|
|
- '奖金',
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: PRIMARY_COLOR,
|
|
|
|
|
- fontSize: 13,
|
|
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
+ Expanded(
|
|
|
|
|
+ flex: 1,
|
|
|
|
|
+ child: CupertinoButton(
|
|
|
|
|
+ padding: EdgeInsets.all(0),
|
|
|
|
|
+ onPressed: () {},
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ '返回锦标赛',
|
|
|
|
|
+ style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
Container(
|
|
Container(
|
|
|
- padding: EdgeInsets.only(left: 10, right: 6),
|
|
|
|
|
- child: Image.asset(
|
|
|
|
|
- 'images/icon_jinbi_da_hong.png',
|
|
|
|
|
- width: 20,
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ width: 1,
|
|
|
|
|
+ height: 12,
|
|
|
|
|
+ color: PRIMARY_COLOR,
|
|
|
),
|
|
),
|
|
|
- Text(
|
|
|
|
|
- '×' +
|
|
|
|
|
- (houseInfo != null
|
|
|
|
|
- ? houseInfo.bonus.toString()
|
|
|
|
|
- : '0'),
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: PRIMARY_COLOR,
|
|
|
|
|
- fontSize: 22,
|
|
|
|
|
- fontWeight: FontWeight.w900,
|
|
|
|
|
|
|
+ Expanded(
|
|
|
|
|
+ flex: 1,
|
|
|
|
|
+ child: CupertinoButton(
|
|
|
|
|
+ padding: EdgeInsets.all(0),
|
|
|
|
|
+ onPressed: () {
|
|
|
|
|
+ showNotice(context);
|
|
|
|
|
+ },
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ '竞赛须知',
|
|
|
|
|
+ style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
- )
|
|
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Container(
|
|
|
|
|
+ height: 40,
|
|
|
|
|
+ margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: Color(0x1AFFFF00),
|
|
|
|
|
+ border: Border.all(
|
|
|
|
|
+ width: 1,
|
|
|
|
|
+ color: Colors.yellow,
|
|
|
|
|
+ )),
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
|
+ children: <Widget>[
|
|
|
|
|
+ Text('积分 加成+0%', style: TextStyle(color: Colors.yellow, fontSize: 12)),
|
|
|
|
|
+ Text('保底 0积分', style: TextStyle(color: Colors.yellow, fontSize: 12)),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
-
|
|
|
|
|
statuFlag != 4
|
|
statuFlag != 4
|
|
|
- ? TipsListContent(
|
|
|
|
|
- tipsList: roomTipsList, houseInfo: houseInfo)
|
|
|
|
|
|
|
+ ? TipsListContent(tipsList: roomTipsList, houseInfo: houseInfo)
|
|
|
: RankContent(
|
|
: RankContent(
|
|
|
- roomId: widget.roomId,
|
|
|
|
|
|
|
+ roomId: houseInfo.id.toString(),
|
|
|
),
|
|
),
|
|
|
Container(
|
|
Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
@@ -623,7 +487,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Widget _joinBtn() {
|
|
Widget _joinBtn() {
|
|
|
- int joinMoney = houseInfo != null ? houseInfo.houseLevel.entryCoin : 0;
|
|
|
|
|
|
|
+ int joinMoney = 0;
|
|
|
int statusFlag = houseInfo != null ? houseInfo.statusFlag : 1;
|
|
int statusFlag = houseInfo != null ? houseInfo.statusFlag : 1;
|
|
|
int playerStatus = playerInfo != null ? playerInfo.statusFlag : 0;
|
|
int playerStatus = playerInfo != null ? playerInfo.statusFlag : 0;
|
|
|
if (!isJoin && statusFlag == 0) {
|
|
if (!isJoin && statusFlag == 0) {
|
|
@@ -631,11 +495,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
color: BG_SUB_COLOR,
|
|
color: BG_SUB_COLOR,
|
|
|
width: ScreenUtil().setWidth(375),
|
|
width: ScreenUtil().setWidth(375),
|
|
|
height: 48 + ScreenUtil().setHeight(40),
|
|
height: 48 + ScreenUtil().setHeight(40),
|
|
|
- padding: EdgeInsets.only(
|
|
|
|
|
- top: ScreenUtil().setHeight(20),
|
|
|
|
|
- bottom: ScreenUtil().setHeight(20),
|
|
|
|
|
- left: 15,
|
|
|
|
|
- right: 15),
|
|
|
|
|
|
|
+ padding: EdgeInsets.only(top: ScreenUtil().setHeight(20), bottom: ScreenUtil().setHeight(20), left: 15, right: 15),
|
|
|
child: RaisedButton(
|
|
child: RaisedButton(
|
|
|
textColor: Colors.white,
|
|
textColor: Colors.white,
|
|
|
child: Row(
|
|
child: Row(
|
|
@@ -645,10 +505,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
margin: EdgeInsets.only(left: 20),
|
|
margin: EdgeInsets.only(left: 20),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
'加入房间',
|
|
'加入房间',
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- fontSize: 16,
|
|
|
|
|
- fontWeight: FontWeight.w500),
|
|
|
|
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
|
|
))
|
|
))
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -672,17 +529,9 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
} else if (isJoin && statusFlag == 0) {
|
|
} else if (isJoin && statusFlag == 0) {
|
|
|
int _time;
|
|
int _time;
|
|
|
if (houseInfo != null) {
|
|
if (houseInfo != null) {
|
|
|
- _time = houseInfo.createTime +
|
|
|
|
|
- 600000 -
|
|
|
|
|
- DateTime.now().millisecondsSinceEpoch;
|
|
|
|
|
|
|
+ _time = houseInfo.createTime + 600000 - DateTime.now().millisecondsSinceEpoch;
|
|
|
}
|
|
}
|
|
|
- if (houseInfo != null &&
|
|
|
|
|
- houseInfo.createUser ==
|
|
|
|
|
- StoreProvider.of<AppState>(context)
|
|
|
|
|
- .state
|
|
|
|
|
- .userInfo
|
|
|
|
|
- .id
|
|
|
|
|
- .toString()) {
|
|
|
|
|
|
|
+ if (houseInfo != null && houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
|
|
|
return Container(
|
|
return Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
@@ -699,8 +548,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
)
|
|
)
|
|
|
])),
|
|
])),
|
|
|
onPressed: () {
|
|
onPressed: () {
|
|
|
- showCustomDialog(context, '确认要开始比赛吗?', isCancel: true,
|
|
|
|
|
- onsubmit: () {
|
|
|
|
|
|
|
+ showCustomDialog(context, '确认要开始比赛吗?', isCancel: true, onsubmit: () {
|
|
|
print('开始');
|
|
print('开始');
|
|
|
startGame();
|
|
startGame();
|
|
|
});
|
|
});
|
|
@@ -713,7 +561,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
height: 88,
|
|
height: 88,
|
|
|
child: RaisedButton(
|
|
child: RaisedButton(
|
|
|
- disabledColor: Color(0xFF914244),
|
|
|
|
|
|
|
+ disabledColor: Color(0xFF1990F8),
|
|
|
disabledTextColor: Color(0xFF252532),
|
|
disabledTextColor: Color(0xFF252532),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
'预计' + getSecondsMIn(_time) + '后开始',
|
|
'预计' + getSecondsMIn(_time) + '后开始',
|
|
@@ -729,7 +577,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
height: 88,
|
|
height: 88,
|
|
|
child: RaisedButton(
|
|
child: RaisedButton(
|
|
|
- disabledColor: Color(0xFF914244),
|
|
|
|
|
|
|
+ disabledColor: Color(0xFF1990F8),
|
|
|
disabledTextColor: Color(0xFF252532),
|
|
disabledTextColor: Color(0xFF252532),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
'正在努力解析视频中',
|
|
'正在努力解析视频中',
|
|
@@ -741,16 +589,14 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
} else if (isJoin && (statusFlag == 2 || statusFlag == 3)) {
|
|
} else if (isJoin && (statusFlag == 2 || statusFlag == 3)) {
|
|
|
int _time;
|
|
int _time;
|
|
|
if (houseInfo != null) {
|
|
if (houseInfo != null) {
|
|
|
- _time = houseInfo.beginTime +
|
|
|
|
|
- 3600000 -
|
|
|
|
|
- DateTime.now().millisecondsSinceEpoch;
|
|
|
|
|
|
|
+ _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),
|
|
|
height: 88,
|
|
height: 88,
|
|
|
child: RaisedButton(
|
|
child: RaisedButton(
|
|
|
- disabledColor: Color(0xFF914244),
|
|
|
|
|
|
|
+ disabledColor: Color(0xFF1990F8),
|
|
|
disabledTextColor: Color(0xFF252532),
|
|
disabledTextColor: Color(0xFF252532),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
'最迟在' + getSecondsMIn(_time) + '后结算',
|
|
'最迟在' + getSecondsMIn(_time) + '后结算',
|
|
@@ -765,7 +611,7 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
height: 88,
|
|
height: 88,
|
|
|
child: RaisedButton(
|
|
child: RaisedButton(
|
|
|
- disabledColor: Color(0xFF727785),
|
|
|
|
|
|
|
+ disabledColor: Color(0xFF1990F8),
|
|
|
disabledTextColor: Color(0xFF15151D),
|
|
disabledTextColor: Color(0xFF15151D),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
'已结束',
|
|
'已结束',
|
|
@@ -775,64 +621,61 @@ class RoomInfoState extends State<RoomInfo>
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
} else if (statusFlag == 4 && tabIndex == 1) {
|
|
} else if (statusFlag == 4 && tabIndex == 1) {
|
|
|
- return Container(
|
|
|
|
|
- height: 48,
|
|
|
|
|
- padding: EdgeInsets.symmetric(vertical: 9, horizontal: 20),
|
|
|
|
|
- color: Color(0xFFC2524D),
|
|
|
|
|
- child: Row(
|
|
|
|
|
- children: <Widget>[
|
|
|
|
|
- Container(
|
|
|
|
|
- width: 30,
|
|
|
|
|
- height: 30,
|
|
|
|
|
- margin: EdgeInsets.only(right: 10),
|
|
|
|
|
- child: CircleAvatar(
|
|
|
|
|
- backgroundImage: NetworkImage(userInfo.icon),
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- Expanded(
|
|
|
|
|
- flex: 1,
|
|
|
|
|
- child: Text(
|
|
|
|
|
- userInfo.nickname,
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- fontSize: 14,
|
|
|
|
|
- color: Color(0xFF252532),
|
|
|
|
|
|
|
+ return Builder(
|
|
|
|
|
+ builder: (context) {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ height: 48,
|
|
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 9, horizontal: 20),
|
|
|
|
|
+ color: SUB_COLOR,
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ children: <Widget>[
|
|
|
|
|
+ Container(
|
|
|
|
|
+ width: 30,
|
|
|
|
|
+ height: 30,
|
|
|
|
|
+ margin: EdgeInsets.only(right: 10),
|
|
|
|
|
+ child: CircleAvatar(
|
|
|
|
|
+ backgroundImage: NetworkImage(StoreProvider.of<AppState>(context).state.userInfo.icon),
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- _myUrl != null
|
|
|
|
|
- ? Container(
|
|
|
|
|
- width: 68,
|
|
|
|
|
- height: 24,
|
|
|
|
|
- margin: EdgeInsets.only(right: 10),
|
|
|
|
|
- child: OutlineButton(
|
|
|
|
|
- textColor: BG_SUB_COLOR,
|
|
|
|
|
- borderSide: BorderSide(color: BG_SUB_COLOR),
|
|
|
|
|
- padding: EdgeInsets.all(0),
|
|
|
|
|
- highlightColor: PRIMARY_COLOR.withOpacity(0.8),
|
|
|
|
|
- highlightedBorderColor: BG_SUB_COLOR,
|
|
|
|
|
- child: Text(
|
|
|
|
|
- '查看回放',
|
|
|
|
|
- style: TextStyle(fontSize: 12),
|
|
|
|
|
- ),
|
|
|
|
|
- onPressed: () => {
|
|
|
|
|
- Navigator.push(
|
|
|
|
|
- context,
|
|
|
|
|
- CupertinoPageRoute(
|
|
|
|
|
- builder: (context) => VideoPlayerPage(
|
|
|
|
|
- videoUrl: _myUrl, fileType: 'file')))
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ Expanded(
|
|
|
|
|
+ flex: 1,
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ StoreProvider.of<AppState>(context).state.userInfo.nickname,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: 14,
|
|
|
|
|
+ color: Colors.white,
|
|
|
),
|
|
),
|
|
|
- )
|
|
|
|
|
- : Container(),
|
|
|
|
|
- Text(
|
|
|
|
|
- myRank != 0 ? '第${myRank}名' : '未上榜',
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- fontSize: 14,
|
|
|
|
|
- color: Color(0xFF252532),
|
|
|
|
|
- fontWeight: FontWeight.w500),
|
|
|
|
|
- )
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ _myUrl != null
|
|
|
|
|
+ ? Container(
|
|
|
|
|
+ width: 68,
|
|
|
|
|
+ height: 24,
|
|
|
|
|
+ margin: EdgeInsets.only(right: 10),
|
|
|
|
|
+ child: OutlineButton(
|
|
|
|
|
+ textColor: BG_SUB_COLOR,
|
|
|
|
|
+ borderSide: BorderSide(color: BG_SUB_COLOR),
|
|
|
|
|
+ padding: EdgeInsets.all(0),
|
|
|
|
|
+ highlightColor: PRIMARY_COLOR.withOpacity(0.8),
|
|
|
|
|
+ highlightedBorderColor: BG_SUB_COLOR,
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ '查看回放',
|
|
|
|
|
+ style: TextStyle(fontSize: 12),
|
|
|
|
|
+ ),
|
|
|
|
|
+ onPressed: () {
|
|
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => VideoPlayerPage(videoUrl: _myUrl, fileType: 'file')));
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ : Container(),
|
|
|
|
|
+ Text(
|
|
|
|
|
+ myRank != 0 ? '第${myRank}名' : '未上榜',
|
|
|
|
|
+ style: TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w500),
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
);
|
|
);
|
|
|
} else {
|
|
} else {
|
|
|
return Container();
|
|
return Container();
|
|
@@ -860,10 +703,7 @@ class TipsListContent extends StatelessWidget {
|
|
|
List<Widget> _list() {
|
|
List<Widget> _list() {
|
|
|
List<Widget> myList = [];
|
|
List<Widget> myList = [];
|
|
|
for (int i = 0; i < tipsList.length; i++) {
|
|
for (int i = 0; i < tipsList.length; i++) {
|
|
|
- myList.add(Tips(
|
|
|
|
|
- content: tipsList[i],
|
|
|
|
|
- showTongzhi: (tipsList[i].length == 1 && i == 0) ? true : false,
|
|
|
|
|
- houseInfo: houseInfo));
|
|
|
|
|
|
|
+ myList.add(Tips(content: tipsList[i], showTongzhi: (tipsList[i].length == 1 && i == 0) ? true : false, houseInfo: houseInfo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return myList;
|
|
return myList;
|
|
@@ -871,8 +711,7 @@ class TipsListContent extends StatelessWidget {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
class Tips extends StatelessWidget {
|
|
class Tips extends StatelessWidget {
|
|
|
- Tips({Key key, this.content, this.showTongzhi, this.houseInfo})
|
|
|
|
|
- : super(key: key);
|
|
|
|
|
|
|
+ Tips({Key key, this.content, this.showTongzhi, this.houseInfo}) : super(key: key);
|
|
|
final List<String> content;
|
|
final List<String> content;
|
|
|
final bool showTongzhi;
|
|
final bool showTongzhi;
|
|
|
final HouseInfo houseInfo;
|
|
final HouseInfo houseInfo;
|
|
@@ -881,15 +720,7 @@ class Tips extends StatelessWidget {
|
|
|
return Container(
|
|
return Container(
|
|
|
padding: EdgeInsets.all(15),
|
|
padding: EdgeInsets.all(15),
|
|
|
margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
|
|
margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- gradient: LinearGradient(
|
|
|
|
|
- colors: [Color(0xFF464B6A), Color(0xFF35395E)],
|
|
|
|
|
- begin: Alignment.topCenter,
|
|
|
|
|
- end: Alignment.bottomCenter),
|
|
|
|
|
- borderRadius: BorderRadius.only(
|
|
|
|
|
- topRight: Radius.circular(8),
|
|
|
|
|
- bottomLeft: Radius.circular(8),
|
|
|
|
|
- bottomRight: Radius.circular(8))),
|
|
|
|
|
|
|
+ color: Color(0xFF293354),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
content.length == 1
|
|
content.length == 1
|
|
@@ -910,24 +741,9 @@ class Tips extends StatelessWidget {
|
|
|
decoration: TextDecoration.underline,
|
|
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);
|
|
|
|
|
- }))
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ onPressed: () {
|
|
|
|
|
+ showNotice(context);
|
|
|
|
|
+ },
|
|
|
)
|
|
)
|
|
|
: Container()
|
|
: Container()
|
|
|
],
|
|
],
|
|
@@ -935,34 +751,19 @@ class Tips extends StatelessWidget {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Widget _textList() {
|
|
Widget _textList() {
|
|
|
- return Text.rich(TextSpan(children: [
|
|
|
|
|
- TextSpan(
|
|
|
|
|
- text: content[0],
|
|
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
|
|
- ),
|
|
|
|
|
- TextSpan(
|
|
|
|
|
- text: content[1],
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Color(0xFFC2524D),
|
|
|
|
|
- fontSize: 13,
|
|
|
|
|
- fontWeight: FontWeight.w500),
|
|
|
|
|
- ),
|
|
|
|
|
- TextSpan(
|
|
|
|
|
- text: content[2],
|
|
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
|
|
- ),
|
|
|
|
|
- TextSpan(
|
|
|
|
|
- text: content[3],
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Color(0xFFC2524D),
|
|
|
|
|
- fontSize: 13,
|
|
|
|
|
- fontWeight: FontWeight.w500),
|
|
|
|
|
- ),
|
|
|
|
|
- TextSpan(
|
|
|
|
|
- text: content[4],
|
|
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
|
|
- )
|
|
|
|
|
- ]));
|
|
|
|
|
|
|
+ return Text.rich(TextSpan(
|
|
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
|
|
+ children: [
|
|
|
|
|
+ TextSpan(text: content[0]),
|
|
|
|
|
+ TextSpan(
|
|
|
|
|
+ text: content[1],
|
|
|
|
|
+ style: TextStyle(color: PRIMARY_COLOR, fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
|
|
+ ),
|
|
|
|
|
+ TextSpan(text: content[2]),
|
|
|
|
|
+ TextSpan(text: content[3]),
|
|
|
|
|
+ TextSpan(text: content[4])
|
|
|
|
|
+ ],
|
|
|
|
|
+ ));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -978,8 +779,7 @@ class RankContentState extends State<RankContent> {
|
|
|
List<PlayerInfo> topList = [];
|
|
List<PlayerInfo> topList = [];
|
|
|
Future<void> getTopList() async {
|
|
Future<void> getTopList() async {
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
- Result res = await HttpManager.get('playerInfo/rankPage',
|
|
|
|
|
- data: {'houseId': widget.roomId, 'currentPage': 1, 'pageNumber': 3});
|
|
|
|
|
|
|
+ Result res = await HttpManager.get('playerInfo/rankPage', data: {'houseId': widget.roomId, 'currentPage': 1, 'pageNumber': 3});
|
|
|
Toast.hide();
|
|
Toast.hide();
|
|
|
List<PlayerInfo> list = [];
|
|
List<PlayerInfo> list = [];
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
@@ -1051,19 +851,14 @@ class RankContentState extends State<RankContent> {
|
|
|
width: _num == 1 ? 70 : 60,
|
|
width: _num == 1 ? 70 : 60,
|
|
|
height: _num == 1 ? 70 : 60,
|
|
height: _num == 1 ? 70 : 60,
|
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
|
|
- colors: colorList[_num - 1],
|
|
|
|
|
- begin: Alignment.topLeft,
|
|
|
|
|
- end: Alignment.bottomRight),
|
|
|
|
|
|
|
+ gradient: LinearGradient(colors: colorList[_num - 1], begin: Alignment.topLeft, end: Alignment.bottomRight),
|
|
|
borderRadius: BorderRadius.all(Radius.circular(100)),
|
|
borderRadius: BorderRadius.all(Radius.circular(100)),
|
|
|
),
|
|
),
|
|
|
child: Center(
|
|
child: Center(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
width: _num == 1 ? 60 : 50,
|
|
width: _num == 1 ? 60 : 50,
|
|
|
height: _num == 1 ? 60 : 50,
|
|
height: _num == 1 ? 60 : 50,
|
|
|
- child: CircleAvatar(
|
|
|
|
|
- backgroundImage:
|
|
|
|
|
- NetworkImage(topList[_num - 1].userInfo.icon)),
|
|
|
|
|
|
|
+ child: CircleAvatar(backgroundImage: NetworkImage(topList[_num - 1].userInfo.icon)),
|
|
|
)),
|
|
)),
|
|
|
),
|
|
),
|
|
|
Positioned(
|
|
Positioned(
|
|
@@ -1094,12 +889,7 @@ class RankContentState extends State<RankContent> {
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
Image.asset('images/icon_jinbi_xiao_hong.png', width: 20),
|
|
Image.asset('images/icon_jinbi_xiao_hong.png', width: 20),
|
|
|
- Text(
|
|
|
|
|
- '×' +
|
|
|
|
|
- (topList[_num - 1].bonus != null
|
|
|
|
|
- ? topList[_num - 1].bonus.toString()
|
|
|
|
|
- : '0'),
|
|
|
|
|
- style: TextStyle(color: PRIMARY_COLOR, fontSize: 12))
|
|
|
|
|
|
|
+ Text('×' + (topList[_num - 1].bonus != null ? topList[_num - 1].bonus.toString() : '0'), style: TextStyle(color: PRIMARY_COLOR, fontSize: 12))
|
|
|
],
|
|
],
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|