@@ -1,5 +1,6 @@ | |||||
package cn.zhios.zhiying_base_widget_example; | package cn.zhios.zhiying_base_widget_example; | ||||
import android.content.Intent; | |||||
import android.graphics.Color; | import android.graphics.Color; | ||||
import android.graphics.drawable.ColorDrawable; | import android.graphics.drawable.ColorDrawable; | ||||
import android.os.Build; | import android.os.Build; | ||||
@@ -38,6 +39,13 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN | |||||
} | } | ||||
@Override | |||||
protected void onNewIntent(@NonNull Intent intent) { | |||||
super.onNewIntent(intent); | |||||
setIntent(intent); | |||||
MobLink.updateNewIntent(getIntent(), this); | |||||
} | |||||
@Override | @Override | ||||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||||
GeneratedPluginRegistrant.registerWith(flutterEngine); | GeneratedPluginRegistrant.registerWith(flutterEngine); | ||||
@@ -82,7 +90,7 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN | |||||
Map map = new HashMap(); | Map map = new HashMap(); | ||||
map.put("domain", "http://inapi.izhyin.cn"); //"http://120.76.175.204:8989"); | map.put("domain", "http://inapi.izhyin.cn"); //"http://120.76.175.204:8989"); | ||||
// map.put("domain", "http://192.168.0.113:5000"); | // map.put("domain", "http://192.168.0.113:5000"); | ||||
map.put("master_id", "123456"); | |||||
map.put("master_id", "template_database"); | |||||
map.put("secret_key", "123456"); | map.put("secret_key", "123456"); | ||||
// map.put("token", "123465"); | // map.put("token", "123465"); | ||||
return map; | return map; | ||||
@@ -61,6 +61,9 @@ class _MyAppState extends State<MyApp> { | |||||
ChangeNotifierProvider.value(value: UserInfoNotifier()), | ChangeNotifierProvider.value(value: UserInfoNotifier()), | ||||
], | ], | ||||
child: MaterialApp( | child: MaterialApp( | ||||
routes: <String, WidgetBuilder>{ | |||||
'/homePage': (BuildContext context) => HomePage() , | |||||
}, | |||||
navigatorKey: navigatorKey, | navigatorKey: navigatorKey, | ||||
localizationsDelegates: [ | localizationsDelegates: [ | ||||
RefreshLocalizations.delegate, | RefreshLocalizations.delegate, | ||||
@@ -86,7 +89,7 @@ class _MyAppState extends State<MyApp> { | |||||
} | } | ||||
}, | }, | ||||
child: LaunchPage( | child: LaunchPage( | ||||
builder: (context) => HomePage(), | |||||
// builder: (context) => HomePage(), | |||||
), | ), | ||||
), | ), | ||||
), | ), | ||||
@@ -3,6 +3,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; | |||||
import 'package:provider/provider.dart'; | import 'package:provider/provider.dart'; | ||||
import 'package:flutter_bloc/flutter_bloc.dart'; | import 'package:flutter_bloc/flutter_bloc.dart'; | ||||
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart'; | import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart'; | ||||
import 'package:zhiying_base_widget/widgets/empty/empty_widget.dart'; | |||||
import 'package:zhiying_base_widget/widgets/refresh/refresh_footer/refresh_footer.dart'; | import 'package:zhiying_base_widget/widgets/refresh/refresh_footer/refresh_footer.dart'; | ||||
import 'package:zhiying_base_widget/widgets/refresh/refresh_header/refresh_header.dart'; | import 'package:zhiying_base_widget/widgets/refresh/refresh_header/refresh_header.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
@@ -178,7 +179,9 @@ class __CustomItemPageContainerState extends State<_CustomItemPageContainer> wit | |||||
/// 空数据 | /// 空数据 | ||||
Widget _buildEmptyWidget() { | Widget _buildEmptyWidget() { | ||||
return Container(); | |||||
return Container( | |||||
child: EmptyWidget(), | |||||
); | |||||
} | } | ||||
/// 骨架图 | /// 骨架图 | ||||
@@ -46,11 +46,11 @@ class _LaunchPageState extends State<LaunchPage> { | |||||
if (widget.builder != null) { | if (widget.builder != null) { | ||||
Navigator.of(context) | |||||
.pushReplacement(CupertinoPageRoute(builder: widget.builder)); | |||||
Navigator.of(context).pushReplacement(CupertinoPageRoute(builder: widget.builder)); | |||||
} else { | } else { | ||||
Navigator.of(context).pushReplacement( | |||||
CupertinoPageRoute(builder: (context) => HomePage())); | |||||
// Navigator.of(context).pushReplacement( | |||||
// CupertinoPageRoute(builder: (context) => HomePage())); | |||||
Navigator.of(context).pushReplacementNamed('/homePage'); | |||||
} | } | ||||
}).catchError((err) { | }).catchError((err) { | ||||
Logger.error(err); | Logger.error(err); | ||||
@@ -141,7 +141,7 @@ class BaseWidgetRegister { | |||||
// 注册页面 | // 注册页面 | ||||
static void registPage() { | static void registPage() { | ||||
PageFactory.regist('LaunchPage', (model) => LaunchPage()); | PageFactory.regist('LaunchPage', (model) => LaunchPage()); | ||||
PageFactory.regist('homePage', (model) => HomePage()); | |||||
// PageFactory.regist('homePage', (model) => HomePage()); | |||||
PageFactory.regist('pub.flutter.index', (model) => MainPage(model)); | PageFactory.regist('pub.flutter.index', (model) => MainPage(model)); | ||||
PageFactory.regist('pub.flutter.profile', (model) => MainPage(model)); | PageFactory.regist('pub.flutter.profile', (model) => MainPage(model)); | ||||
PageFactory.regist( | PageFactory.regist( | ||||
@@ -30,7 +30,7 @@ class GoodsDetailsFooterWidget extends StatelessWidget { | |||||
child: BlocProvider<GoodsDetailsFooterBloc>( | child: BlocProvider<GoodsDetailsFooterBloc>( | ||||
create: (_) => GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository()), | create: (_) => GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository()), | ||||
//..add(GoodsDetailsFooterInitEvent(model: model)), | //..add(GoodsDetailsFooterInitEvent(model: model)), | ||||
child: GooddsDetailsFooterContainer( | |||||
child: _GoodsDetailsFooterContainer( | |||||
model, | model, | ||||
key: UniqueKey(), | key: UniqueKey(), | ||||
), | ), | ||||
@@ -39,16 +39,16 @@ class GoodsDetailsFooterWidget extends StatelessWidget { | |||||
} | } | ||||
} | } | ||||
class GooddsDetailsFooterContainer extends StatefulWidget { | |||||
class _GoodsDetailsFooterContainer extends StatefulWidget { | |||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
const GooddsDetailsFooterContainer(this.model, {Key key}) : super(key: key); | |||||
const _GoodsDetailsFooterContainer(this.model, {Key key}) : super(key: key); | |||||
@override | @override | ||||
_GooddsDetailsFooterContainerState createState() => _GooddsDetailsFooterContainerState(); | |||||
_GoodsDetailsFooterContainerState createState() => _GoodsDetailsFooterContainerState(); | |||||
} | } | ||||
class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContainer> { | |||||
class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContainer> { | |||||
UserInfoModel _user; | UserInfoModel _user; | ||||
@override | @override | ||||
@@ -65,11 +65,19 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai | |||||
/// 打开首页 | /// 打开首页 | ||||
void _openHome() { | void _openHome() { | ||||
Navigator.pushAndRemoveUntil( | |||||
context, | |||||
CupertinoPageRoute(builder: (BuildContext context) => PageFactory.create('homePage', null)), | |||||
(Route<dynamic> route) => false, | |||||
); | |||||
// Navigator.pushAndRemoveUntil( | |||||
// context, | |||||
// CupertinoPageRoute(builder: (BuildContext context) => PageFactory.create('homePage', null)), | |||||
// (Route<dynamic> route) => false, | |||||
// ); | |||||
// Navigator.popUntil( | |||||
// context, | |||||
// CupertinoPageRoute(builder: (BuildContext context) => PageFactory.create('homePage', null)), | |||||
// (Route<dynamic> route) => false, | |||||
// ); | |||||
RouterUtil.goBackHomePage(context); | |||||
} | } | ||||
/// 收藏 | /// 收藏 | ||||
@@ -11,7 +11,7 @@ import 'package:zhiying_comm/util/base_bloc.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
class GoodsDetailCommendCreater extends WidgetCreater { | class GoodsDetailCommendCreater extends WidgetCreater { | ||||
final EventBus _eventBus = EventBus(); | |||||
// final EventBus _eventBus = EventBus(); | |||||
@override | @override | ||||
List<Widget> createWidgets(Map<String, dynamic> model) { | List<Widget> createWidgets(Map<String, dynamic> model) { | ||||
@@ -25,13 +25,37 @@ class GoodsDetailCommendCreater extends WidgetCreater { | |||||
// child: HomeGoodsHeader(model, _eventBus), | // child: HomeGoodsHeader(model, _eventBus), | ||||
// ); | // ); | ||||
String provider = 'taobao'; | |||||
Map<String, dynamic> json = convert.jsonDecode(model['data']); | |||||
bool haveProvider = false; | |||||
try{ | |||||
haveProvider = json.containsKey('provider') && !EmptyUtil.isEmpty(json['provider']); | |||||
if(haveProvider){ | |||||
provider = json['provider']; | |||||
} | |||||
}catch(e, s){ | |||||
provider = 'taobao'; | |||||
Logger.error(e,s); | |||||
} | |||||
try { | |||||
if(!haveProvider) { | |||||
var listStyle = json['list_style']; | |||||
provider = listStyle['product_type']?.toString() ?? 'taobao'; | |||||
} | |||||
} catch (e, s) { | |||||
provider = 'taobao'; | |||||
Logger.error(e, s); | |||||
} | |||||
Logger.warn(model?.toString()); | |||||
return [ | return [ | ||||
SliverToBoxAdapter( | SliverToBoxAdapter( | ||||
child: GoodsDetailsRecommendWidget(model), | child: GoodsDetailsRecommendWidget(model), | ||||
), | ), | ||||
GoodsDetailCommendList( | GoodsDetailCommendList( | ||||
model, | model, | ||||
provider: 'taobao', // 猜你喜欢数据源暂无数据 | |||||
provider: provider, // 猜你喜欢数据源暂无数据 | |||||
), | ), | ||||
]; | ]; | ||||
} | } | ||||
@@ -3,7 +3,7 @@ import 'dart:convert' as convert; | |||||
import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:provider/provider.dart'; | import 'package:provider/provider.dart'; | ||||
import 'package:zhiying_base_widget/pages/goods_details_page/notifier/goods_details_page_notifier.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart'; | import 'package:zhiying_base_widget/pages/main_page/notifier/main_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/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.dart'; | ||||
@@ -86,7 +86,7 @@ class _GoodsDetailCommendListContainerState extends State<_GoodsDetailCommendLis | |||||
} | } | ||||
List<HomeGoodsModel> goods = snapshot.data; | List<HomeGoodsModel> goods = snapshot.data; | ||||
int column = 2; | |||||
int column = int.parse(_style?.listStyle?.listColumn ?? '2') ; | |||||
int count = ((goods?.length ?? 0) / column).ceil(); | int count = ((goods?.length ?? 0) / column).ceil(); | ||||
return SliverList( | return SliverList( | ||||
delegate: SliverChildBuilderDelegate( | delegate: SliverChildBuilderDelegate( | ||||
@@ -161,18 +161,18 @@ class HomeGoodsItem extends StatelessWidget { | |||||
Widget _createCupone() { | Widget _createCupone() { | ||||
List<Widget> widgets = List(); | List<Widget> widgets = List(); | ||||
if (goods.coupon != null && goods.coupon != '') { | if (goods.coupon != null && goods.coupon != '') { | ||||
var couponDe = style?.listStyle?.couponCommission?.coupon?.isImg == '1' | |||||
var couponDe = style?.listStyle?.couponCommission?.coupon?.bgType == 'img' | |||||
? BoxDecoration( | ? BoxDecoration( | ||||
image: DecorationImage( | image: DecorationImage( | ||||
image: CachedNetworkImageProvider( | image: CachedNetworkImageProvider( | ||||
style?.listStyle?.couponCommission?.coupon?.couponBgImg ?? | |||||
style?.listStyle?.couponCommission?.coupon?.bgImg ?? | |||||
''), | ''), | ||||
), | ), | ||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
) | ) | ||||
: BoxDecoration( | : BoxDecoration( | ||||
color: HexColor.fromHex( | color: HexColor.fromHex( | ||||
style?.listStyle?.couponCommission?.coupon?.couponBgColor), | |||||
style?.listStyle?.couponCommission?.coupon?.bgColor), | |||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
); | ); | ||||
@@ -204,17 +204,17 @@ class HomeGoodsItem extends StatelessWidget { | |||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style | color: HexColor.fromHex(style | ||||
?.listStyle?.couponCommission?.coupon?.couponFontColor), | |||||
?.listStyle?.couponCommission?.coupon?.fontColor), | |||||
), | ), | ||||
children: [ | children: [ | ||||
TextSpan( | TextSpan( | ||||
text: | text: | ||||
'${style?.listStyle?.couponCommission?.coupon?.couonText ?? '元劵'}', | |||||
'${style?.listStyle?.couponCommission?.coupon?.text ?? '元劵'}', | |||||
style: TextStyle( | style: TextStyle( | ||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style | color: HexColor.fromHex(style | ||||
?.listStyle?.couponCommission?.coupon?.couponFontColor), | |||||
?.listStyle?.couponCommission?.coupon?.fontColor), | |||||
), | ), | ||||
) | ) | ||||
]), | ]), | ||||
@@ -224,18 +224,18 @@ class HomeGoodsItem extends StatelessWidget { | |||||
if (goods.commission != null || goods.commission != '') { | if (goods.commission != null || goods.commission != '') { | ||||
var commissionDe = | var commissionDe = | ||||
style?.listStyle?.couponCommission?.commission?.isImg == '1' | |||||
style?.listStyle?.couponCommission?.commission?.bgType == 'img' | |||||
? BoxDecoration( | ? BoxDecoration( | ||||
image: DecorationImage( | image: DecorationImage( | ||||
image: CachedNetworkImageProvider(style?.listStyle | image: CachedNetworkImageProvider(style?.listStyle | ||||
?.couponCommission?.commission?.commissionBgImg ?? | |||||
?.couponCommission?.commission?.bgImg ?? | |||||
''), | ''), | ||||
), | ), | ||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
) | ) | ||||
: BoxDecoration( | : BoxDecoration( | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission | color: HexColor.fromHex(style?.listStyle?.couponCommission | ||||
?.commission?.commissionBgColor), | |||||
?.commission?.bgColor), | |||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
); | ); | ||||
@@ -252,12 +252,12 @@ class HomeGoodsItem extends StatelessWidget { | |||||
textAlign: TextAlign.center, | textAlign: TextAlign.center, | ||||
text: TextSpan( | text: TextSpan( | ||||
text: | text: | ||||
'${style?.listStyle?.couponCommission?.commission?.commissionText ?? ''}', | |||||
'${style?.listStyle?.couponCommission?.commission?.text ?? ''}', | |||||
style: TextStyle( | style: TextStyle( | ||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission | color: HexColor.fromHex(style?.listStyle?.couponCommission | ||||
?.commission?.commissionFontColor), | |||||
?.commission?.fontColor), | |||||
), | ), | ||||
children: [ | children: [ | ||||
TextSpan( | TextSpan( | ||||
@@ -266,7 +266,7 @@ class HomeGoodsItem extends StatelessWidget { | |||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission | color: HexColor.fromHex(style?.listStyle?.couponCommission | ||||
?.commission?.commissionFontColor), | |||||
?.commission?.fontColor), | |||||
), | ), | ||||
) | ) | ||||
]), | ]), | ||||
@@ -167,18 +167,18 @@ class HomeGoodsItemSingle extends StatelessWidget { | |||||
Widget _createCupone() { | Widget _createCupone() { | ||||
List<Widget> widgets = List(); | List<Widget> widgets = List(); | ||||
if (goods.coupon != null && goods.coupon != '') { | if (goods.coupon != null && goods.coupon != '') { | ||||
var couponDe = style?.listStyle?.couponCommission?.coupon?.isImg == '1' | |||||
var couponDe = style?.listStyle?.couponCommission?.coupon?.bgImg == 'img' | |||||
? BoxDecoration( | ? BoxDecoration( | ||||
image: DecorationImage( | image: DecorationImage( | ||||
image: CachedNetworkImageProvider( | image: CachedNetworkImageProvider( | ||||
style?.listStyle?.couponCommission?.coupon?.couponBgImg ?? | |||||
style?.listStyle?.couponCommission?.coupon?.bgImg ?? | |||||
''), | ''), | ||||
), | ), | ||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
) | ) | ||||
: BoxDecoration( | : BoxDecoration( | ||||
color: HexColor.fromHex( | color: HexColor.fromHex( | ||||
style?.listStyle?.couponCommission?.coupon?.couponBgColor), | |||||
style?.listStyle?.couponCommission?.coupon?.bgColor), | |||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
); | ); | ||||
@@ -211,17 +211,17 @@ class HomeGoodsItemSingle extends StatelessWidget { | |||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style | color: HexColor.fromHex(style | ||||
?.listStyle?.couponCommission?.coupon?.couponFontColor), | |||||
?.listStyle?.couponCommission?.coupon?.fontColor), | |||||
), | ), | ||||
children: [ | children: [ | ||||
TextSpan( | TextSpan( | ||||
text: | text: | ||||
'${style?.listStyle?.couponCommission?.coupon?.couonText ?? '元劵'}', | |||||
'${style?.listStyle?.couponCommission?.coupon?.text ?? '元劵'}', | |||||
style: TextStyle( | style: TextStyle( | ||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style | color: HexColor.fromHex(style | ||||
?.listStyle?.couponCommission?.coupon?.couponFontColor), | |||||
?.listStyle?.couponCommission?.coupon?.fontColor), | |||||
), | ), | ||||
) | ) | ||||
]), | ]), | ||||
@@ -231,18 +231,18 @@ class HomeGoodsItemSingle extends StatelessWidget { | |||||
if (goods.commission != null || goods.commission != '') { | if (goods.commission != null || goods.commission != '') { | ||||
var commissionDe = | var commissionDe = | ||||
style?.listStyle?.couponCommission?.commission?.isImg == '1' | |||||
style?.listStyle?.couponCommission?.commission?.bgType == 'img' | |||||
? BoxDecoration( | ? BoxDecoration( | ||||
image: DecorationImage( | image: DecorationImage( | ||||
image: CachedNetworkImageProvider(style?.listStyle | image: CachedNetworkImageProvider(style?.listStyle | ||||
?.couponCommission?.commission?.commissionBgImg ?? | |||||
?.couponCommission?.commission?.bgImg ?? | |||||
''), | ''), | ||||
), | ), | ||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
) | ) | ||||
: BoxDecoration( | : BoxDecoration( | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission | color: HexColor.fromHex(style?.listStyle?.couponCommission | ||||
?.commission?.commissionBgColor), | |||||
?.commission?.bgColor), | |||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
); | ); | ||||
@@ -271,12 +271,11 @@ class HomeGoodsItemSingle extends StatelessWidget { | |||||
textAlign: TextAlign.center, | textAlign: TextAlign.center, | ||||
text: TextSpan( | text: TextSpan( | ||||
text: | text: | ||||
'${style?.listStyle?.couponCommission?.commission?.commissionText ?? ''}', | |||||
'${style?.listStyle?.couponCommission?.commission?.text ?? ''}', | |||||
style: TextStyle( | style: TextStyle( | ||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission | |||||
?.commission?.commissionFontColor), | |||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.commission?.fontColor), | |||||
), | ), | ||||
children: [ | children: [ | ||||
TextSpan( | TextSpan( | ||||
@@ -284,8 +283,7 @@ class HomeGoodsItemSingle extends StatelessWidget { | |||||
style: TextStyle( | style: TextStyle( | ||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission | |||||
?.commission?.commissionFontColor), | |||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.commission?.fontColor), | |||||
), | ), | ||||
) | ) | ||||
]), | ]), | ||||
@@ -12,6 +12,7 @@ class HomeGoodsListStyleModel { | |||||
String shopIcon; | String shopIcon; | ||||
HomeGoodsStyleModelCouponCommission couponCommission; | HomeGoodsStyleModelCouponCommission couponCommission; | ||||
HomeGoodsStyleModelHotRank hotRank; | HomeGoodsStyleModelHotRank hotRank; | ||||
String listColumn; | |||||
HomeGoodsListStyleModel( | HomeGoodsListStyleModel( | ||||
{this.hotRankIconList, | {this.hotRankIconList, | ||||
@@ -26,11 +27,14 @@ class HomeGoodsListStyleModel { | |||||
this.saleCountText, | this.saleCountText, | ||||
this.shopIcon, | this.shopIcon, | ||||
this.couponCommission, | this.couponCommission, | ||||
this.hotRank}); | |||||
this.hotRank, | |||||
this.listColumn, | |||||
}); | |||||
HomeGoodsListStyleModel.fromJson(Map<String, dynamic> json) { | HomeGoodsListStyleModel.fromJson(Map<String, dynamic> json) { | ||||
hotRankIconList = json['hot_rank_icon_list'].cast<String>(); | hotRankIconList = json['hot_rank_icon_list'].cast<String>(); | ||||
topMargin = json['top_margin']; | topMargin = json['top_margin']; | ||||
listColumn = json['list_column']; | |||||
leftRighMargin = json['left_righ_margin']; | leftRighMargin = json['left_righ_margin']; | ||||
if (json['providers'] != null) { | if (json['providers'] != null) { | ||||
providers = new List<HomeGoodsStyleModelProviders>(); | providers = new List<HomeGoodsStyleModelProviders>(); | ||||
@@ -57,6 +61,7 @@ class HomeGoodsListStyleModel { | |||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | final Map<String, dynamic> data = new Map<String, dynamic>(); | ||||
data['hot_rank_icon_list'] = this.hotRankIconList; | data['hot_rank_icon_list'] = this.hotRankIconList; | ||||
data['list_column'] = this.listColumn; | |||||
data['top_margin'] = this.topMargin; | data['top_margin'] = this.topMargin; | ||||
data['left_righ_margin'] = this.leftRighMargin; | data['left_righ_margin'] = this.leftRighMargin; | ||||
if (this.providers != null) { | if (this.providers != null) { | ||||
@@ -103,18 +108,14 @@ class HomeGoodsStyleModelProviders { | |||||
} | } | ||||
class HomeGoodsStyleModelCouponCommission { | class HomeGoodsStyleModelCouponCommission { | ||||
HomeGoodsStyleModelCoupon coupon; | |||||
HomeGoodsStyleModelCommission commission; | |||||
Left coupon; | |||||
Left commission; | |||||
HomeGoodsStyleModelCouponCommission({this.coupon, this.commission}); | HomeGoodsStyleModelCouponCommission({this.coupon, this.commission}); | ||||
HomeGoodsStyleModelCouponCommission.fromJson(Map<String, dynamic> json) { | HomeGoodsStyleModelCouponCommission.fromJson(Map<String, dynamic> json) { | ||||
coupon = json['left'] != null | |||||
? new HomeGoodsStyleModelCoupon.fromJson(json['left']) | |||||
: null; | |||||
commission = json['right'] != null | |||||
? new HomeGoodsStyleModelCommission.fromJson(json['right']) | |||||
: null; | |||||
coupon = json['left'] != null ? new Left.fromJson(json['left']) : null; | |||||
commission = json['right'] != null ? new Left.fromJson(json['right']) : null; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -129,72 +130,127 @@ class HomeGoodsStyleModelCouponCommission { | |||||
} | } | ||||
} | } | ||||
class HomeGoodsStyleModelCoupon { | |||||
String couonText; | |||||
String couponFontColor; | |||||
String couponBgColor; | |||||
String couponBgImg; | |||||
String isImg; | |||||
HomeGoodsStyleModelCoupon( | |||||
{this.couonText, | |||||
this.couponFontColor, | |||||
this.couponBgColor, | |||||
this.couponBgImg, | |||||
this.isImg}); | |||||
HomeGoodsStyleModelCoupon.fromJson(Map<String, dynamic> json) { | |||||
couonText = json['couon_text']?.toString(); | |||||
couponFontColor = json['coupon_font_color']?.toString(); | |||||
couponBgColor = json['coupon_bg_color']?.toString(); | |||||
couponBgImg = json['coupon_bg_img']?.toString(); | |||||
isImg = json['is_img']?.toString(); | |||||
} | |||||
class Left { | |||||
String text; | |||||
String fontColor; | |||||
String bgType; | |||||
String bgColor; | |||||
String bgImg; | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['couon_text'] = this.couonText; | |||||
data['coupon_font_color'] = this.couponFontColor; | |||||
data['coupon_bg_color'] = this.couponBgColor; | |||||
data['coupon_bg_img'] = this.couponBgImg; | |||||
data['is_img'] = this.isImg; | |||||
return data; | |||||
} | |||||
} | |||||
Left({this.text, this.fontColor, this.bgType, this.bgColor, this.bgImg}); | |||||
class HomeGoodsStyleModelCommission { | |||||
String commissionText; | |||||
String commissionFontColor; | |||||
String commissionBgColor; | |||||
String commissionBgImg; | |||||
String isImg; | |||||
HomeGoodsStyleModelCommission( | |||||
{this.commissionText, | |||||
this.commissionFontColor, | |||||
this.commissionBgColor, | |||||
this.commissionBgImg, | |||||
this.isImg}); | |||||
HomeGoodsStyleModelCommission.fromJson(Map<String, dynamic> json) { | |||||
commissionText = json['commission_text']?.toString(); | |||||
commissionFontColor = json['commission_font_color']?.toString(); | |||||
commissionBgColor = json['commission_bg_color']?.toString(); | |||||
commissionBgImg = json['commission_bg_img']?.toString(); | |||||
isImg = json['is_img']?.toString(); | |||||
Left.fromJson(Map<String, dynamic> json) { | |||||
text = json['text']; | |||||
fontColor = json['font_color']; | |||||
bgType = json['bg_type']; | |||||
bgColor = json['bg_color']; | |||||
bgImg = json['bg_img']; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | final Map<String, dynamic> data = new Map<String, dynamic>(); | ||||
data['commission_text'] = this.commissionText; | |||||
data['commission_font_color'] = this.commissionFontColor; | |||||
data['commission_bg_color'] = this.commissionBgColor; | |||||
data['commission_bg_img'] = this.commissionBgImg; | |||||
data['is_img'] = this.isImg; | |||||
data['text'] = this.text; | |||||
data['font_color'] = this.fontColor; | |||||
data['bg_type'] = this.bgType; | |||||
data['bg_color'] = this.bgColor; | |||||
data['bg_img'] = this.bgImg; | |||||
return data; | return data; | ||||
} | } | ||||
} | } | ||||
// class HomeGoodsStyleModelCouponCommission { | |||||
// HomeGoodsStyleModelCoupon coupon; | |||||
// HomeGoodsStyleModelCommission commission; | |||||
// | |||||
// HomeGoodsStyleModelCouponCommission({this.coupon, this.commission}); | |||||
// | |||||
// HomeGoodsStyleModelCouponCommission.fromJson(Map<String, dynamic> json) { | |||||
// coupon = json['left'] != null | |||||
// ? new HomeGoodsStyleModelCoupon.fromJson(json['left']) | |||||
// : null; | |||||
// commission = json['right'] != null | |||||
// ? new HomeGoodsStyleModelCommission.fromJson(json['right']) | |||||
// : null; | |||||
// } | |||||
// | |||||
// Map<String, dynamic> toJson() { | |||||
// final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
// if (this.coupon != null) { | |||||
// data['left'] = this.coupon.toJson(); | |||||
// } | |||||
// if (this.commission != null) { | |||||
// data['right'] = this.commission.toJson(); | |||||
// } | |||||
// return data; | |||||
// } | |||||
// } | |||||
// class HomeGoodsStyleModelCoupon { | |||||
// String couonText; | |||||
// String couponFontColor; | |||||
// String couponBgColor; | |||||
// String couponBgImg; | |||||
// String isImg; | |||||
// | |||||
// HomeGoodsStyleModelCoupon( | |||||
// {this.couonText, | |||||
// this.couponFontColor, | |||||
// this.couponBgColor, | |||||
// this.couponBgImg, | |||||
// this.isImg}); | |||||
// | |||||
// HomeGoodsStyleModelCoupon.fromJson(Map<String, dynamic> json) { | |||||
// couonText = json['couon_text']?.toString(); | |||||
// couponFontColor = json['coupon_font_color']?.toString(); | |||||
// couponBgColor = json['coupon_bg_color']?.toString(); | |||||
// couponBgImg = json['coupon_bg_img']?.toString(); | |||||
// isImg = json['is_img']?.toString(); | |||||
// } | |||||
// | |||||
// Map<String, dynamic> toJson() { | |||||
// final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
// data['couon_text'] = this.couonText; | |||||
// data['coupon_font_color'] = this.couponFontColor; | |||||
// data['coupon_bg_color'] = this.couponBgColor; | |||||
// data['coupon_bg_img'] = this.couponBgImg; | |||||
// data['is_img'] = this.isImg; | |||||
// return data; | |||||
// } | |||||
// } | |||||
// class HomeGoodsStyleModelCommission { | |||||
// String commissionText; | |||||
// String commissionFontColor; | |||||
// String commissionBgColor; | |||||
// String commissionBgImg; | |||||
// String isImg; | |||||
// | |||||
// HomeGoodsStyleModelCommission( | |||||
// {this.commissionText, | |||||
// this.commissionFontColor, | |||||
// this.commissionBgColor, | |||||
// this.commissionBgImg, | |||||
// this.isImg}); | |||||
// | |||||
// HomeGoodsStyleModelCommission.fromJson(Map<String, dynamic> json) { | |||||
// commissionText = json['commission_text']?.toString(); | |||||
// commissionFontColor = json['commission_font_color']?.toString(); | |||||
// commissionBgColor = json['commission_bg_color']?.toString(); | |||||
// commissionBgImg = json['commission_bg_img']?.toString(); | |||||
// isImg = json['is_img']?.toString(); | |||||
// } | |||||
// | |||||
// Map<String, dynamic> toJson() { | |||||
// final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
// data['commission_text'] = this.commissionText; | |||||
// data['commission_font_color'] = this.commissionFontColor; | |||||
// data['commission_bg_color'] = this.commissionBgColor; | |||||
// data['commission_bg_img'] = this.commissionBgImg; | |||||
// data['is_img'] = this.isImg; | |||||
// return data; | |||||
// } | |||||
// } | |||||
class HomeGoodsStyleModelHotRank { | class HomeGoodsStyleModelHotRank { | ||||
String isOpen; | String isOpen; | ||||
String bgColor; | String bgColor; | ||||