Commit d9fcc5522266c88e31416cd0c0063df88450c7bc
Merge branch 'xy_phone'
Showing
9 changed files
with
79 additions
and
19 deletions
ios/Runner/Wowgame/Classes/game_food/SubGameScene.cpp
... | ... | @@ -192,7 +192,7 @@ void SubGameScene::presentGameResumeLayer(){ |
192 | 192 | buttonResume->setCascadeOpacityEnabled(true); |
193 | 193 | auto buttonTexturePath = "buttons/graphics/dark_green.png"; |
194 | 194 | buttonResume->loadTextures(buttonTexturePath, buttonTexturePath, buttonTexturePath); |
195 | - auto buttonBg = cocos2d::Sprite::create("buttons/graphics/button_repeat.png"); | |
195 | + auto buttonBg = cocos2d::Sprite::create("buttons/graphics/button_resume.png"); | |
196 | 196 | buttonResume->addChild(buttonBg); |
197 | 197 | buttonBg->setPosition(cocos2d::Vec2(buttonResume->getContentSize().width/2,buttonResume->getContentSize().height/2)); |
198 | 198 | resumeLayer->addChild(buttonResume); | ... | ... |
ios/Runner/Wowgame/Classes/game_toy/ToySubGameScene.cpp
... | ... | @@ -245,7 +245,7 @@ void ToySubGameScene::presentGameResumeLayer(){ |
245 | 245 | buttonResume->setCascadeOpacityEnabled(true); |
246 | 246 | auto buttonTexturePath = "buttons/graphics/dark_green.png"; |
247 | 247 | buttonResume->loadTextures(buttonTexturePath, buttonTexturePath, buttonTexturePath); |
248 | - auto buttonBg = cocos2d::Sprite::create("buttons/graphics/button_repeat.png"); | |
248 | + auto buttonBg = cocos2d::Sprite::create("buttons/graphics/button_resume.png"); | |
249 | 249 | buttonResume->addChild(buttonBg); |
250 | 250 | buttonBg->setPosition(cocos2d::Vec2(buttonResume->getContentSize().width/2,buttonResume->getContentSize().height/2)); |
251 | 251 | resumeLayer->addChild(buttonResume); | ... | ... |
ios/Runner/Wowgame/Resources/game_animal/xlarge/buttons/graphics/button_repeat.png
ios/Runner/Wowgame/Resources/game_food/small/buttons/graphics/button_resume.png
0 → 100644
2.37 KB
ios/Runner/Wowgame/Resources/game_food/xlarge/buttons/graphics/button_resume.png
0 → 100644
2.37 KB
ios/Runner/Wowgame/Resources/game_toy/xlarge/buttons/graphics/button_resume.png
0 → 100644
2.37 KB
lib/common/request/apis.dart
lib/common/request/dao/user_dao.dart
... | ... | @@ -113,4 +113,10 @@ class UserDao { |
113 | 113 | } |
114 | 114 | return await requestClient.put(Apis.setUserInfo, data: data); |
115 | 115 | } |
116 | + | |
117 | + /// 用户反馈 | |
118 | + static Future feedBack(String content, String deviceModel, String osType, String osVersion) async { | |
119 | + final params = {'content': content, 'deviceModel': deviceModel, 'osType': osType, "osVersion": osVersion}; | |
120 | + return await requestClient.post(Apis.feedBack, data: params); | |
121 | + } | |
116 | 122 | } | ... | ... |
lib/pages/user/setting/reback_page.dart
1 | +import 'dart:async'; | |
2 | +import 'dart:io'; | |
3 | +import 'dart:math'; | |
4 | + | |
5 | +import 'package:device_info_plus/device_info_plus.dart'; | |
1 | 6 | import 'package:flutter/material.dart'; |
7 | +import 'package:flutter/services.dart'; | |
8 | +import 'package:flutter_easyloading/flutter_easyloading.dart'; | |
2 | 9 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
10 | +import 'package:wow_english/common/core/app_config_helper.dart'; | |
3 | 11 | import 'package:wow_english/common/extension/string_extension.dart'; |
12 | +import 'package:wow_english/route/route.dart'; | |
4 | 13 | import 'package:wow_english/utils/color_util.dart'; |
5 | 14 | |
6 | -import '../../../common/widgets/we_app_bar.dart'; | |
15 | +import 'package:wow_english/common/request/dao/user_dao.dart'; | |
16 | +import 'package:wow_english/common/widgets/we_app_bar.dart'; | |
17 | +import 'package:wow_english/utils/toast_util.dart'; | |
7 | 18 | |
8 | 19 | class ReBackPage extends StatefulWidget { |
9 | 20 | const ReBackPage({super.key}); |
... | ... | @@ -16,11 +27,15 @@ class ReBackPage extends StatefulWidget { |
16 | 27 | |
17 | 28 | class ReBackPageState extends State<ReBackPage> { |
18 | 29 | late bool _canEnsure; |
30 | + int _textCount = 0; | |
31 | + String _textInputStr = ""; | |
19 | 32 | |
20 | 33 | @override |
21 | 34 | void initState() { |
22 | 35 | super.initState(); |
23 | 36 | _canEnsure = false; |
37 | + _textCount = 0; | |
38 | + _textInputStr = ""; | |
24 | 39 | } |
25 | 40 | |
26 | 41 | @override |
... | ... | @@ -53,7 +68,7 @@ class ReBackPageState extends State<ReBackPage> { |
53 | 68 | fontSize: 19.sp, color: HexColor('#333333')), |
54 | 69 | ), |
55 | 70 | Text( |
56 | - '48/500', | |
71 | + '$_textCount/500', | |
57 | 72 | textAlign: TextAlign.right, |
58 | 73 | style: TextStyle( |
59 | 74 | fontSize: 19.sp, color: HexColor('#333333')), |
... | ... | @@ -72,6 +87,17 @@ class ReBackPageState extends State<ReBackPage> { |
72 | 87 | vertical: 10, horizontal: 16), |
73 | 88 | // 设置对称内边距 |
74 | 89 | child: TextField( |
90 | + inputFormatters: [ | |
91 | + LengthLimitingTextInputFormatter(500, maxLengthEnforcement: MaxLengthEnforcement.truncateAfterCompositionEnds), | |
92 | + ], | |
93 | + onChanged: (String value) { | |
94 | + setState(() { | |
95 | + _textInputStr = value; | |
96 | + _textCount = min(value.length, 500); | |
97 | + _canEnsure = value.length >= 10; | |
98 | + }); | |
99 | + }, | |
100 | + maxLines: null, | |
75 | 101 | textInputAction: TextInputAction.done, |
76 | 102 | decoration: InputDecoration( |
77 | 103 | border: InputBorder.none, |
... | ... | @@ -83,21 +109,26 @@ class ReBackPageState extends State<ReBackPage> { |
83 | 109 | ), |
84 | 110 | ), |
85 | 111 | 4.5.verticalSpace, |
86 | - Container( | |
87 | - decoration: BoxDecoration( | |
88 | - image: DecorationImage( | |
89 | - fit: BoxFit.fill, | |
90 | - image: AssetImage(_canEnsure | |
91 | - ? 're_button'.assetPng | |
92 | - : 're_button_dis'.assetPng))), | |
93 | - alignment: Alignment.center, | |
94 | - width: 91.w, | |
95 | - height: 45.h, | |
96 | - child: Text( | |
97 | - '提交', | |
98 | - textAlign: TextAlign.center, | |
99 | - style: | |
100 | - TextStyle(color: Colors.white, fontSize: 17.sp), | |
112 | + GestureDetector( | |
113 | + onTap: () { | |
114 | + userFeedBack(_textInputStr); | |
115 | + }, | |
116 | + child: Container( | |
117 | + decoration: BoxDecoration( | |
118 | + image: DecorationImage( | |
119 | + fit: BoxFit.fill, | |
120 | + image: AssetImage(_canEnsure | |
121 | + ? 're_button'.assetPng | |
122 | + : 're_button_dis'.assetPng))), | |
123 | + alignment: Alignment.center, | |
124 | + width: 91.w, | |
125 | + height: 45.h, | |
126 | + child: Text( | |
127 | + '提交', | |
128 | + textAlign: TextAlign.center, | |
129 | + style: | |
130 | + TextStyle(color: Colors.white, fontSize: 17.sp), | |
131 | + ), | |
101 | 132 | ), |
102 | 133 | ) |
103 | 134 | ], |
... | ... | @@ -109,4 +140,24 @@ class ReBackPageState extends State<ReBackPage> { |
109 | 140 | ), |
110 | 141 | )); |
111 | 142 | } |
143 | + | |
144 | + Future<void> userFeedBack(content) async { | |
145 | + String deviceModel = ""; | |
146 | + String osType = AppConfigHelper.isIosPlatform() ? "ios" : "android"; | |
147 | + String osVersion = ""; | |
148 | + if (AppConfigHelper.isIosPlatform()) { | |
149 | + final iosDeviceInfo = await DeviceInfoPlugin().iosInfo; | |
150 | + osVersion = iosDeviceInfo.systemVersion; | |
151 | + deviceModel = iosDeviceInfo.model; | |
152 | + } else { | |
153 | + final androidInfo = await DeviceInfoPlugin().androidInfo; | |
154 | + osVersion = androidInfo.version.release.toString(); | |
155 | + deviceModel = androidInfo.manufacturer; | |
156 | + } | |
157 | + EasyLoading.show(); | |
158 | + await UserDao.feedBack(content, deviceModel, osType, osVersion); | |
159 | + EasyLoading.dismiss(); | |
160 | + showToast('提交成功'); | |
161 | + popPage(); | |
162 | + } | |
112 | 163 | } | ... | ... |