diff --git a/lib/widgets/custom/banner/custom_banner_widget.dart b/lib/widgets/custom/banner/custom_banner_widget.dart index a656c92..bcb5e82 100644 --- a/lib/widgets/custom/banner/custom_banner_widget.dart +++ b/lib/widgets/custom/banner/custom_banner_widget.dart @@ -11,6 +11,7 @@ class CustomBannerWidget extends StatelessWidget { final Map<String, dynamic> data; CustomBannerModel _model; + CustomBannerWidget(this.data, {Key key}) : super(key: key) { try { _model = CustomBannerModel.fromJson(jsonDecode(data['data'])); @@ -97,6 +98,9 @@ class CustomBannerWidget extends StatelessWidget { /// 左1右2 Widget _buildStyle3(BuildContext context, List<CustomBannerListStyle> listStyle) { + const bool inProduction = const bool.fromEnvironment("dart.vm.product"); + // if(!inProduction )return Container(); + CustomBannerListStyle left1 = listStyle.firstWhere((element) => element.locationType == 'left1'); CustomBannerListStyle right1 = listStyle.firstWhere((element) => element.locationType == 'right1'); CustomBannerListStyle right2 = listStyle.firstWhere((element) => element.locationType == 'right2'); @@ -107,11 +111,15 @@ class CustomBannerWidget extends StatelessWidget { Flexible(flex: 1, child: _buildSingleWidthWidget(context, left1)), Flexible( flex: 1, - child: Column( - children: <Widget>[ - Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), - Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right2), child: CachedNetworkImage(imageUrl: right2?.img ?? ''))), - ], + child: Visibility( + replacement: Container(), + visible: inProduction, + child: Column( + children: <Widget>[ + Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), + Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right2), child: CachedNetworkImage(imageUrl: right2?.img ?? ''))), + ], + ), ), ), ], @@ -120,6 +128,10 @@ class CustomBannerWidget extends StatelessWidget { /// 左2右1 Widget _buildStyle4(BuildContext context, List<CustomBannerListStyle> listStyle) { + + const bool inProduction = const bool.fromEnvironment("dart.vm.product"); + // if(!inProduction )return Container(); + CustomBannerListStyle left1 = listStyle.firstWhere((element) => element.locationType == 'left1'); CustomBannerListStyle left2 = listStyle.firstWhere((element) => element.locationType == 'left2'); CustomBannerListStyle right1 = listStyle.firstWhere((element) => element.locationType == 'right1'); @@ -128,11 +140,15 @@ class CustomBannerWidget extends StatelessWidget { children: <Widget>[ Flexible( flex: 1, - child: Column( - children: <Widget>[ - Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left1), child: CachedNetworkImage(imageUrl: left1?.img ?? ''))), - Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left2), child: CachedNetworkImage(imageUrl: left2?.img ?? ''))), - ], + child: Visibility( + replacement: Container(), + visible: inProduction, + child: Column( + children: <Widget>[ + Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left1), child: CachedNetworkImage(imageUrl: left1?.img ?? ''))), + Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left2), child: CachedNetworkImage(imageUrl: left2?.img ?? ''))), + ], + ), ), ), // Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), @@ -143,6 +159,10 @@ class CustomBannerWidget extends StatelessWidget { /// 左1右3 Widget _buildStyle5(BuildContext context, List<CustomBannerListStyle> listStyle) { + + const bool inProduction = const bool.fromEnvironment("dart.vm.product"); + // if(!inProduction )return Container(); + CustomBannerListStyle left1 = listStyle.firstWhere((element) => element.locationType == 'left1'); CustomBannerListStyle right1 = listStyle.firstWhere((element) => element.locationType == 'right1'); CustomBannerListStyle right2 = listStyle.firstWhere((element) => element.locationType == 'right2'); @@ -155,16 +175,20 @@ class CustomBannerWidget extends StatelessWidget { Flexible(flex: 4, child: _buildSingleWidthWidget(context, left1)), Flexible( flex: 6, - child: Column( - children: <Widget>[ - Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), - Row( - children: <Widget>[ - Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right2), child: CachedNetworkImage(imageUrl: right2?.img ?? ''))), - Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right3), child: CachedNetworkImage(imageUrl: right3?.img ?? ''))), - ], - ) - ], + child: Visibility( + replacement: Container(), + visible: inProduction, + child: Column( + children: <Widget>[ + Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), + Row( + children: <Widget>[ + Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right2), child: CachedNetworkImage(imageUrl: right2?.img ?? ''))), + Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right3), child: CachedNetworkImage(imageUrl: right3?.img ?? ''))), + ], + ) + ], + ), ), ) ], diff --git a/lib/widgets/custom/multi_nav/custom_quick_entry.dart b/lib/widgets/custom/multi_nav/custom_quick_entry.dart index e23546e..86df86b 100644 --- a/lib/widgets/custom/multi_nav/custom_quick_entry.dart +++ b/lib/widgets/custom/multi_nav/custom_quick_entry.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -108,9 +110,10 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> // 总页数 int totalPage = totalDataSize % (totalRowSize * columSize) == 0 ? totalDataSize ~/ (totalRowSize * columSize) : (totalDataSize ~/ (totalRowSize * columSize)) + 1; + Logger.log('totalPage = ' + totalPage?.toString()); // 总体高度 = 行数 * (子元素高度 + 边距高度) + 进度条的高度 - double totalHeight = totalRowSize * (itemHeight + barMargin) + 4; - if (!EmptyUtil.isEmpty(model?.pagination) && model.pagination != 'type_null' /*model.pagination_open == '0'*/) { + double totalHeight = totalRowSize * (itemHeight + barMargin); + if (totalPage > 1 && !EmptyUtil.isEmpty(model?.pagination) && model.pagination != 'type_null' /*model.pagination_open == '0'*/) { totalHeight = totalRowSize * (itemHeight + barMargin); } diff --git a/lib/widgets/custom/notice/custom_notice_widget.dart b/lib/widgets/custom/notice/custom_notice_widget.dart index a1e774e..8bd2e13 100644 --- a/lib/widgets/custom/notice/custom_notice_widget.dart +++ b/lib/widgets/custom/notice/custom_notice_widget.dart @@ -43,7 +43,7 @@ class _CustomNoticeWidgetContainerState extends State<_CustomNoticeWidgetContain /// 子item跳转 void _itemJump(NoticeListStyle model) { print('${model?.contentText}'); - RouterUtil.route(model, model.toJson(), context); + // RouterUtil.route(model, model.toJson(), context); } @override diff --git a/lib/widgets/goods_details/price/goods_details_price_widget.dart b/lib/widgets/goods_details/price/goods_details_price_widget.dart index 7626f52..127eeae 100644 --- a/lib/widgets/goods_details/price/goods_details_price_widget.dart +++ b/lib/widgets/goods_details/price/goods_details_price_widget.dart @@ -94,6 +94,10 @@ class GoodsDetailsPriceWidget extends StatelessWidget { /// 购买人数 Widget _getBuyNumberWidget(GoodsDetailsPriceModel model) { + // 考拉和唯品会不展示 + if(model?.provider == GlobalConfig.PROVIDER_VIP || model?.provider == GlobalConfig.PROVIDER_KL){ + return Container(); + } return Text('${model?.sold_count}${model?.buy_text}' ?? '99999人已购买', style: TextStyle(color: HexColor.fromHex(model?.buy_color ?? '#999999'), fontSize: 12.5)); } } diff --git a/lib/widgets/goods_details/price/model/goods_details_price_model.dart b/lib/widgets/goods_details/price/model/goods_details_price_model.dart index 0ddaa89..25f57f6 100644 --- a/lib/widgets/goods_details/price/model/goods_details_price_model.dart +++ b/lib/widgets/goods_details/price/model/goods_details_price_model.dart @@ -15,6 +15,7 @@ class GoodsDetailsPriceModel { String symbol; String hand_price_text; String is_coupon; + String provider; GoodsDetailsPriceModel({ this.buy_color, @@ -33,6 +34,7 @@ class GoodsDetailsPriceModel { this.symbol, this.hand_price_text, this.is_coupon, + this.provider, }); factory GoodsDetailsPriceModel.fromJson(Map<String, dynamic> json) { @@ -53,6 +55,7 @@ class GoodsDetailsPriceModel { symbol: json['symbol'], hand_price_text: json['hand_price_text'], is_coupon: json['is_coupon'], + provider: json['provider'], ); } @@ -74,6 +77,7 @@ class GoodsDetailsPriceModel { data['symbol'] = this.symbol; data['hand_price_text'] = this.hand_price_text; data['is_coupon'] = this.is_coupon; + data['provider'] = this.provider; return data; } }