From e07d281be52d4d5e3845e7d1c3def7ffac6eb2a4 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 23 Jul 2021 18:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=95=86=E5=9F=8E=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/home/points_mall_page.dart | 84 ++++++++++++++++++++++++---------- lib/login/login_page.dart | 12 ++--- pubspec.lock | 24 +++++----- pubspec.yaml | 4 +- 4 files changed, 79 insertions(+), 45 deletions(-) diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index 18029f9e..22271593 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -34,7 +34,7 @@ class PointsMallPage extends StatefulWidget { } class _PointsMallPage extends State - with AutomaticKeepAliveClientMixin { + with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin { var _itemText = S.current.morenpaixu; ApiService client; @@ -42,8 +42,8 @@ class _PointsMallPage extends State RefreshController(initialRefresh: false); List sortString = [ S.current.morenpaixu, - S.current.duihuanlianggaodaodi, - S.current.duihuanliangdidaogao, + // S.current.duihuanlianggaodaodi, + // S.current.duihuanliangdidaogao, S.current.jifengaodaodi, S.current.jifendidaogao, ]; @@ -180,6 +180,42 @@ class _PointsMallPage extends State items: sortItems, onChanged: _sortChange, ), + Container( + alignment: Alignment.centerLeft, + child: DefaultTabController( + length: 4, + child:Stack( + children: [ + Padding(padding: EdgeInsets.only(top: 39),child:Divider( + // indent: 0.0, + thickness:1.5, + color: Color(0xffE6E6E6), + )), + TabBar( + isScrollable: true, //可滚动 + indicatorColor: Color(0xff39B54A), + labelColor: Color(0xff32A060), + labelStyle: TextStyle(fontSize: 14), + unselectedLabelStyle: TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + ), + // controller: tabController, + //未选中文字颜色 + unselectedLabelColor: Color(0xff262626), + indicatorSize: TabBarIndicatorSize.label, + //指示器与文字等宽 + tabs: [ + Tab(text: "全部"), + Tab(text: "饮食"), + Tab(text: "生活娱乐"), + Tab(text: "办公"), + ], + ), + ], + ), + ), + ), GridView.builder( itemCount: gooods.length, padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 16.h, bottom: 16.h), @@ -225,19 +261,20 @@ class _PointsMallPage extends State case 0: orderType = 1; break; + //兑换量 + // case 1: + // orderType = 2; + // orderDesc = true; + // break; + // case 2: + // orderType = 2; + // orderDesc = false; + // break; case 1: - orderType = 2; - orderDesc = true; - break; - case 2: - orderType = 2; - orderDesc = false; - break; - case 3: orderType = 3; orderDesc = true; break; - case 4: + case 2: orderType = 3; orderDesc = false; break; @@ -274,8 +311,8 @@ class _PointsMallPage extends State goods.mainImgPath, aspectRatio: 1, radius: BorderRadius.only( - topLeft: Radius.circular(4), - topRight: Radius.circular(4), + topLeft: Radius.circular(2), + topRight: Radius.circular(2), ), fit: BoxFit.cover, errorSrc: "assets/image/default_1.png", @@ -318,15 +355,14 @@ class _PointsMallPage extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text( - S.of(context).yiduihuanjian("${goods.sales}万"), - style: TextStyle( - color: Color(0xFFA29E9E), - fontSize: 10.sp, - ), - ), - Column( - children: [ + // 兑换数量 + // Text( + // S.of(context).yiduihuanjian("${goods.sales}万"), + // style: TextStyle( + // color: Color(0xFFA29E9E), + // fontSize: 10.sp, + // ), + // ), Text( S.of(context).yuan_(goods.worth), style: TextStyle( @@ -344,8 +380,6 @@ class _PointsMallPage extends State fontWeight: FontWeight.bold, ), ), - ], - ) ], ), ], diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 7a1d2845..79b77ba5 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -17,7 +17,7 @@ import 'package:flutter/services.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:dio/dio.dart'; -import 'package:photo_view/photo_view.dart'; +// import 'package:photo_view/photo_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; class LoginPage extends StatefulWidget { @@ -390,11 +390,11 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { child: Stack( alignment: Alignment.center, children: [ - PhotoView( - imageProvider: AssetImage("assets/image/laoban.png"), - initialScale: Platform.isAndroid ? 1.02 : 1.2, - basePosition: alignmentProgress, - ), + // PhotoView( + // imageProvider: AssetImage("assets/image/laoban.png"), + // initialScale: Platform.isAndroid ? 1.02 : 1.2, + // basePosition: alignmentProgress, + // ), Positioned( top: 54.h, left: 28.w, diff --git a/pubspec.lock b/pubspec.lock index 686d4ff2..8ed43772 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -49,14 +49,14 @@ packages: name: args url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "2.2.0" async: dependency: transitive description: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.5.0" + version: "2.6.1" barcode: dependency: transitive description: @@ -385,6 +385,13 @@ packages: description: flutter source: sdk version: "0.0.0" + fluttertoast: + dependency: "direct main" + description: + name: fluttertoast + url: "https://pub.flutter-io.cn" + source: hosted + version: "8.0.7" glob: dependency: transitive description: @@ -623,13 +630,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" - photo_view: - dependency: "direct main" - description: - name: photo_view - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.11.1" platform: dependency: transitive description: @@ -858,7 +858,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.19" + version: "0.3.0" timing: dependency: transitive description: @@ -970,7 +970,7 @@ packages: name: win32 url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.5" + version: "2.2.5" xdg_directories: dependency: transitive description: @@ -993,5 +993,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.13.0 <3.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 3a26bd7a..2d2f9efd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -63,7 +63,7 @@ dependencies: event_bus: ^2.0.0 intl: ^0.17.0 shared_preferences: ^2.0.6 -# fluttertoast: ^8.0.7 + fluttertoast: ^8.0.7 flutter_smart_dialog: ^2.1.6 # url_launcher: ^6.0.5 @@ -80,7 +80,7 @@ dependencies: cached_network_image: ^2.0.0 flutter_html: ^1.3.0 #2.1.0 - photo_view: ^0.11.1 +# photo_view: ^0.11.1 chewie: ^0.12.2 video_player: ^1.0.1