@@ -1,6 +1,6 @@ | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
class CustomShareContentModel extends SkipModel{ | |||||
class CustomShareContentModel extends SkipModel { | |||||
String name; | String name; | ||||
String desc; | String desc; | ||||
String text; | String text; | ||||
@@ -30,37 +30,46 @@ class CustomShareContentModel extends SkipModel{ | |||||
String textColor; | String textColor; | ||||
String skipName; | String skipName; | ||||
String cateTag; | String cateTag; | ||||
String cardBgColor; | |||||
String cardBorderColor; | |||||
String scaleImage; | |||||
String scaleImageUrl; | |||||
CustomShareContentModel( | |||||
{this.name, | |||||
this.desc, | |||||
this.text, | |||||
this.moduleType, | |||||
this.moduleKey, | |||||
this.isTopMargin, | |||||
this.isLeftRightMargin, | |||||
this.isShow, | |||||
this.topMargin, | |||||
this.leftRightMargin, | |||||
this.topLeftRadius, | |||||
this.topRightRadius, | |||||
this.bottomLeftRadius, | |||||
this.bottomRightRadius, | |||||
this.bgColor, | |||||
this.isShowShareFriend, | |||||
this.bgImage, | |||||
this.bgImageUrl, | |||||
this.titleImage, | |||||
this.titleImageUrl, | |||||
this.copyImage, | |||||
this.copyImageUrl, | |||||
this.copyLongImage, | |||||
this.copyLongImageUrl, | |||||
this.shareImage, | |||||
this.shareImageUrl, | |||||
this.textColor, | |||||
this.skipName, | |||||
this.cateTag}); | |||||
CustomShareContentModel({ | |||||
this.name, | |||||
this.desc, | |||||
this.text, | |||||
this.moduleType, | |||||
this.moduleKey, | |||||
this.isTopMargin, | |||||
this.isLeftRightMargin, | |||||
this.isShow, | |||||
this.topMargin, | |||||
this.leftRightMargin, | |||||
this.topLeftRadius, | |||||
this.topRightRadius, | |||||
this.bottomLeftRadius, | |||||
this.bottomRightRadius, | |||||
this.bgColor, | |||||
this.isShowShareFriend, | |||||
this.bgImage, | |||||
this.bgImageUrl, | |||||
this.titleImage, | |||||
this.titleImageUrl, | |||||
this.copyImage, | |||||
this.copyImageUrl, | |||||
this.copyLongImage, | |||||
this.copyLongImageUrl, | |||||
this.shareImage, | |||||
this.shareImageUrl, | |||||
this.textColor, | |||||
this.skipName, | |||||
this.cateTag, | |||||
this.cardBgColor, | |||||
this.cardBorderColor, | |||||
this.scaleImage, | |||||
this.scaleImageUrl, | |||||
}); | |||||
CustomShareContentModel.fromJson(Map<String, dynamic> json) { | CustomShareContentModel.fromJson(Map<String, dynamic> json) { | ||||
super.fromJson(json); | super.fromJson(json); | ||||
@@ -97,6 +106,10 @@ class CustomShareContentModel extends SkipModel{ | |||||
requiredTaobaoAuth = json['required_taobao_auth']; | requiredTaobaoAuth = json['required_taobao_auth']; | ||||
isJump = json['is_jump']; | isJump = json['is_jump']; | ||||
cateTag = json['cate_tag']; | cateTag = json['cate_tag']; | ||||
cardBgColor = json['card_bg_color']; | |||||
cardBorderColor = json['card_border_color']; | |||||
scaleImage = json['scale_image']; | |||||
scaleImageUrl = json['scale_image_url']; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -134,6 +147,10 @@ class CustomShareContentModel extends SkipModel{ | |||||
data['required_taobao_auth'] = this.requiredTaobaoAuth; | data['required_taobao_auth'] = this.requiredTaobaoAuth; | ||||
data['is_jump'] = this.isJump; | data['is_jump'] = this.isJump; | ||||
data['cate_tag'] = this.cateTag; | data['cate_tag'] = this.cateTag; | ||||
data['card_bg_color'] = this.cardBgColor; | |||||
data['card_border_color'] = this.cardBorderColor; | |||||
data['scale_image'] = this.scaleImage; | |||||
data['scale_image_url'] = this.scaleImageUrl; | |||||
return data; | return data; | ||||
} | } | ||||
} | |||||
} |
@@ -91,37 +91,46 @@ class _CustomShareContentContainerWidgetState extends State<_CustomShareContentC | |||||
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)), | ||||
)), | )), | ||||
child: Stack( | |||||
children: [ | |||||
CachedNetworkImage(imageUrl: model?.bgImageUrl ?? '', width: double.infinity), | |||||
Padding( | |||||
padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 12.5, bottom: 14), | |||||
child: Column( | |||||
child: Container( | |||||
width: double.infinity, | |||||
padding: const EdgeInsets.only(left: 12, right: 12, bottom: 14), | |||||
decoration: BoxDecoration( | |||||
color: HexColor.fromHex(model?.cardBgColor), | |||||
border: Border.all(color: HexColor.fromHex(model?.cardBorderColor), width: 1), | |||||
borderRadius: BorderRadius.all(Radius.circular(8)) | |||||
), | |||||
child: Column( | |||||
children: [ | |||||
// 标题 | |||||
Row( | |||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |||||
crossAxisAlignment: CrossAxisAlignment.center, | |||||
children: [ | children: [ | ||||
// 标题 | |||||
CachedNetworkImage(imageUrl: model?.titleImageUrl, width: 90,), | |||||
SizedBox(height: 20), | |||||
// 文案 | |||||
Text(model?.text?? '', style: TextStyle(color: HexColor.fromHex(model?.textColor), fontSize: 15), maxLines: 4, overflow: TextOverflow.ellipsis,), | |||||
SizedBox(height: 22), | |||||
// 复制按钮 or 分享 按钮 | |||||
Visibility( | |||||
visible: (model?.isShowShareFriend ?? '0') == '1', | |||||
// 仅仅复制按钮 | |||||
replacement: GestureDetector( onTap: () => _clickCopyButton(model?.text) ,child: CachedNetworkImage(imageUrl: model?.copyLongImageUrl ?? '', width: double.infinity)), | |||||
child: Row( | |||||
children: [ | |||||
// 复制按钮 | |||||
Flexible(flex: 1, child: GestureDetector(onTap: () => _clickCopyButton(model?.text),child: CachedNetworkImage(imageUrl: model?.copyImageUrl, width: double.infinity,))), | |||||
SizedBox(width: 20), | |||||
// 分享按钮 | |||||
Flexible(flex: 1,child: GestureDetector(onTap: ()=> _clickShareButton(model?.text), child: CachedNetworkImage(imageUrl: model?.shareImageUrl, width: double.infinity,))) | |||||
], | |||||
)) | |||||
CachedNetworkImage(imageUrl: model?.scaleImageUrl, width: 36), | |||||
CachedNetworkImage(imageUrl: model?.titleImageUrl, width: 90), | |||||
SizedBox(width: 36,) | |||||
], | ], | ||||
), | ), | ||||
), | |||||
], | |||||
SizedBox(height: 20), | |||||
// 文案 | |||||
Text(model?.text?? '', style: TextStyle(color: HexColor.fromHex(model?.textColor), fontSize: 15), maxLines: 4, overflow: TextOverflow.ellipsis,), | |||||
SizedBox(height: 22), | |||||
// 复制按钮 or 分享 按钮 | |||||
Visibility( | |||||
visible: (model?.isShowShareFriend ?? '0') == '1', | |||||
// 仅仅复制按钮 | |||||
replacement: GestureDetector( onTap: () => _clickCopyButton(model?.text) ,child: CachedNetworkImage(imageUrl: model?.copyLongImageUrl ?? '', width: double.infinity)), | |||||
child: Row( | |||||
children: [ | |||||
// 复制按钮 | |||||
Flexible(flex: 1, child: GestureDetector(onTap: () => _clickCopyButton(model?.text),child: CachedNetworkImage(imageUrl: model?.copyImageUrl, width: double.infinity,))), | |||||
SizedBox(width: 20), | |||||
// 分享按钮 | |||||
Flexible(flex: 1,child: GestureDetector(onTap: ()=> _clickShareButton(model?.text), child: CachedNetworkImage(imageUrl: model?.shareImageUrl, width: double.infinity,))) | |||||
], | |||||
)) | |||||
], | |||||
), | |||||
) | ) | ||||
); | ); | ||||
} | } | ||||