观看视频界面商品卡片UI变更

master
laiiihz 5 years ago
parent 60670cb250
commit f04e9d50a1

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

@ -1,3 +1,4 @@
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart';
import 'package:recook/constants/api.dart';
@ -54,7 +55,6 @@ class _ActivityPreviewPageState extends State<ActivityPreviewPage> {
horizontal: rSize(15),
),
alignment: Alignment.bottomCenter,
height: rSize(150),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
@ -66,171 +66,170 @@ class _ActivityPreviewPageState extends State<ActivityPreviewPage> {
end: Alignment.bottomCenter,
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
InkWell(
onTap: () {
CRoute.push(
context,
TopicPage(
topicId: widget.model.topicId,
initAttention: false));
AppRouter.push(context, RouteName.COMMODITY_PAGE,
arguments: CommodityDetailPage.setArguments(
widget.model.goods.id));
},
child: Text(
'#${widget.model.topicName}',
style: TextStyle(
color: Color(0xFFEB8A49),
fontSize: rSP(14),
),
),
),
rHBox(4),
Text(
widget.model.content,
style: TextStyle(
color: Color(0xFFE4E4E4),
fontSize: rSP(14),
),
),
rHBox(6),
Row(
children: [
MaterialButton(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(rSize(4)),
),
padding: EdgeInsets.all(rSize(4)),
minWidth: rSize(165),
onPressed: () {
AppRouter.push(context, RouteName.COMMODITY_PAGE,
arguments: CommodityDetailPage.setArguments(
widget.model.goods.id));
},
child: SizedBox(
width: rSize(165),
child: Row(
children: [
FadeInImage.assetNetwork(
child: Container(
width: rSize(110),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
rHBox(11),
ClipRRect(
borderRadius: BorderRadius.circular(rSize(4)),
child: Material(
color: AppColor.frenchColor,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG,
image: Api.getImgUrl(
widget.model.goods.mainPhotoURL,
),
width: rSize(47),
height: rSize(47),
width: rSize(100),
height: rSize(100),
),
),
),
rHBox(3),
Row(
children: [
rWBox(5),
Text(
'¥',
style: TextStyle(
fontSize: rSP(10),
color: Color(0xFFC92219),
),
),
Expanded(
child: Column(
children: [
Text(
widget.model.goods.name,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: rSP(12),
color: Color(0xFF333333),
),
),
Row(
children: [
Text(
'¥',
style: TextStyle(
fontSize: rSP(10),
color: Color(0xFFC92219),
),
),
Text(
widget.model.goods.price,
style: TextStyle(
fontSize: rSP(12),
color: Color(0xFFC92219),
),
),
Spacer(),
Image.asset(
R.ASSETS_LIVE_SMALL_RED_CART_PNG,
height: rSize(12),
width: rSize(12),
),
],
),
],
Text(
widget.model.goods.price,
style: TextStyle(
fontSize: rSP(14),
color: Color(0xFFC92219),
),
),
],
),
),
rHBox(3),
],
),
Spacer(),
// CustomImageButton(
// onPressed: () {},
// child: Image.asset(
// R.ASSETS_LIVE_VIDEO_SHARE_PNG,
// height: rSize(20),
// width: rSize(20),
// ),
// ),
// rWBox(22),
CustomImageButton(
onPressed: () {
if (UserManager.instance.haveLogin)
showGeneralDialog(
context: context,
barrierDismissible: true,
barrierColor: Colors.black.withOpacity(0.55),
barrierLabel: '',
transitionBuilder: (context, animation,
secondaryAnimation, child) {
final value = Curves.easeInOutCubic
.transform(animation.value);
return Transform.translate(
offset: Offset(0, (1 - value) * 400),
child: child,
);
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(rSize(4)),
),
),
),
// CustomImageButton(
// onPressed: () {},
// child: Image.asset(
// R.ASSETS_LIVE_VIDEO_SHARE_PNG,
// height: rSize(20),
// width: rSize(20),
// ),
// ),
// rWBox(22),
rWBox(15),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () {
CRoute.push(
context,
TopicPage(
topicId: widget.model.topicId,
initAttention: false));
},
child: TextUtil.isEmpty(widget.model.topicName)
? SizedBox()
: Text(
'#${widget.model.topicName}',
style: TextStyle(
color: Color(0xFFEB8A49),
fontSize: rSP(14),
),
),
),
rHBox(4),
Text(
widget.model.content,
style: TextStyle(
color: Color(0xFFE4E4E4),
fontSize: rSP(14),
),
),
rHBox(15),
Row(
children: [
Spacer(),
CustomImageButton(
onPressed: () {
if (UserManager.instance.haveLogin)
showGeneralDialog(
context: context,
barrierDismissible: true,
barrierColor:
Colors.black.withOpacity(0.55),
barrierLabel: '',
transitionBuilder: (context, animation,
secondaryAnimation, child) {
final value = Curves.easeInOutCubic
.transform(animation.value);
return Transform.translate(
offset: Offset(0, (1 - value) * 400),
child: child,
);
},
transitionDuration:
Duration(milliseconds: 300),
pageBuilder: (BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation) {
return ReviewChildCards(
trendId: widget.model.id);
},
);
else {
showToast('未登陆,请先登陆');
CRoute.push(context, UserPage());
}
},
transitionDuration: Duration(milliseconds: 300),
pageBuilder: (BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation) {
return ReviewChildCards(
trendId: widget.model.id);
child: Image.asset(
R.ASSETS_LIVE_VIDEO_COMMENT_PNG,
height: rSize(20),
width: rSize(20),
),
),
rWBox(22),
RecookLikeButton(
initValue: widget.model.isPraise == 1,
likePath: R.ASSETS_LIVE_VIDEO_LIKE_PNG,
size: rSize(20),
onChange: (oldState) {
if (UserManager.instance.haveLogin)
HttpManager.post(
oldState
? LiveAPI.dislikeActivity
: LiveAPI.likeActivity,
{'trendId': widget.model.id},
);
else {
showToast('未登陆,请先登陆');
CRoute.push(context, UserPage());
}
},
);
else {
showToast('未登陆,请先登陆');
CRoute.push(context, UserPage());
}
},
child: Image.asset(
R.ASSETS_LIVE_VIDEO_COMMENT_PNG,
height: rSize(20),
width: rSize(20),
),
],
),
),
rWBox(22),
RecookLikeButton(
initValue: widget.model.isPraise == 1,
likePath: R.ASSETS_LIVE_VIDEO_LIKE_PNG,
size: rSize(20),
onChange: (oldState) {
if (UserManager.instance.haveLogin)
HttpManager.post(
oldState
? LiveAPI.dislikeActivity
: LiveAPI.likeActivity,
{'trendId': widget.model.id},
);
else {
showToast('未登陆,请先登陆');
CRoute.push(context, UserPage());
}
},
),
],
)
],
),
),
],
),
),

@ -69,7 +69,7 @@ class _GoodsListDialogState extends State<GoodsListDialog> {
Text('全部宝贝 ${widget.models.length}'),
Spacer(),
Image.asset(
R.ASSETS_LIVE_FANCY_CART_PNG,
R.ASSETS_LIVE_FANCY_CART_RED_PNG,
height: rSize(40),
width: rSize(40),
)

Loading…
Cancel
Save