diff --git a/assets/image/2x/di_zhi.png b/assets/image/2x/di_zhi.png new file mode 100644 index 00000000..723f79c8 Binary files /dev/null and b/assets/image/2x/di_zhi.png differ diff --git a/assets/image/2x/ding_dan.png b/assets/image/2x/ding_dan.png new file mode 100644 index 00000000..da1a9bc6 Binary files /dev/null and b/assets/image/2x/ding_dan.png differ diff --git a/assets/image/2x/dong_tai.png b/assets/image/2x/dong_tai.png new file mode 100644 index 00000000..e264afcf Binary files /dev/null and b/assets/image/2x/dong_tai.png differ diff --git a/assets/image/2x/fen_si.png b/assets/image/2x/fen_si.png new file mode 100644 index 00000000..76aec509 Binary files /dev/null and b/assets/image/2x/fen_si.png differ diff --git a/assets/image/2x/guan_zhu.png b/assets/image/2x/guan_zhu.png new file mode 100644 index 00000000..4100e4e5 Binary files /dev/null and b/assets/image/2x/guan_zhu.png differ diff --git a/assets/image/2x/ka.png b/assets/image/2x/ka.png new file mode 100644 index 00000000..bb66655b Binary files /dev/null and b/assets/image/2x/ka.png differ diff --git a/assets/image/2x/xiao_fei.png b/assets/image/2x/xiao_fei.png new file mode 100644 index 00000000..ff427bb8 Binary files /dev/null and b/assets/image/2x/xiao_fei.png differ diff --git a/assets/image/3x/di_zhi.png b/assets/image/3x/di_zhi.png new file mode 100644 index 00000000..47fea0b9 Binary files /dev/null and b/assets/image/3x/di_zhi.png differ diff --git a/assets/image/3x/ding_dan.png b/assets/image/3x/ding_dan.png new file mode 100644 index 00000000..415d6844 Binary files /dev/null and b/assets/image/3x/ding_dan.png differ diff --git a/assets/image/3x/dong_tai.png b/assets/image/3x/dong_tai.png new file mode 100644 index 00000000..0f509803 Binary files /dev/null and b/assets/image/3x/dong_tai.png differ diff --git a/assets/image/3x/fen_si.png b/assets/image/3x/fen_si.png new file mode 100644 index 00000000..999e78ba Binary files /dev/null and b/assets/image/3x/fen_si.png differ diff --git a/assets/image/3x/guan_zhu.png b/assets/image/3x/guan_zhu.png new file mode 100644 index 00000000..94d3d42e Binary files /dev/null and b/assets/image/3x/guan_zhu.png differ diff --git a/assets/image/3x/ka.png b/assets/image/3x/ka.png new file mode 100644 index 00000000..c05163f3 Binary files /dev/null and b/assets/image/3x/ka.png differ diff --git a/assets/image/3x/xiao_fei.png b/assets/image/3x/xiao_fei.png new file mode 100644 index 00000000..561d6005 Binary files /dev/null and b/assets/image/3x/xiao_fei.png differ diff --git a/assets/image/di_zhi.png b/assets/image/di_zhi.png new file mode 100644 index 00000000..469c5e6a Binary files /dev/null and b/assets/image/di_zhi.png differ diff --git a/assets/image/ding_dan.png b/assets/image/ding_dan.png new file mode 100644 index 00000000..c64ac543 Binary files /dev/null and b/assets/image/ding_dan.png differ diff --git a/assets/image/dong_tai.png b/assets/image/dong_tai.png new file mode 100644 index 00000000..54d4b464 Binary files /dev/null and b/assets/image/dong_tai.png differ diff --git a/assets/image/fen_si.png b/assets/image/fen_si.png new file mode 100644 index 00000000..48715fb2 Binary files /dev/null and b/assets/image/fen_si.png differ diff --git a/assets/image/guan_zhu.png b/assets/image/guan_zhu.png new file mode 100644 index 00000000..63eb501f Binary files /dev/null and b/assets/image/guan_zhu.png differ diff --git a/assets/image/ka.png b/assets/image/ka.png new file mode 100644 index 00000000..dfe1580a Binary files /dev/null and b/assets/image/ka.png differ diff --git a/assets/image/xiao_fei.png b/assets/image/xiao_fei.png new file mode 100644 index 00000000..11363d43 Binary files /dev/null and b/assets/image/xiao_fei.png differ diff --git a/lib/community/community_list.dart b/lib/community/community_list.dart index 7ffd1094..f147987b 100644 --- a/lib/community/community_list.dart +++ b/lib/community/community_list.dart @@ -10,6 +10,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/icon_text.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -84,6 +85,14 @@ class _CommunityList extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ + (widget.comments == null || widget.comments.length == 0) + ? NoDataView( + src: widget.commentType == 1 ? "assets/image/dong_tai.png" :"assets/image/guan_zhu.png", + isShowBtn: false, + text:widget.commentType == 1 ? "目前暂无发布动态,要把开心的事讲出来哦~" :"目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), + ): ListView.builder( padding: EdgeInsets.zero, itemCount: widget.comments.length, diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index a433ad18..50c468f9 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -198,6 +198,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -322,6 +323,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -457,6 +459,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -603,6 +606,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -846,6 +850,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 35fa22e2..ff302caf 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -403,6 +403,7 @@ class _SystemMessagePage extends State { ), (messages == null || messages.length == 0) ? NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index a0f3bc1e..c1eb6c7b 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -196,10 +196,11 @@ class _CouponsPage extends State { itemCount: coupons != null ? coupons.length : 0, ) : NoDataView( + src: "assets/image/ka.png", isShowBtn: false, - text: "你还没有券~", + text: "目前暂无优惠券,请到领劵中心领取哦~", fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), + margin: EdgeInsets.only(top: 120.h,left:60,right:60), ), ), ), diff --git a/lib/mine/fans_page.dart b/lib/mine/fans_page.dart index c69c6ccb..0aedc064 100644 --- a/lib/mine/fans_page.dart +++ b/lib/mine/fans_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.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:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -18,9 +19,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; class FansPage extends StatefulWidget { final Function refresh; - FansPage( - this.refresh - ); + FansPage(this.refresh); @override State createState() { @@ -81,12 +80,13 @@ class _FansPage extends State { } //关注/取关会员 - _vipFollow(followId,isFollow) async { + _vipFollow(followId, isFollow) async { BaseData baseData = await apiService.follow(followId); if (baseData != null && baseData.isSuccess) { widget.refresh(); _queryFollowList(); - SmartDialog.showToast(isFollow?"取关成功":"关注成功", alignment: Alignment.center); + SmartDialog.showToast(isFollow ? "取关成功" : "关注成功", + alignment: Alignment.center); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } @@ -94,42 +94,44 @@ class _FansPage extends State { @override Widget build(BuildContext context) { - return Scaffold( - body: Container( - margin: EdgeInsets.only(top: 2), - color: Colors.white, - child: SmartRefresher( - enablePullDown: true, - enablePullUp: false, - header: MyHeader(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - controller: _refreshController, - onRefresh: (){_queryFollowList();}, - physics: BouncingScrollPhysics(), - child: ListView.builder( - itemCount: list == null ? 0 : list.length, - padding: EdgeInsets.symmetric(vertical: 8.h), - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - itemBuilder: (context, position) { - return GestureDetector( - onTap: () {}, - child: fansItem(list[position]), - ); - }, - ) - // NoDataView( - // isShowBtn: false, - // text: "共关注0人", - // fontSize: 16.sp, - // margin: EdgeInsets.only(top: 120.h), - // ), - ), + return Container( + margin: EdgeInsets.only(top: 2), + color: Colors.white, + child: SmartRefresher( + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + controller: _refreshController, + onRefresh: () { + _queryFollowList(); + }, + physics: BouncingScrollPhysics(), + child: (list == null || list.length == 0) + ? NoDataView( + src: "assets/image/fen_si.png", + isShowBtn: false, + text: "目前暂无粉丝,听说多发动态可以涨粉哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), + ) + : ListView.builder( + itemCount: list == null ? 0 : list.length, + padding: EdgeInsets.symmetric(vertical: 8.h), + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: fansItem(list[position]), + ); + }, + ), ), ); } @@ -154,15 +156,15 @@ class _FansPage extends State { width: 8, ), Expanded( - flex: 1, + flex: 1, child: Text( - list != null ? (list.nickname ?? "") : "", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - )), + list != null ? (list.nickname ?? "") : "", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + )), Container( width: 56.w, height: 25.h, @@ -173,7 +175,7 @@ class _FansPage extends State { child: GestureDetector( onTap: () { setState(() { - _vipFollow(list.mid,list?.isFollow ?? false); + _vipFollow(list.mid, list?.isFollow ?? false); }); }, child: RoundButton( @@ -186,9 +188,7 @@ class _FansPage extends State { text: (list?.isFollow ?? false) ? "已关注" : "关注", radius: 20, icons: Icon( - (list?.isFollow ?? false) - ? Icons.check - : Icons.add, + (list?.isFollow ?? false) ? Icons.check : Icons.add, color: (list?.isFollow ?? false) ? Color(0xFF808080) : Colors.white, diff --git a/lib/mine/follow_page.dart b/lib/mine/follow_page.dart index 8a09f3d1..8cf32b9c 100644 --- a/lib/mine/follow_page.dart +++ b/lib/mine/follow_page.dart @@ -112,7 +112,15 @@ class _FollowPage extends State { controller: _refreshController, onRefresh: (){_queryFollowList();}, physics: BouncingScrollPhysics(), - child: ListView.builder( + child: (list == null || list.length == 0) + ? NoDataView( + src: "assets/image/guan_zhu.png", + isShowBtn: false, + text: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), + ) + : ListView.builder( itemCount: list == null ? 0 : list.length, shrinkWrap: true, physics: NeverScrollableScrollPhysics(), @@ -124,14 +132,7 @@ class _FollowPage extends State { ); }, ), - // NoDataView( - // isShowBtn: false, - // text: "共关注0人", - // fontSize: 16.sp, - // margin: EdgeInsets.only(top: 120.h), - // ), ), - ), ); } diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index 890eaf5b..cf27ea7d 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -66,8 +66,9 @@ class _ManageAddressPage extends State { Expanded( child: (addressList == null || addressList.length == 0) ? NoDataView( + src: "assets/image/di_zhi.png", isShowBtn: false, - text: "目前暂无送货地址,请添加", + text: "目前暂无收货地址,请添加~", fontSize: 16.sp, margin: EdgeInsets.only(top: 120.h), ) diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index faf730b8..048c1755 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -172,8 +172,9 @@ class _MineWalletPage extends State { margin: EdgeInsets.only(top: 14.h), child: (userBills == null || userBills.length == 0) ? NoDataView( + src: "assets/image/ding_dan.png", isShowBtn: false, - text: "目前暂未记录哦", + text: "目前暂无记录哦~", fontSize: 16.sp, margin: EdgeInsets.only(top: 120.h), ) diff --git a/lib/mine/release_page.dart b/lib/mine/release_page.dart index 5ac84996..628fab30 100644 --- a/lib/mine/release_page.dart +++ b/lib/mine/release_page.dart @@ -103,7 +103,7 @@ class _ReleasePage extends State { enablePullUp: true, physics: BouncingScrollPhysics(), header: MyHeader(), - footer: CustomFooter( + footer:CustomFooter( builder: (context, mode) { return MyFooter(mode); }, diff --git a/lib/mine/roll_center_page.dart b/lib/mine/roll_center_page.dart index 2c46d765..ccc0e956 100644 --- a/lib/mine/roll_center_page.dart +++ b/lib/mine/roll_center_page.dart @@ -152,6 +152,7 @@ class _RollCenterPage extends State { itemCount: (coupons != null && coupons.length > 0) ? coupons.length : 0, ) : NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouyouhuiquankeyilingqu, fontSize: 16.sp, diff --git a/lib/mine/vip_balance_page.dart b/lib/mine/vip_balance_page.dart index 24e90cc2..362d87ce 100644 --- a/lib/mine/vip_balance_page.dart +++ b/lib/mine/vip_balance_page.dart @@ -92,6 +92,7 @@ class _VipBalancePage extends State { body: Container( child: (userBills == null || userBills.length == 0) ? NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).nihaimeiyouchongzhihuoxiaofeijilu, fontSize: 16.sp, diff --git a/lib/mine/vip_card_page.dart b/lib/mine/vip_card_page.dart index 55cb6dfd..2d645ee9 100644 --- a/lib/mine/vip_card_page.dart +++ b/lib/mine/vip_card_page.dart @@ -88,6 +88,7 @@ class _VipCardPage extends State { itemCount: coupons != null ? coupons.length : 0, ) : NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: "还没有会员卡~", fontSize: 16.sp, diff --git a/lib/order/bargain_group_order.dart b/lib/order/bargain_group_order.dart index 020d5ab8..3beedebd 100644 --- a/lib/order/bargain_group_order.dart +++ b/lib/order/bargain_group_order.dart @@ -192,15 +192,10 @@ class _ExchangeHistoryList extends State { }, ), controller: _refreshController, + physics: BouncingScrollPhysics(), onRefresh: _refresh, - child: (activityOrderList?.length ?? 0) < 0 - ? NoDataView( - isShowBtn: false, - text: "还没有订单,快去下一单吧~", - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) - : + child: (activityOrderList != null && activityOrderList.length > 0) + ? ListView.builder( itemCount: activityOrderList?.length ?? 0, shrinkWrap: true, @@ -208,6 +203,12 @@ class _ExchangeHistoryList extends State { itemBuilder: (context, position) { return bargainOrder(activityOrderList[position]); }, + ):NoDataView( + src: "assets/image/icon_empty.png", + isShowBtn: false, + text: "还没有订单,快去下一单吧~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), ), ), ); @@ -441,7 +442,14 @@ class _ExchangeHistoryList extends State { child: Row( children: [ GestureDetector( - onTap: () {}, + onTap: () { + Navigator.of(context) + .popAndPushNamed('/router/group_details', arguments: { + "actRecordId": activityOrderList.actRecordId, + "actProduct":activityOrderList, + "limitNumber":activityOrderList.howManyMore, + }); + }, child: RoundButton( height: 25.h, text: "查看详情", diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index 805d9822..6cd8a660 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -191,10 +191,11 @@ class _ExchangeHistoryList extends State { onLoading: queryHistory, child: orders == null || orders.length == 0 ? NoDataView( + src: "assets/image/ding_dan.png", isShowBtn: false, - text: "暂无已完成的订单", + text: "目前暂无记录,手上那么多积分要赶紧用掉哦~", fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), + margin: EdgeInsets.only(top: 120.h,left: 72,right: 72), ) : ListView.builder( itemCount: orders == null ? 0 : orders.length, diff --git a/lib/order/logistics_information_page.dart b/lib/order/logistics_information_page.dart index 2b70548d..897cf39e 100644 --- a/lib/order/logistics_information_page.dart +++ b/lib/order/logistics_information_page.dart @@ -153,6 +153,7 @@ class _LogisticsInformationPage extends State { position, logistics.length); }) : NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: "暂无物流信息~", fontSize: 16.sp, diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 42c454dd..56318001 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -156,8 +156,9 @@ class _OrderHistoryList extends State ); }) : NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, - text: "还没有订单,快去下一单吧~", + text: "目前暂无订单,快去下一单吧~", fontSize: 16.sp, margin: EdgeInsets.only(top: 120), ), @@ -253,8 +254,7 @@ class _OrderHistoryList extends State width: 1, color: Color(0xFF32A060), style: BorderStyle.solid, - ) - ), + )), child: Text( "团", style: TextStyle( @@ -266,8 +266,8 @@ class _OrderHistoryList extends State ), Container( width: 19, - height:21, - margin: EdgeInsets.only(left:7.w,top: 12.h), + height: 21, + margin: EdgeInsets.only(left: 7.w, top: 12.h), alignment: Alignment.center, decoration: BoxDecoration( color: Color(0xff32A060), @@ -542,18 +542,21 @@ class _OrderHistoryList extends State }, ); if (payChannel != null && payChannel > 0) { - OrderUtils.carryOnPay(payChannel, minService, orderInfo, () { - SmartDialog.showToast("订单支付成功"); - Future.delayed(Duration(seconds: 1), () { - _onRefresh(); - }); - },); + OrderUtils.carryOnPay( + payChannel, + minService, + orderInfo, + () { + SmartDialog.showToast("订单支付成功"); + Future.delayed(Duration(seconds: 1), () { + _onRefresh(); + }); + }, + ); } } - payResult(BaseData baseData) { - - } + payResult(BaseData baseData) {} orderCancel(String orderId) async { BaseData baseData = await apiService.orderCancel(orderId); @@ -573,7 +576,7 @@ class _OrderHistoryList extends State // ? (orderInfo.storeVO.id ?? "") // : ""; - if(orderInfo.storeVO.posType.code == "NORMALSTORE") { + if (orderInfo.storeVO.posType.code == "NORMALSTORE") { Scan.toScan( context, orderInfo.storeVO.id, diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 33003ab0..0d37b80e 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -34,8 +34,8 @@ part 'min_api.g.dart'; // 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.88:8765/app/";///詹云久 diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 1c1cc751..b8c39c26 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 ??= 'http://192.168.10.88:8765/app/'; } final Dio _dio; @@ -400,4 +400,209 @@ class _MinApiService implements MinApiService { ); return value; } + + @override + Future>> recommendList() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'product/recommendList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => HomeRecommendList.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future> homeConfig() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('store/homeConfig', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ShoppingHomeConfig.fromJson(json), + ); + return value; + } + + @override + Future> findActListByType(allDay, type) async { + ArgumentError.checkNotNull(allDay, 'allDay'); + ArgumentError.checkNotNull(type, 'type'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'actTemplate/findActListByType?allDay=$allDay&type=$type', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ActivityAreaList.fromJson(json), + ); + return value; + } + + @override + Future> viewProduct(actProductId, type) async { + ArgumentError.checkNotNull(actProductId, 'actProductId'); + ArgumentError.checkNotNull(type, 'type'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'actTemplate/viewProduct?actProductId=$actProductId&type=$type', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ActivityDetails.fromJson(json), + ); + return value; + } + + @override + Future> launchAct(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'actTemplate/launchAct', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> joinAct(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'actTemplate/joinAct', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> actPay(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'actTemplate/actPay', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> showMyActList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'actTemplate/showMyActList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => ActivityOrderList.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future> showOneAct(actRecordId) async { + ArgumentError.checkNotNull(actRecordId, 'actRecordId'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'actTemplate/showOneAct?actRecordId=$actRecordId', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ActivityActRecordDetails.fromJson(json), + ); + return value; + } } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index bec3c215..6c1a74f8 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -61,8 +61,8 @@ part 'retrofit_api.g.dart'; // 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.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 71083690..0479f31f 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 ??= 'http://192.168.10.88:8766/app/'; } final Dio _dio; @@ -17,22 +17,17 @@ class _ApiService implements ApiService { String baseUrl; @override - Future> upload(data, folderId,bool isVideo) async { + Future> upload(data, folderId, isVideo) async { ArgumentError.checkNotNull(data, 'data'); ArgumentError.checkNotNull(folderId, 'folderId'); + ArgumentError.checkNotNull(isVideo, 'isVideo'); const _extra = {}; final queryParameters = {}; final _data = FormData(); - String fileName = data.path.split(Platform.pathSeparator).last; - if(!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png")) - fileName += ".jpeg"; - else if(isVideo && !fileName.contains(".mp4")) - fileName += ".mp4"; _data.files.add(MapEntry( 'file', MultipartFile.fromFileSync(data.path, - filename: fileName))); - print("filename:$fileName"); + filename: data.path.split(Platform.pathSeparator).last))); if (folderId != null) { _data.fields.add(MapEntry('folderId', folderId.toString())); } @@ -74,28 +69,6 @@ class _ApiService implements ApiService { return value; } - // @override - // Future> memberLogin(param) async { - // ArgumentError.checkNotNull(param, 'param'); - // const _extra = {}; - // final queryParameters = {}; - // final _data = {}; - // _data.addAll(param ?? {}); - // final _result = await _dio.request>( - // '/auth/platform/memberLogin', - // queryParameters: queryParameters, - // options: RequestOptions( - // method: 'POST', - // headers: {}, - // extra: _extra, - // baseUrl: baseUrl), - // data: _data); - // final value = BaseData.fromJson( - // _result.data, - // (json) => json as dynamic, - // ); - // return value; - // } @override Future> memberLogin(param) async { ArgumentError.checkNotNull(param, 'param'); @@ -114,7 +87,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => LoginInfo.fromJson(json), + (json) => LoginInfo.fromJson(json), ); return value; } @@ -315,7 +288,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -374,15 +347,13 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _headers = {}; - _headers.addAll({"Environment":"app"}); _data.addAll(param ?? {}); final _result = await _dio.request>( '/creditOrder/create', queryParameters: queryParameters, options: RequestOptions( method: 'POST', - headers: _headers, + headers: {}, extra: _extra, baseUrl: baseUrl), data: _data); @@ -1037,8 +1008,7 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _result = await _dio.request>( - '/app-msg/stats', + final _result = await _dio.request>('/app-msg/stats', queryParameters: queryParameters, options: RequestOptions( method: 'GET', @@ -1048,7 +1018,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) + (json) => (json as List) .map((i) => MsgStats.fromJson(i as Map)) .toList()); return value; @@ -1414,8 +1384,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => CategorySelectList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => CategorySelectList.fromJson(i as Map)) .toList()); return value; } @@ -1437,7 +1408,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) + (json) => (json as List) .map((i) => Chapter.fromJson(i as Map)) .toList()); return value; @@ -1450,8 +1421,7 @@ class _ApiService implements ApiService { final queryParameters = {}; final _data = {}; _data.addAll(map ?? {}); - final _result = await _dio.request>( - '/course/list', + final _result = await _dio.request>('/course/list', queryParameters: queryParameters, options: RequestOptions( method: 'POST', @@ -1461,9 +1431,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => PageInfo.fromJson( + (json) => PageInfo.fromJson( json, - (json) => CourseList.fromJson(json), + (json) => CourseList.fromJson(json), ), ); return value; @@ -1485,8 +1455,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => CollectClassList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => CollectClassList.fromJson(i as Map)) .toList()); return value; } @@ -1508,8 +1479,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => CourseList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => CourseList.fromJson(i as Map)) .toList()); return value; } @@ -1520,8 +1492,7 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _result = await _dio.request>( - '/course/$id', + final _result = await _dio.request>('/course/$id', queryParameters: queryParameters, options: RequestOptions( method: 'GET', @@ -1531,7 +1502,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => CourseDetails.fromJson(json), + (json) => CourseDetails.fromJson(json), ); return value; } @@ -1553,19 +1524,20 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @override - Future>> findBadges(param) async { - ArgumentError.checkNotNull(param, 'param'); + Future>> findBadges(map) async { + ArgumentError.checkNotNull(map, 'map'); const _extra = {}; final queryParameters = {}; final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/app-memberAchievement/findBadges', + _data.addAll(map ?? {}); + final _result = await _dio.request>( + '/app-memberAchievement/findBadges', queryParameters: queryParameters, options: RequestOptions( method: 'POST', @@ -1575,14 +1547,16 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => VipBadgesList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => VipBadgesList.fromJson(i as Map)) .toList()); return value; } @override - Future>> getAchievementDetail(achievementCategoryId) async { + Future>> getAchievementDetail( + achievementCategoryId) async { ArgumentError.checkNotNull(achievementCategoryId, 'achievementCategoryId'); const _extra = {}; final queryParameters = {}; @@ -1598,8 +1572,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => AchievementDetailList.fromJson(i as Map)) + (json) => (json as List) + .map((i) => + AchievementDetailList.fromJson(i as Map)) .toList()); return value; } @@ -1620,8 +1595,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => VipBenefitList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => VipBenefitList.fromJson(i as Map)) .toList()); return value; } @@ -1631,8 +1607,7 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _result = await _dio.request>( - '/home/vipBenefit', + final _result = await _dio.request>('/home/vipBenefit', queryParameters: queryParameters, options: RequestOptions( method: 'GET', @@ -1642,7 +1617,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => VipRuleDetails.fromJson(json), + (json) => VipRuleDetails.fromJson(json), ); return value; } @@ -1663,8 +1638,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => SecondCardList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => SecondCardList.fromJson(i as Map)) .toList()); return value; } @@ -1686,7 +1662,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -1708,7 +1684,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -1730,7 +1706,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => Logistics.fromJson(json), + (json) => Logistics.fromJson(json), ); return value; } @@ -1752,7 +1728,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -1773,8 +1749,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => HeadlinesList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => HeadlinesList.fromJson(i as Map)) .toList()); return value; } @@ -1796,9 +1773,8 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => HeadlinesListDetails.fromJson(json), + (json) => HeadlinesListDetails.fromJson(json), ); return value; } - } diff --git a/lib/store/shopping/activity_prefecture_details.dart b/lib/store/shopping/activity_prefecture_details.dart index e90ba6cf..69ac1b9f 100644 --- a/lib/store/shopping/activity_prefecture_details.dart +++ b/lib/store/shopping/activity_prefecture_details.dart @@ -176,7 +176,7 @@ class _ActivityPrefectureDetails extends State { refreshController.refreshCompleted(); }); } else { - refreshController.refreshFailed(); + refreshController.refreshCompleted(); } } @@ -217,7 +217,7 @@ class _ActivityPrefectureDetails extends State { physics: BouncingScrollPhysics(), onRefresh: () { setState(() { - queryFindActListByType(pageType == "2" ? false : true); + queryFindActListByType((pageType == "2" && seckillIndex == 0) ? false : true); }); }, child:SingleChildScrollView( @@ -916,6 +916,7 @@ class _ActivityPrefectureDetails extends State { ], ), ), + SizedBox(width:2.w,), Expanded( child: Text( productList.productPrice, diff --git a/lib/store/shopping/shopping_cart/shopping_cart_page.dart b/lib/store/shopping/shopping_cart/shopping_cart_page.dart index 6799250f..ae76d6fd 100644 --- a/lib/store/shopping/shopping_cart/shopping_cart_page.dart +++ b/lib/store/shopping/shopping_cart/shopping_cart_page.dart @@ -13,6 +13,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -388,26 +389,14 @@ class _ShoppingCartPage extends State } Widget cartGoodsList(){ - return - // ((shopCarGoods?.length ?? 0) > 0) ?Container( - // // width: double.infinity, - // alignment: Alignment.center, - // margin: EdgeInsets.only(bottom: 47.h,left: 66.w,right: 59.w), - // child:Column(children: [ - // Image.asset( - // "assets/image/shopping_k.png", - // width:double.infinity, - // height: 250.h, - // ), - // Text( - // "目前暂无商品,要快去买点好吃的哦~", - // style: TextStyle( - // fontSize: 16.sp, - // fontWeight: MyFontWeight.regular, - // color: Color(0xFF353535), - // ), - // ), - // ],)): + return (shopCarGoods == null || shopCarGoods.length == 0) + ? NoDataView( + src: "assets/image/shopping_k.png", + isShowBtn: false, + text:"目前暂无商品,要快去买点好吃的哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 150.h), + ): Container( margin: EdgeInsets.only(bottom: 50.h), child: ListView.builder( diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index 70c9bd93..89d09b6a 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -75,7 +75,6 @@ class _ShoppingGoodsDetails extends State { Timer _timer; String testTime = "2021-12-30 10:00:00"; - @override void dispose() { super.dispose(); @@ -96,7 +95,7 @@ class _ShoppingGoodsDetails extends State { limitNumber = widget.arguments["limitNumber"]; limitTime = widget.arguments["limitTime"]; bannerImg = widget.arguments["bannerImg"]; - productId =widget.arguments["productId"]; + productId = widget.arguments["productId"]; startCountdownTimer(); debugPrint("store_param tenant:$tenant storeId:$storeId"); @@ -183,8 +182,7 @@ class _ShoppingGoodsDetails extends State { if (baseData != null && baseData.isSuccess) { setState(() { miNiDetail = baseData.data; - if(pageType != null) - queryViewProduct(actProductId, pageType); + if (pageType != null) queryViewProduct(actProductId, pageType); }); refreshController.refreshCompleted(); } else { @@ -212,10 +210,11 @@ class _ShoppingGoodsDetails extends State { setState(() { activityDetails = baseData.data; miNiDetail.productSkuVOList.forEach((element) { - var sku = activityDetails.actProduct.skuJson.firstWhere((ele) => ele.skuId == element.id); - if(sku == null ){ + var sku = activityDetails.actProduct.skuJson + .firstWhere((ele) => ele.skuId == element.id); + if (sku == null) { miNiDetail.productSkuVOList.remove(sku); - }else{ + } else { element.skuPrice = sku.skuPrice.toString(); element.skuStock = sku.skuStock.toInt(); } @@ -289,7 +288,11 @@ class _ShoppingGoodsDetails extends State { } ///选规格添加购物车 - Future _addShopCar(MiNiDetail miNiDetail, selectSkus, int count,) async { + Future _addShopCar( + MiNiDetail miNiDetail, + selectSkus, + int count, + ) async { if (selectSkus != null && selectSkus.length == 0) { productSku = miNiDetail.productSkuVOList.first; } else { @@ -310,14 +313,12 @@ class _ShoppingGoodsDetails extends State { .toString() .replaceAll("[", "") .replaceAll("]", "") - .replaceAll(",", "") - ; + .replaceAll(",", ""); setState(() { skuId1 = skuId; skuValue1 = skuValue; count1 = count; }); - } ///商品➕1 @@ -355,7 +356,7 @@ class _ShoppingGoodsDetails extends State { } } - _onRefresh(){ + _onRefresh() { if (pageType == null) { queryMiNiDetail(id); } else { @@ -370,22 +371,25 @@ class _ShoppingGoodsDetails extends State { var callback = ((timer) { if (isDispose) return; setState(() { - if((activityDetails?.actRecordAndJoinlDTOList) != null) - activityDetails.actRecordAndJoinlDTOList.forEach((element) { - var tempDateTime = - DateTime.parse(element.actRecord.endTime).difference(DateTime.now()); - if (tempDateTime.inSeconds < 0) { - element.actRecord.tempDay = 0; - element.actRecord.tempHour = 0; - element.actRecord.tempM = 0; - element.actRecord.tempS = 0; - return; - } - element.actRecord.tempDay = tempDateTime.inDays; - element.actRecord.tempHour = tempDateTime.inHours - (tempDateTime.inDays * 24); - element.actRecord.tempM = tempDateTime.inMinutes - (tempDateTime.inHours * 60); - element.actRecord.tempS = tempDateTime.inSeconds - (tempDateTime.inMinutes * 60); - }); + if ((activityDetails?.actRecordAndJoinlDTOList) != null) + activityDetails.actRecordAndJoinlDTOList.forEach((element) { + var tempDateTime = DateTime.parse(element.actRecord.endTime) + .difference(DateTime.now()); + if (tempDateTime.inSeconds < 0) { + element.actRecord.tempDay = 0; + element.actRecord.tempHour = 0; + element.actRecord.tempM = 0; + element.actRecord.tempS = 0; + return; + } + element.actRecord.tempDay = tempDateTime.inDays; + element.actRecord.tempHour = + tempDateTime.inHours - (tempDateTime.inDays * 24); + element.actRecord.tempM = + tempDateTime.inMinutes - (tempDateTime.inHours * 60); + element.actRecord.tempS = + tempDateTime.inSeconds - (tempDateTime.inMinutes * 60); + }); }); }); _timer = Timer.periodic(oneSec, callback); @@ -404,12 +408,12 @@ class _ShoppingGoodsDetails extends State { arguments: { "storeInfo": storeInfo, "tableId": tableId, - // "parentCode": parentCode, - // "parentId": parentId, - "pName":pName, - "pid":pid, - "cName":cName, - "cid":cid, + "parentCode": parentCode, + "parentId": parentId, + "pName": pName, + "pid": pid, + "cName": cName, + "cid": cid, "shoppingCartSkuItemList": [ { "buyNum": count1, @@ -426,7 +430,6 @@ class _ShoppingGoodsDetails extends State { // "numberOfPeople": numberOfPeople, }, ); - } @override @@ -465,12 +468,10 @@ class _ShoppingGoodsDetails extends State { buildColumn(), ///拼团 - if (pageType == "1") - groupOption(), + if (pageType == "1") groupOption(), ///拼团规则 - if(pageType == "1") - groupRule(), + if (pageType == "1") groupRule(), goodsOption(), Padding( padding: EdgeInsets.only(top: 16.h, bottom: 12.h), @@ -612,15 +613,16 @@ class _ShoppingGoodsDetails extends State { ///购买按钮 Widget payButton() { return Container( - child:Row( + child: Row( children: [ - if(pageType == null) + if (pageType == null) Row( children: [ GestureDetector( onTap: () { if (productSku == null) - SmartDialog.showToast("请选择規格!", alignment: Alignment.center); + SmartDialog.showToast("请选择規格!", + alignment: Alignment.center); addShoppingCar(); }, child: Container( @@ -680,17 +682,17 @@ class _ShoppingGoodsDetails extends State { ), ///秒杀按钮 - if(pageType == "2") + if (pageType == "2") Row( children: [ GestureDetector( - onTap: (){ + onTap: () { toDownOrder(); }, child: Container( alignment: Alignment.center, width: 120.w, - height:40.h, + height: 40.h, margin: EdgeInsets.only(left: 6.w), decoration: BoxDecoration( borderRadius: BorderRadius.circular(16), @@ -714,7 +716,9 @@ class _ShoppingGoodsDetails extends State { ), ), TextSpan( - text:activityDetails?.actProduct?.productPrice ?? "", + text: + activityDetails?.actProduct?.productPrice ?? + "", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, @@ -724,8 +728,8 @@ class _ShoppingGoodsDetails extends State { ], ), ), - Expanded(child: - Text( + Expanded( + child: Text( "原价购买", style: TextStyle( fontSize: 12.sp, @@ -738,7 +742,7 @@ class _ShoppingGoodsDetails extends State { ), ), GestureDetector( - onTap: (){ + onTap: () { toDownOrder(); }, child: Container( @@ -772,7 +776,9 @@ class _ShoppingGoodsDetails extends State { ), ), TextSpan( - text: activityDetails?.actProduct?.promotionPrice ?? "", + text: activityDetails + ?.actProduct?.promotionPrice ?? + "", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, @@ -782,15 +788,16 @@ class _ShoppingGoodsDetails extends State { ], ), ), - Expanded(child: - Text( - "我要秒杀", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, + Expanded( + child: Text( + "我要秒杀", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), ), - ),), + ), ], ), )), @@ -798,17 +805,17 @@ class _ShoppingGoodsDetails extends State { ), ///砍价 - if(pageType == "3") + if (pageType == "3") Row( children: [ GestureDetector( - onTap: (){ + onTap: () { toDownOrder(); }, child: Container( alignment: Alignment.center, width: 120.w, - height:40.h, + height: 40.h, margin: EdgeInsets.only(left: 6.w), decoration: BoxDecoration( borderRadius: BorderRadius.circular(16), @@ -832,7 +839,9 @@ class _ShoppingGoodsDetails extends State { ), ), TextSpan( - text:activityDetails?.actProduct?.productPrice ?? "", + text: + activityDetails?.actProduct?.productPrice ?? + "", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, @@ -842,8 +851,8 @@ class _ShoppingGoodsDetails extends State { ], ), ), - Expanded(child: - Text( + Expanded( + child: Text( "原价购买", style: TextStyle( fontSize: 12.sp, @@ -856,8 +865,17 @@ class _ShoppingGoodsDetails extends State { ), ), GestureDetector( - onTap: (){ - Navigator.of(context).popAndPushNamed('/router/bargain_details'); + onTap: () { + if (count1 == 0) { + SmartDialog.showToast("请先选择您要购买的商品!~"); + return; + } + Navigator.of(context) + .popAndPushNamed('/router/bargain_details',arguments: { + // "actRecordId": activityDetails.actRecordAndJoinlDTOList[0] + // .actRecordJoinList[index].actRecordId, + "actProduct":activityDetails.actProduct, + }); }, child: Container( alignment: Alignment.center, @@ -890,7 +908,9 @@ class _ShoppingGoodsDetails extends State { ), ), TextSpan( - text:activityDetails?.actProduct?.promotionPrice ?? "", + text: activityDetails + ?.actProduct?.promotionPrice ?? + "", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, @@ -900,34 +920,34 @@ class _ShoppingGoodsDetails extends State { ], ), ), - Expanded(child: - Text( - "我要砍价", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, + Expanded( + child: Text( + "我要砍价", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), ), - ),), + ), ], ), )), ], ), - ///拼团按钮 - if(pageType == "1") + if (pageType == "1") Row( children: [ GestureDetector( - onTap: (){ + onTap: () { toDownOrder(); }, child: Container( alignment: Alignment.center, width: 120.w, - height:40.h, + height: 40.h, margin: EdgeInsets.only(left: 6.w), decoration: BoxDecoration( borderRadius: BorderRadius.circular(16), @@ -951,7 +971,9 @@ class _ShoppingGoodsDetails extends State { ), ), TextSpan( - text:activityDetails?.actProduct?.productPrice ?? "", + text: + activityDetails?.actProduct?.productPrice ?? + "", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, @@ -961,8 +983,8 @@ class _ShoppingGoodsDetails extends State { ], ), ), - Expanded(child: - Text( + Expanded( + child: Text( "单人购买", style: TextStyle( fontSize: 12.sp, @@ -975,7 +997,7 @@ class _ShoppingGoodsDetails extends State { ), ), GestureDetector( - onTap: (){ + onTap: () { toDownOrder(); }, child: Container( @@ -1009,7 +1031,9 @@ class _ShoppingGoodsDetails extends State { ), ), TextSpan( - text:activityDetails?.actProduct?.promotionPrice ?? "", + text: activityDetails + ?.actProduct?.promotionPrice ?? + "", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, @@ -1019,15 +1043,16 @@ class _ShoppingGoodsDetails extends State { ], ), ), - Expanded(child: - Text( - "我要开团", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, + Expanded( + child: Text( + "我要开团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), ), - ),), + ), ], ), )), @@ -1342,51 +1367,50 @@ class _ShoppingGoodsDetails extends State { height: 1.h, color: Color(0xFFF1F1F1), ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "规格", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFA2A2A2), - ), - ), - SizedBox( - width: 8.w, - ), - Expanded( - child: Text( - (skuValue1 ?? "请选择規格") + (count1 > 0 ? "x${count1}" : ""), - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF353535), + GestureDetector( + onTap: () { + setState(() { + if (pageType == null) { + showStoreSelector(miNiDetail, id, 1); + } else { + showStoreSelector(miNiDetail, productId, 1); + } + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "规格", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA2A2A2), + ), ), - ), - ), - GestureDetector( - onTap: () { - setState(() { - if(pageType == null){ - showStoreSelector(miNiDetail, id, 1); - }else { - showStoreSelector(miNiDetail, productId, 1); - } - }); - }, - child: Icon( - Icons.arrow_forward_ios, - color: Colors.black, - size: 16.sp, - ), - ), - ], - ), + SizedBox( + width: 8.w, + ), + Expanded( + child: Text( + (skuValue1 ?? "请选择規格") + (count1 > 0 ? "x${count1}" : ""), + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + color: Colors.black, + size: 16.sp, + ), + ], + )), Container( margin: EdgeInsets.only(left: 32.w, top: 8.h, bottom: 8.h), width: double.infinity, @@ -1467,9 +1491,12 @@ class _ShoppingGoodsDetails extends State { GestureDetector( onTap: () { setState(() { - Navigator.of(context) - .popAndPushNamed('/router/group_page_details', - arguments: {"actRecordAndJoinlDTOList":json.encode(activityDetails.actRecordAndJoinlDTOList),}); + Navigator.of(context).popAndPushNamed( + '/router/group_page_details', + arguments: { + "actRecordAndJoinlDTOList": json + .encode(activityDetails.actRecordAndJoinlDTOList), + }); }); }, child: Text( @@ -1491,7 +1518,7 @@ class _ShoppingGoodsDetails extends State { SizedBox(height: 12.h), ListView.builder( padding: EdgeInsets.zero, - itemCount:activityDetails?.actRecordAndJoinlDTOList?.length ?? 0, + itemCount: activityDetails?.actRecordAndJoinlDTOList?.length ?? 0, scrollDirection: Axis.vertical, shrinkWrap: true, physics: NeverScrollableScrollPhysics(), @@ -1500,7 +1527,9 @@ class _ShoppingGoodsDetails extends State { onTap: () { setState(() {}); }, - child: groupItem(activityDetails.actRecordAndJoinlDTOList[position],position), + child: groupItem( + activityDetails.actRecordAndJoinlDTOList[position], + position), ); }, ), @@ -1509,7 +1538,7 @@ class _ShoppingGoodsDetails extends State { ); } - Widget groupItem(ActRecordAndJoinlDTOList actRecordAndJoinlDTOList,index) { + Widget groupItem(ActRecordAndJoinlDTOList actRecordAndJoinlDTOList, index) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), child: Row( @@ -1517,18 +1546,19 @@ class _ShoppingGoodsDetails extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ MImage( - actRecordAndJoinlDTOList?.actRecordJoinList[0]?.memberAvatar ??"", - width:30, - height:30, + actRecordAndJoinlDTOList?.actRecordJoinList[0]?.memberAvatar ?? "", + width: 30, + height: 30, fit: BoxFit.cover, - isCircle: true, + isCircle: true, errorSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png", ), SizedBox(width: 4.w), Expanded( child: Text( - actRecordAndJoinlDTOList?.actRecordJoinList[0]?.memberNickname ??"", + actRecordAndJoinlDTOList?.actRecordJoinList[0]?.memberNickname ?? + "", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, @@ -1551,7 +1581,7 @@ class _ShoppingGoodsDetails extends State { ), ), TextSpan( - text:activityDetails.actRecordAndJoinlDTOList[0].actRecord.joinNum.toString(), + text: (limitNumber - (activityDetails.actRecordAndJoinlDTOList[0].actRecord.joinNum)).toString(), style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.regular, @@ -1570,7 +1600,7 @@ class _ShoppingGoodsDetails extends State { ), ), Text( - "剩余${(actRecordAndJoinlDTOList?.actRecord?.tempDay != 0)?actRecordAndJoinlDTOList.actRecord.tempDay : ""}:${actRecordAndJoinlDTOList?.actRecord?.tempHour ?? 0}:${actRecordAndJoinlDTOList?.actRecord?.tempM ?? 0}:${actRecordAndJoinlDTOList?.actRecord?.tempS ?? 0}", + "剩余${(actRecordAndJoinlDTOList?.actRecord?.tempDay != 0) ? actRecordAndJoinlDTOList.actRecord.tempDay : ""}:${actRecordAndJoinlDTOList?.actRecord?.tempHour ?? 0}:${actRecordAndJoinlDTOList?.actRecord?.tempM ?? 0}:${actRecordAndJoinlDTOList?.actRecord?.tempS ?? 0}", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.regular, @@ -1580,9 +1610,14 @@ class _ShoppingGoodsDetails extends State { ], ), GestureDetector( - onTap: (){ - Navigator.of(context).popAndPushNamed('/router/group_details', - arguments: {"actRecordId":activityDetails.actRecordAndJoinlDTOList[0].actRecordJoinList[index].actRecordId}); + onTap: () { + Navigator.of(context) + .popAndPushNamed('/router/group_details', arguments: { + "actRecordId": activityDetails.actRecordAndJoinlDTOList[0] + .actRecordJoinList[index].actRecordId, + "actProduct":activityDetails.actProduct, + "limitNumber":limitNumber, + }); }, child: Container( alignment: Alignment.center, @@ -1615,9 +1650,8 @@ class _ShoppingGoodsDetails extends State { color: Colors.white, ), ), - ) , + ), ), - ], ), ); diff --git a/lib/store/shopping/shopping_home/group_details.dart b/lib/store/shopping/shopping_home/group_details.dart index d7081544..c3827b0b 100644 --- a/lib/store/shopping/shopping_home/group_details.dart +++ b/lib/store/shopping/shopping_home/group_details.dart @@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/retrofit/data/activity_actRecord_details.dart'; +import 'package:huixiang/retrofit/data/activity_details.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/utils/font_weight.dart'; @@ -30,6 +31,7 @@ class GroupDetails extends StatefulWidget { class _GroupDetails extends State { MinApiService minService; String actRecordId; + // ActProduct actProduct; ActivityActRecordDetails activityActRecordDetails; bool isDispose = false; Timer _timer; @@ -38,6 +40,7 @@ class _GroupDetails extends State { int tempHour = 0; int tempM = 0; int tempS = 0; + int limitNumber = 0; @override void dispose() { @@ -54,7 +57,8 @@ class _GroupDetails extends State { void initState() { super.initState(); actRecordId = widget.arguments["actRecordId"]; - + // actProduct = widget.arguments["actProduct"]; + limitNumber = widget.arguments["limitNumber"]; startCountdownTimer(); SharedPreferences.getInstance().then((value) { String minToken = value.getString("minToken"); @@ -216,7 +220,7 @@ class _GroupDetails extends State { ), ), // MImage( - // "", + // actProduct?.productImg??"", // width: double.infinity, // height: 166, // fit: BoxFit.cover, @@ -381,7 +385,7 @@ class _GroupDetails extends State { alignment: Alignment.center, decoration: BoxDecoration( // color: Color(0xFFD2D2D2), - color: Color(0xFFF8961E), + color: (((activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber) || tempDay == 0) ? Color(0xFFD2D2D2):Color(0xFFF8961E), borderRadius: BorderRadius.circular(4)), child: Text( tempDay.toString(), @@ -401,7 +405,7 @@ class _GroupDetails extends State { fontSize: 16.sp, fontWeight: MyFontWeight.medium, // color: Color(0xFFD2D2D2), - color: Color(0xFFF8961E), + color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), ), )), ], @@ -414,7 +418,7 @@ class _GroupDetails extends State { alignment: Alignment.center, decoration: BoxDecoration( // color: Color(0xFFD2D2D2), - color: Color(0xFFF8961E), + color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), borderRadius: BorderRadius.circular(4)), child: Text( tempHour.toString(), @@ -434,7 +438,7 @@ class _GroupDetails extends State { fontSize: 16.sp, fontWeight: MyFontWeight.medium, // color: Color(0xFFD2D2D2), - color: Color(0xFFF8961E), + color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), ), )), InkWell( @@ -445,7 +449,7 @@ class _GroupDetails extends State { alignment: Alignment.center, decoration: BoxDecoration( // color: Color(0xFFD2D2D2), - color: Color(0xFFF8961E), + color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), borderRadius: BorderRadius.circular(4)), child: Text( tempM.toString(), @@ -465,7 +469,7 @@ class _GroupDetails extends State { fontSize: 16.sp, fontWeight: MyFontWeight.medium, // color: Color(0xFFD2D2D2), - color: Color(0xFFF8961E), + color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), ), )), InkWell( @@ -476,7 +480,7 @@ class _GroupDetails extends State { alignment: Alignment.center, decoration: BoxDecoration( // color: Color(0xFFD2D2D2), - color: Color(0xFFF8961E), + color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), borderRadius: BorderRadius.circular(4)), child: Text( tempS.toString(), @@ -493,14 +497,16 @@ class _GroupDetails extends State { SizedBox( height: 24, ), - // Text( - // "恭喜您拼团成功", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.semi_bold, - // color: Colors.black, - // ), - // ), + if((activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber) + Text( + "恭喜您拼团成功", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < limitNumber) Text.rich( TextSpan( children: [ @@ -513,7 +519,7 @@ class _GroupDetails extends State { ), ), TextSpan( - text:(activityActRecordDetails?.actRecord?.joinNum ?? 0).toString(), + text:(limitNumber - (activityActRecordDetails?.actRecord?.joinNum ?? 0)).toString(), style: TextStyle( fontSize: 18.sp, fontWeight: MyFontWeight.semi_bold, @@ -531,14 +537,6 @@ class _GroupDetails extends State { ], ), ), - // Text( - // "很遗憾,拼团失败", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.semi_bold, - // color: Colors.black, - // ), - // ), SizedBox( height: 32, ), @@ -551,11 +549,11 @@ class _GroupDetails extends State { padding: EdgeInsets.zero, scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), - itemCount:activityActRecordDetails?.actRecord?.joinNum ?? 0, + itemCount:limitNumber, itemBuilder: (context, position) { return GestureDetector( onTap: () {}, - child: groupItem(activityActRecordDetails.actRecordJoinList[position]), + child: groupItem(position), ); }, ), @@ -563,6 +561,7 @@ class _GroupDetails extends State { SizedBox( height:54.h, ), + if((activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber) InkWell( onTap: () { setState(() { @@ -585,44 +584,44 @@ class _GroupDetails extends State { ), )), ), - // InkWell( - // onTap: () { - // setState(() { - // }); - // }, - // child:Container( - // width:double.infinity, - // height:54.h, - // margin: EdgeInsets.only(bottom: 28), - // alignment: Alignment.center, - // decoration: BoxDecoration( - // color: Color(0xFF00A359), - // borderRadius: BorderRadius.circular(27)), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Image.asset( - // "assets/image/wx.png", - // width:24, - // height:24, - // fit: BoxFit.cover, - // ), - // SizedBox( - // width:8, - // ), - // Text( - // "邀请微信好友一起拼团", - // style: TextStyle( - // fontSize: 16.sp, - // fontWeight: MyFontWeight.medium, - // color: Colors.white, - // ), - // ) - // ], - // )), - // ), - // + if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < limitNumber) + InkWell( + onTap: () { + setState(() { + }); + }, + child:Container( + width:double.infinity, + height:54.h, + margin: EdgeInsets.only(bottom: 28), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF00A359), + borderRadius: BorderRadius.circular(27)), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/wx.png", + width:24, + height:24, + fit: BoxFit.cover, + ), + SizedBox( + width:8, + ), + Text( + "邀请微信好友一起拼团", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ) + ], + )), + ), // InkWell( // onTap: () { // setState(() { @@ -650,16 +649,19 @@ class _GroupDetails extends State { ); } - Widget groupItem(ActRecordJoinList actRecordJoinList) { + Widget groupItem(position) { return Container( margin: EdgeInsets.only(right:25), child:Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ + if(position < (activityActRecordDetails?.actRecord?.joinNum ?? 0)) Stack( children: [ Container( + width:70, + height:70, alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(60), @@ -670,7 +672,7 @@ class _GroupDetails extends State { ), ), child:MImage( - actRecordJoinList?.memberAvatar ?? "", + activityActRecordDetails.actRecordJoinList[position]?.memberAvatar ?? "", width:60, height:60, fit: BoxFit.cover, @@ -679,7 +681,7 @@ class _GroupDetails extends State { fadeSrc: "assets/image/default_1.png", ), ), - actRecordJoinList.isLeader ? + activityActRecordDetails.actRecordJoinList[position].isLeader ? Align( alignment: Alignment.bottomCenter, child:Container( @@ -705,8 +707,7 @@ class _GroupDetails extends State { ):Container(), ], ), - if( - activityActRecordDetails.actRecord.joinNum != 0) + if(position >= (activityActRecordDetails?.actRecord?.joinNum ?? 0)) Container( width: 60, height: 67, diff --git a/lib/store/shopping/shopping_home/recommend_goods_list_view.dart b/lib/store/shopping/shopping_home/recommend_goods_list_view.dart index d6c64326..7b79baec 100644 --- a/lib/store/shopping/shopping_home/recommend_goods_list_view.dart +++ b/lib/store/shopping/shopping_home/recommend_goods_list_view.dart @@ -42,6 +42,7 @@ class _RecommendGoodsListView extends State { ), ), Container( + margin: EdgeInsets.only(top:5.h), color: Color(0xFF32A060), width: 35.w, height: 5.h, diff --git a/lib/store/shopping/shopping_mall_home.dart b/lib/store/shopping/shopping_mall_home.dart index 0929cff7..6c2cece4 100644 --- a/lib/store/shopping/shopping_mall_home.dart +++ b/lib/store/shopping/shopping_mall_home.dart @@ -121,7 +121,7 @@ class _ShoppingMallHome extends State children: [ Container( // padding: EdgeInsets.only(top: 40.h), - height: 260.h, + height: 230.h, decoration: BoxDecoration( gradient: new LinearGradient( begin: Alignment.centerRight, diff --git a/lib/store/store_view/store_activity.dart b/lib/store/store_view/store_activity.dart index 7c385d3e..7739e695 100644 --- a/lib/store/store_view/store_activity.dart +++ b/lib/store/store_view/store_activity.dart @@ -30,6 +30,7 @@ class _StoreActivity extends State { ), color: Colors.white, child: NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text: "还没有活动~", iconWidth: 220, diff --git a/lib/view_widget/no_data_view.dart b/lib/view_widget/no_data_view.dart index 28a5ddce..6dc7f808 100644 --- a/lib/view_widget/no_data_view.dart +++ b/lib/view_widget/no_data_view.dart @@ -3,6 +3,7 @@ import 'package:huixiang/view_widget/round_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class NoDataView extends StatelessWidget { + final String src; final bool isShowBtn; final String text; final double fontSize; @@ -11,6 +12,7 @@ class NoDataView extends StatelessWidget { final EdgeInsets margin; NoDataView({ + this.src, this.isShowBtn = true, this.text, this.fontSize, @@ -27,7 +29,7 @@ class NoDataView extends StatelessWidget { child: Column( children: [ Image( - image: AssetImage("assets/image/icon_empty.png"), + image: AssetImage(src), width: iconWidth, height: iconHeight, ), @@ -36,8 +38,10 @@ class NoDataView extends StatelessWidget { ), Text( text, + textAlign: TextAlign.center, style: TextStyle( fontSize: fontSize, + height: 1.5, color: Color(0xFF353535), ), ), diff --git a/pubspec.lock b/pubspec.lock index 82eb5922..e80c0a4b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -867,7 +867,7 @@ packages: name: xdg_directories url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: