|
|
@@ -3,11 +3,13 @@ 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/painting.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
import 'package:battery/battery.dart';
|
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
+import 'package:wanna_battle/model/HouseLevel.dart';
|
|
|
import '../styles/colors.dart';
|
|
|
import '../plugins/ScreenStramPlugin.dart';
|
|
|
import '../net/HttpManager.dart';
|
|
|
@@ -25,6 +27,7 @@ import 'VideoPlayer.dart';
|
|
|
import '../model/UserInfo.dart';
|
|
|
import '../widget/LinearButton.dart';
|
|
|
import 'Appeal.dart';
|
|
|
+import 'ShoppingMall.dart';
|
|
|
|
|
|
class RoomInfo extends StatefulWidget {
|
|
|
RoomInfo({Key key, this.roomId}) : super(key: key);
|
|
|
@@ -45,7 +48,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
bool isPop = false;
|
|
|
bool showBack = false;
|
|
|
Timer timer;
|
|
|
- List<List<String>> roomTipsList = [];
|
|
|
+ List<List<Map>> roomTipsList = [];
|
|
|
ScrollController _tipController;
|
|
|
String _myUrl;
|
|
|
int tabIndex = 0;
|
|
|
@@ -54,6 +57,9 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
String mymedal = '';
|
|
|
bool canAppeal = false;
|
|
|
int appealState = 0;
|
|
|
+ bool showJiexie = false;
|
|
|
+ bool showHelloWord = false;
|
|
|
+ bool showWait = false;
|
|
|
|
|
|
//获取房间信息
|
|
|
Future<void> getRoomInfo(type) async {
|
|
|
@@ -101,6 +107,10 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
houseInfo.bonus = res.data['bonus'];
|
|
|
houseInfo.beginTime = res.data['beginTime'];
|
|
|
});
|
|
|
+
|
|
|
+ if (houseInfo.statusFlag == 4) {
|
|
|
+ checkJoinInfo();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -181,7 +191,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
],
|
|
|
title: '完成比赛',
|
|
|
submitText: '我已完成比赛', onsubmit: () async {
|
|
|
- HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': status, 'endTime': DateTime.now().millisecondsSinceEpoch});
|
|
|
+ HttpManager.post('playerInfo/gameOver', data: {'id': playerInfo.id, 'statusFlag': status, 'endTime': DateTime.now().millisecondsSinceEpoch});
|
|
|
bool success = await ScreenStreamPlugin.stop();
|
|
|
|
|
|
Timer(Duration(seconds: 1), () {
|
|
|
@@ -201,7 +211,16 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
int time = houseInfo.beginTime + 1 * 3600 * 1000 - DateTime.now().millisecondsSinceEpoch;
|
|
|
var nowTime = (time ~/ 1000 ~/ 60) % 60;
|
|
|
setState(() {
|
|
|
- roomTipsList.add(['你已完成本次比赛,当前完成人数 ', res.data.toString(), '人,比赛需要等待所有人完成后方可结算奖励', '', ',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励']);
|
|
|
+ roomTipsList.add([
|
|
|
+ {"value": '你已完成本次比赛,当前完成人数 ', "type": 0},
|
|
|
+ {"value": res.data.toString(), "type": 1},
|
|
|
+ {"value": '人,比赛需要等待其他人完成后方可结算奖励,你可以先去参加其他竞赛,稍后会有', "type": 0},
|
|
|
+ {"value": '邮件', "type": 1},
|
|
|
+ {"value": '提醒你本次竞赛结果以及领取奖励,请注意查看', "type": 0},
|
|
|
+ {"value": '首页左上角邮件提醒', "type": 1},
|
|
|
+ {"value": '哦', "type": 0}
|
|
|
+ ]);
|
|
|
+ showWait = true;
|
|
|
changeScroll();
|
|
|
});
|
|
|
}
|
|
|
@@ -222,13 +241,21 @@ 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([{
|
|
|
+ // "value":'房间创建成功,待人数满员时会自动开启比赛,房主也可以手动开启比赛,同时,你也可以加入本次比赛',
|
|
|
+ // "type":0
|
|
|
+ // }]);
|
|
|
changeScroll();
|
|
|
}
|
|
|
|
|
|
+ setState(() {
|
|
|
+ showHelloWord = true;
|
|
|
+ });
|
|
|
+
|
|
|
// if (isJoin) {
|
|
|
- roomTipsList
|
|
|
- .add(['待倒计时结束或人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛。', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
|
|
|
+ // roomTipsList.add([{
|
|
|
+ // "value":'亲爱的玩家:',
|
|
|
+ // }]);
|
|
|
// }
|
|
|
|
|
|
changeScroll();
|
|
|
@@ -294,6 +321,9 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
}
|
|
|
|
|
|
if (isJoin && houseInfo.statusFlag == 4) {
|
|
|
+ setState(() {
|
|
|
+ showJiexie = true;
|
|
|
+ });
|
|
|
HttpManager.get('appealInfo/getOne', data: {
|
|
|
'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
|
|
|
'playerInfoId': playerInfo.id,
|
|
|
@@ -320,41 +350,45 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
//加入房间
|
|
|
Future<void> joinRoom() async {
|
|
|
print(StoreProvider.of<AppState>(context).state.userInfo.moneyTicket);
|
|
|
- if (StoreProvider.of<AppState>(context).state.userInfo.moneyTicket < 1) {
|
|
|
- MyDialog.showDialog(context, '门票不足不能加入');
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
- 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();
|
|
|
- },
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
+ if (StoreProvider.of<AppState>(context).state.userInfo.moneyTicket < houseInfo.houseLevel.entryCoin) {
|
|
|
+ MyDialog.showDialog(context, '门票不足不能加入', onsubmit: () {
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
|
|
|
+ });
|
|
|
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();
|
|
|
- } else {
|
|
|
- Toast.show(context, res.error, 1500, 'info');
|
|
|
- }
|
|
|
+
|
|
|
+ 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();
|
|
|
+ } else {
|
|
|
+ Toast.show(context, res.error, 1500, 'info');
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
//展示通知
|
|
|
@@ -369,7 +403,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
);
|
|
|
},
|
|
|
pageBuilder: (BuildContext context, _, __) {
|
|
|
- return CompetitionInformation();
|
|
|
+ return CompetitionInformation(houseInfo: houseInfo);
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
@@ -463,18 +497,17 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
elevation: 0,
|
|
|
actions: <Widget>[
|
|
|
Container(
|
|
|
- padding: EdgeInsets.only(right: 30, left: 20),
|
|
|
- child: Container(
|
|
|
- width: 24,
|
|
|
- )
|
|
|
- )
|
|
|
+ padding: EdgeInsets.only(right: 30, left: 20),
|
|
|
+ child: Container(
|
|
|
+ width: 24,
|
|
|
+ ))
|
|
|
],
|
|
|
),
|
|
|
body: Container(
|
|
|
- color: BG_SUB_COLOR,
|
|
|
+ color: Color(0xFF2E3049),
|
|
|
child: TabBarView(
|
|
|
controller: mController,
|
|
|
- children: [_firstPage(), SecondPage(roomId: widget.roomId, status: status,houseInfo:houseInfo)],
|
|
|
+ children: [_firstPage(), SecondPage(roomId: widget.roomId, status: status, houseInfo: houseInfo)],
|
|
|
)),
|
|
|
floatingActionButton: _joinBtn(),
|
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
|
@@ -567,7 +600,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
Container(
|
|
|
child: Text(
|
|
|
houseInfo != null ? houseInfo.houseName : '',
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.w600),
|
|
|
),
|
|
|
),
|
|
|
Container(
|
|
|
@@ -579,19 +612,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
textSize: 12.0,
|
|
|
colorList: [Color(0xFFFFB726), Color(0xFFFFB726)],
|
|
|
onTapHomeMenu: () {
|
|
|
- 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();
|
|
|
- }));
|
|
|
+ showNotice();
|
|
|
},
|
|
|
),
|
|
|
)
|
|
|
@@ -619,6 +640,10 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
child: Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
children: <Widget>[
|
|
|
+ Text(
|
|
|
+ '本次任务:游戏中最短时间内杀戮${houseInfo.killnumber}人',
|
|
|
+ style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xFFFFB726)),
|
|
|
+ ),
|
|
|
Row(
|
|
|
children: <Widget>[
|
|
|
Image.asset(
|
|
|
@@ -633,35 +658,86 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
],
|
|
|
),
|
|
|
|
|
|
- Row(
|
|
|
+ // Row(
|
|
|
+ // children: <Widget>[
|
|
|
+ // Image.asset(
|
|
|
+ // 'images/house2.png',
|
|
|
+ // ),
|
|
|
+ // Text(
|
|
|
+ // 'X${houseInfo.bonus}',
|
|
|
+ // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // ),
|
|
|
+ // Container(
|
|
|
+ // width: 30,
|
|
|
+ // ),
|
|
|
+
|
|
|
+ // Container(
|
|
|
+ // width: 10,
|
|
|
+ // ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
|
|
+ margin: EdgeInsets.fromLTRB(15, 7, 15, 0),
|
|
|
+ decoration: BoxDecoration(color: Color(0xFF23253C), borderRadius: BorderRadius.all(Radius.circular(4))),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: <Widget>[
|
|
|
+ Column(
|
|
|
children: <Widget>[
|
|
|
- Image.asset(
|
|
|
- 'images/house2.png',
|
|
|
+ Row(
|
|
|
+ children: <Widget>[
|
|
|
+ Image.asset('images/icon_jifen.png'),
|
|
|
+ Text(
|
|
|
+ 'x${houseInfo.bonus * houseInfo.houseLevel.firstRatio / 100}',
|
|
|
+ style: TextStyle(color: Color(0xFFB1B2C0), fontSize: 14, fontWeight: FontWeight.w600),
|
|
|
+ )
|
|
|
+ ],
|
|
|
),
|
|
|
- Text('X${houseInfo.bonus}',
|
|
|
- style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
|
|
|
+ Container(
|
|
|
+ height: 3,
|
|
|
),
|
|
|
+ Text('第一名奖励', style: TextStyle(fontSize: 12, color: Color(0xFFB1B2C0)))
|
|
|
],
|
|
|
),
|
|
|
- // Container(
|
|
|
- // width: 30,
|
|
|
- // ),
|
|
|
- Row(
|
|
|
+ Column(
|
|
|
children: <Widget>[
|
|
|
- Image.asset(
|
|
|
- 'images/icon_jisha.png',
|
|
|
+ Row(
|
|
|
+ children: <Widget>[
|
|
|
+ Image.asset('images/icon_jifen.png'),
|
|
|
+ Text(
|
|
|
+ 'x${houseInfo.bonus * houseInfo.houseLevel.secondRatio / 100}',
|
|
|
+ style: TextStyle(color: Color(0xFFB1B2C0), fontSize: 14, fontWeight: FontWeight.w600),
|
|
|
+ )
|
|
|
+ ],
|
|
|
),
|
|
|
- Text('在游戏中击败${houseInfo.killnumber}人',
|
|
|
- style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
|
|
|
+ Container(
|
|
|
+ height: 3,
|
|
|
),
|
|
|
+ Text('第二名奖励', style: TextStyle(fontSize: 12, color: Color(0xFFB1B2C0)))
|
|
|
],
|
|
|
),
|
|
|
-
|
|
|
-
|
|
|
- // Container(
|
|
|
- // width: 10,
|
|
|
- // ),
|
|
|
-
|
|
|
+ Column(
|
|
|
+ children: <Widget>[
|
|
|
+ Row(
|
|
|
+ children: <Widget>[
|
|
|
+ Image.asset('images/icon_jifen.png'),
|
|
|
+ Text(
|
|
|
+ 'x${houseInfo.bonus * houseInfo.houseLevel.thirdRatio / 100}',
|
|
|
+ style: TextStyle(color: Color(0xFFB1B2C0), fontSize: 14, fontWeight: FontWeight.w600),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 3,
|
|
|
+ ),
|
|
|
+ Text('第三名奖励', style: TextStyle(fontSize: 12, color: Color(0xFFB1B2C0)))
|
|
|
+ ],
|
|
|
+ )
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -681,10 +757,72 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
)
|
|
|
: Container(),
|
|
|
|
|
|
+ statuFlag != 4 && showWait
|
|
|
+ ? Container(
|
|
|
+ width: double.infinity,
|
|
|
+ margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 10),
|
|
|
+ height: 40,
|
|
|
+ decoration: BoxDecoration(color: Color(0xFF3E3348), borderRadius: BorderRadius.all(Radius.circular(4))),
|
|
|
+ child: Text(
|
|
|
+ '你已完成比赛,等待游戏解析中',
|
|
|
+ style: TextStyle(
|
|
|
+ color: Color(0xFFD4504B),
|
|
|
+ fontSize: 15,
|
|
|
+ ),
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ ))
|
|
|
+ : Container(),
|
|
|
+
|
|
|
+ showHelloWord
|
|
|
+ ? Container(
|
|
|
+ width: double.infinity,
|
|
|
+ padding: EdgeInsets.all(15),
|
|
|
+ margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ // gradient: LinearGradient(colors: [Color(0xFF464B6A), Color(0xFF35395E)], begin: Alignment.topCenter, end: Alignment.bottomCenter),
|
|
|
+ color: Color(0xFF3A3E61),
|
|
|
+ borderRadius:
|
|
|
+ BorderRadius.only(topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
|
|
|
+ child: DefaultTextStyle(
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 13.0,
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: <Widget>[
|
|
|
+ Text('亲爱的玩家:'),
|
|
|
+ Text('欢迎来到有奖杀戮的世界!'),
|
|
|
+ Text(
|
|
|
+ '请保持手机电量在50%以上',
|
|
|
+ style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xFFFFB726)),
|
|
|
+ ),
|
|
|
+ Text.rich(TextSpan(children: [
|
|
|
+ TextSpan(text: '倒计时结束或人数满员时会'),
|
|
|
+ TextSpan(
|
|
|
+ text: '自动',
|
|
|
+ style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xFFFFB726)),
|
|
|
+ ),
|
|
|
+ TextSpan(text: '开启比赛!请在此等候其他玩家加入')
|
|
|
+ ])),
|
|
|
+ Text.rich(TextSpan(children: [
|
|
|
+ TextSpan(text: '完成本房间任务目标后,'),
|
|
|
+ TextSpan(
|
|
|
+ text: '切记立刻点击悬浮窗',
|
|
|
+ style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xFFFFB726)),
|
|
|
+ ),
|
|
|
+ TextSpan(text: '回到房间')
|
|
|
+ ])),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ))
|
|
|
+ : Container(),
|
|
|
+
|
|
|
statuFlag != 4
|
|
|
? TipsListContent(tipsList: roomTipsList, houseInfo: houseInfo)
|
|
|
: Container(
|
|
|
- child: playerInfo != null
|
|
|
+ child: playerInfo != null && showJiexie
|
|
|
? Column(
|
|
|
children: <Widget>[
|
|
|
// ( playerInfo.statusFlag!=7&&playerInfo.statusFlag!=9&&!playerInfo.dataError)?
|
|
|
@@ -693,12 +831,13 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
|
|
padding: EdgeInsets.symmetric(vertical: 10),
|
|
|
height: 40,
|
|
|
- decoration:
|
|
|
- BoxDecoration(color: Color(0xFFD4504B).withOpacity(0.1), borderRadius: BorderRadius.all(Radius.circular(4))),
|
|
|
+ decoration: BoxDecoration(color: Color(0xFF3E3348), borderRadius: BorderRadius.all(Radius.circular(4))),
|
|
|
child: Text(
|
|
|
- (playerInfo.statusFlag != 7 && playerInfo.statusFlag != 9 && !playerInfo.dataError)
|
|
|
- ? (playerInfo.houseRank < 3 ? '恭喜您,您获得了第${playerInfo.houseRank}名!' : '很遗憾您未能进入前三名,下次加油!')
|
|
|
- : '很遗憾您本次上传的比赛结果解析失败',
|
|
|
+ playerInfo.houseRank < 4
|
|
|
+ ? '恭喜您,您获得了第${playerInfo.houseRank}名!'
|
|
|
+ : (playerInfo.statusFlag != 7 && playerInfo.statusFlag != 9 && !playerInfo.dataError
|
|
|
+ ? '很遗憾您未能进入前三名,下次加油!'
|
|
|
+ : '很遗憾您本次上传的比赛结果解析失败'),
|
|
|
style: prefix0.TextStyle(
|
|
|
color: Color(0xFFD4504B),
|
|
|
fontSize: 15,
|
|
|
@@ -706,7 +845,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
textAlign: TextAlign.center,
|
|
|
),
|
|
|
),
|
|
|
- (playerInfo.statusFlag != 7 && playerInfo.statusFlag != 9 && !playerInfo.dataError)
|
|
|
+ ((playerInfo.statusFlag != 7 && playerInfo.statusFlag != 9 && !playerInfo.dataError) || playerInfo.houseRank < 4)
|
|
|
? Container(
|
|
|
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
padding: EdgeInsets.all(15),
|
|
|
@@ -739,20 +878,14 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
children: <Widget>[
|
|
|
- Text("获得奖牌 ", style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
- img != ''
|
|
|
- ? Row(
|
|
|
- children: <Widget>[
|
|
|
- Image.asset(
|
|
|
- img,
|
|
|
- width: 20,
|
|
|
- ),
|
|
|
- Text("+1",
|
|
|
- style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
|
|
|
- ],
|
|
|
- )
|
|
|
- : Text("无",
|
|
|
+ Text("获得积分 ", style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
+ Row(
|
|
|
+ children: <Widget>[
|
|
|
+ Image.asset('images/icon_jifen.png'),
|
|
|
+ Text('x${playerInfo.bonus}',
|
|
|
style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
|
|
|
+ ],
|
|
|
+ )
|
|
|
],
|
|
|
)
|
|
|
],
|
|
|
@@ -761,7 +894,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
: Container(
|
|
|
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
padding: EdgeInsets.all(15),
|
|
|
- height: 239,
|
|
|
+ // height: 239,
|
|
|
width: double.infinity,
|
|
|
decoration: BoxDecoration(
|
|
|
color: Color(0xFF3A3E61),
|
|
|
@@ -832,6 +965,8 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ int entryCoin = houseInfo != null ? houseInfo.houseLevel.entryCoin : 0;
|
|
|
+
|
|
|
if (!isJoin && statusFlag == 0 && houseInfo.userId == StoreProvider.of<AppState>(context).state.userInfo.id) {
|
|
|
return Container(
|
|
|
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
|
|
|
@@ -851,7 +986,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
Container(
|
|
|
margin: EdgeInsets.only(left: 6),
|
|
|
child: Text(
|
|
|
- '×1',
|
|
|
+ '×${entryCoin}',
|
|
|
style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
|
|
),
|
|
|
),
|
|
|
@@ -898,7 +1033,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
Container(
|
|
|
margin: EdgeInsets.only(left: 6),
|
|
|
child: Text(
|
|
|
- '×1',
|
|
|
+ '×${entryCoin}',
|
|
|
style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
|
|
),
|
|
|
),
|
|
|
@@ -1005,13 +1140,13 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
} else if (isJoin && (statusFlag == 2 || statusFlag == 3)) {
|
|
|
int _time;
|
|
|
if (houseInfo != null) {
|
|
|
- _time = houseInfo.beginTime + 3600000 - DateTime.now().millisecondsSinceEpoch;
|
|
|
+ _time = houseInfo.beginTime + 1800000 - DateTime.now().millisecondsSinceEpoch;
|
|
|
}
|
|
|
return Container(
|
|
|
width: double.infinity,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
|
|
|
height: 88,
|
|
|
- child: LinearButton(btntext: '预计还有 ' + getSecondsMIn(_time) + ' 结算', colorList: [Color(0xFFB34A4A), Color(0xFFB34A4A)], textColor: Color(0xFF252532)),
|
|
|
+ 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)) {
|
|
|
@@ -1088,15 +1223,10 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
),
|
|
|
)
|
|
|
: Container(),
|
|
|
- myRank != 0 && myRank < 4
|
|
|
- ? Text(
|
|
|
- img,
|
|
|
- style: TextStyle(fontSize: 14, color: Color(0xFF252532), fontWeight: FontWeight.w500),
|
|
|
- )
|
|
|
- : Text(
|
|
|
- '未上榜',
|
|
|
- style: TextStyle(fontSize: 14, color: Color(0xFF252532), fontWeight: FontWeight.w500),
|
|
|
- )
|
|
|
+ Text(
|
|
|
+ '${myRank}',
|
|
|
+ style: TextStyle(fontSize: 14, color: Color(0xFF252532), fontWeight: FontWeight.w500),
|
|
|
+ )
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -1111,7 +1241,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
|
|
|
//房间的提示信息
|
|
|
class TipsListContent extends StatelessWidget {
|
|
|
TipsListContent({Key key, this.tipsList, this.houseInfo}) : super(key: key);
|
|
|
- final List<List<String>> tipsList;
|
|
|
+ final List<List<Map>> tipsList;
|
|
|
final HouseInfo houseInfo;
|
|
|
|
|
|
@override
|
|
|
@@ -1137,7 +1267,7 @@ class TipsListContent extends StatelessWidget {
|
|
|
|
|
|
class Tips extends StatelessWidget {
|
|
|
Tips({Key key, this.content, this.showTongzhi, this.houseInfo}) : super(key: key);
|
|
|
- final List<String> content;
|
|
|
+ final List<Map> content;
|
|
|
final bool showTongzhi;
|
|
|
final HouseInfo houseInfo;
|
|
|
@override
|
|
|
@@ -1151,39 +1281,21 @@ class Tips extends StatelessWidget {
|
|
|
borderRadius: BorderRadius.only(topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
|
|
|
child: Column(
|
|
|
children: <Widget>[
|
|
|
- content.length == 1
|
|
|
- ? Text(
|
|
|
- content[0],
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
- )
|
|
|
- : _textList(),
|
|
|
+ _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(0xFFFFB726), fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
- ),
|
|
|
- TextSpan(
|
|
|
- text: content[2],
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
- ),
|
|
|
- TextSpan(
|
|
|
- text: content[3],
|
|
|
- style: TextStyle(color: Color(0xFFFFB726), fontSize: 13, fontWeight: FontWeight.w500),
|
|
|
- ),
|
|
|
- TextSpan(
|
|
|
- text: content[4],
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
- )
|
|
|
- ]));
|
|
|
+ List<TextSpan> list = [];
|
|
|
+ for (var item in content) {
|
|
|
+ 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),
|
|
|
+ ));
|
|
|
+ }
|
|
|
+ return Text.rich(TextSpan(children: list));
|
|
|
}
|
|
|
}
|
|
|
|