|
@@ -9,6 +9,7 @@ import '../net/Result.dart';
|
|
|
import '../model/HouseInfo.dart';
|
|
import '../model/HouseInfo.dart';
|
|
|
import '../model/GameInfo.dart';
|
|
import '../model/GameInfo.dart';
|
|
|
import '../pages/RoomInfo.dart';
|
|
import '../pages/RoomInfo.dart';
|
|
|
|
|
+import '../widget/SuccessfulReception.dart';
|
|
|
|
|
|
|
|
class TipInfo extends StatefulWidget {
|
|
class TipInfo extends StatefulWidget {
|
|
|
TipInfo({Key key, this.tipId}) : super(key: key);
|
|
TipInfo({Key key, this.tipId}) : super(key: key);
|
|
@@ -18,11 +19,13 @@ class TipInfo extends StatefulWidget {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
class TipInfoState extends State<TipInfo> {
|
|
class TipInfoState extends State<TipInfo> {
|
|
|
- SystemNotice tipInfo = SystemNotice.fromJson({'content': '', "createTime": DateTime.now().microsecondsSinceEpoch});
|
|
|
|
|
|
|
+ SystemNotice tipInfo = SystemNotice.fromJson(
|
|
|
|
|
+ {'content': '', "createTime": DateTime.now().microsecondsSinceEpoch});
|
|
|
HouseInfo houseInfo;
|
|
HouseInfo houseInfo;
|
|
|
getInfo() async {
|
|
getInfo() async {
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
- Result res = await HttpManager.get("systemNotice/getOne", data: {'id': widget.tipId});
|
|
|
|
|
|
|
+ Result res = await HttpManager.get("systemNotice/getOne",
|
|
|
|
|
+ data: {'id': widget.tipId});
|
|
|
Toast.hide();
|
|
Toast.hide();
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
setState(() {
|
|
setState(() {
|
|
@@ -31,10 +34,12 @@ class TipInfoState extends State<TipInfo> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (tipInfo.statusFlag == 0 && tipInfo.typeFlag != 2) {
|
|
if (tipInfo.statusFlag == 0 && tipInfo.typeFlag != 2) {
|
|
|
- HttpManager.post("systemNotice/update", data: {'id': tipInfo.id, "statusFlag": 1});
|
|
|
|
|
|
|
+ HttpManager.post("systemNotice/update",
|
|
|
|
|
+ data: {'id': tipInfo.id, "statusFlag": 1});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Result res2 = await HttpManager.get("houseInfo/getOne", data: {'id': tipInfo.houseId});
|
|
|
|
|
|
|
+ Result res2 = await HttpManager.get("houseInfo/getOne",
|
|
|
|
|
+ data: {'id': tipInfo.houseId});
|
|
|
if (res2.success) {
|
|
if (res2.success) {
|
|
|
setState(() {
|
|
setState(() {
|
|
|
houseInfo = HouseInfo.fromJson(res2.data);
|
|
houseInfo = HouseInfo.fromJson(res2.data);
|
|
@@ -42,7 +47,24 @@ class TipInfoState extends State<TipInfo> {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void updateHousInfo() {}
|
|
|
|
|
|
|
+ void showSuccess(money) {
|
|
|
|
|
+ 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 SuccessfulReception(money: money);
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
void initState() {
|
|
void initState() {
|
|
@@ -79,7 +101,11 @@ class TipInfoState extends State<TipInfo> {
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
Padding(
|
|
Padding(
|
|
|
padding: EdgeInsets.symmetric(vertical: 12),
|
|
padding: EdgeInsets.symmetric(vertical: 12),
|
|
|
- child: Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Colors.white24, fontSize: 13)),
|
|
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ readTimestamp(
|
|
|
|
|
+ tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'),
|
|
|
|
|
+ style:
|
|
|
|
|
+ TextStyle(color: Colors.white24, fontSize: 13)),
|
|
|
),
|
|
),
|
|
|
Container(
|
|
Container(
|
|
|
height: 1,
|
|
height: 1,
|
|
@@ -95,7 +121,9 @@ class TipInfoState extends State<TipInfo> {
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
- houseInfo != null ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo) : Container(),
|
|
|
|
|
|
|
+ houseInfo != null
|
|
|
|
|
+ ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo)
|
|
|
|
|
+ : Container(),
|
|
|
type == 2 && status == 0
|
|
type == 2 && status == 0
|
|
|
? Container(
|
|
? Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
@@ -106,11 +134,15 @@ class TipInfoState extends State<TipInfo> {
|
|
|
child: Text('立即领取'),
|
|
child: Text('立即领取'),
|
|
|
onPressed: () async {
|
|
onPressed: () async {
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
- Result res = await HttpManager.post("playerInfo/receive", data: {"id": tipInfo.playerId});
|
|
|
|
|
|
|
+ Result res = await HttpManager.post(
|
|
|
|
|
+ "playerInfo/receive",
|
|
|
|
|
+ data: {"id": tipInfo.playerId});
|
|
|
Toast.hide();
|
|
Toast.hide();
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- Toast.show(context, '领取成功', 1000, 'success');
|
|
|
|
|
- Future.delayed(Duration(milliseconds: 1000), () => getInfo());
|
|
|
|
|
|
|
+ if (tipInfo.playerInfo != null) {
|
|
|
|
|
+ showSuccess(tipInfo.playerInfo.bonus);
|
|
|
|
|
+ getInfo();
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
Toast.show(context, res.error, 1000, 'info');
|
|
Toast.show(context, res.error, 1000, 'info');
|
|
|
}
|
|
}
|
|
@@ -171,26 +203,34 @@ class houseItem extends StatelessWidget {
|
|
|
maxWidth: 170,
|
|
maxWidth: 170,
|
|
|
child: Text(
|
|
child: Text(
|
|
|
roomInfo.houseName,
|
|
roomInfo.houseName,
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
|
|
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ fontSize: 14,
|
|
|
|
|
+ fontWeight: FontWeight.w500),
|
|
|
maxLines: 1,
|
|
maxLines: 1,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
overflow: TextOverflow.ellipsis,
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
Container(
|
|
Container(
|
|
|
margin: EdgeInsets.only(left: 6),
|
|
margin: EdgeInsets.only(left: 6),
|
|
|
- child: Image.network(roomInfo.houseLevel.icon, width: 14),
|
|
|
|
|
|
|
+ child: Image.network(roomInfo.houseLevel.icon,
|
|
|
|
|
+ width: 14),
|
|
|
),
|
|
),
|
|
|
Container(
|
|
Container(
|
|
|
margin: EdgeInsets.only(left: 1),
|
|
margin: EdgeInsets.only(left: 1),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
roomInfo.houseLevel.levelName,
|
|
roomInfo.houseLevel.levelName,
|
|
|
- style: TextStyle(color: Color(0xFFF9D881), fontSize: 9),
|
|
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: Color(0xFFF9D881), fontSize: 9),
|
|
|
)),
|
|
)),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
Text(
|
|
Text(
|
|
|
roomInfo.houseAbstract,
|
|
roomInfo.houseAbstract,
|
|
|
- style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
|
|
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: 12,
|
|
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
|
|
+ color: Color(0xFF9BA0AE)),
|
|
|
maxLines: 2,
|
|
maxLines: 2,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
overflow: TextOverflow.ellipsis,
|
|
|
)
|
|
)
|
|
@@ -202,8 +242,15 @@ class houseItem extends StatelessWidget {
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
Image.asset('images/icon_renshu.png', width: 20),
|
|
Image.asset('images/icon_renshu.png', width: 20),
|
|
|
Text(
|
|
Text(
|
|
|
- (roomInfo.playerNumber != null ? roomInfo.playerNumber.toString() : '0') + '/' + roomInfo.maxNumber.toString(),
|
|
|
|
|
- style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
|
|
|
|
|
|
|
+ (roomInfo.playerNumber != null
|
|
|
|
|
+ ? roomInfo.playerNumber.toString()
|
|
|
|
|
+ : '0') +
|
|
|
|
|
+ '/' +
|
|
|
|
|
+ roomInfo.maxNumber.toString(),
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: 14,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ color: Color(0xFFB1B2C0)),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
)
|
|
)
|
|
@@ -211,7 +258,11 @@ class houseItem extends StatelessWidget {
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
onTap: () {
|
|
onTap: () {
|
|
|
- Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomInfo(roomId: roomInfo.id.toString())));
|
|
|
|
|
|
|
+ Navigator.push(
|
|
|
|
|
+ context,
|
|
|
|
|
+ new CupertinoPageRoute(
|
|
|
|
|
+ builder: (context) =>
|
|
|
|
|
+ new RoomInfo(roomId: roomInfo.id.toString())));
|
|
|
},
|
|
},
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|