From 33a0ced3b7d8f09bf1fd156692d2ea003be48acc Mon Sep 17 00:00:00 2001 From: Weller <1812208341@qq.com> Date: Wed, 23 Sep 2020 16:04:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E7=8C=9C=E4=BD=A0=E5=96=9C=E6=AC=A2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dart_tool/package_config.json | 2 +- .idea/saveactions_settings.xml | 14 ++ .../models/mine_detail_model.g.dart | 30 ---- .../setting_page_style_item_model.g.dart | 30 ---- lib/register.dart | 5 +- .../goods_detail_commend_creater.dart | 45 ++++++ .../recommend/goods_detail_commend_list.dart | 132 ++++++++++++++++++ .../goods_detail_commend_widget.dart | 66 +++++++++ .../models/goods_detail_recommend_model.dart | 72 ++++++++++ .../home_auth/models/home_auth_model.g.dart | 32 ----- .../models/home_goods_header_model.g.dart | 29 ---- .../home_goods/models/home_goods_model.g.dart | 38 ----- .../models/home_goods_style_model.g.dart | 44 ------ .../mine_data/model/mine_data_model.g.dart | 46 ------ .../model/mine_header_model.g.dart | 42 ------ .../model/mine_profile_model.g.dart | 48 ------- .../mine_quick_entry/mine_quick_entry.dart | 2 +- .../model/mine_quick_model.dart | 6 +- .../model/mine_quick_model.g.dart | 50 ------- 19 files changed, 338 insertions(+), 395 deletions(-) create mode 100644 .idea/saveactions_settings.xml delete mode 100644 lib/pages/mine_detail_page/models/mine_detail_model.g.dart delete mode 100644 lib/pages/setting_page/models/setting_page_style_item_model.g.dart create mode 100644 lib/widgets/goods_details/recommend/goods_detail_commend_creater.dart create mode 100644 lib/widgets/goods_details/recommend/goods_detail_commend_list.dart create mode 100644 lib/widgets/goods_details/recommend/goods_detail_commend_widget.dart create mode 100644 lib/widgets/goods_details/recommend/models/goods_detail_recommend_model.dart delete mode 100644 lib/widgets/home/home_auth/models/home_auth_model.g.dart delete mode 100644 lib/widgets/home/home_goods/models/home_goods_header_model.g.dart delete mode 100644 lib/widgets/home/home_goods/models/home_goods_model.g.dart delete mode 100644 lib/widgets/home/home_goods/models/home_goods_style_model.g.dart delete mode 100644 lib/widgets/mine/mine_data/model/mine_data_model.g.dart delete mode 100644 lib/widgets/mine/mine_header/model/mine_header_model.g.dart delete mode 100644 lib/widgets/mine/mine_header/model/mine_profile_model.g.dart delete mode 100644 lib/widgets/mine/mine_quick_entry/model/mine_quick_model.g.dart diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index d0b9c77..3d0aa65 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -560,7 +560,7 @@ "languageVersion": "2.1" } ], - "generated": "2020-09-23T04:06:39.433861Z", + "generated": "2020-09-23T06:47:59.492879Z", "generator": "pub", "generatorVersion": "2.7.2" } diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml new file mode 100644 index 0000000..1e9ec9d --- /dev/null +++ b/.idea/saveactions_settings.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/lib/pages/mine_detail_page/models/mine_detail_model.g.dart b/lib/pages/mine_detail_page/models/mine_detail_model.g.dart deleted file mode 100644 index 0bd1061..0000000 --- a/lib/pages/mine_detail_page/models/mine_detail_model.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'mine_detail_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -MineDetailModel _$MineDetailModelFromJson(Map json) { - return MineDetailModel( - json['avatar'] as String, - json['nickname'] as String, - json['gender'] as String, - json['birthday'] as String, - json['register_time'] as String, - json['file_bucket_url'] as String, - json['file_format'] as String, - ); -} - -Map _$MineDetailModelToJson(MineDetailModel instance) => - { - 'avatar': instance.avatar, - 'nickname': instance.nickname, - 'gender': instance.gender, - 'birthday': instance.birthday, - 'register_time': instance.registerTime, - 'file_bucket_url': instance.fileBucketUrl, - 'file_format': instance.format, - }; diff --git a/lib/pages/setting_page/models/setting_page_style_item_model.g.dart b/lib/pages/setting_page/models/setting_page_style_item_model.g.dart deleted file mode 100644 index c831197..0000000 --- a/lib/pages/setting_page/models/setting_page_style_item_model.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'setting_page_style_item_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -SettingPageStyleItemModel _$SettingPageStyleItemModelFromJson( - Map json) { - return SettingPageStyleItemModel( - json['name'] as String, - json['name_color'] as String, - json['desc'] as String, - json['desc_color'] as String, - json['skip_identifier'] as String, - json['url'] as String, - ); -} - -Map _$SettingPageStyleItemModelToJson( - SettingPageStyleItemModel instance) => - { - 'name': instance.name, - 'name_color': instance.nameColor, - 'desc': instance.desc, - 'desc_color': instance.descColor, - 'skip_identifier': instance.skipIdentifier, - 'url': instance.url, - }; diff --git a/lib/register.dart b/lib/register.dart index f17f3e2..7e5286b 100644 --- a/lib/register.dart +++ b/lib/register.dart @@ -10,6 +10,7 @@ import 'package:zhiying_base_widget/pages/wallet_page/wallet_page.dart'; import 'package:zhiying_base_widget/pages/webview/base_webview.dart'; import 'package:zhiying_base_widget/widgets/goods_details/footer/goods_details_footer_widget.dart'; import 'package:zhiying_base_widget/widgets/goods_details/price/goods_details_price_widget.dart'; +import 'package:zhiying_base_widget/widgets/goods_details/recommend/goods_detail_commend_creater.dart'; import 'package:zhiying_base_widget/widgets/goods_details/slide_banner/goods_details_slide_banner_widget.dart'; import 'package:zhiying_base_widget/widgets/goods_details/store/store_widget.dart'; import 'package:zhiying_base_widget/widgets/goods_details/upgrade_tip/upgrade_tip_widget.dart'; @@ -19,7 +20,6 @@ import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_creater.d import 'package:zhiying_base_widget/widgets/home/home_notice/home_notice_widget.dart'; import 'package:zhiying_base_widget/widgets/home/home_slide_banner/home_slide_banner_creater.dart'; import 'package:zhiying_base_widget/widgets/home/home_sreach/home_sreach_creater.dart'; -import 'package:zhiying_base_widget/widgets/home/home_sreach/home_sreach_widget.dart'; import 'package:zhiying_base_widget/widgets/mine/mine_data/mine_data.dart'; import 'package:zhiying_base_widget/widgets/mine/mine_header/mine_header.dart'; import 'package:zhiying_base_widget/widgets/mine/mine_nav/mine_nav_bg.dart'; @@ -124,7 +124,8 @@ class BaseWidgetRegister { DefaultWidgetCreater((model) => GoodsDetailsImgWidget(model))); // 商品详情底部推荐列表 // WidgetFactory.regist('product_detail_bottom_rec', DefaultWidgetCreater((model) => GoodsListCreater(model))); - WidgetFactory.regist('product_detail_bottom_rec', GoodsListCreater()); + WidgetFactory.regist( + 'product_detail_bottom_rec', GoodsDetailCommendCreater()); // 商品详情底部 WidgetFactory.regist('product_detail_bottom', DefaultWidgetCreater((model) => GoodsDetailsFooterWidget(model))); diff --git a/lib/widgets/goods_details/recommend/goods_detail_commend_creater.dart b/lib/widgets/goods_details/recommend/goods_detail_commend_creater.dart new file mode 100644 index 0000000..ef8f7f0 --- /dev/null +++ b/lib/widgets/goods_details/recommend/goods_detail_commend_creater.dart @@ -0,0 +1,45 @@ +import 'dart:convert' as convert; + +import 'package:event_bus/event_bus.dart'; +import 'package:flutter/material.dart'; +import 'package:zhiying_base_widget/widgets/goods_details/recommend/goods_detail_commend_list.dart'; +import 'package:zhiying_base_widget/widgets/goods_details/recommend/goods_detail_commend_widget.dart'; +import 'package:zhiying_base_widget/widgets/goods_details/recommend/models/goods_detail_recommend_model.dart'; +import 'package:zhiying_base_widget/widgets/home/home_goods/bloc/home_goods_header_bloc.dart'; +import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_header.dart'; +import 'package:zhiying_comm/util/base_bloc.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +class GoodsDetailCommendCreater extends WidgetCreater { + final EventBus _eventBus = EventBus(); + + @override + List createWidgets(Map model) { + String d = model['data']; + Map json = convert.jsonDecode(d); + GoodsDetailRecommendModel style = GoodsDetailRecommendModel.fromJson(json); + + print('创建商品列表'); + Widget _widget = BlocProvider( + bloc: HomeGoodsHeaderBloc(), + child: HomeGoodsHeader(model, _eventBus), + ); + + return [ + SliverToBoxAdapter( + child: GoodsDetailsRecommendWidget(model), + ), + SliverToBoxAdapter( + child: GoodsDetailCommendList( + model, + provider: style.recType, // 猜你喜欢数据源暂无数据 + ), + ), + ]; + } + + @override + bool isSliverChild() { + return true; + } +} diff --git a/lib/widgets/goods_details/recommend/goods_detail_commend_list.dart b/lib/widgets/goods_details/recommend/goods_detail_commend_list.dart new file mode 100644 index 0000000..97d17b7 --- /dev/null +++ b/lib/widgets/goods_details/recommend/goods_detail_commend_list.dart @@ -0,0 +1,132 @@ +import 'dart:convert' as convert; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:zhiying_base_widget/pages/goods_details_page/notifier/goods_details_page_notifier.dart'; +import 'package:zhiying_base_widget/widgets/home/home_goods/bloc/home_goods_bloc.dart'; +import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_item.dart'; +import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_item_single.dart'; +import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_model.dart'; +import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_style_model.dart'; +import 'package:zhiying_comm/util/base_bloc.dart'; + +class GoodsDetailCommendList extends StatefulWidget { + final Map data; + final String provider; + + GoodsDetailCommendList(this.data, {Key key, this.provider}) : super(key: key); + + @override + _GoodsDetailCommendListState createState() => _GoodsDetailCommendListState(); +} + +class _GoodsDetailCommendListState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BlocProvider( + bloc: HomeGoodsBloc(), + child: _GoodsDetailCommendListContainer(widget.data, widget.provider), + ); + } +} + +class _GoodsDetailCommendListContainer extends StatefulWidget { + final Map data; + final String provider; + + _GoodsDetailCommendListContainer(this.data, this.provider, {Key key}) + : super(key: key); + + @override + _GoodsDetailCommendListContainerState createState() => + _GoodsDetailCommendListContainerState(); +} + +class _GoodsDetailCommendListContainerState + extends State<_GoodsDetailCommendListContainer> { + HomeGoodsBloc _bloc; + String _provider = ''; + HomeGoodsStyleModel _style; + + @override + void initState() { + _bloc = BlocProvider.of(context); + + String d = widget.data['data']; + dynamic json = convert.jsonDecode(d); + _style = HomeGoodsStyleModel.fromJson(Map.from(json)); + + _bloc.loadMore(widget.provider); + + super.initState(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + print('didChangeDependencies'); + bool isNeedLoadMore = + Provider.of(context).scrollEnd; + if (isNeedLoadMore && _provider != '') { + print('HomeGoods loadmore...'); + _bloc.loadMore(_provider); + } + } + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + child: StreamBuilder>( + stream: _bloc.outData, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.data == null) { + return Container(); + } + + List goods = snapshot.data; + int column = 2; + int count = (goods.length / column).ceil(); + return ListView.builder( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemCount: count, + itemBuilder: (context, index) { + if (column == 1) { + return HomeGoodsItemSingle( + goods[index], + _style, + data: widget.data, + ); + } else { + // return Container(color: Colors.red, height: 126,margin: EdgeInsets.all(10),); + return Padding( + padding: const EdgeInsets.only(left: 5, right: 5), + child: Row( + children: List.generate(column, (c) { + int i = index * column + c; + return Expanded( + child: i < goods.length + ? HomeGoodsItem( + goods[i], + _style, + data: widget.data, + ) + : Container(), + ); + }).toList(), + ), + ); + } + }); + }, + ), + ); + } +} diff --git a/lib/widgets/goods_details/recommend/goods_detail_commend_widget.dart b/lib/widgets/goods_details/recommend/goods_detail_commend_widget.dart new file mode 100644 index 0000000..156c48d --- /dev/null +++ b/lib/widgets/goods_details/recommend/goods_detail_commend_widget.dart @@ -0,0 +1,66 @@ +import 'dart:convert' as convert; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:zhiying_base_widget/widgets/goods_details/recommend/models/goods_detail_recommend_model.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +class GoodsDetailsRecommendWidget extends StatefulWidget { + final Map data; + + const GoodsDetailsRecommendWidget(this.data, {Key key}) : super(key: key); + + @override + _GoodsDetailsRecommendWidgetState createState() => + _GoodsDetailsRecommendWidgetState(); +} + +class _GoodsDetailsRecommendWidgetState + extends State { + GoodsDetailRecommendModel _style; + + @override + void initState() { + String d = widget.data['data']; + Map json = convert.jsonDecode(d); + _style = GoodsDetailRecommendModel.fromJson(json); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + _createTitle(), + ], + ); + } + + Widget _createTitle() { + return Container( + width: double.infinity, + height: 50, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CachedNetworkImage( + imageUrl: _style.recListIcon ?? '', + width: 15, + height: 15, + ), + Padding( + padding: const EdgeInsets.only(left: 2.5), + child: Text( + _style.recListText, + style: TextStyle( + color: HexColor.fromHex(_style?.recListTextColor ?? 'FF4242'), + fontSize: 14), + ), + ) + ], + ), + ); + } +} diff --git a/lib/widgets/goods_details/recommend/models/goods_detail_recommend_model.dart b/lib/widgets/goods_details/recommend/models/goods_detail_recommend_model.dart new file mode 100644 index 0000000..379799b --- /dev/null +++ b/lib/widgets/goods_details/recommend/models/goods_detail_recommend_model.dart @@ -0,0 +1,72 @@ +class GoodsDetailRecommendModel { + String recListIcon; + String recListText; + String recListTextColor; + String recType; + String providerNameColor; + String providerBgColor; + String titleColor; + String shopIcon; + String shopNameColor; + String currentPriceColor; + String marketPriceColor; + String couponTextColor; + String couponBgColor; + String commissionTextColor; + String commissionBgColor; + + GoodsDetailRecommendModel( + {this.recListIcon, + this.recListText, + this.recListTextColor, + this.recType, + this.providerNameColor, + this.providerBgColor, + this.titleColor, + this.shopIcon, + this.shopNameColor, + this.currentPriceColor, + this.marketPriceColor, + this.couponTextColor, + this.couponBgColor, + this.commissionTextColor, + this.commissionBgColor}); + + GoodsDetailRecommendModel.fromJson(Map json) { + recListIcon = json['rec_list_icon']; + recListText = json['rec_list_text']; + recListTextColor = json['rec_list_text_color']; + recType = json['rec_type']; + providerNameColor = json['provider_name_color']; + providerBgColor = json['provider_bg_color']; + titleColor = json['title_color']; + shopIcon = json['shop_icon']; + shopNameColor = json['shop_name_color']; + currentPriceColor = json['current_price_color']; + marketPriceColor = json['market_price_color']; + couponTextColor = json['coupon_text_color']; + couponBgColor = json['coupon_bg_color']; + commissionTextColor = json['commission_text_color']; + commissionBgColor = json['commission_bg_color']; + } + + Map toJson() { + final Map data = new Map(); + data['rec_list_icon'] = this.recListIcon; + data['rec_list_text'] = this.recListText; + data['rec_list_text_color'] = this.recListTextColor; + data['rec_type'] = this.recType; + data['provider_name_color'] = this.providerNameColor; + data['provider_bg_color'] = this.providerBgColor; + data['title_color'] = this.titleColor; + data['shop_icon'] = this.shopIcon; + data['shop_name_color'] = this.shopNameColor; + data['current_price_color'] = this.currentPriceColor; + data['market_price_color'] = this.marketPriceColor; + data['coupon_text_color'] = this.couponTextColor; + data['coupon_bg_color'] = this.couponBgColor; + data['commission_text_color'] = this.commissionTextColor; + data['commission_bg_color'] = this.commissionBgColor; + return data; + } +} diff --git a/lib/widgets/home/home_auth/models/home_auth_model.g.dart b/lib/widgets/home/home_auth/models/home_auth_model.g.dart deleted file mode 100644 index dde266f..0000000 --- a/lib/widgets/home/home_auth/models/home_auth_model.g.dart +++ /dev/null @@ -1,32 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'home_auth_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -HomeAuthModel _$HomeAuthModelFromJson(Map json) { - return HomeAuthModel( - json['taobao_auth_icon'] as String, - json['taoabo_tip_bg_color'] as String, - json['taoabo_tip_shadow_color'] as String, - json['taoabo_tip_text_color'] as String, - json['taoabo_tip_text'] as String, - json['taoabo_tip_btn_text_color'] as String, - json['taoabo_tip_btn_bg_color'] as String, - json['taoabo_tip_btn_text'] as String, - ); -} - -Map _$HomeAuthModelToJson(HomeAuthModel instance) => - { - 'taobao_auth_icon': instance.icon, - 'taoabo_tip_bg_color': instance.bgColor, - 'taoabo_tip_shadow_color': instance.shadowColor, - 'taoabo_tip_text_color': instance.textColor, - 'taoabo_tip_text': instance.text, - 'taoabo_tip_btn_text_color': instance.tipBtnTextColor, - 'taoabo_tip_btn_bg_color': instance.tipBtnBgColor, - 'taoabo_tip_btn_text': instance.tipBtnText, - }; diff --git a/lib/widgets/home/home_goods/models/home_goods_header_model.g.dart b/lib/widgets/home/home_goods/models/home_goods_header_model.g.dart deleted file mode 100644 index ae36d39..0000000 --- a/lib/widgets/home/home_goods/models/home_goods_header_model.g.dart +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'home_goods_header_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -HomeGoodsHeaderModel _$HomeGoodsHeaderModelFromJson(Map json) { - return HomeGoodsHeaderModel( - json['type'] as String, - json['title'] as String, - json['subtitle'] as String, - json['tilte_text_color'] as String, - json['subtitle_bg_color'] as String, - json['subtitle_text_color'] as String, - ); -} - -Map _$HomeGoodsHeaderModelToJson( - HomeGoodsHeaderModel instance) => - { - 'type': instance.type, - 'title': instance.title, - 'subtitle': instance.subtitle, - 'tilte_text_color': instance.tilteTextColor, - 'subtitle_bg_color': instance.subtitleBgColor, - 'subtitle_text_color': instance.subtitleTextColor, - }; diff --git a/lib/widgets/home/home_goods/models/home_goods_model.g.dart b/lib/widgets/home/home_goods/models/home_goods_model.g.dart deleted file mode 100644 index 397c6ca..0000000 --- a/lib/widgets/home/home_goods/models/home_goods_model.g.dart +++ /dev/null @@ -1,38 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'home_goods_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -HomeGoodsModel _$HomeGoodsModelFromJson(Map json) { - return HomeGoodsModel( - json['provider'] as String, - json['provider_name'] as String, - json['good_id'] as String, - json['good_image'] as String, - json['good_title'] as String, - json['shop_name'] as String, - json['coupon'] as String, - json['commission'] as String, - json['market_price'] as String, - json['current_price'] as String, - json['inorder_count'] as String, - ); -} - -Map _$HomeGoodsModelToJson(HomeGoodsModel instance) => - { - 'provider': instance.provider, - 'provider_name': instance.providerName, - 'good_id': instance.goodId, - 'good_image': instance.goodImage, - 'good_title': instance.goodTitle, - 'shop_name': instance.shopName, - 'coupon': instance.coupon, - 'commission': instance.commission, - 'market_price': instance.marketPrice, - 'current_price': instance.currentPrice, - 'inorder_count': instance.inorderCount, - }; diff --git a/lib/widgets/home/home_goods/models/home_goods_style_model.g.dart b/lib/widgets/home/home_goods/models/home_goods_style_model.g.dart deleted file mode 100644 index 11063e6..0000000 --- a/lib/widgets/home/home_goods/models/home_goods_style_model.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'home_goods_style_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -HomeGoodsStyleModel _$HomeGoodsStyleModelFromJson(Map json) { - return HomeGoodsStyleModel( - (json['recommend_list'] as List) - ?.map((e) => e == null - ? null - : HomeGoodsHeaderModel.fromJson(e as Map)) - ?.toList(), - json['provider_name_color'] as String, - json['provider_name_background_color'] as String, - json['shop_name_color'] as String, - json['shop_icon'] as String, - json['coupon_font_color'] as String, - json['coupon_bg_color'] as String, - json['commission_font_color'] as String, - json['commission_bg_color'] as String, - json['market_price_color'] as String, - json['current_price_color'] as String, - )..column = json['list_column'] as String; -} - -Map _$HomeGoodsStyleModelToJson( - HomeGoodsStyleModel instance) => - { - 'list_column': instance.column, - 'recommend_list': instance.recommendList, - 'provider_name_color': instance.providerNameColor, - 'provider_name_background_color': instance.providerNameBackgroundColor, - 'shop_name_color': instance.shopNameColor, - 'shop_icon': instance.shopIcon, - 'coupon_font_color': instance.couponFontColor, - 'coupon_bg_color': instance.couponBgColor, - 'commission_font_color': instance.commissionFontColor, - 'commission_bg_color': instance.commissionBgColor, - 'market_price_color': instance.marketPriceColor, - 'current_price_color': instance.currentPriceColor, - }; diff --git a/lib/widgets/mine/mine_data/model/mine_data_model.g.dart b/lib/widgets/mine/mine_data/model/mine_data_model.g.dart deleted file mode 100644 index a3c4fa7..0000000 --- a/lib/widgets/mine/mine_data/model/mine_data_model.g.dart +++ /dev/null @@ -1,46 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'mine_data_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -MineDataModel _$MineDataModelFromJson(Map json) { - return MineDataModel( - json['accumulated_earnings_name_color'] as String, - json['accumulated_earnings_color'] as String, - json['accumulated_earnings_bg_img'] as String, - json['btn_text'] as String, - json['btn_text_color'] as String, - json['btn_img'] as String, - json['required_login'] as String, - json['required_taobao_auth'] as String, - json['skip_identifier'] as String, - json['grid_view_bg_color'] as String, - json['grid_view_name_color'] as String, - json['grid_view_value_color'] as String, - (json['grid_view'] as List) - ?.map((e) => e == null - ? null - : MineProfileDataModel.fromJson(e as Map)) - ?.toList(), - ); -} - -Map _$MineDataModelToJson(MineDataModel instance) => - { - 'accumulated_earnings_name_color': instance.accumulatedEarningsNameColor, - 'accumulated_earnings_color': instance.accumulatedEarningsColor, - 'accumulated_earnings_bg_img': instance.accumulatedEarningsBgImg, - 'btn_text': instance.btnText, - 'btn_text_color': instance.btnTextColor, - 'btn_img': instance.btnImg, - 'required_login': instance.requiredLogin, - 'required_taobao_auth': instance.requiredTaobaoAuth, - 'skip_identifier': instance.skipIdentifier, - 'grid_view_bg_color': instance.gridViewBgColor, - 'grid_view_name_color': instance.gridViewNameColor, - 'grid_view_value_color': instance.gridViewValueColor, - 'grid_view': instance.datas, - }; diff --git a/lib/widgets/mine/mine_header/model/mine_header_model.g.dart b/lib/widgets/mine/mine_header/model/mine_header_model.g.dart deleted file mode 100644 index 6d34a76..0000000 --- a/lib/widgets/mine/mine_header/model/mine_header_model.g.dart +++ /dev/null @@ -1,42 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'mine_header_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -MineHeaderModel _$MineHeaderModelFromJson(Map json) { - return MineHeaderModel( - json['non_login_avatar'] as String, - json['user_name_color'] as String, - json['invited_code_text'] as String, - json['invited_code_color'] as String, - json['login_color'] as String, - json['login_name'] as String, - json['login_name_help_text'] as String, - json['coype_icon'] as String, - json['required_login'] as String, - json['required_taobao_auth'] as String, - json['skip_identifier'] as String, - ) - ..lvBgColor = json['lv_bg_color'] as String - ..lvNameColor = json['lv_name_color'] as String; -} - -Map _$MineHeaderModelToJson(MineHeaderModel instance) => - { - 'lv_bg_color': instance.lvBgColor, - 'lv_name_color': instance.lvNameColor, - 'non_login_avatar': instance.defaultAvatar, - 'user_name_color': instance.userNameColor, - 'invited_code_text': instance.invitedCodeText, - 'invited_code_color': instance.invitedCodeColor, - 'login_color': instance.loginColor, - 'login_name': instance.loginName, - 'login_name_help_text': instance.loginNameHelpText, - 'coype_icon': instance.coypeIcon, - 'required_login': instance.requiredLogin, - 'required_taobao_auth': instance.requiredTaobaoAuth, - 'skip_identifier': instance.skipIdentifier, - }; diff --git a/lib/widgets/mine/mine_header/model/mine_profile_model.g.dart b/lib/widgets/mine/mine_header/model/mine_profile_model.g.dart deleted file mode 100644 index aef0889..0000000 --- a/lib/widgets/mine/mine_header/model/mine_profile_model.g.dart +++ /dev/null @@ -1,48 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'mine_profile_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -MineProfileModel _$MineProfileModelFromJson(Map json) { - return MineProfileModel( - json['username'] as String, - json['avatar'] as String, - json['InviteCode'] as String, - json['user_lv_name'] as String, - json['user_lv_icon'] as String, - json['total'] as String, - (json['grid_views'] as List) - ?.map((e) => e == null - ? null - : MineProfileDataModel.fromJson(e as Map)) - ?.toList(), - ); -} - -Map _$MineProfileModelToJson(MineProfileModel instance) => - { - 'username': instance.username, - 'avatar': instance.avatar, - 'InviteCode': instance.inviteCode, - 'user_lv_name': instance.userLvName, - 'user_lv_icon': instance.userLvIcon, - 'total': instance.total, - 'grid_views': instance.datas, - }; - -MineProfileDataModel _$MineProfileDataModelFromJson(Map json) { - return MineProfileDataModel( - json['name'] as String, - json['value'] as String, - ); -} - -Map _$MineProfileDataModelToJson( - MineProfileDataModel instance) => - { - 'name': instance.name, - 'value': instance.value, - }; diff --git a/lib/widgets/mine/mine_quick_entry/mine_quick_entry.dart b/lib/widgets/mine/mine_quick_entry/mine_quick_entry.dart index 4bb79c5..7ab115c 100644 --- a/lib/widgets/mine/mine_quick_entry/mine_quick_entry.dart +++ b/lib/widgets/mine/mine_quick_entry/mine_quick_entry.dart @@ -84,7 +84,7 @@ class MineQuickEntry extends StatelessWidget { ), ), onTap: () { - // RouterUtil.route(model.items[index].toJson(), context); + RouterUtil.route(model.functionsList[index], model.functionsList[index].toJson(), context); }, ); }, diff --git a/lib/widgets/mine/mine_quick_entry/model/mine_quick_model.dart b/lib/widgets/mine/mine_quick_entry/model/mine_quick_model.dart index c4eb482..0bf89da 100644 --- a/lib/widgets/mine/mine_quick_entry/model/mine_quick_model.dart +++ b/lib/widgets/mine/mine_quick_entry/model/mine_quick_model.dart @@ -1,3 +1,5 @@ +import 'package:zhiying_comm/zhiying_comm.dart'; + class MineQuickModel { String myFunctionsText; String myFunctionsTextColor; @@ -40,7 +42,7 @@ class MineQuickModel { } -class MineQuickItemModel { +class MineQuickItemModel extends SkipModel { String icon; String name; String nameColor; @@ -54,7 +56,7 @@ class MineQuickItemModel { this.nameColor, this.requiredLogin, this.requiredTaobaoAuth, - this.skipIdentifier}); + this.skipIdentifier}): super(requiredLogin: requiredLogin, requiredTaobaoAuth: requiredTaobaoAuth, skipIdentifier: skipIdentifier,); MineQuickItemModel.fromJson(Map json) { icon = json['icon']; diff --git a/lib/widgets/mine/mine_quick_entry/model/mine_quick_model.g.dart b/lib/widgets/mine/mine_quick_entry/model/mine_quick_model.g.dart deleted file mode 100644 index 4c3fa45..0000000 --- a/lib/widgets/mine/mine_quick_entry/model/mine_quick_model.g.dart +++ /dev/null @@ -1,50 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'mine_quick_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -MineQuickModel _$MineQuickModelFromJson(Map json) { - return MineQuickModel( - json['my_functions_text'] as String, - json['my_functions_text_color'] as String, - json['layout'] as String, - json['functions_bg_color'] as String, - (json['functions_list'] as List) - ?.map((e) => e == null - ? null - : MineQuickItemModel.fromJson(e as Map)) - ?.toList(), - ); -} - -Map _$MineQuickModelToJson(MineQuickModel instance) => - { - 'my_functions_text': instance.title, - 'my_functions_text_color': instance.titleColor, - 'layout': instance.layout, - 'functions_bg_color': instance.myFunctionsBgColor, - 'functions_list': instance.items, - }; - -MineQuickItemModel _$MineQuickItemModelFromJson(Map json) { - return MineQuickItemModel( - json['name'] as String, - json['icon'] as String, - json['required_login'] as String, - json['required_taobao_auth'] as String, - json['skip_identifier'] as String, - )..nameColor = json['name_color'] as String; -} - -Map _$MineQuickItemModelToJson(MineQuickItemModel instance) => - { - 'name': instance.name, - 'name_color': instance.nameColor, - 'icon': instance.icon, - 'required_login': instance.requiredLogin, - 'required_taobao_auth': instance.requiredTaobaoAuth, - 'skip_identifier': instance.skipIdentifier, - };