Primroses 3 лет назад
Родитель
Сommit
72999c8afa
3 измененных файлов с 18 добавлено и 21 удалено
  1. 1 1
      lib/pages/my/level_page.dart
  2. 9 16
      lib/pages/my/score_shop.dart
  3. 8 4
      lib/pages/my/user_info_page.dart

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

@@ -144,7 +144,7 @@ class _PageState extends State<LevelPage> with InjectLoginApi {
                                         width: 5.0,
                                       ),
                                       Text(
-                                        '${_data.exp}',
+                                        '${_data.score}',
                                         style: TextStyle(
                                             fontSize: 14.0,
                                             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/widgets/appbar.dart';
 import 'package:sport/widgets/button_primary.dart';
+import 'package:sport/widgets/decoration.dart';
 import 'package:sport/widgets/space.dart';
 
 class ScoreShopPage extends StatefulWidget {
@@ -89,7 +90,7 @@ class _ScoreShopPageState extends ViewStateLifecycle<ScoreShopPage, ShopModel>
                           },
                         ),
                         Text(
-                          "",
+                          "积分商城",
                           style: TextStyle(
                               color: Colors.white,
                               fontSize: 18,
@@ -269,23 +270,13 @@ class _ScoreShopPageState extends ViewStateLifecycle<ScoreShopPage, ShopModel>
                                     crossAxisCount: 2,
                                     crossAxisSpacing: 18,
                                     mainAxisSpacing:18,
-                                    childAspectRatio: 157 / 181),
+                                    childAspectRatio: 150 / 181),
                             delegate: SliverChildBuilderDelegate(
                                 (BuildContext context, int index) {
                                   Items item = model?.shop?.items[index];
                               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(
                                   children: <Widget>[
                                     Space(height: 10.0,),
@@ -297,7 +288,7 @@ class _ScoreShopPageState extends ViewStateLifecycle<ScoreShopPage, ShopModel>
                                     Container(
                                       alignment: Alignment.center,
                                       child: Text(
-                                        "${item?.name}",
+                                        "${item?.name}${item.price}积分",
                                         style: TextStyle(
                                             color: Color(0xff333333),
                                             fontSize: 14.0),
@@ -313,7 +304,9 @@ class _ScoreShopPageState extends ViewStateLifecycle<ScoreShopPage, ShopModel>
                                         callback: () async {
                                           // print("${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: "兑换",
                                         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),
                   trailing: arrowRight5(),
-                  onTap: () {
+                  onTap: () async {
+                    SharedPreferences prefs = await SharedPreferences.getInstance();
+                    String name = prefs.getString("name");
+
                     _showDialog((TextEditingValue name) async {
                       await request(context, () async {
                         await _loginInfoModel.updateUserInfo(
@@ -141,7 +144,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi,InjectApi {
                                 .user
                                 .gender);
                       });
-                    });
+                    },name:name);
                   },
                 ),
                 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();
+    _controller.text = name;
     return showDialog(
         context: context,
         barrierDismissible: true,
@@ -351,7 +355,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi,InjectApi {
                         decoration: InputDecoration(
                             counterText: '',
                             // helperText: '用户名长度为2-10个字母,数字,中文',
-                            hintText: "用户昵称七个字",
+                            // hintText: name,
                             helperMaxLines: 1,
                             focusedBorder: UnderlineInputBorder(
                               borderSide: BorderSide(color: Color(0xffF1F1F1)),