From b4f56ce7fe3831e793b522b31d9bdd3a2aa37435 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 12 Jan 2022 18:41:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_course.dart | 2 - lib/community/headlines/article_page.dart | 1 - lib/main.dart | 2 +- lib/mine/mine_view/mine_item.dart | 19 ++--- lib/order/bargain_group_order.dart | 79 ++++++++++--------- .../shopping/shopping_goods_details.dart | 1 - .../shopping_home/shopping_home_page.dart | 3 - pubspec.lock | 10 ++- pubspec.yaml | 8 +- 9 files changed, 61 insertions(+), 64 deletions(-) diff --git a/lib/community/community_course.dart b/lib/community/community_course.dart index 57b707e8..06210d79 100644 --- a/lib/community/community_course.dart +++ b/lib/community/community_course.dart @@ -15,8 +15,6 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:huixiang/view_widget/my_footer.dart'; -import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'community_view/class_list_view.dart'; diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index c240743f..5bcc9376 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -17,7 +17,6 @@ import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_footer.dart'; -import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; diff --git a/lib/main.dart b/lib/main.dart index 8f00f264..74dff435 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -262,7 +262,7 @@ Map routers = { '/router/order_history_page': (context, {arguments}) => OrderHistoryPage(arguments: arguments), '/router/bargain_group_order': (context, {arguments}) => - BargainGroupOrder(), + BargainGroupOrder(arguments:arguments), '/router/union_detail_page': (context, {arguments}) => UnionDetailsPage(arguments: arguments), '/router/address_edit_page': (context, {arguments}) => diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 31d1962f..cfd1ea06 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -17,7 +17,7 @@ class _MineItem extends State { Widget build(BuildContext context) { return Container( margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 6.h), - padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), + padding: EdgeInsets.only(top: 12,bottom: 12), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), @@ -50,7 +50,7 @@ class _MineItem extends State { // ), // ), Container( - padding: EdgeInsets.symmetric(vertical: 4.h), + padding: EdgeInsets.symmetric(vertical: 4.h,horizontal: 20.w), child: Text( S.of(context).wodegongju, style: TextStyle( @@ -137,15 +137,9 @@ class _MineItem extends State { Expanded(child: InkWell( onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context) - .pushNamed('/router/bargain_group_order'); - }); + Navigator.of(context) + .pushNamed('/router/bargain_group_order', + arguments: {"type":3}); }, child: mineItem( S.of(context).wodekanjia, @@ -154,7 +148,8 @@ class _MineItem extends State { ),), Expanded(child: InkWell( onTap: () { - Navigator.of(context).pushNamed('/router/bargain_group_order'); + Navigator.of(context).pushNamed('/router/bargain_group_order', + arguments: {"type":1}); }, child: mineItem( S.of(context).wodepintuan, diff --git a/lib/order/bargain_group_order.dart b/lib/order/bargain_group_order.dart index 7aae5c6c..020d5ab8 100644 --- a/lib/order/bargain_group_order.dart +++ b/lib/order/bargain_group_order.dart @@ -20,8 +20,12 @@ import 'package:huixiang/view_widget/round_button.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class BargainGroupOrder extends StatefulWidget { + final Map arguments; + + BargainGroupOrder({this.arguments}); @override State createState() { return _BargainGroupOrder(); @@ -33,10 +37,12 @@ class _BargainGroupOrder extends State List tabs; List _pages; TabController tabcontroller; + int type = 0; @override void initState() { super.initState(); + type = widget.arguments["type"]; } ///查看我的拼团、砍价、列表 @@ -62,10 +68,10 @@ class _BargainGroupOrder extends State ) ]; _pages = [ - ExchangeHistoryList(0), - ExchangeHistoryList(1), - ExchangeHistoryList(2), - ExchangeHistoryList(3) + ExchangeHistoryList(0,type), + ExchangeHistoryList(2,type), + ExchangeHistoryList(3,type), + ExchangeHistoryList(4,type) ]; } @@ -75,7 +81,7 @@ class _BargainGroupOrder extends State length: 4, child: Scaffold( appBar: MyAppBar( - title: S.of(context).wodekanjia, + title:type == 1 ? S.of(context).wodepintuan :S.of(context).wodekanjia, titleColor: Colors.black, titleSize: 18.sp, background: Color(0xFFFFFFFF), @@ -113,8 +119,9 @@ class _BargainGroupOrder extends State class ExchangeHistoryList extends StatefulWidget { final int orderStatus; + final int type; - ExchangeHistoryList(this.orderStatus); + ExchangeHistoryList(this.orderStatus,this.type); @override State createState() { @@ -150,7 +157,7 @@ class _ExchangeHistoryList extends State { BaseData> baseData = await minService.showMyActList({ "state":0, - "type" :1, + "type" :widget.type, }).catchError((error) { _refreshController.loadFailed(); _refreshController.refreshFailed(); @@ -164,44 +171,44 @@ class _ExchangeHistoryList extends State { }); } else { _refreshController.refreshFailed(); + _refreshController.loadFailed(); } } - // int pageNum = 1; - _refresh() { - // pageNum = 1; queryShowMyActList(); } @override Widget build(BuildContext context) { - return SmartRefresher( - enablePullDown: true, - enablePullUp: true, - header: MyHeader(), - footer: CustomFooter( - builder: (BuildContext context, LoadStatus mode) { - return MyFooter(mode); - }, - ), - controller: _refreshController, - onRefresh: _refresh, - onLoading: queryShowMyActList, - child: - (activityOrderList?.length ?? 0) < 0 - ? NoDataView( - isShowBtn: false, - text: "还没有订单,快去下一单吧~", - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) - : - ListView.builder( - itemCount: activityOrderList?.length ?? 0, - itemBuilder: (context, position) { - return bargainOrder(activityOrderList[position]); - }, + return Container( + child: SmartRefresher( + enablePullDown: true, + enablePullUp: true, + header: MyHeader(), + footer: CustomFooter( + builder: (BuildContext context, LoadStatus mode) { + return MyFooter(mode); + }, + ), + controller: _refreshController, + onRefresh: _refresh, + child: (activityOrderList?.length ?? 0) < 0 + ? NoDataView( + isShowBtn: false, + text: "还没有订单,快去下一单吧~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) + : + ListView.builder( + itemCount: activityOrderList?.length ?? 0, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return bargainOrder(activityOrderList[position]); + }, + ), ), ); } diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index 4da30bc1..b73418c6 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -417,7 +417,6 @@ class _ShoppingGoodsDetails extends State { } - @override Widget build(BuildContext context) { return Stack( diff --git a/lib/store/shopping/shopping_home/shopping_home_page.dart b/lib/store/shopping/shopping_home/shopping_home_page.dart index 700f7ea8..6358d79c 100644 --- a/lib/store/shopping/shopping_home/shopping_home_page.dart +++ b/lib/store/shopping/shopping_home/shopping_home_page.dart @@ -3,11 +3,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/home_recommend_list.dart'; -import 'package:huixiang/retrofit/data/miNiDetail.dart'; import 'package:huixiang/retrofit/data/shopping_home_config.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/min_api.dart'; diff --git a/pubspec.lock b/pubspec.lock index 81da05a4..ccd41931 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -743,10 +743,12 @@ packages: tpns_flutter_plugin: dependency: "direct main" description: - name: tpns_flutter_plugin - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.0.8" + path: "." + ref: "V1.0.7" + resolved-ref: ab0c457ab52f36a34e2b90256929a9809e8d4f9b + url: "git://github.com/TencentCloud/TPNS-Flutter-Plugin" + source: git + version: "1.0.7" transformer_page_view: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 39444ec3..4eacd0fa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,10 +19,10 @@ dependencies: keframe: ^2.0.2 #滑动组件卡顿优化 - tpns_flutter_plugin: 1.0.8 -# git: -# url: git://github.com/TencentCloud/TPNS-Flutter-Plugin -# ref: V1.0.7 + tpns_flutter_plugin: + git: + url: git://github.com/TencentCloud/TPNS-Flutter-Plugin + ref: V1.0.7 like_button: ^2.0.2 cupertino_icons: ^1.0.2