瀏覽代碼

门票算法&ios悬浮窗文字修改

panhui 6 年之前
父節點
當前提交
d56a688570
共有 4 個文件被更改,包括 22 次插入8 次删除
  1. 4 2
      lib/pages/CompetitionInformation.dart
  2. 0 1
      lib/pages/LoginFirst.dart
  3. 1 1
      lib/pages/MyCode.dart
  4. 17 4
      lib/pages/RoomInfo.dart

+ 4 - 2
lib/pages/CompetitionInformation.dart

@@ -1,3 +1,5 @@
+import 'dart:io';
+
 import 'package:flutter/material.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
 import 'package:wanna_battle/model/HouseInfo.dart';
@@ -283,11 +285,11 @@ class InfoBox extends StatelessWidget {
                     style: TextStyle(color: Color(0xFFFFB726), fontSize: 14, fontWeight: FontWeight.w600),
                   ),
                   TextSpan(
-                    text: '完成杀人目标后立刻点击',
+                    text:Platform.isIOS?'完成杀人目标后立刻回到':'完成杀人目标后立刻点击',
                     style: _text,
                   ),
                   TextSpan(
-                    text: '悬浮窗',
+                    text: Platform.isIOS?'游戏':'悬浮窗',
                     style: TextStyle(color: Color(0xFFFFB726), fontSize: 14, fontWeight: FontWeight.w600),
                   ),
                   TextSpan(

+ 0 - 1
lib/pages/LoginFirst.dart

@@ -22,7 +22,6 @@ class LoginFirstState extends State<LoginFirst> {
 
   @override
   void initState() {
-    // TODO: implement initState
     super.initState();
     Future.delayed(Duration.zero, () {
       getVersion(context);

+ 1 - 1
lib/pages/MyCode.dart

@@ -60,7 +60,7 @@ class MyCodeState extends State<MyCode> {
     Result res2 = await HttpManager.get('systemVariable/get', data: {'name': "ticketPrice"});
     if (res2.success) {
       setState(() {
-        race = res2.data;
+        race = double.parse( res2.data);
       });
     }
   }

+ 17 - 4
lib/pages/RoomInfo.dart

@@ -1,8 +1,10 @@
 import 'dart:async';
+import 'dart:io';
 import 'dart:ui';
 import 'package:flutter/material.dart';
 import 'package:flutter/painting.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:intl/intl.dart';
 import 'package:url_launcher/url_launcher.dart';
 import 'package:battery/battery.dart';
 import 'package:flutter_redux/flutter_redux.dart';
@@ -58,6 +60,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
   bool showJiexie = false;
   bool showHelloWord = false;
   bool showWait = false;
+  num race = 10;
 
 //获取房间信息
   Future<void> getRoomInfo(type) async {
@@ -472,6 +475,16 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     };
 
     Future.delayed(Duration.zero, () async {
+      Result res2 = await HttpManager.get('systemVariable/get', data: {'name': "ticketPrice"});
+      if (res2.success) {
+        print( res2.data);
+        setState(() {
+          race =double.parse( res2.data);
+           
+
+         
+        });
+      }
       // showSucessInfo(3);
       getRoomInfo('first');
       userInfo = StoreProvider.of<AppState>(context).state.userInfo;
@@ -718,7 +731,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                                       children: <Widget>[
                                         Image.asset('images/icon_jifen.png'),
                                         Text(
-                                          'x${houseInfo.bonus * houseInfo.houseLevel.firstRatio / 100}',
+                                          'x${houseInfo.bonus * houseInfo.houseLevel.firstRatio / 100}/${houseInfo.maxNumber * race * houseInfo.houseLevel.entryCoin * houseInfo.houseLevel.firstRatio / 100}',
                                           style: TextStyle(color: Color(0xFFB1B2C0), fontSize: 14, fontWeight: FontWeight.w600),
                                         )
                                       ],
@@ -735,7 +748,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                                       children: <Widget>[
                                         Image.asset('images/icon_jifen.png'),
                                         Text(
-                                          'x${houseInfo.bonus * houseInfo.houseLevel.secondRatio / 100}',
+                                          'x${houseInfo.bonus * houseInfo.houseLevel.secondRatio / 100}/${houseInfo.maxNumber * race * houseInfo.houseLevel.entryCoin * houseInfo.houseLevel.secondRatio / 100}',
                                           style: TextStyle(color: Color(0xFFB1B2C0), fontSize: 14, fontWeight: FontWeight.w600),
                                         )
                                       ],
@@ -752,7 +765,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                                       children: <Widget>[
                                         Image.asset('images/icon_jifen.png'),
                                         Text(
-                                          'x${houseInfo.bonus * houseInfo.houseLevel.thirdRatio / 100}',
+                                          'x${houseInfo.bonus * houseInfo.houseLevel.thirdRatio / 100}/${houseInfo.maxNumber * race * houseInfo.houseLevel.entryCoin * houseInfo.houseLevel.thirdRatio / 100}',
                                           style: TextStyle(color: Color(0xFFB1B2C0), fontSize: 14, fontWeight: FontWeight.w600),
                                         )
                                       ],
@@ -834,7 +847,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                                         Text.rich(TextSpan(children: [
                                           TextSpan(text: '完成本房间任务目标后,'),
                                           TextSpan(
-                                            text: '切记立刻点击悬浮窗',
+                                            text: Platform.isIOS?'切记立刻返回应用':'切记立刻点击悬浮窗',
                                             style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xFFFFB726)),
                                           ),
                                           TextSpan(text: '回到房间')