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 1/2] =?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, From f7d2ec5b0a7d762c1d31f33e385e298ae649a4ca Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 28 Jan 2022 10:08:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=8B=E5=8D=95,=E4=BF=A1=E6=81=AFbug?= =?UTF-8?q?=E6=9B=B4=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_list.dart | 2 + lib/home/home_page.dart | 6 +- lib/message/system_details.dart | 3 - lib/message/system_message.dart | 39 ++++- lib/mine/manage_address_page.dart | 23 +-- lib/mine/release_page.dart | 86 +++++----- lib/retrofit/min_api.dart | 8 +- lib/retrofit/min_api.g.dart | 2 +- lib/retrofit/retrofit_api.dart | 8 +- lib/retrofit/retrofit_api.g.dart | 2 +- lib/settlement/settlement.dart | 47 +++++- .../settlement_view/distribution.dart | 159 +++++++++++------- .../settlement_order_commodity.dart | 4 +- lib/store/store_view/store_info.dart | 2 +- pubspec.lock | 10 +- pubspec.yaml | 8 +- 16 files changed, 248 insertions(+), 161 deletions(-) diff --git a/lib/community/community_list.dart b/lib/community/community_list.dart index 011ee1df..7ffd1094 100644 --- a/lib/community/community_list.dart +++ b/lib/community/community_list.dart @@ -20,6 +20,7 @@ class CommunityList extends StatefulWidget { final int commentType; final bool isList; final Function exitFull; + final Function removalDynamic; CommunityList( this.comments, @@ -27,6 +28,7 @@ class CommunityList extends StatefulWidget { this.commentType,{ this.isList = false, this.exitFull, + this.removalDynamic } ); diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 6e523eba..dd5ba48c 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -304,7 +304,11 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { ), child: GestureDetector( onTap: () { - Navigator.of(context).pushNamed('/router/system_msg_page'); + Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { + setState(() { + totalMsg = 0; + }); + }); }, child: Container( diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index af482424..cbf3de27 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -4,20 +4,17 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/message.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; -import 'package:huixiang/view_widget/comment_menu.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:huixiang/view_widget/round_button.dart'; -import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index f8276451..35fa22e2 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -124,7 +124,12 @@ class _SystemMessagePage extends State { @override Widget build(BuildContext context) { - return Scaffold( + return WillPopScope( + onWillPop: () async { + Navigator.of(context).pop(true); + return false; + }, + child:Scaffold( appBar: MyAppBar( background: Colors.white, leadingColor: Colors.black, @@ -187,7 +192,7 @@ class _SystemMessagePage extends State { ), ), - ); + )); } Widget newsSurvey(){ @@ -199,7 +204,11 @@ class _SystemMessagePage extends State { Expanded(child: GestureDetector( onTap: (){ Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":5}); + .pushNamed('/router/system_details',arguments: {"msgType":5}).then((value) { + setState(() { + msgNumber["5"] = 0; + }); + }); }, child:Column( children: [ @@ -255,7 +264,11 @@ class _SystemMessagePage extends State { GestureDetector( onTap: (){ Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":6}); + .pushNamed('/router/system_details',arguments: {"msgType":6}).then((value) { + setState(() { + msgNumber["6"] = 0; + }); + }); }, child: Column( children: [ @@ -310,7 +323,11 @@ class _SystemMessagePage extends State { GestureDetector( onTap: (){ Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":4}); + .pushNamed('/router/system_details',arguments: {"msgType":4}).then((value) { + setState(() { + msgNumber["4"] = 0; + }); + }); }, child:Column( children: [ @@ -401,10 +418,18 @@ class _SystemMessagePage extends State { onTap: () { if(messages[position].typed == 2) Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":2}); + .pushNamed('/router/system_details',arguments: {"msgType":2}).then((value) { + setState(() { + msgNumber["2"] = 0; + }); + }); else if(messages[position].typed == 3) Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":3}); + .pushNamed('/router/system_details',arguments: {"msgType":3}).then((value) { + setState(() { + msgNumber["3"] = 0; + }); + }); }, child: buildMessageItem(messages[position]), ); diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index 8ae0c7fc..890eaf5b 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -1,6 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -346,15 +347,15 @@ class _ManageAddressPage extends State { } } - changeCheck(value, position) async { - if (value) { - addressList[checkIndex].isDefault = false; - checkIndex = position; - addressList[position].isDefault = true; - BaseData baseData = - await apiService.updateAddress(addressList[position].toJson()); - if (baseData != null && baseData.isSuccess) {} - setState(() {}); - } - } + // changeCheck(value, position) async { + // if (value) { + // addressList[checkIndex].isDefault = false; + // checkIndex = position; + // addressList[position].isDefault = true; + // BaseData baseData = + // await apiService.updateAddress(addressList[position].toJson()); + // if (baseData != null && baseData.isSuccess) {} + // setState(() {}); + // } + // } } diff --git a/lib/mine/release_page.dart b/lib/mine/release_page.dart index 7a52ff00..5ac84996 100644 --- a/lib/mine/release_page.dart +++ b/lib/mine/release_page.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:huixiang/community/community_list.dart'; import 'package:huixiang/community/community_view/community_dynamic.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/retrofit/data/article.dart'; @@ -25,24 +26,25 @@ class ReleasePage extends StatefulWidget { class _ReleasePage extends State { RefreshController refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); ApiService apiService; int pageNum = 0; String userId; + bool isLoadMore = false; - List
articles = []; + List comments = []; @override void initState() { super.initState(); - _onRefresh(); } _onRefresh() async { - pageNum = 0; - setState(() {}); + queryCommunity(); } + ///动态列表 queryCommunity() async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); @@ -53,7 +55,10 @@ class _ReleasePage extends State { token: value.getString("token"), ); } - pageNum += 1; + if(isLoadMore){ + pageNum += 1; + isLoadMore = false; + }else pageNum = 1; BaseData> baseData = await apiService.trendList({ "onlyFollow": false, "onlyMe": true, @@ -69,23 +74,9 @@ class _ReleasePage extends State { refreshController.loadComplete(); if (baseData.isSuccess) { if (pageNum == 1) { - articles.clear(); + comments.clear(); } - baseData.data.list.forEach((element) { - var article = Article(); - article.id = element.id; - article.content = jsonEncode(element.subjectInfo); - article.mainTitle =element.subject; - article.liked = element.selfFollow; - article.authorHeadImg = element.memberInfo?.avatar; - article.authorName = element.memberInfo?.nickname; - article.createTime = element.createTime; - article.updateUser = element.memberInfo?.mid; - article.viewers = element?.viewers; - article.likes = element?.likes; - article.comments = element?.comments; - articles.add(article); - }); + comments.addAll(baseData.data.list); // print("comments: ${comments.length}"); if (int.tryParse(baseData.data.total) < (pageNum * 10)) { refreshController.loadNoData(); @@ -119,34 +110,35 @@ class _ReleasePage extends State { ), onRefresh: _onRefresh, onLoading: () { - setState(() {}); + isLoadMore = true; + _onRefresh(); }, - child: ListView.builder( - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return InkWell( - child: CommunityDynamic( - articles[position], - 1, - exitFull: (){setState(() { - _onRefresh(); - });}, - removalDynamic: () { - _onRefresh(); - }, + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + // color: Color(0xFFF7F7F7), + // margin: EdgeInsets.only(top: 16.h), + child: Column( + children: [ + CommunityList( + comments, + userId, + 1, + isList: true, + exitFull: () { + _onRefresh(); + }, + removalDynamic: () { + _onRefresh(); + }, + ), + ], ), - onTap: () { - Navigator.of(context).pushNamed( - '/router/community_details', - arguments: { - "businessId": articles[position].id,"userId":userId, - }, - ); - }, - ); - }, - itemCount: articles.length, - )), + ), + ), + ),), ); }, ); diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 823d1620..901bc3f1 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -21,8 +21,8 @@ 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 @@ -32,8 +32,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.88:8765/app/";///詹云久 -// const baseUrl = "http://192.168.10.88: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 02d9988a..856ae6e1 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 ??= 'https://pos.api.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.88:8765/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index ee8c8eb8..b95d48d0 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -54,8 +54,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 @@ -70,8 +70,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.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) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 5735110a..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 ??= 'https://pos.platform.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.88:8766/app/'; } final Dio _dio; diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 3d120e31..b25b4a28 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -137,6 +137,7 @@ class _Settlement extends State { queryOrderDetails(parentId); } }); + } } @@ -154,7 +155,9 @@ class _Settlement extends State { } queryAddress(int selectedBtn) async { - this.selectedBtn = selectedBtn; + setState(() { + this.selectedBtn = selectedBtn; + }); if (address != null) { queryOrderInfo(address.id, selectedBtn, null, 0, null); return; @@ -167,7 +170,10 @@ class _Settlement extends State { double.tryParse(storeInfo.longitude), ); if (baseDate != null && baseDate.isSuccess) { - address = baseDate.data[0]; + setState(() { + address = baseDate.data[0]; + }); + for (int i = 1; i < baseDate.data.length; i++) { Address address1 = baseDate.data[i]; @@ -191,7 +197,9 @@ class _Settlement extends State { double mi1 = await BMFCalculateUtils.getLocationDistance( bmfCoordinate, coordinate1); if (mi1 < mi) { - address = address1; + setState(() { + address = address1; + }); } } @@ -199,6 +207,23 @@ class _Settlement extends State { } } + ///选择收货地址 + selectedAddress(String addId) async { + BaseData> baseDate = + await minService.queryAddress().catchError((error) {}); + + if (baseDate != null && baseDate.isSuccess) { + setState(() { + baseDate.data.forEach((element) { + if(element.id == addId) + address = element; + }); + }); + + queryOrderInfo(address.id, selectedBtn, null, 0, null); + } + } + PlaceOrderFirst placeOrderFirst; DownOrder downOrder; @@ -399,10 +424,24 @@ class _Settlement extends State { child: Column( children: [ DistributionMode( - queryOrderInfo, + (addressId, + isTake, + memberCouponId, + orderId, + promotionId){ + setState(() { + this.selectedBtn = 0; + }); + queryOrderInfo(addressId, + isTake, + memberCouponId, + orderId, + promotionId); + }, queryAddress, storeInfo, address, + selectedAddress ), SizedBox( diff --git a/lib/settlement/settlement_view/distribution.dart b/lib/settlement/settlement_view/distribution.dart index 474906e9..3a926178 100644 --- a/lib/settlement/settlement_view/distribution.dart +++ b/lib/settlement/settlement_view/distribution.dart @@ -20,11 +20,12 @@ class DistributionMode extends StatefulWidget { String promotionId, ) queryOrderInfo; final Function(int selectedBtn) queryAddress; + final Function(String addId) selectedNewAddress; final StoreInfo storeInfo; final Address address; - DistributionMode( - this.queryOrderInfo, this.queryAddress, this.storeInfo, this.address); + DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo, + this.address, this.selectedNewAddress); @override State createState() { @@ -86,7 +87,7 @@ class _DistributionMode extends State { @override Widget build(BuildContext context) { return Container( - height: 143.h, + height: 150.h, margin: EdgeInsets.only( left: 16, right: 16, @@ -126,10 +127,13 @@ class _DistributionMode extends State { Expanded( flex: 1, child: GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { - selectedBtn = 0; - widget.queryOrderInfo( - null, selectedBtn, null, 0, null); + setState(() { + selectedBtn = 0; + widget.queryOrderInfo( + null, selectedBtn, null, 0, null); + }); }, child: Container( height: 50.h, @@ -149,8 +153,10 @@ class _DistributionMode extends State { flex: 1, child: GestureDetector( onTap: () { - selectedBtn = 1; - widget.queryAddress(selectedBtn); + setState(() { + selectedBtn = 1; + widget.queryAddress(selectedBtn); + }); }, child: Container( height: 50.h, @@ -252,7 +258,7 @@ class _DistributionMode extends State { Column( children: [ RoundButton( - width: 41.w, + // width: 41.w, height: 13, text: distance.length > 3 ? "${distance}km" @@ -280,74 +286,97 @@ class _DistributionMode extends State { ], ), ) - : Container( - width: double.infinity, - padding: EdgeInsets.only(left: 16, right: 16, top: 15), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/icon_permission_location.png", - height: 24.h, - width: 24.w, - ), - Text( - "张先生", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 15.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF4C4C4C), + : GestureDetector( + onTap: () { + setState(() { + Navigator.of(context).pushNamed( + '/router/manage_address_page', + arguments: {"isSelector": true}).then((value) { + widget.selectedNewAddress((value as Map)["id"]); + }); + }); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.only(left: 16, right: 16, top: 15), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/icon_permission_location.png", + height: 24.h, + width: 24.w, ), - ), - SizedBox( - width: 13, - ), - Expanded( - child: Text( - "12309090909", + Text( + widget?.address?.username ?? "", overflow: TextOverflow.ellipsis, - maxLines: 2, style: TextStyle( fontSize: 15.sp, fontWeight: MyFontWeight.medium, color: Color(0xFF4C4C4C), ), ), - ), - InkWell( - onTap: () { - setState(() { - Navigator.of(context).popAndPushNamed( - '/router/manage_address_page'); - }); - }, - child: Icon( - Icons.keyboard_arrow_right, - size: 24, + SizedBox( + width: 13, + ), + Expanded( + child: Text( + widget?.address?.phone ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), + ), + ), + ), + InkWell( + onTap: () { + setState(() { + Navigator.of(context).pushNamed( + '/router/manage_address_page', + arguments: { + "isSelector": true + }).then((value) { + widget.selectedNewAddress( + (value as Map)["id"]); + }); + }); + }, + child: Container( + padding:EdgeInsets.symmetric(horizontal:15.w,vertical: 5.h), + child: Icon( + Icons.keyboard_arrow_right, + size: 24, + ), + )), + ], + ), + Padding( + padding: EdgeInsets.only(top: 4, left: 25), + child: Text( + (widget?.address?.city ?? "") + + (widget?.address?.area ?? "") + + (widget?.address?.address ?? ""), + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), ), - ), - ], - ), - Padding( - padding: EdgeInsets.only(top: 4, left: 25), - child: Text( - "武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF727272), ), ), - ), - ], + ], + ), ), - ), + ) ], ), ], diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index ea89f6ab..3292f7c2 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -94,8 +94,8 @@ class _SettlementOrderCommodity extends State { : S.of(context).yunfei, "", (widget.minOrderInfo != null) - ? "+${widget.minOrderInfo?.postFee ?? "0"}" - : "+${widget.settleOrderInfo?.postAge ?? "0"}", + ? "+ ${widget.minOrderInfo?.postFee ?? "0"}" + : "+ ${widget.settleOrderInfo?.postAge ?? "0"}", ), ); } diff --git a/lib/store/store_view/store_info.dart b/lib/store/store_view/store_info.dart index cf0e46be..efb45ac3 100644 --- a/lib/store/store_view/store_info.dart +++ b/lib/store/store_view/store_info.dart @@ -30,7 +30,7 @@ class _StoreInfoView extends State { top: 5.h, bottom: 6.h, ), - height: 140.h, + height: 143.h, padding: EdgeInsets.all(12.w), decoration: BoxDecoration( color: Colors.white, diff --git a/pubspec.lock b/pubspec.lock index 7b7b2595..939a44cf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -708,12 +708,10 @@ packages: tpns_flutter_plugin: dependency: "direct main" description: - path: "." - ref: "V1.1.2" - resolved-ref: b814d62f4b82422459f786671f23dd535062d503 - url: "git://github.com/TencentCloud/TPNS-Flutter-Plugin" - source: git - version: "1.1.2" + name: tpns_flutter_plugin + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" transformer_page_view: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 6f6affec..b9c86f7a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,10 +19,10 @@ dependencies: keframe: ^2.0.2 #滑动组件卡顿优化 - tpns_flutter_plugin: - git: - url: git://github.com/TencentCloud/TPNS-Flutter-Plugin - ref: V1.1.2 + tpns_flutter_plugin: ^1.0.8 +# git: +# url: git://github.com/TencentCloud/TPNS-Flutter-Plugin +# ref: V1.1.2 like_button: ^2.0.2 cupertino_icons: ^1.0.2