From 8711f4fe5be400a0269dce5543ddee68341e4046 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 27 Jan 2022 11:19:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BC=98=E5=8C=96;=20?= =?UTF-8?q?=E4=B8=8B=E5=8D=95bug=E6=9B=B4=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_child_list.dart | 38 +++++++++---------- lib/community/community_list.dart | 4 ++ .../community_view/community_dynamic.dart | 3 +- lib/community/new_community_details.dart | 9 ++++- lib/main.dart | 4 +- lib/retrofit/min_api.dart | 12 +++--- lib/retrofit/min_api.g.dart | 2 +- lib/retrofit/retrofit_api.dart | 10 ++--- lib/retrofit/retrofit_api.g.dart | 2 +- lib/store/store_order.dart | 20 ++++++++-- lib/view_widget/new_people_reward.dart | 4 +- 11 files changed, 64 insertions(+), 44 deletions(-) diff --git a/lib/community/community_child_list.dart b/lib/community/community_child_list.dart index 7ddd551f..a0283165 100644 --- a/lib/community/community_child_list.dart +++ b/lib/community/community_child_list.dart @@ -39,7 +39,7 @@ class _CommunityChildList extends State { } _onRefresh() async { - setState(() {}); + queryCommunity(); } ///动态列表 @@ -71,23 +71,25 @@ class _CommunityChildList extends State { refreshController.refreshCompleted(); refreshController.loadComplete(); if (baseData.isSuccess) { - if (pageNum == 1) { - comments.clear(); - } - comments.addAll(baseData.data.list); - // comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); - // print("comments: ${comments.length}"); - if (int.tryParse(baseData.data.total) < (pageNum * 10)) { - refreshController.loadNoData(); - } + setState(() { + if (pageNum == 1) { + comments.clear(); + } + comments.addAll(baseData.data.list); + // comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); + // print("comments: ${comments.length}"); + if (int.tryParse(baseData.data.total) < (pageNum * 10)) { + refreshController.loadNoData(); + } + }); } } @override Widget build(BuildContext context) { - return FutureBuilder( - future: queryCommunity(), - builder: (context, position) { + // return FutureBuilder( + // future: queryCommunity(), + // builder: (context, position) { return SmartRefresher( controller: refreshController, enablePullDown: true, @@ -102,7 +104,7 @@ class _CommunityChildList extends State { onRefresh: _onRefresh, onLoading: () { isLoadMore = true; - setState(() {}); + _onRefresh(); }, scrollController: scrollController, child: Container( @@ -119,9 +121,7 @@ class _CommunityChildList extends State { 0, isList: true, exitFull: () { - setState(() { - _onRefresh(); - }); + _onRefresh(); }, ), ], @@ -130,7 +130,7 @@ class _CommunityChildList extends State { ), ), ); - }, - ); + // }, + // ); } } diff --git a/lib/community/community_list.dart b/lib/community/community_list.dart index 73531a4a..011ee1df 100644 --- a/lib/community/community_list.dart +++ b/lib/community/community_list.dart @@ -98,6 +98,10 @@ class _CommunityList extends State { // exitFull: () { // setState(() {}); // }, + }).then((value) { + widget.exitFull(); + setState(() { + }); }); setState(() {}); }, diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index c87e5207..cb62e132 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -406,8 +406,7 @@ class _CommunityDynamic extends State { ); }, child: MImage( - cnt["images"][position] - .replaceAll(".jpg", ".jpg?imageView2/0/q/75"), + cnt["images"][position], fit: BoxFit.cover, aspectRatio: 1, radius: BorderRadius.circular(1), diff --git a/lib/community/new_community_details.dart b/lib/community/new_community_details.dart index 0e0626d1..9c441cd3 100644 --- a/lib/community/new_community_details.dart +++ b/lib/community/new_community_details.dart @@ -121,7 +121,12 @@ class _NewCommunityDetails extends State with WidgetsBindin @override Widget build(BuildContext context) { - return AnnotatedRegion( + return WillPopScope( + onWillPop: () async { + Navigator.of(context).pop(true); + return false; + }, + child:AnnotatedRegion( value: SystemUiOverlayStyle.light, child: Material(child: Scaffold( appBar: MyAppBar( @@ -318,7 +323,7 @@ class _NewCommunityDetails extends State with WidgetsBindin ), ), ),) - ); + )); } ///动态内容 diff --git a/lib/main.dart b/lib/main.dart index f634b27e..a41c627f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -100,9 +100,9 @@ void main() async { Locale locale; if (sharedPreferences.containsKey("language") && sharedPreferences.getString("language") == "zh") { - locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CN'); - } else { locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'); + } else { + locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); } ImgCachePath(); initSdk(); diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 557ac24e..823d1620 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -21,19 +21,19 @@ import 'data/shoppingCart.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 // const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 -const base_url = "http://192.168.10.236:8765/app/";///费韬 -const baseUrl = "http://192.168.10.236:8765/app/";///费韬 +// const base_url = "http://192.168.10.236:8765/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 1c1cc751..02d9988a 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.236:8765/app/'; + baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 2bb9d4b8..ee8c8eb8 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -54,14 +54,14 @@ 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 -const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.159:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.159:8766/app/"; ///费韬 @@ -70,7 +70,7 @@ const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.37:8766/app/"; -// const base_url = "http://192.168.10.142:8766/app/";///詹云久 +// const base_url = "http://192.168.10.88:8766/app/";///詹云久 // const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 71083690..5735110a 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.236:8766/app/'; + baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; } final Dio _dio; diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 42c98f39..40278e52 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -656,6 +656,16 @@ class _StoreOrderPage extends State ///选规格 _queryMiNiDetail(String id, int count) async { EasyLoading.show(status: S.current.zhengzaijiazai); + if(count < 0){ + shopCarGoods.shoppingCartSkuItemList.forEach((element) { + if(element.productId == id){ + shopCartReduce(element); + setState(() { + }); + } + }); + return; + } BaseData baseData = await minService.miNiDetail(id); if (baseData != null && baseData.isSuccess) { showStoreSelector(baseData.data, id, count); @@ -805,11 +815,13 @@ class _StoreOrderPage extends State BaseData> baseDate = await minService.shoppingCartSingle(shopCarTemp); if (baseDate.isSuccess) { + EasyLoading.dismiss(); this.shopCarGoods = await queryShopCar(); - if (shopCartKey != null) { + if (shopCartKey?.currentState != null) { shopCartKey.currentState.setState(() {}); } - setState(() {}); + setState(() { + }); } return this.shopCarGoods; } @@ -868,9 +880,9 @@ class _StoreOrderPage extends State } ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods .shoppingCartSkuItemList - .firstWhere((element) => skuId == element.skuId); + .firstWhere((element) => skuId == element.id); int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList - .indexWhere((element) => skuId == element.skuId); + .indexWhere((element) => skuId == element.id); if (shopSkuItem != null) { if (shopSkuItem.buyNum > 1) { diff --git a/lib/view_widget/new_people_reward.dart b/lib/view_widget/new_people_reward.dart index b44c8b0c..d2f89108 100644 --- a/lib/view_widget/new_people_reward.dart +++ b/lib/view_widget/new_people_reward.dart @@ -108,7 +108,7 @@ class _NewPeopleReward extends State { Widget rewardItem(FirstLoginCouponList firstLoginCouponList) { return Container( - height:80.h, + height:90.h, width: double.infinity, decoration: BoxDecoration( image: DecorationImage( @@ -167,7 +167,7 @@ class _NewPeopleReward extends State { Text( firstLoginCouponList.couponName, overflow: TextOverflow.ellipsis, - maxLines: 2, + maxLines: 1, style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium,