Procházet zdrojové kódy

1、custom banner 的修改

2、转账数据返回有问题失效
tags/0.0.2+16^0
PH2 před 3 roky
rodič
revize
3ed93463ce
3 změnil soubory, kde provedl 72 přidání a 48 odebrání
  1. +2
    -2
      lib/pages/withdraw_page/models/withdraw_model.dart
  2. +66
    -42
      lib/widgets/custom/banner/custom_banner_widget.dart
  3. +4
    -4
      lib/widgets/custom/banner/model/custom_banner_model.dart

+ 2
- 2
lib/pages/withdraw_page/models/withdraw_model.dart Zobrazit soubor

@@ -79,7 +79,7 @@ class WithdrawModel {
bindAlipayText = json['bind_alipay_text'];
unbindAlipayGotoText = json['unbind_alipay_goto_text'];
bindAlipayGotoText = json['bind_alipay_goto_text'];
isCashOutType = json['is_cash_out_type'];
isCashOutType = json['is_cash_out_type']?.toString();
if (json['cash_out_dashbord_items'] != null) {
cashOutDashbordItems = new List<WithdrawDashbordItems>();
json['cash_out_dashbord_items'].forEach((v) {
@@ -165,7 +165,7 @@ class WithdrawDashbordItems {

WithdrawDashbordItems.fromJson(Map<String, dynamic> json) {
name = json['name'];
value = json['value'];
value = json['value']?.toString();
}

Map<String, dynamic> toJson() {


+ 66
- 42
lib/widgets/custom/banner/custom_banner_widget.dart Zobrazit soubor

@@ -101,19 +101,23 @@ class CustomBannerWidget extends StatelessWidget {
CustomBannerListStyle right1 = listStyle.firstWhere((element) => element.locationType == 'right1');
CustomBannerListStyle right2 = listStyle.firstWhere((element) => element.locationType == 'right2');
if (EmptyUtil.isEmpty(left1) || EmptyUtil.isEmpty(right1) || EmptyUtil.isEmpty(right2)) return Container();
return Row(
children: <Widget>[
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left1), child: CachedNetworkImage(imageUrl: left1?.img ?? ''))),
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 ?? ''))),
],

return IntrinsicHeight(
child: Row(
children: <Widget>[
// Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left1), child: CachedNetworkImage(imageUrl: left1?.img ?? ''))),
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 ?? ''))),
],
),
),
),
],
],
),
);
}

@@ -123,19 +127,22 @@ class CustomBannerWidget extends StatelessWidget {
CustomBannerListStyle left2 = listStyle.firstWhere((element) => element.locationType == 'left2');
CustomBannerListStyle right1 = listStyle.firstWhere((element) => element.locationType == 'right1');
if (EmptyUtil.isEmpty(left1) || EmptyUtil.isEmpty(right1) || EmptyUtil.isEmpty(left2)) return Container();
return Row(
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 ?? ''))),
],
return IntrinsicHeight(
child: Row(
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 ?? ''))),
],
),
),
),
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))),
],
// Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))),
Flexible(flex: 1, child: _buildSingleWidthWidget(context, right1)),
],
),
);
}

@@ -147,24 +154,27 @@ class CustomBannerWidget extends StatelessWidget {
CustomBannerListStyle right3 = listStyle.firstWhere((element) => element.locationType == 'right3');
if (EmptyUtil.isEmpty(left1) || EmptyUtil.isEmpty(right1) || EmptyUtil.isEmpty(right2) || EmptyUtil.isEmpty(right3)) return Container();

return Row(
children: <Widget>[
Flexible(flex: 4, child: GestureDetector(onTap: () => _itemOnClick(context, left1), child: CachedNetworkImage(imageUrl: left1?.img ?? ''))),
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 ?? ''))),
],
)
],
),
)
],
return IntrinsicHeight(
child: Row(
children: <Widget>[
// Flexible(flex: 4, child: GestureDetector(onTap: () => _itemOnClick(context, left1), child: CachedNetworkImage(imageUrl: left1?.img ?? ''))),
Flexible(flex: 1, 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 ?? ''))),
],
)
],
),
)
],
),
);
}

@@ -203,4 +213,18 @@ class CustomBannerWidget extends StatelessWidget {
.toList(),
);
}

/// 单个
Widget _buildSingleWidthWidget(BuildContext context, CustomBannerListStyle listStyle){
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: ()=> _itemOnClick(context, listStyle),
child: Container(
width: double.infinity,
child: CachedNetworkImage(
imageUrl: listStyle?.img ?? '',
),
),
);
}
}

+ 4
- 4
lib/widgets/custom/banner/model/custom_banner_model.dart Zobrazit soubor

@@ -97,11 +97,11 @@ class CustomBannerListStyle extends SkipModel {
super.fromJson(json);
name = json['name'];
img = json['img'];
locationType = json['location_type'];
locationName = json['location_name'];
requiredLogin = json['required_login'];
locationType = json['location_type']?.toString();
locationName = json['location_name']?.toString();
requiredLogin = json['required_login']?.toString();
requiredTaobaoAuth = json['required_taobao_auth'];
skipIdentifier = json['skip_identifier'];
skipIdentifier = json['skip_identifier']?.toString();
}

Map<String, dynamic> toJson() {


Načítá se…
Zrušit
Uložit