@@ -142,7 +142,7 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> | |||||
// 总体高度 = 行数 * (子元素高度 + 边距高度) + 进度条的高度 | // 总体高度 = 行数 * (子元素高度 + 边距高度) + 进度条的高度 | ||||
double totalHeight = totalRowSize * (itemHeight + barMargin); | double totalHeight = totalRowSize * (itemHeight + barMargin); | ||||
if (totalPage > 1 && !EmptyUtil.isEmpty(model?.pagination) && model.pagination != 'type_null' /*model.pagination_open == '0'*/) { | if (totalPage > 1 && !EmptyUtil.isEmpty(model?.pagination) && model.pagination != 'type_null' /*model.pagination_open == '0'*/) { | ||||
totalHeight = totalRowSize * (itemHeight + barMargin)+8; | totalHeight = totalRowSize * (itemHeight + barMargin) + 8; | ||||
} | } | ||||
// 分类导航高度 | // 分类导航高度 | ||||
@@ -398,7 +398,10 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> | |||||
child: Column( | child: Column( | ||||
children: <Widget>[ | children: <Widget>[ | ||||
/// 图标 | /// 图标 | ||||
MyNetWorkImage(item.img), | MyNetWorkImage( | ||||
item.img, | |||||
width: 40, | |||||
), | |||||
/// 一级标题 | /// 一级标题 | ||||
Visibility( | Visibility( | ||||
@@ -694,11 +697,12 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
} | } | ||||
} | } | ||||
//计算实际显示行数 | //计算实际显示行数 | ||||
print("行数" + totalRowSize.toString()); | print("行数" + totalRowSize.toString()); | ||||
// 图标的高度 | // 图标的高度 | ||||
double iconHeight = 40.0; | double iconHeight = 40; | ||||
// 标题的高度 | // 标题的高度 | ||||
double titleHeight = 20.0; | double titleHeight = 20.0; | ||||
@@ -724,7 +728,7 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
// 总体高度 = 行数 * (子元素高度 + 边距高度) + 进度条的高度 | // 总体高度 = 行数 * (子元素高度 + 边距高度) + 进度条的高度 | ||||
double totalHeight = totalRowSize * (itemHeight + barMargin); | double totalHeight = totalRowSize * (itemHeight + barMargin); | ||||
if (totalPage > 1 && !EmptyUtil.isEmpty(model?.pagination) && model.pagination != 'type_null' /*model.pagination_open == '0'*/) { | if (totalPage > 1 && !EmptyUtil.isEmpty(model?.pagination) && model.pagination != 'type_null' /*model.pagination_open == '0'*/) { | ||||
totalHeight = totalRowSize * (itemHeight + barMargin)+8; | totalHeight = totalRowSize * (itemHeight + barMargin) + 6; | ||||
} | } | ||||
// 分类导航高度 | // 分类导航高度 | ||||
@@ -749,7 +753,7 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
int currentTypeIndex = 0; | int currentTypeIndex = 0; | ||||
for (var item in model.typeList) { | for (var item in model.typeList) { | ||||
if ((item?.listStyle?.length??0) == 0) { | if ((item?.listStyle?.length ?? 0) == 0) { | ||||
pageList.add(PageItem(index: currentTypeIndex, listStyle: List())); | pageList.add(PageItem(index: currentTypeIndex, listStyle: List())); | ||||
currentTypeIndex++; | currentTypeIndex++; | ||||
continue; | continue; | ||||
@@ -761,14 +765,14 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
var startIndex = index * columSize * totalRowSize; | var startIndex = index * columSize * totalRowSize; | ||||
for (var i = 0; i < columSize * totalRowSize; i++) { | for (var i = 0; i < columSize * totalRowSize; i++) { | ||||
if (item.listStyle.length > startIndex + i) { | if (item.listStyle.length > startIndex + i) { | ||||
list.add(item.listStyle[startIndex+i]); | list.add(item.listStyle[startIndex + i]); | ||||
} else { | } else { | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
pageList.add(PageItem(index: currentTypeIndex, listStyle: list)); | pageList.add(PageItem(index: currentTypeIndex, listStyle: list)); | ||||
} | } | ||||
}else{ | } else { | ||||
pageList.add(PageItem(index: currentTypeIndex, listStyle: item?.listStyle)); | pageList.add(PageItem(index: currentTypeIndex, listStyle: item?.listStyle)); | ||||
} | } | ||||
currentTypeIndex++; | currentTypeIndex++; | ||||
@@ -786,20 +790,20 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
bottomRight: Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)), | bottomRight: Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)), | ||||
)), | )), | ||||
child: Container( | child: Container( | ||||
height: totalHeight+(totalRowSize*5), | height: totalHeight + (totalRowSize * 5) + 5+5, | ||||
margin: EdgeInsets.only(bottom: model?.pagination=="type_null"?0:8), | margin: EdgeInsets.only(bottom: model?.pagination == "type_null" ? 0 : 8), | ||||
child: Column( | child: Column( | ||||
crossAxisAlignment: CrossAxisAlignment.start, | crossAxisAlignment: CrossAxisAlignment.start, | ||||
children: <Widget>[ | children: <Widget>[ | ||||
hasCategory | hasCategory | ||||
? Container( | ? Container( | ||||
height: categoryHeight, | height: categoryHeight, | ||||
margin: EdgeInsets.only(top: 10,bottom: 10), | margin: EdgeInsets.only(top: 10, bottom: 15), | ||||
child: TabBar( | child: TabBar( | ||||
isScrollable: true, | isScrollable: true, | ||||
onTap: (value) { | onTap: (value) { | ||||
onTapTimer?.cancel(); | onTapTimer?.cancel(); | ||||
isOnTap=true; | isOnTap = true; | ||||
onTapTimer = Timer(Duration(milliseconds: 300), () { | onTapTimer = Timer(Duration(milliseconds: 300), () { | ||||
isOnTap = false; | isOnTap = false; | ||||
}); | }); | ||||
@@ -816,7 +820,8 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
labelColor: HexColor.fromHex("#FFFFFF"), | labelColor: HexColor.fromHex("#FFFFFF"), | ||||
unselectedLabelColor: HexColor.fromHex("#FF333333"), | unselectedLabelColor: HexColor.fromHex("#FF333333"), | ||||
labelStyle: TextStyle(fontSize: 14), | labelStyle: TextStyle(fontSize: 14), | ||||
tabs: _buildTab(model), | tabs: _buildTab(model,columSize), | ||||
labelPadding: EdgeInsets.only(left: 16,right: 16), | |||||
controller: tabController, | controller: tabController, | ||||
indicatorSize: TabBarIndicatorSize.label, | indicatorSize: TabBarIndicatorSize.label, | ||||
indicatorColor: Colors.transparent, | indicatorColor: Colors.transparent, | ||||
@@ -841,12 +846,12 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
return Container( | return Container( | ||||
height: double.infinity, | height: double.infinity, | ||||
width: double.infinity, | width: double.infinity, | ||||
padding: const EdgeInsets.symmetric(horizontal: 4), | padding: const EdgeInsets.symmetric(horizontal: 0), | ||||
child: _getCategoryPageWidget( | child: _getCategoryPageWidget( | ||||
iconHeight: iconHeight, | iconHeight: iconHeight, | ||||
titleHeight: titleHeight, | titleHeight: titleHeight, | ||||
totalDataSize: totalDataSize, | totalDataSize: totalDataSize, | ||||
totalPage: pageList?.length??0, | totalPage: pageList?.length ?? 0, | ||||
currentPage: index, | currentPage: index, | ||||
totalRowSize: totalRowSize, | totalRowSize: totalRowSize, | ||||
columSize: columSize, | columSize: columSize, | ||||
@@ -863,11 +868,16 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
); | ); | ||||
} | } | ||||
_buildTab(CustomQuickEntryModel model) { | _buildTab(CustomQuickEntryModel model,int columSize) { | ||||
List<Widget> listWidget = List(); | List<Widget> listWidget = List(); | ||||
var maxWidth = (MediaQuery.of(context).size.width-(32*columSize)) / columSize; | |||||
print("测试"+columSize.toString()); | |||||
for (var item in model?.typeList) { | for (var item in model?.typeList) { | ||||
listWidget.add(Tab( | listWidget.add(Tab( | ||||
text: item.name, | child: Container( | ||||
width: maxWidth, | |||||
child: Center(child: Text(item.name??"")), | |||||
), | |||||
)); | )); | ||||
} | } | ||||
return listWidget; | return listWidget; | ||||
@@ -875,15 +885,7 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
/// 获取有分类页 | /// 获取有分类页 | ||||
_getCategoryPageWidget( | _getCategoryPageWidget( | ||||
{double titleHeight, | {double titleHeight, double iconHeight, int totalPage, int currentPage, int columSize, int totalRowSize, int totalDataSize, CustomQuickEntryModel model, double itemHeight}) { | ||||
double iconHeight, | |||||
int totalPage, | |||||
int currentPage, | |||||
int columSize, | |||||
int totalRowSize, | |||||
int totalDataSize, | |||||
CustomQuickEntryModel model, | |||||
double itemHeight}) { | |||||
List rowList = []; | List rowList = []; | ||||
for (int i = 0; i < totalRowSize; i++) { | for (int i = 0; i < totalRowSize; i++) { | ||||
rowList.add(i); | rowList.add(i); | ||||
@@ -894,7 +896,7 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
mainAxisAlignment: MainAxisAlignment.start, | mainAxisAlignment: MainAxisAlignment.start, | ||||
children: rowList.map((currentRow) { | children: rowList.map((currentRow) { | ||||
return Container( | return Container( | ||||
padding: EdgeInsets.only(bottom: 15), | padding: EdgeInsets.only(bottom: 15, top: 0), | ||||
width: double.infinity, | width: double.infinity, | ||||
child: _buildHasCategoryRowWidget( | child: _buildHasCategoryRowWidget( | ||||
titleHeight: titleHeight, | titleHeight: titleHeight, | ||||
@@ -928,8 +930,9 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
for (int i = 0; i < columSize; i++) { | for (int i = 0; i < columSize; i++) { | ||||
itemList.add(i); | itemList.add(i); | ||||
} | } | ||||
return Row( | return Row( | ||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | mainAxisAlignment: MainAxisAlignment.spaceAround, | ||||
crossAxisAlignment: CrossAxisAlignment.center, | crossAxisAlignment: CrossAxisAlignment.center, | ||||
children: itemList.map((currentIndex) { | children: itemList.map((currentIndex) { | ||||
return _getHasCategoryColumWidget( | return _getHasCategoryColumWidget( | ||||
@@ -969,11 +972,12 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
// currentColum + currentRow * columSize; | // currentColum + currentRow * columSize; | ||||
// 当前元素的下表 = 当前的列数 + 当前的行数 * 列数 + 当前的页数 * 当前的行数 + 当前的列数 | // 当前元素的下表 = 当前的列数 + 当前的行数 * 列数 + 当前的页数 * 当前的行数 + 当前的列数 | ||||
int currentIndex = currentColum + currentRow * columSize ; | int currentIndex = currentColum + currentRow * columSize; | ||||
print("当前页"+currentPage.toString()+"当前点"+currentIndex.toString()); | print("当前页" + currentPage.toString() + "当前点" + currentIndex.toString()); | ||||
// print('current Index sss = $currentIndex'); | // print('current Index sss = $currentIndex'); | ||||
if (currentIndex >= totalDataSize) { | if (currentIndex >= totalDataSize) { | ||||
return Container( | return Container( | ||||
height: itemHeight, | height: itemHeight, | ||||
@@ -988,12 +992,12 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
onTap: () => _itemIconClick(item), | onTap: () => _itemIconClick(item), | ||||
child: Container( | child: Container( | ||||
height: itemHeight, | height: itemHeight, | ||||
width: 60, | |||||
// color: Colors.red, | // color: Colors.red, | ||||
child: Column( | child: Column( | ||||
crossAxisAlignment: CrossAxisAlignment.center, | |||||
children: <Widget>[ | children: <Widget>[ | ||||
/// 图标 | /// 图标 | ||||
MyNetWorkImage(item.img), | MyNetWorkImage(item.img,width: 40,), | ||||
/// 一级标题 | /// 一级标题 | ||||
Visibility( | Visibility( | ||||
@@ -1051,7 +1055,8 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||||
return SwiperPagination( | return SwiperPagination( | ||||
margin: const EdgeInsets.only(), | margin: const EdgeInsets.only(), | ||||
builder: DotSwiperPaginationBuilder( | builder: DotSwiperPaginationBuilder( | ||||
color: HexColor.fromHex(model?.paginationUnselectColor), activeColor: HexColor.fromHex(model?.paginationSelectColor), size: 8, activeSize: 8)); | space: 2, | ||||
color: HexColor.fromHex(model?.paginationUnselectColor), activeColor: HexColor.fromHex(model?.paginationSelectColor), size: 6, activeSize: 7)); | |||||
} | } | ||||
// 自定义进度条 条形 | // 自定义进度条 条形 | ||||
@@ -21,7 +21,8 @@ import 'package:zhiying_comm/util/turn_chain/turn_chain_util.dart'; | |||||
class GoodsDetailsFooterWidget extends StatelessWidget { | class GoodsDetailsFooterWidget extends StatelessWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
final bool isFree; | final bool isFree; | ||||
const GoodsDetailsFooterWidget(this.model,{this.isFree=false}); | const GoodsDetailsFooterWidget(this.model, {this.isFree = false}); | ||||
@override | @override | ||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
@@ -44,7 +45,8 @@ class GoodsDetailsFooterWidget extends StatelessWidget { | |||||
class _GoodsDetailsFooterContainer extends StatefulWidget { | class _GoodsDetailsFooterContainer extends StatefulWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
final bool isFree; | final bool isFree; | ||||
const _GoodsDetailsFooterContainer(this.model, {this.isFree,Key key}) : super(key: key); | const _GoodsDetailsFooterContainer(this.model, {this.isFree, Key key}) : super(key: key); | ||||
@override | @override | ||||
_GoodsDetailsFooterContainerState createState() => _GoodsDetailsFooterContainerState(); | _GoodsDetailsFooterContainerState createState() => _GoodsDetailsFooterContainerState(); | ||||
@@ -61,7 +63,9 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
@override | @override | ||||
void didChangeDependencies() { | void didChangeDependencies() { | ||||
_user = Provider.of<UserInfoNotifier>(context).userInfo; | _user = Provider | ||||
.of<UserInfoNotifier>(context) | |||||
.userInfo; | |||||
super.didChangeDependencies(); | super.didChangeDependencies(); | ||||
} | } | ||||
@@ -105,7 +109,7 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
/// 自购省 | /// 自购省 | ||||
void _saveMoneyOnClick(GoodsDetailsFooterModel model) async { | void _saveMoneyOnClick(GoodsDetailsFooterModel model) async { | ||||
await TurnChainUtil.openReceiveCoupon(context, _user, model?.good_id, model?.provider, model?.convertArgs?.toJson(),isFree: widget?.isFree); | await TurnChainUtil.openReceiveCoupon(context, _user, model?.good_id, model?.provider, model?.convertArgs?.toJson(), isFree: widget?.isFree); | ||||
} | } | ||||
@override | @override | ||||
@@ -129,23 +133,26 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
} | } | ||||
Widget _getMainWidget(GoodsDetailsFooterModel model) { | Widget _getMainWidget(GoodsDetailsFooterModel model) { | ||||
double height = MediaQuery.of(context).padding.bottom; | double height = MediaQuery | ||||
.of(context) | |||||
.padding | |||||
.bottom; | |||||
return SafeArea( | return SafeArea( | ||||
child: Container( | child: Container( | ||||
width: double.infinity, | width: double.infinity, | ||||
padding: EdgeInsets.only(bottom: (height > 10 ? 0 : 8), top: 8, left: 21, right: 12.5), | padding: EdgeInsets.only(bottom: (height > 10 ? 0 : 8), top: 8, left: 12.5, right: 12.5), | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
// boxShadow: [ | // boxShadow: [ | ||||
// BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0), blurRadius: 5.0, spreadRadius: 2.0), | // BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0), blurRadius: 5.0, spreadRadius: 2.0), | ||||
// BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0)), | // BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0)), | ||||
// ], | // ], | ||||
color: HexColor.fromHex(model?.bgColor), | color: HexColor.fromHex(model?.bgColor), | ||||
borderRadius: BorderRadius.only( | borderRadius: BorderRadius.only( | ||||
topLeft: Radius.circular(ParseUtil.stringParseDouble(model?.topLeftRadius)), | topLeft: Radius.circular(ParseUtil.stringParseDouble(model?.topLeftRadius)), | ||||
topRight: Radius.circular(ParseUtil.stringParseDouble(model?.topRightRadius)), | topRight: Radius.circular(ParseUtil.stringParseDouble(model?.topRightRadius)), | ||||
bottomLeft: Radius.circular(ParseUtil.stringParseDouble(model?.bottomLeftRadius)), | bottomLeft: Radius.circular(ParseUtil.stringParseDouble(model?.bottomLeftRadius)), | ||||
bottomRight: Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)), | bottomRight: Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)), | ||||
) | ) | ||||
), | ), | ||||
child: Container(height: 44, child: _getMainWidet(model)), | child: Container(height: 44, child: _getMainWidet(model)), | ||||
), | ), | ||||
@@ -158,11 +165,12 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
crossAxisAlignment: CrossAxisAlignment.center, | crossAxisAlignment: CrossAxisAlignment.center, | ||||
children: <Widget>[ | children: <Widget>[ | ||||
/// 首页与收藏 | /// 首页与收藏 | ||||
_getLeftWidget(model), | _getLeftWidget(model), | ||||
/// 分享赚与自购省 | /// 分享赚与自购省 | ||||
_getRightWidget(model), | Expanded(child: _getRightWidget(model)), | ||||
], | ], | ||||
); | ); | ||||
} | } | ||||
@@ -173,32 +181,54 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
crossAxisAlignment: CrossAxisAlignment.center, | crossAxisAlignment: CrossAxisAlignment.center, | ||||
mainAxisAlignment: MainAxisAlignment.start, | mainAxisAlignment: MainAxisAlignment.start, | ||||
children: <Widget>[ | children: <Widget>[ | ||||
GestureDetector( | Visibility( | ||||
behavior: HitTestBehavior.opaque, | visible: (model?.listStyle?.leftIcon1?.isShow ?? "0") == "1" ? true : false, | ||||
onTap: () => _openHome(), | child: GestureDetector( | ||||
child: Padding( | behavior: HitTestBehavior.opaque, | ||||
padding: const EdgeInsets.only(right: 35), | onTap: () => _openHome(), | ||||
child: _getCustomWidget(model?.listStyle?.leftIcon1?.text ?? '首页', model?.listStyle?.leftIcon1?.color ?? '999999', model?.listStyle?.leftIcon1?.beforeIcon ?? ''), | child: Padding( | ||||
)), | padding: const EdgeInsets.only(right: 35,left: 8), | ||||
GestureDetector( | child: _getCustomWidget(model?.listStyle?.leftIcon1?.text ?? '首页', model?.listStyle?.leftIcon1?.color ?? '999999', model?.listStyle?.leftIcon1?.beforeIcon ?? ''), | ||||
behavior: HitTestBehavior.opaque, | )), | ||||
onTap: () => _collectOnClick(model), | ), | ||||
child: Padding( | Visibility( | ||||
padding: const EdgeInsets.only(right: 0), | visible: (model?.listStyle?.leftIcon2?.isShow ?? "0") == "1" ? true : false, | ||||
child: _getCustomWidget(model?.listStyle?.leftIcon2?.text ?? '收藏', model?.listStyle?.leftIcon2?.color ?? '999999', model?.isFav == '0' ? model?.listStyle?.leftIcon2?.beforeIcon ?? '' : model?.listStyle?.leftIcon2?.afterIcon ?? ''))) | child: GestureDetector( | ||||
behavior: HitTestBehavior.opaque, | |||||
onTap: () => _collectOnClick(model), | |||||
child: Padding( | |||||
padding: const EdgeInsets.only(right: 35), | |||||
child: _getCustomWidget(model?.listStyle?.leftIcon2?.text ?? '收藏', model?.listStyle?.leftIcon2?.color ?? '999999', | |||||
model?.isFav == '0' ? model?.listStyle?.leftIcon2?.beforeIcon ?? '' : model?.listStyle?.leftIcon2?.afterIcon ?? ''))), | |||||
) | |||||
], | ], | ||||
); | ); | ||||
} | } | ||||
/// 分享赚与自购省 | /// 分享赚与自购省 | ||||
Widget _getRightWidget(GoodsDetailsFooterModel model) { | Widget _getRightWidget(GoodsDetailsFooterModel model) { | ||||
return Row( | if (model?.listStyle?.rightIcon1.isShow == "0" || model?.listStyle.rightIcon2.isShow == "0") { | ||||
mainAxisAlignment: MainAxisAlignment.end, | return Container( | ||||
crossAxisAlignment: CrossAxisAlignment.center, | child: Row( | ||||
children: <Widget>[ | mainAxisAlignment: MainAxisAlignment.end, | ||||
_getFxzButton(model), | crossAxisAlignment: CrossAxisAlignment.center, | ||||
_getZgsButton(model), | children: <Widget>[ | ||||
], | (model?.listStyle?.rightIcon1?.isShow ?? "0") == "1" ? Expanded(child: _getFxzButton(model)):Container(), | ||||
(model?.listStyle?.rightIcon2?.isShow ?? "0") == "1" ? Expanded(child: _getZgsButton(model)):Container() | |||||
], | |||||
), | |||||
); | |||||
} | |||||
return Container( | |||||
width: 220, | |||||
child: Row( | |||||
mainAxisAlignment: MainAxisAlignment.end, | |||||
crossAxisAlignment: CrossAxisAlignment.center, | |||||
children: <Widget>[ | |||||
Expanded(child: _getFxzButton(model)), | |||||
Expanded(child: _getZgsButton(model)), | |||||
], | |||||
), | |||||
); | ); | ||||
} | } | ||||
@@ -209,13 +239,13 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
child: Container( | child: Container( | ||||
alignment: Alignment.center, | alignment: Alignment.center, | ||||
height: 44, | height: 44, | ||||
width: 110, | width: double.infinity, | ||||
// padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5), | // padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5), | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
// gradient: LinearGradient( | // gradient: LinearGradient( | ||||
// colors: [HexColor.fromHex(/*model?.share_earn_bg1_color ??*/ '#FFCA66'), HexColor.fromHex(/*model?.share_earn_bg2_color ??*/ '#FFD961')], | // colors: [HexColor.fromHex(/*model?.share_earn_bg1_color ??*/ '#FFCA66'), HexColor.fromHex(/*model?.share_earn_bg2_color ??*/ '#FFD961')], | ||||
// begin: Alignment.centerLeft, | // begin: Alignment.centerLeft, | ||||
// end: Alignment.centerRight), | // end: Alignment.centerRight), | ||||
image: DecorationImage(image: CachedNetworkImageProvider(model?.listStyle?.rightIcon1?.bgImage ?? ''), fit: BoxFit.fitWidth), | image: DecorationImage(image: CachedNetworkImageProvider(model?.listStyle?.rightIcon1?.bgImage ?? ''), fit: BoxFit.fitWidth), | ||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(25), topLeft: Radius.circular(25))), | borderRadius: BorderRadius.only(bottomLeft: Radius.circular(25), topLeft: Radius.circular(25))), | ||||
child: Column( | child: Column( | ||||
@@ -227,7 +257,11 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
TextSpan( | TextSpan( | ||||
text: model?.share_value ?? '0.0', | text: model?.share_value ?? '0.0', | ||||
style: TextStyle( | style: TextStyle( | ||||
fontSize: 15, fontWeight: FontWeight.bold, color: HexColor.fromHex(model?.listStyle?.rightIcon1?.color ?? '#FFFFFF'), fontFamily: 'Din', package: 'zhiying_comm')), | fontSize: 15, | ||||
fontWeight: FontWeight.bold, | |||||
color: HexColor.fromHex(model?.listStyle?.rightIcon1?.color ?? '#FFFFFF'), | |||||
fontFamily: 'Din', | |||||
package: 'zhiying_comm')), | |||||
]), | ]), | ||||
), | ), | ||||
Text( | Text( | ||||
@@ -249,12 +283,11 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
alignment: Alignment.center, | alignment: Alignment.center, | ||||
// padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5), | // padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5), | ||||
height: 44, | height: 44, | ||||
width: 110, | |||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
// gradient: LinearGradient( | // gradient: LinearGradient( | ||||
// colors: [HexColor.fromHex(/*model?.save_earn_bg1_color ??*/ '#FF6969'), HexColor.fromHex(/*model?.save_earn_bg2_color ??*/ '#FF4646')], | // colors: [HexColor.fromHex(/*model?.save_earn_bg1_color ??*/ '#FF6969'), HexColor.fromHex(/*model?.save_earn_bg2_color ??*/ '#FF4646')], | ||||
// begin: Alignment.centerLeft, | // begin: Alignment.centerLeft, | ||||
// end: Alignment.centerRight), | // end: Alignment.centerRight), | ||||
image: DecorationImage(image: CachedNetworkImageProvider(model?.listStyle?.rightIcon2?.bgImage ?? ''), fit: BoxFit.fitWidth), | image: DecorationImage(image: CachedNetworkImageProvider(model?.listStyle?.rightIcon2?.bgImage ?? ''), fit: BoxFit.fitWidth), | ||||
borderRadius: BorderRadius.only(bottomRight: Radius.circular(25), topRight: Radius.circular(25))), | borderRadius: BorderRadius.only(bottomRight: Radius.circular(25), topRight: Radius.circular(25))), | ||||
child: Column( | child: Column( | ||||
@@ -286,6 +319,7 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||||
crossAxisAlignment: CrossAxisAlignment.center, | crossAxisAlignment: CrossAxisAlignment.center, | ||||
mainAxisAlignment: MainAxisAlignment.end, | mainAxisAlignment: MainAxisAlignment.end, | ||||
children: <Widget>[ | children: <Widget>[ | ||||
/// 图标 | /// 图标 | ||||
CachedNetworkImage( | CachedNetworkImage( | ||||
imageUrl: icon, | imageUrl: icon, | ||||
@@ -337,6 +337,7 @@ class LeftIcon1 extends SkipModel{ | |||||
String requiredLogin; | String requiredLogin; | ||||
String requiredTaobaoAuth; | String requiredTaobaoAuth; | ||||
String isJump; | String isJump; | ||||
String isShow; | |||||
LeftIcon1({this.text, | LeftIcon1({this.text, | ||||
this.color, | this.color, | ||||
@@ -357,6 +358,7 @@ class LeftIcon1 extends SkipModel{ | |||||
requiredLogin = json['required_login']; | requiredLogin = json['required_login']; | ||||
requiredTaobaoAuth = json['required_taobao_auth']; | requiredTaobaoAuth = json['required_taobao_auth']; | ||||
isJump = json['is_jump']; | isJump = json['is_jump']; | ||||
isShow=json['is_show']; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -380,6 +382,7 @@ class RightIcon1 { | |||||
String bgImage; | String bgImage; | ||||
String functionType; | String functionType; | ||||
List<String> sourceList; | List<String> sourceList; | ||||
String isShow; | |||||
RightIcon1({this.text, | RightIcon1({this.text, | ||||
this.color, | this.color, | ||||
@@ -395,6 +398,7 @@ class RightIcon1 { | |||||
bgImage = json['bg_image']; | bgImage = json['bg_image']; | ||||
functionType = json['function_type']; | functionType = json['function_type']; | ||||
sourceList = json['source_list'].cast<String>(); | sourceList = json['source_list'].cast<String>(); | ||||
isShow=json['is_show']; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -176,48 +176,51 @@ class HomeGoodsItem extends StatelessWidget { | |||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
); | ); | ||||
widgets.add(Container( | widgets.add(Visibility( | ||||
margin: EdgeInsets.only(right: 5), | visible: style?.listStyle?.couponCommission?.coupon?.isShow=="1"?true:false, | ||||
padding: EdgeInsets.only(left: 10, right: 10, top: 3, bottom: 3), | child: Container( | ||||
// decoration: BoxDecoration( | margin: EdgeInsets.only(right: 5), | ||||
// color: HexColor.fromHex(style.couponBgColor), | padding: EdgeInsets.only(left: 10, right: 10, top: 3, bottom: 3), | ||||
// borderRadius: BorderRadius.circular(2.5), | // decoration: BoxDecoration( | ||||
// ), | // color: HexColor.fromHex(style.couponBgColor), | ||||
// child: Text( | // borderRadius: BorderRadius.circular(2.5), | ||||
// goods.coupon, | // ), | ||||
// textAlign: TextAlign.center, | // child: Text( | ||||
// maxLines: 1, | // goods.coupon, | ||||
// style: TextStyle( | // textAlign: TextAlign.center, | ||||
// height: 1, | // maxLines: 1, | ||||
// fontSize: 11, | // style: TextStyle( | ||||
// // color: HexColor.fromHex(style.couponFontColor), | // height: 1, | ||||
// color: HexColor.fromHex(style?.couponCommission?.coupon?.couponFontColor), | // fontSize: 11, | ||||
// ), | // // color: HexColor.fromHex(style.couponFontColor), | ||||
// ), | // color: HexColor.fromHex(style?.couponCommission?.coupon?.couponFontColor), | ||||
decoration: couponDe, | // ), | ||||
child: RichText( | // ), | ||||
maxLines: 1, | decoration: couponDe, | ||||
textAlign: TextAlign.center, | child: RichText( | ||||
text: TextSpan( | maxLines: 1, | ||||
text: '${goods?.coupon ?? '0'}', | textAlign: TextAlign.center, | ||||
style: TextStyle( | text: TextSpan( | ||||
height: 1, | text: '${goods?.coupon ?? '0'}', | ||||
fontSize: 11, | style: TextStyle( | ||||
color: HexColor.fromHex(style | height: 1, | ||||
?.listStyle?.couponCommission?.coupon?.fontColor), | fontSize: 11, | ||||
), | color: HexColor.fromHex(style | ||||
children: [ | ?.listStyle?.couponCommission?.coupon?.fontColor), | ||||
TextSpan( | ), | ||||
text: | children: [ | ||||
'${style?.listStyle?.couponCommission?.coupon?.text ?? '元劵'}', | TextSpan( | ||||
style: TextStyle( | text: | ||||
height: 1, | '${style?.listStyle?.couponCommission?.coupon?.text ?? '元劵'}', | ||||
fontSize: 11, | style: TextStyle( | ||||
color: HexColor.fromHex(style | height: 1, | ||||
?.listStyle?.couponCommission?.coupon?.fontColor), | fontSize: 11, | ||||
), | color: HexColor.fromHex(style | ||||
) | ?.listStyle?.couponCommission?.coupon?.fontColor), | ||||
]), | ), | ||||
) | |||||
]), | |||||
), | |||||
), | ), | ||||
)); | )); | ||||
} | } | ||||
@@ -239,37 +242,40 @@ class HomeGoodsItem extends StatelessWidget { | |||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
); | ); | ||||
widgets.add(Container( | widgets.add(Visibility( | ||||
margin: EdgeInsets.only(right: 5), | visible: style?.listStyle?.couponCommission?.commission.isShow=="1"?true:false, | ||||
padding: EdgeInsets.only(left: 10, right: 10, top: 3, bottom: 3), | child: Container( | ||||
// decoration: BoxDecoration( | margin: EdgeInsets.only(right: 5), | ||||
// color: HexColor.fromHex(style.commissionBgColor), | padding: EdgeInsets.only(left: 10, right: 10, top: 3, bottom: 3), | ||||
// borderRadius: BorderRadius.circular(2.5), | // decoration: BoxDecoration( | ||||
// ), | // color: HexColor.fromHex(style.commissionBgColor), | ||||
decoration: commissionDe, | // borderRadius: BorderRadius.circular(2.5), | ||||
child: RichText( | // ), | ||||
maxLines: 1, | decoration: commissionDe, | ||||
textAlign: TextAlign.center, | child: RichText( | ||||
text: TextSpan( | maxLines: 1, | ||||
text: | textAlign: TextAlign.center, | ||||
'${style?.listStyle?.couponCommission?.commission?.text ?? ''}', | text: TextSpan( | ||||
style: TextStyle( | text: | ||||
height: 1, | '${style?.listStyle?.couponCommission?.commission?.text ?? ''}', | ||||
fontSize: 11, | style: TextStyle( | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission | height: 1, | ||||
?.commission?.fontColor), | fontSize: 11, | ||||
), | color: HexColor.fromHex(style?.listStyle?.couponCommission | ||||
children: [ | ?.commission?.fontColor), | ||||
TextSpan( | ), | ||||
text: '${goods?.commission ?? '0'}', | children: [ | ||||
style: TextStyle( | TextSpan( | ||||
height: 1, | text: '${goods?.commission ?? '0'}', | ||||
fontSize: 11, | style: TextStyle( | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission | height: 1, | ||||
?.commission?.fontColor), | fontSize: 11, | ||||
), | color: HexColor.fromHex(style?.listStyle?.couponCommission | ||||
) | ?.commission?.fontColor), | ||||
]), | ), | ||||
) | |||||
]), | |||||
), | |||||
), | ), | ||||
)); | )); | ||||
} | } | ||||
@@ -192,105 +192,111 @@ class HomeGoodsItemSingle extends StatelessWidget { | |||||
borderRadius: BorderRadius.circular(2.5), | borderRadius: BorderRadius.circular(2.5), | ||||
); | ); | ||||
widgets.add(Container( | widgets.add(Visibility( | ||||
margin: EdgeInsets.only(right: 5), | visible: style?.listStyle?.couponCommission?.coupon.isShow=="1"?true:false, | ||||
padding: EdgeInsets.only(left: 10, right: 10, top: 3, bottom: 3), | child: Container( | ||||
// decoration: BoxDecoration( | |||||
// color: HexColor.fromHex(style.couponBgColor), | |||||
// borderRadius: BorderRadius.circular(2.5), | |||||
// ), | |||||
// child: Text( | |||||
// goods.coupon, | |||||
// textAlign: TextAlign.center, | |||||
// maxLines: 1, | |||||
// style: TextStyle( | |||||
// height: 1, | |||||
// fontSize: 11, | |||||
// // color: HexColor.fromHex(style.couponFontColor), | |||||
// color: HexColor.fromHex(style?.couponCommission?.coupon?.couponFontColor), | |||||
// ), | |||||
// ), | |||||
decoration: couponDe, | |||||
child: RichText( | |||||
maxLines: 1, | |||||
textAlign: TextAlign.center, | |||||
text: TextSpan( | |||||
text: '${goods?.coupon ?? '0'}', | |||||
style: TextStyle( | |||||
height: 1, | |||||
fontSize: 11, | |||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.coupon?.fontColor), | |||||
), | |||||
children: [ | |||||
TextSpan( | |||||
text: '${style?.listStyle?.couponCommission?.coupon?.text ?? '元劵'}', | |||||
style: TextStyle( | |||||
height: 1, | |||||
fontSize: 11, | |||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.coupon?.fontColor), | |||||
), | |||||
) | |||||
]), | |||||
), | |||||
)); | |||||
} | |||||
if (goods.commission != null || goods.commission != '') { | |||||
var commissionDe = style?.listStyle?.couponCommission?.commission?.bgType == 'img' | |||||
? BoxDecoration( | |||||
image: DecorationImage( | |||||
image: CachedNetworkImageProvider(style?.listStyle?.couponCommission?.commission?.bgImg ?? ''), | |||||
), | |||||
borderRadius: BorderRadius.circular(2.5), | |||||
) | |||||
: BoxDecoration( | |||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.commission?.bgColor), | |||||
borderRadius: BorderRadius.circular(2.5), | |||||
); | |||||
widgets.add( | |||||
Container( | |||||
margin: EdgeInsets.only(right: 5), | margin: EdgeInsets.only(right: 5), | ||||
padding: EdgeInsets.only(left: 10, right: 10, top: 3, bottom: 3), | padding: EdgeInsets.only(left: 10, right: 10, top: 3, bottom: 3), | ||||
// decoration: BoxDecoration( | // decoration: BoxDecoration( | ||||
// color: HexColor.fromHex(style.commissionBgColor), | // color: HexColor.fromHex(style.couponBgColor), | ||||
// borderRadius: BorderRadius.circular(2.5), | // borderRadius: BorderRadius.circular(2.5), | ||||
// ), | // ), | ||||
// child: Text( | // child: Text( | ||||
// goods.commission, | // goods.coupon, | ||||
// textAlign: TextAlign.center, | // textAlign: TextAlign.center, | ||||
// maxLines: 1, | // maxLines: 1, | ||||
// style: TextStyle( | // style: TextStyle( | ||||
// height: 1, | // height: 1, | ||||
// fontSize: 11, | // fontSize: 11, | ||||
// // color: HexColor.fromHex(style.commissionFontColor), | // // color: HexColor.fromHex(style.couponFontColor), | ||||
// color: HexColor.fromHex(style?.couponCommission?.commission?.commissionFontColor), | // color: HexColor.fromHex(style?.couponCommission?.coupon?.couponFontColor), | ||||
// ), | // ), | ||||
// ), | // ), | ||||
decoration: commissionDe, | decoration: couponDe, | ||||
child: RichText( | child: RichText( | ||||
maxLines: 1, | maxLines: 1, | ||||
textAlign: TextAlign.center, | textAlign: TextAlign.center, | ||||
text: TextSpan( | text: TextSpan( | ||||
text: '${style?.listStyle?.couponCommission?.commission?.text ?? ''}', | text: '${goods?.coupon ?? '0'}', | ||||
style: TextStyle( | style: TextStyle( | ||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.commission?.fontColor), | color: HexColor.fromHex(style?.listStyle?.couponCommission?.coupon?.fontColor), | ||||
), | ), | ||||
children: [ | children: [ | ||||
TextSpan( | TextSpan( | ||||
text: '${goods?.commission ?? '0'}', | text: '${style?.listStyle?.couponCommission?.coupon?.text ?? '元劵'}', | ||||
style: TextStyle( | style: TextStyle( | ||||
height: 1, | height: 1, | ||||
fontSize: 11, | fontSize: 11, | ||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.commission?.fontColor), | color: HexColor.fromHex(style?.listStyle?.couponCommission?.coupon?.fontColor), | ||||
), | ), | ||||
) | ) | ||||
]), | ]), | ||||
), | ), | ||||
), | ), | ||||
)); | |||||
} | |||||
if (goods.commission != null || goods.commission != '') { | |||||
var commissionDe = style?.listStyle?.couponCommission?.commission?.bgType == 'img' | |||||
? BoxDecoration( | |||||
image: DecorationImage( | |||||
image: CachedNetworkImageProvider(style?.listStyle?.couponCommission?.commission?.bgImg ?? ''), | |||||
), | |||||
borderRadius: BorderRadius.circular(2.5), | |||||
) | |||||
: BoxDecoration( | |||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.commission?.bgColor), | |||||
borderRadius: BorderRadius.circular(2.5), | |||||
); | |||||
widgets.add( | |||||
Visibility( | |||||
visible: style?.listStyle?.couponCommission?.commission.isShow=="1"?true:false, | |||||
child: Container( | |||||
margin: EdgeInsets.only(right: 5), | |||||
padding: EdgeInsets.only(left: 10, right: 10, top: 3, bottom: 3), | |||||
// decoration: BoxDecoration( | |||||
// color: HexColor.fromHex(style.commissionBgColor), | |||||
// borderRadius: BorderRadius.circular(2.5), | |||||
// ), | |||||
// child: Text( | |||||
// goods.commission, | |||||
// textAlign: TextAlign.center, | |||||
// maxLines: 1, | |||||
// style: TextStyle( | |||||
// height: 1, | |||||
// fontSize: 11, | |||||
// // color: HexColor.fromHex(style.commissionFontColor), | |||||
// color: HexColor.fromHex(style?.couponCommission?.commission?.commissionFontColor), | |||||
// ), | |||||
// ), | |||||
decoration: commissionDe, | |||||
child: RichText( | |||||
maxLines: 1, | |||||
textAlign: TextAlign.center, | |||||
text: TextSpan( | |||||
text: '${style?.listStyle?.couponCommission?.commission?.text ?? ''}', | |||||
style: TextStyle( | |||||
height: 1, | |||||
fontSize: 11, | |||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.commission?.fontColor), | |||||
), | |||||
children: [ | |||||
TextSpan( | |||||
text: '${goods?.commission ?? '0'}', | |||||
style: TextStyle( | |||||
height: 1, | |||||
fontSize: 11, | |||||
color: HexColor.fromHex(style?.listStyle?.couponCommission?.commission?.fontColor), | |||||
), | |||||
) | |||||
]), | |||||
), | |||||
), | |||||
), | |||||
); | ); | ||||
} | } | ||||
@@ -136,6 +136,7 @@ class Left { | |||||
String bgType; | String bgType; | ||||
String bgColor; | String bgColor; | ||||
String bgImg; | String bgImg; | ||||
String isShow; | |||||
Left({this.text, this.fontColor, this.bgType, this.bgColor, this.bgImg}); | Left({this.text, this.fontColor, this.bgType, this.bgColor, this.bgImg}); | ||||
@@ -145,6 +146,7 @@ class Left { | |||||
bgType = json['bg_type']; | bgType = json['bg_type']; | ||||
bgColor = json['bg_color']; | bgColor = json['bg_color']; | ||||
bgImg = json['bg_img']; | bgImg = json['bg_img']; | ||||
isShow=json['is_show']; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||