diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index b94d898c..2f996806 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -930,7 +930,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 54; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -980,7 +980,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.54; + MARKETING_VERSION = 1.0.59; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -1168,7 +1168,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 54; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1218,7 +1218,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.54; + MARKETING_VERSION = 1.0.59; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -1297,7 +1297,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 54; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1347,7 +1347,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.54; + MARKETING_VERSION = 1.0.59; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index a24ac327..b65c6da1 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -14,9 +14,13 @@ import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:image_pickers/image_pickers.dart'; +import 'package:photo_view/photo_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:video_player/video_player.dart'; +import '../photo_view_gallery_screen.dart'; + + class CommunityDynamic extends StatefulWidget { final int itemCount; final Function(double height) heightFun; @@ -166,14 +170,22 @@ class _CommunityDynamic extends State { height: 44, child: Row( children: [ - MImage( - widget?.comment?.memberInfo?.avatar ?? "", - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", + GestureDetector( + onTap: (){ + Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen( + images:[widget?.comment?.memberInfo?.avatar ?? ""],//传入图片list + index: 0,//传入当前点击的图片的index + ), ), ); + }, + child: MImage( + widget?.comment?.memberInfo?.avatar ?? "", + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), ), SizedBox( width: 8, @@ -221,11 +233,8 @@ class _CommunityDynamic extends State { width: 56.w, height: 25.h, alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(11.w), - color: Color(0xFF32A060), - ), child: RoundButton( + height: 25.h, backgroup: (widget.comment.selfFollow ?? false) ? Color(0xFFE6E6E6) : Color(0xFF32A060), @@ -334,10 +343,15 @@ class _CommunityDynamic extends State { child: InkWell( onTap: () { ImagePickers.previewImages(subjectInfo.images,0); + // Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen( + // images:subjectInfo.images,//传入图片list + // index: 0,//传入当前点击的图片的index + // ), ), ); }, child: MImage( subjectInfo.images[0], fit: BoxFit.cover, + radius: BorderRadius.circular(2), width: MediaQuery.of(context).size.width / 1.5, height: MediaQuery.of(context).size.width / 1.5, errorSrc: "assets/image/default_2_1.png", @@ -362,12 +376,17 @@ class _CommunityDynamic extends State { return Container( child: InkWell( onTap: () { - ImagePickers.previewImages(subjectInfo.images, position); + // ImagePickers.previewImages(subjectInfo.images, position); + Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen( + images:subjectInfo.images,//传入图片list + index: position,//传入当前点击的图片的index + ), ), ); }, child: MImage( subjectInfo.images[position], fit: BoxFit.cover, aspectRatio: 1, + radius: BorderRadius.circular(1), errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", ), diff --git a/lib/community/photo_view_gallery_screen.dart b/lib/community/photo_view_gallery_screen.dart new file mode 100644 index 00000000..08c0e0f7 --- /dev/null +++ b/lib/community/photo_view_gallery_screen.dart @@ -0,0 +1,93 @@ +import 'package:flutter/material.dart'; +import 'package:photo_view/photo_view.dart'; +import 'package:photo_view/photo_view_gallery.dart'; + +class PhotoViewGalleryScreen extends StatefulWidget { + List images=[]; + int index=0; + String heroTag; + PageController controller; + + PhotoViewGalleryScreen({Key key,@required this.images,this.index,this.controller,this.heroTag}) : super(key: key){ + controller=PageController(initialPage: index); + } + + @override + _PhotoViewGalleryScreenState createState() => _PhotoViewGalleryScreenState(); +} + +class _PhotoViewGalleryScreenState extends State { + int currentIndex=0; + + @override + void initState() { + // TODO: implement initState + super.initState(); + currentIndex=widget.index; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + children: [ + Positioned( + top: 0, + left: 0, + bottom: 0, + right: 0, + child: Container( + child: PhotoViewGallery.builder( + scrollPhysics: const BouncingScrollPhysics(), + builder: (BuildContext context, int index) { + return PhotoViewGalleryPageOptions( + imageProvider: NetworkImage(widget.images[index]), + + ); + }, + itemCount: widget.images.length, + loadingBuilder: (context, progress) => Center( + child: Container( + width: 20.0, + height: 20.0, + child: CircularProgressIndicator( + value: progress == null + ? null + : progress.cumulativeBytesLoaded / + progress.expectedTotalBytes, + ), + ), + ), + backgroundDecoration: null, + pageController: widget.controller, + enableRotation: true, + onPageChanged: (index){ + setState(() { + currentIndex=index; + }); + }, + ) + ), + ), + Positioned(//图片index显示 + top: MediaQuery.of(context).padding.top+15, + width: MediaQuery.of(context).size.width, + child: Center( + child: Text("${currentIndex+1}/${widget.images.length}",style: TextStyle(color: Colors.white,fontSize: 16)), + ), + ), + Positioned(//右上角关闭按钮 + right: 10, + top: MediaQuery.of(context).padding.top, + child: IconButton( + icon: Icon(Icons.close,size: 30,color: Colors.white,), + onPressed: (){ + Navigator.of(context).pop(); + }, + ), + ), + ], + ), + ); + } +} diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 7e649ea8..cacbb575 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -186,7 +186,7 @@ class _ReleaseDynamic extends State { } else { thumbnail = await Thumbnails.getThumbnail( videoFile: file.path, - imageType: ThumbFormat.WEBP, + imageType: ThumbFormat.JPEG, quality: 10, ); } diff --git a/lib/integral/intergra_view/integral_vip.dart b/lib/integral/intergra_view/integral_vip.dart index 813aac89..2295200e 100644 --- a/lib/integral/intergra_view/integral_vip.dart +++ b/lib/integral/intergra_view/integral_vip.dart @@ -44,7 +44,7 @@ class _IntegralVip extends State { Expanded( child: Container( margin: EdgeInsets.only(left: 15.w), - height: 50.h, + height: 53.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index d8792447..812533ec 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -12,6 +12,7 @@ import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -296,7 +297,7 @@ class _IntegralStoreDetailsPage extends State { itemBuilder: (context, position) { return goods == null ? Container() - : Image.network( + : MImage( goods.viceImgPaths.elementAt(position), fit: BoxFit.cover, ) diff --git a/lib/main.dart b/lib/main.dart index ef5a3403..2c5120f0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -51,14 +51,6 @@ import 'package:huixiang/setting/help_feedback_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; -import 'package:huixiang/store/shopping/activity_prefecture_details.dart'; -import 'package:huixiang/store/shopping/shopping_cart/shopping_cart_page.dart'; -import 'package:huixiang/store/shopping/shopping_goods_details.dart'; -import 'package:huixiang/store/shopping/shopping_home/bargain_details.dart'; -import 'package:huixiang/store/shopping/shopping_home/group_details.dart'; -import 'package:huixiang/store/shopping/shopping_home/group_page_details.dart'; -import 'package:huixiang/store/shopping/shopping_home/search_page.dart'; -import 'package:huixiang/store/shopping/shopping_mall_home.dart'; import 'package:huixiang/store/store_order.dart'; import 'package:huixiang/settlement/settlement.dart'; import 'package:huixiang/test_page.dart'; @@ -78,6 +70,7 @@ import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'community/community_view/class_details.dart'; import 'community/headlines/headlines_column_details.dart'; +import 'community/photo_view_gallery_screen.dart'; import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; import 'main_page.dart'; @@ -350,4 +343,6 @@ Map routers = { BargainDetails(), '/router/group_page_details': (context, {arguments}) => GroupPageDetails(), + '/router/photo_view_gallery_screen': (context, {arguments}) => + PhotoViewGalleryScreen(), }; diff --git a/lib/mine/fans_page.dart b/lib/mine/fans_page.dart index bd888992..c69c6ccb 100644 --- a/lib/mine/fans_page.dart +++ b/lib/mine/fans_page.dart @@ -167,9 +167,9 @@ class _FansPage extends State { width: 56.w, height: 25.h, alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(11.w), - ), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(11.w), + // ), child: GestureDetector( onTap: () { setState(() { diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 15ba7165..1e8b585d 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -7,9 +7,7 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/retrofit/data/comunity_comment.dart'; import 'package:huixiang/retrofit/data/rank.dart'; -import 'package:huixiang/retrofit/data/sign_info.dart'; import 'package:huixiang/retrofit/data/social_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -55,9 +53,12 @@ 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(); @@ -117,6 +118,11 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { EasyLoading.dismiss(); } + _onRefresh(){ + queryUserInfo(); + querySocialInfo(); + } + ///个人社交信息(粉丝/关注数量/成就数量) querySocialInfo() async { SharedPreferences value = await SharedPreferences.getInstance(); @@ -128,9 +134,12 @@ 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) { infoNumber = baseData.data; + _refreshController.refreshCompleted(); } EasyLoading.dismiss(); } @@ -150,7 +159,9 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { header: MyHeader(), physics: BouncingScrollPhysics(), onRefresh: () { - setState(() {}); + setState(() { + _onRefresh(); + }); }, child: SingleChildScrollView( child: Container( diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 57b3d053..b5f418ea 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -98,7 +98,12 @@ class _MineView extends State { String tableId = uri.queryParameters["tableId"]; String tenantCode = uri.queryParameters["tenantCode"]; String shopId = uri.queryParameters["shopId"]; - if (tableId != null && tableId != "" && tenantCode != null && tenantCode != "" && shopId != null && shopId != "") { + if (tableId != null && + tableId != "" && + tenantCode != null && + tenantCode != "" && + shopId != null && + shopId != "") { Navigator.of(context).pushNamed( '/router/store_order', arguments: { @@ -156,7 +161,7 @@ class _MineView extends State { Expanded( flex: 1, child: Container( - height: 50.h, + height: 53.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.stretch, @@ -211,7 +216,7 @@ class _MineView extends State { : Text( widget.userInfo == null ? "" - : "NO.${widget.userInfo.vipNo}", + : "我的积分:${widget.userInfo.points}", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, @@ -236,28 +241,34 @@ class _MineView extends State { alignment: Alignment.bottomRight, height: 50.h, child: GestureDetector( - onTap: () { - widget.toIntegralPage(); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - S.of(context).jifenxiangqing, - style: TextStyle( - color: Colors.black, - fontSize: 12.sp, - fontWeight: MyFontWeight.semi_bold, - ), + onTap: () { + widget.toIntegralPage(); + }, + child: Container( + padding: EdgeInsets.only(top: 4, bottom: 4, right: 16,left: 7), + decoration: BoxDecoration( + color: Color(0xFF87E8B0), + borderRadius: BorderRadius.only(topLeft: Radius.circular(100),bottomLeft:Radius.circular(100)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + S.of(context).jifenxiangqing, + style: TextStyle( + color: Colors.black, + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Icon( + Icons.keyboard_arrow_right, + size: 16, + color: Colors.black, + ) + ], ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - color: Colors.black, - ) - ], - ), - ), + )), ), ], ), diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index c92bc3d6..94bcaf5b 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -152,28 +152,30 @@ class _MineVipCore extends State { @override Widget build(BuildContext context) { - return Stack( - children: [ - Container( - // padding: EdgeInsets.only(top: 40.h), - height:260.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ]), - // border: Border.all(color: Colors.white,width: 0.5), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(35), - bottomLeft: Radius.circular(35), + return Container( + color: Color(0xFFF7F7F7), + child: Stack( + children: [ + Container( + // padding: EdgeInsets.only(top: 40.h), + height:260.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ]), + // border: Border.all(color: Colors.white,width: 0.5), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(35), + bottomLeft: Radius.circular(35), + ), + ), ), - ), - ), - Column( + Column( children: [ SizedBox(height: 40), Container( @@ -232,48 +234,49 @@ class _MineVipCore extends State { child: Column( children: [ ///会员卡 - Container( - height: (MediaQuery.of(context).size.width) / - 1.78 * - AppUtils.textScale(context), - child: Swiper( - viewportFraction: 0.95, - loop: false, - physics: BouncingScrollPhysics(), - controller: controller, - onIndexChanged: (index) { - setState(() { - checkIndex = index; - }); - }, - itemBuilder: (context, position) { - return MineVipView( - vipLevel: !(ranks != null && ranks.isNotEmpty) - ? widget.arguments["rankLevel"] - : position + 1, - curLevel: widget.arguments["rankLevel"], - tag: (widget.arguments["rankLevel"] == (position + 1) || - !(ranks != null && ranks.isNotEmpty)) - ? "vip" - : "", - padding: 6.w, - // rank: !(ranks != null && ranks.isNotEmpty) - // ? 0 - // : widget.arguments["expendAmount"] ?? 0, - rankMax: !(ranks != null && ranks.isNotEmpty) - ? 0 - : ranks[position].rankOrigin, - createTime: widget.arguments["createTime"], - showRank: false, - price: !(ranks != null && ranks.isNotEmpty) - ? "0" - : ranks[position].price, - ); - }, - itemCount: - (ranks != null && ranks.isNotEmpty) ? ranks.length : 1, + if(ranks.length > 0) + Container( + height: (MediaQuery.of(context).size.width) / + 1.78 * + AppUtils.textScale(context), + child: Swiper( + viewportFraction: 0.95, + loop: false, + physics: BouncingScrollPhysics(), + controller: controller, + onIndexChanged: (index) { + setState(() { + checkIndex = index; + }); + }, + itemBuilder: (context, position) { + return MineVipView( + vipLevel: !(ranks != null && ranks.isNotEmpty) + ? widget.arguments["rankLevel"] + : position + 1, + curLevel: widget.arguments["rankLevel"], + tag: (widget.arguments["rankLevel"] == (position + 1) || + !(ranks != null && ranks.isNotEmpty)) + ? "vip" + : "", + padding: 6.w, + // rank: !(ranks != null && ranks.isNotEmpty) + // ? 0 + // : widget.arguments["expendAmount"] ?? 0, + rankMax: !(ranks != null && ranks.isNotEmpty) + ? 0 + : ranks[position].rankOrigin, + createTime: widget.arguments["createTime"], + showRank: false, + price: !(ranks != null && ranks.isNotEmpty) + ? "0" + : ranks[position].price, + ); + }, + itemCount: + (ranks != null && ranks.isNotEmpty) ? ranks.length : 1, + ), ), - ), ///会员权益 Container( @@ -528,45 +531,47 @@ class _MineVipCore extends State { )), ], ), - if (ranks.length > checkIndex && - widget.arguments["rankLevel"] < ranks[checkIndex].level && - ranks[checkIndex].price != "0.00") - Align( - alignment: Alignment.bottomCenter, - child: InkWell( - onTap: () { - setState(() { - buyRank(); - }); - }, - child: Container( - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [ - Color(0xFFFFDCA1), - Color(0xFFFAE4C0), - ]), - ), - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(16), - height: 54, - alignment: Alignment.center, - child: Text( - "${S.of(context).lijikaitong}¥${ranks.length > checkIndex ? ranks[checkIndex].price : ""}/永久", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16.sp, - color: Color(0xFF4A4748), + if (ranks.length > checkIndex && + widget.arguments["rankLevel"] < ranks[checkIndex].level && + ranks[checkIndex].price != "0.00") + Align( + alignment: Alignment.bottomCenter, + child: InkWell( + onTap: () { + setState(() { + buyRank(); + }); + }, + child: Container( + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color(0xFFFFDCA1), + Color(0xFFFAE4C0), + ]), + ), + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(16), + height: 54, + alignment: Alignment.center, + child: Text( + "${S.of(context).lijikaitong}¥${ranks.length > checkIndex ? ranks[checkIndex].price : ""}/永久", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF4A4748), + ), + ), ), ), - ), - ), - ) + ) + + ], + ), + ); - ], - ); } diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index 55a8234e..72bd318d 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/view_widget/cupertino_date_picker.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:image_pickers/image_pickers.dart'; import 'package:intl/intl.dart'; @@ -410,7 +411,7 @@ class _UserInfoPage extends State { borderRadius: BorderRadius.circular(4), child: filePath == null || filePath == "" ? (modifyInfo["headimg"] != null && modifyInfo["headimg"] != "" - ? Image.network( + ? MImage( modifyInfo["headimg"], width: 42, height: 42, diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 395dca09..f0f7cda7 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -25,8 +25,8 @@ 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 @@ -38,8 +38,8 @@ part 'min_api.g.dart'; // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/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.142:8765/app/";///詹云久 +// const baseUrl = "http://192.168.10.142:8765/app/";///詹云久 ///调用小程序的接口 @RestApi(baseUrl: baseUrl) diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index ec4190d2..4060db33 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 ??= '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 9a42e5ed..29b4aa1c 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 @@ -67,8 +67,8 @@ part 'retrofit_api.g.dart'; // const baseUrl = "http://192.168.10.37:8766/app/"; -const base_url = "http://192.168.10.142:8766/app/";///詹云久 -const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 +// const base_url = "http://192.168.10.142: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 0adf7d45..d221d3b7 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 ??= 'https://pos.platform.lotus-wallet.com/app/'; } final Dio _dio; @@ -23,10 +23,14 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = FormData(); + String fileName = data.path.split(Platform.pathSeparator).last; + if(!fileName.contains(".jpeg") && !fileName.contains(".mp4") && !fileName.contains(".png")) + fileName += ".jpeg"; _data.files.add(MapEntry( 'file', MultipartFile.fromFileSync(data.path, - filename: data.path.split(Platform.pathSeparator).last))); + filename: fileName))); + print("filename:$fileName"); if (folderId != null) { _data.fields.add(MapEntry('folderId', folderId.toString())); } diff --git a/lib/view_widget/hot_item.dart b/lib/view_widget/hot_item.dart index 3ff50286..6a8bb590 100644 --- a/lib/view_widget/hot_item.dart +++ b/lib/view_widget/hot_item.dart @@ -176,7 +176,7 @@ class _HotArticleItem extends State { child:Stack( alignment: Alignment.center, children: [ - Image.network( + MImage( widget.article?.coverImg ?? "", fit: BoxFit.fill, height: double.infinity, diff --git a/lib/view_widget/icon_text.dart b/lib/view_widget/icon_text.dart index 5e90ce53..19cdbd38 100644 --- a/lib/view_widget/icon_text.dart +++ b/lib/view_widget/icon_text.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'custom_image.dart'; + class IconText extends StatelessWidget { final String leftImage; final String rightImage; @@ -48,7 +50,7 @@ class IconText extends StatelessWidget { widgets.add(Padding( padding: EdgeInsets.only(left: 2), child: leftImage.startsWith("http") - ? Image.network( + ? MImage( leftImage, width: iconSize, height: iconSize, diff --git a/lib/view_widget/message_item.dart b/lib/view_widget/message_item.dart index e35a40f8..ff840734 100644 --- a/lib/view_widget/message_item.dart +++ b/lib/view_widget/message_item.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'custom_image.dart'; + class MessageItem extends StatefulWidget { final int stStatus; @@ -19,7 +21,7 @@ class _MessageItemState extends State { if (widget.stStatus != 0) checkView(), Container( margin: EdgeInsets.only(left: widget.stStatus == 0 ? 16 : 0), - child: Image.network( + child: MImage( "https://t7.baidu.com/it/u=1297102096,3476971300&fm=193&f=GIF", width: 44.w, fit: BoxFit.cover, diff --git a/lib/view_widget/mine_vip_view.dart b/lib/view_widget/mine_vip_view.dart index aa4693cb..6766255e 100644 --- a/lib/view_widget/mine_vip_view.dart +++ b/lib/view_widget/mine_vip_view.dart @@ -331,7 +331,6 @@ class MineVipView extends StatelessWidget { .pushNamed('/router/mine_vip_core', arguments: { "rankLevel": curLevel, "userInfo":userInfo.masterCardRankName, - "createTime": (userInfo != null) ? "${userInfo.createTime}" : "", "expendAmount": double.tryParse(userInfo?.expendAmount??"0").toInt(), }); diff --git a/pubspec.lock b/pubspec.lock index 1bfee819..e9e32916 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -531,7 +531,7 @@ packages: name: photo_view url: "https://pub.flutter-io.cn" source: hosted - version: "0.11.1" + version: "0.13.0" platform: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index aec2cefc..e15d0ed5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,7 +70,7 @@ dependencies: flutter_html: ^2.1.5 #2.1.0 chewie_audio: ^1.1.2 - photo_view: ^0.11.1 + photo_view: ^0.13.0 video_player: ^2.2.3 thumbnails: ^1.0.1 # media_info: ^0.9.0