From cab48fa74d8ceb95141d0c356c05b5e5815c5610 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 27 Jan 2022 13:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=90=88=E5=B9=B6u?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/mine_page.dart | 91 ++++++++++++++++---------------- lib/retrofit/min_api.dart | 14 +++-- lib/retrofit/min_api.g.dart | 18 ++++--- lib/retrofit/retrofit_api.dart | 8 +-- lib/retrofit/retrofit_api.g.dart | 2 +- 5 files changed, 70 insertions(+), 63 deletions(-) diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 31fa1484..3720d21a 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -53,12 +53,9 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { @override void dispose() { super.dispose(); - if (_refreshController != null) - _refreshController.dispose(); + if (_refreshController != null) _refreshController.dispose(); } - - @override void initState() { super.initState(); @@ -118,7 +115,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { EasyLoading.dismiss(); } - _onRefresh(){ + _onRefresh() { queryUserInfo(); querySocialInfo(); } @@ -134,7 +131,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { ); BaseData baseData = - await apiService.socialInfo().catchError((onError) { + await apiService.socialInfo().catchError((onError) { _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { @@ -203,11 +200,13 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { tag: "vip", ranks: ranks, userInfo: userInfo, - rank: double.tryParse(userInfo?.expendAmount??"0").toInt(), - rankMax: userInfo?.memberRankVo?.nextOrigin??0, - createTime: userInfo?.createTime??"", + rank: double.tryParse( + userInfo?.expendAmount ?? "0") + .toInt(), + rankMax: + userInfo?.memberRankVo?.nextOrigin ?? 0, + createTime: userInfo?.createTime ?? "", ), - ], ), ), @@ -310,7 +309,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { } ///关注度/粉丝/成就数量 - Widget attention(){ + Widget attention() { return Container( margin: EdgeInsets.only(left: 16, top: 10, right: 16), // padding: EdgeInsets.only(top: 16,bottom: 16), @@ -405,43 +404,43 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { ), ), Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - Navigator.of(context).pushNamed( - '/router/mine_attainment_page', - arguments: {"userInfo": userInfo}, - ); - }, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - infoNumber != null - ? infoNumber.achievementNumber.toString() - : "0", - style: TextStyle( - color: Color(0xFF000000), - fontSize: 15.sp, - fontWeight: MyFontWeight.medium, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed( + '/router/mine_attainment_page', + arguments: {"userInfo": userInfo}, + ); + }, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + infoNumber != null + ? infoNumber.achievementNumber.toString() + : "0", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + ), ), - ), - SizedBox( - height: 4, - ), - Text( - "成就", - style: TextStyle( - color: Color(0xFF000000), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, + SizedBox( + height: 4, ), - ), - ], - ), - )), + Text( + "成就", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ))), ], ), ); diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index d95056e3..0d37b80e 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -14,15 +14,21 @@ import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; +import 'data/activity_actRecord_details.dart'; +import 'data/activity_area_list.dart'; +import 'data/activity_details.dart'; +import 'data/activity_order_list.dart'; import 'data/findMiNiGroupList.dart'; +import 'data/home_recommend_list.dart'; import 'data/miNiDetail.dart'; import 'data/settleOrderInfo.dart'; import 'data/shoppingCart.dart'; +import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -32,8 +38,8 @@ const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const baseUrl = "http://192.168.10.236:8765/app/";///费韬 -// const base_url = "http://192.168.10.142:8765/app/";///詹云久 -// const baseUrl = "http://192.168.10.142:8765/app/";///詹云久 +const base_url = "http://192.168.10.88:8765/app/";///詹云久 +const baseUrl = "http://192.168.10.88:8765/app/";///詹云久 // const base_url = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 5ea71d25..826808dc 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.142:8765/app/'; + baseUrl ??= 'http://192.168.10.88:8765/app/'; } final Dio _dio; @@ -176,13 +176,14 @@ class _MinApiService implements MinApiService { } @override - Future> shoppingCartSingle(param) async { + Future>> shoppingCartSingle(param) async { ArgumentError.checkNotNull(param, 'param'); const _extra = {}; final queryParameters = {}; final _data = {}; _data.addAll(param ?? {}); - final _result = await _dio.request>('shoppingcart/single', + final _result = await _dio.request>( + 'shoppingcart/single', queryParameters: queryParameters, options: RequestOptions( method: 'PUT', @@ -190,14 +191,15 @@ class _MinApiService implements MinApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => ShoppingCart.fromJson(i as Map)) + .toList()); return value; } - @override Future> getOrderInfo(param) async { ArgumentError.checkNotNull(param, 'param'); diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 6b1f9de2..6c1a74f8 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -55,8 +55,8 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -68,8 +68,8 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const baseUrl = "http://192.168.10.37:8766/app/"; -// const base_url = "http://192.168.10.88:8766/app/";///詹云久 -// const baseUrl = "http://192.168.10.88:8766/app/";///詹云久 +const base_url = "http://192.168.10.88:8766/app/";///詹云久 +const baseUrl = "http://192.168.10.88:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index b39600ce..527cc52a 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.142:8766/app/'; + baseUrl ??= 'http://192.168.10.88:8766/app/'; } final Dio _dio;