Pārlūkot izejas kodu

fix:v1.3.1版本的UI

Primroses 3 gadi atpakaļ
vecāks
revīzija
72999c8afa

+ 1 - 1
lib/pages/my/level_page.dart

@@ -144,7 +144,7 @@ class _PageState extends State<LevelPage> with InjectLoginApi {
                                         width: 5.0,
                                         width: 5.0,
                                       ),
                                       ),
                                       Text(
                                       Text(
-                                        '${_data.exp}',
+                                        '${_data.score}',
                                         style: TextStyle(
                                         style: TextStyle(
                                             fontSize: 14.0,
                                             fontSize: 14.0,
                                             color: Color(0xffFFC400)),
                                             color: Color(0xffFFC400)),

+ 9 - 16
lib/pages/my/score_shop.dart

@@ -14,6 +14,7 @@ import 'package:sport/services/api/inject_api.dart';
 import 'package:sport/utils/toast.dart';
 import 'package:sport/utils/toast.dart';
 import 'package:sport/widgets/appbar.dart';
 import 'package:sport/widgets/appbar.dart';
 import 'package:sport/widgets/button_primary.dart';
 import 'package:sport/widgets/button_primary.dart';
+import 'package:sport/widgets/decoration.dart';
 import 'package:sport/widgets/space.dart';
 import 'package:sport/widgets/space.dart';
 
 
 class ScoreShopPage extends StatefulWidget {
 class ScoreShopPage extends StatefulWidget {
@@ -89,7 +90,7 @@ class _ScoreShopPageState extends ViewStateLifecycle<ScoreShopPage, ShopModel>
                           },
                           },
                         ),
                         ),
                         Text(
                         Text(
-                          "",
+                          "积分商城",
                           style: TextStyle(
                           style: TextStyle(
                               color: Colors.white,
                               color: Colors.white,
                               fontSize: 18,
                               fontSize: 18,
@@ -269,23 +270,13 @@ class _ScoreShopPageState extends ViewStateLifecycle<ScoreShopPage, ShopModel>
                                     crossAxisCount: 2,
                                     crossAxisCount: 2,
                                     crossAxisSpacing: 18,
                                     crossAxisSpacing: 18,
                                     mainAxisSpacing:18,
                                     mainAxisSpacing:18,
-                                    childAspectRatio: 157 / 181),
+                                    childAspectRatio: 150 / 181),
                             delegate: SliverChildBuilderDelegate(
                             delegate: SliverChildBuilderDelegate(
                                 (BuildContext context, int index) {
                                 (BuildContext context, int index) {
                                   Items item = model?.shop?.items[index];
                                   Items item = model?.shop?.items[index];
                               return Container(
                               return Container(
-                                decoration: BoxDecoration(
-                                  borderRadius:
-                                      BorderRadius.all(Radius.circular(10.0)),
-                                  color: Colors.white,
-                                  boxShadow: [
-                                    BoxShadow(
-                                        offset: Offset(0.0, 0),
-                                        blurRadius: 5,
-                                        spreadRadius: 0,
-                                        color: Color.fromRGBO(0, 0, 0, 0.1))
-                                  ],
-                                ),
+                                margin: EdgeInsets.all(5.0),
+                                decoration: card(),
                                 child: Column(
                                 child: Column(
                                   children: <Widget>[
                                   children: <Widget>[
                                     Space(height: 10.0,),
                                     Space(height: 10.0,),
@@ -297,7 +288,7 @@ class _ScoreShopPageState extends ViewStateLifecycle<ScoreShopPage, ShopModel>
                                     Container(
                                     Container(
                                       alignment: Alignment.center,
                                       alignment: Alignment.center,
                                       child: Text(
                                       child: Text(
-                                        "${item?.name}",
+                                        "${item?.name}${item.price}积分",
                                         style: TextStyle(
                                         style: TextStyle(
                                             color: Color(0xff333333),
                                             color: Color(0xff333333),
                                             fontSize: 14.0),
                                             fontSize: 14.0),
@@ -313,7 +304,9 @@ class _ScoreShopPageState extends ViewStateLifecycle<ScoreShopPage, ShopModel>
                                         callback: () async {
                                         callback: () async {
                                           // print("${item.id}-----------------------------");
                                           // print("${item.id}-----------------------------");
                                           var data = (await api.buyItem('${item.id}'));
                                           var data = (await api.buyItem('${item.id}'));
-                                          ToastUtil.show("${data.msg}");
+                                          // ToastUtil.show("${data.msg}");
+                                          ToastUtil.show("兑换成功,当前改名卡数量${data.data == null ? 0 : data.data}");
+                                          model.init();
                                         },
                                         },
                                         content: "兑换",
                                         content: "兑换",
                                         height: 35.0,
                                         height: 35.0,

+ 8 - 4
lib/pages/my/user_info_page.dart

@@ -131,7 +131,10 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi,InjectApi {
                   ),
                   ),
                   contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
                   contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
                   trailing: arrowRight5(),
                   trailing: arrowRight5(),
-                  onTap: () {
+                  onTap: () async {
+                    SharedPreferences prefs = await SharedPreferences.getInstance();
+                    String name = prefs.getString("name");
+
                     _showDialog((TextEditingValue name) async {
                     _showDialog((TextEditingValue name) async {
                       await request(context, () async {
                       await request(context, () async {
                         await _loginInfoModel.updateUserInfo(
                         await _loginInfoModel.updateUserInfo(
@@ -141,7 +144,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi,InjectApi {
                                 .user
                                 .user
                                 .gender);
                                 .gender);
                       });
                       });
-                    });
+                    },name:name);
                   },
                   },
                 ),
                 ),
                 ListTile(
                 ListTile(
@@ -322,8 +325,9 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi,InjectApi {
     ;
     ;
   }
   }
 
 
-  _showDialog(Function callBack) {
+  _showDialog(Function callBack,{String name}) {
     TextEditingController _controller = new TextEditingController();
     TextEditingController _controller = new TextEditingController();
+    _controller.text = name;
     return showDialog(
     return showDialog(
         context: context,
         context: context,
         barrierDismissible: true,
         barrierDismissible: true,
@@ -351,7 +355,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi,InjectApi {
                         decoration: InputDecoration(
                         decoration: InputDecoration(
                             counterText: '',
                             counterText: '',
                             // helperText: '用户名长度为2-10个字母,数字,中文',
                             // helperText: '用户名长度为2-10个字母,数字,中文',
-                            hintText: "用户昵称七个字",
+                            // hintText: name,
                             helperMaxLines: 1,
                             helperMaxLines: 1,
                             focusedBorder: UnderlineInputBorder(
                             focusedBorder: UnderlineInputBorder(
                               borderSide: BorderSide(color: Color(0xffF1F1F1)),
                               borderSide: BorderSide(color: Color(0xffF1F1F1)),