Browse Source

1、唯品会,考拉不显示购买人数

2、banner广告图 debug模式崩溃修改
3、公告轮播取消跳转
4、多眼导航细微调整
tags/0.0.3+1
PH2 4 years ago
parent
commit
0b2ccb8c9c
5 changed files with 58 additions and 23 deletions
  1. +44
    -20
      lib/widgets/custom/banner/custom_banner_widget.dart
  2. +5
    -2
      lib/widgets/custom/multi_nav/custom_quick_entry.dart
  3. +1
    -1
      lib/widgets/custom/notice/custom_notice_widget.dart
  4. +4
    -0
      lib/widgets/goods_details/price/goods_details_price_widget.dart
  5. +4
    -0
      lib/widgets/goods_details/price/model/goods_details_price_model.dart

+ 44
- 20
lib/widgets/custom/banner/custom_banner_widget.dart View File

@@ -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 ?? ''))),
],
)
],
),
),
)
],


+ 5
- 2
lib/widgets/custom/multi_nav/custom_quick_entry.dart View File

@@ -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);
}



+ 1
- 1
lib/widgets/custom/notice/custom_notice_widget.dart View File

@@ -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


+ 4
- 0
lib/widgets/goods_details/price/goods_details_price_widget.dart View File

@@ -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));
}
}

+ 4
- 0
lib/widgets/goods_details/price/model/goods_details_price_model.dart View File

@@ -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;
}
}

||||||
x
 
000:0
Loading…
Cancel
Save