更新图标线条颜色

视频物品页UI变更
master
laiiihz 5 years ago
parent a4125b77b0
commit ea38cd5ab2

@ -133,7 +133,7 @@ class _BrandGoodsListViewState extends State<BrandGoodsListView> {
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.black.withOpacity(0.2), color: Colors.black.withOpacity(0.1),
width: rSize(1), width: rSize(1),
), ),
), ),

@ -4,7 +4,6 @@ import 'package:recook/constants/api.dart';
import 'package:recook/constants/header.dart'; import 'package:recook/constants/header.dart';
import 'package:recook/manager/http_manager.dart'; import 'package:recook/manager/http_manager.dart';
import 'package:recook/pages/goods/small_coupon_widget.dart'; import 'package:recook/pages/goods/small_coupon_widget.dart';
import 'package:recook/pages/home/classify/brandgoods_list_page.dart';
import 'package:recook/pages/live/models/video_goods_model.dart'; import 'package:recook/pages/live/models/video_goods_model.dart';
import 'package:recook/widgets/refresh_widget.dart'; import 'package:recook/widgets/refresh_widget.dart';
@ -199,21 +198,38 @@ class _VideoGoodsPageState extends State<VideoGoodsPage> {
_recentController.loadComplete(); _recentController.loadComplete();
}); });
}, },
body: ListView.separated( body: recentGoods.isEmpty
separatorBuilder: (context, index) { ? Center(
return Divider( child: Column(
height: rSize(0.5), mainAxisSize: MainAxisSize.min,
thickness: rSize(0.5), children: [
color: Color(0xFFD6D6D6), Image.asset(R.ASSETS_IMG_NO_DATA_PNG),
indent: rSize(15), rHBox(10),
endIndent: rSize(15), Text(
); '最近没有购买商品',
}, style: TextStyle(
itemBuilder: (context, index) { color: Color(0xFF333333),
return _buildGoodsCard(recentGoods[index]); fontSize: rSP(16),
}, ),
itemCount: recentGoods.length, ),
), ],
),
)
: ListView.separated(
separatorBuilder: (context, index) {
return Divider(
height: rSize(0.5),
thickness: rSize(0.5),
color: Color(0xFFD6D6D6),
indent: rSize(15),
endIndent: rSize(15),
);
},
itemBuilder: (context, index) {
return _buildGoodsCard(recentGoods[index]);
},
itemCount: recentGoods.length,
),
), ),
), ),
], ],
@ -222,6 +238,7 @@ class _VideoGoodsPageState extends State<VideoGoodsPage> {
} }
_buildGoodsCard(VideoGoodsModel model) { _buildGoodsCard(VideoGoodsModel model) {
final _height = (MediaQuery.of(context).size.width - 20) * 150.0 / 350.0;
return MaterialButton( return MaterialButton(
onPressed: () { onPressed: () {
widget.onPick(model); widget.onPick(model);
@ -235,100 +252,128 @@ class _VideoGoodsPageState extends State<VideoGoodsPage> {
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG, placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG,
image: Api.getImgUrl(model.mainPhotoUrl), image: Api.getImgUrl(model.mainPhotoUrl),
height: rSize(100), height: _height,
width: rSize(100), width: _height,
), ),
), ),
rWBox(10), rWBox(10),
Expanded( Expanded(
child: SizedBox( child: SizedBox(
height: rSize(110), height: _height,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Text(
// model.goodsName,
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: Color(0xFF0A0001),
// fontSize: rSP(14),
// ),
// ),
// Text(
// model.description,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: AppTextStyle.generate(ScreenAdapterUtils.setSp(14),
// color: Colors.black54, fontWeight: FontWeight.w300),
// ),
// InkWell(
// onTap: () {
// AppRouter.push(context, RouteName.BRANDGOODS_LIST_PAGE,
// arguments: BrandGoodsListPage.setArguments(
// model.brandId,
// model.brandName,
// ));
// },
// child: Row(
// children: [
// FadeInImage.assetNetwork(
// placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG,
// image: Api.getImgUrl(model.brandImg),
// width: rSize(13),
// height: rSize(13),
// ),
// rWBox(4),
// Text(
// model.brandName,
// style: TextStyle(
// color: Color(0xffc70404),
// fontSize: ScreenAdapterUtils.setSp(12),
// ),
// ),
// ],
// ),
// ),
// Row(
// children: [
// SmallCouponWidget(number: num.parse(model.coupon)),
// rWBox(4),
// Container(
// height: rSize(18),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(rSize(1)),
// border: Border.all(
// color: Color(0xFFCC1B4F),
// width: rSize(0.5),
// ),
// ),
// child: Text(
// '${model.commission}',
// style: TextStyle(
// color: Color(0xFFCC1B4F),
// fontSize: rSP(12),
// height: 1,
// ),
// ),
// ),
// Spacer(),
// Text(
// '剩余',
// style: TextStyle(
// color: Color(0xFF333333),
// fontSize: rSP(11),
// ),
// ),
// Text(
// '${model.inventory}',
// style: TextStyle(
// color: Color(0xFFC91147),
// fontSize: rSP(11),
// ),
// ),
// ],
// ),
// Spacer(),
Container(
height: 2,
),
Text( Text(
model.goodsName, model.goodsName,
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: AppTextStyle.generate(ScreenAdapterUtils.setSp(16),
color: Color(0xFF0A0001), fontWeight: FontWeight.w600),
fontSize: rSP(14),
),
),
Text(
model.description,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: AppTextStyle.generate(ScreenAdapterUtils.setSp(14),
color: Colors.black54, fontWeight: FontWeight.w300),
), ),
InkWell( Container(
onTap: () { alignment: Alignment.centerLeft,
AppRouter.push(context, RouteName.BRANDGOODS_LIST_PAGE, margin: EdgeInsets.only(top: 2),
arguments: BrandGoodsListPage.setArguments( child: model.description == null
model.brandId, ? Container()
model.brandName, : Text(
)); model.description,
}, maxLines: 1,
child: Row( overflow: TextOverflow.ellipsis,
children: [ style: AppTextStyle.generate(
FadeInImage.assetNetwork( ScreenAdapterUtils.setSp(14),
placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG, color: Colors.black54,
image: Api.getImgUrl(model.brandImg), fontWeight: FontWeight.w300),
width: rSize(13),
height: rSize(13),
),
rWBox(4),
Text(
model.brandName,
style: TextStyle(
color: Color(0xffc70404),
fontSize: ScreenAdapterUtils.setSp(12),
), ),
),
],
),
),
Row(
children: [
SmallCouponWidget(number: num.parse(model.coupon)),
rWBox(4),
Container(
height: rSize(18),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(rSize(1)),
border: Border.all(
color: Color(0xFFCC1B4F),
width: rSize(0.5),
),
),
child: Text(
'${model.commission}',
style: TextStyle(
color: Color(0xFFCC1B4F),
fontSize: rSP(12),
height: 1,
),
),
),
Spacer(),
Text(
'剩余',
style: TextStyle(
color: Color(0xFF333333),
fontSize: rSP(11),
),
),
Text(
'${model.inventory}',
style: TextStyle(
color: Color(0xFFC91147),
fontSize: rSP(11),
),
),
],
), ),
_brandWidget(model),
_saleNumberWidget(model),
Spacer(), Spacer(),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.baseline, crossAxisAlignment: CrossAxisAlignment.baseline,
@ -367,6 +412,113 @@ class _VideoGoodsPageState extends State<VideoGoodsPage> {
); );
} }
_brandWidget(VideoGoodsModel model) {
return GestureDetector(
onTap: () {},
child: Container(
width: double.infinity,
height: 25,
color: Colors.white,
child: Row(
children: <Widget>[
Container(
width: 13 * 1.5,
height: 13 * 1.5,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG,
image: Api.getImgUrl(model.brandImg),
fit: BoxFit.fill,
),
),
SizedBox(
width: 4,
),
Text(
TextUtils.isEmpty(model.brandName) ? "" : model.brandName,
style: TextStyle(
color: Color(0xffc70404),
fontSize: ScreenAdapterUtils.setSp(12),
),
),
],
),
));
}
_saleNumberWidget(VideoGoodsModel model) {
return Container(
child: Stack(
children: <Widget>[
Row(
children: <Widget>[
(model.coupon != null && model.coupon != "0")
? Container(
margin: EdgeInsets.only(right: 5),
child: SmallCouponWidget(
height: 18,
number: num.parse(model.coupon),
),
)
: SizedBox(),
AppConfig.commissionByRoleLevel
? Container(
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.symmetric(vertical: 2),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
border: Border.all(
color: Color(0xffec294d),
width: 0.5,
)),
padding: EdgeInsets.symmetric(horizontal: 3),
child: Text(
"" + model.commission,
style: TextStyle(
color: Colors.white.withAlpha(0),
fontSize: ScreenAdapterUtils.setSp(12),
),
),
),
AppConfig.getShowCommission()
? Container(
alignment: Alignment.center,
child: Text(
"" + model.commission,
style: TextStyle(
color: Color(0xffeb0045),
fontSize: ScreenAdapterUtils.setSp(12),
),
),
)
: SizedBox(),
],
),
)
: SizedBox(),
Spacer(),
],
),
Positioned(
right: 0,
bottom: 0,
top: 0,
child: Text(
"已售${model.salesVolume}",
style: TextStyle(
color: Color(0xff595757),
fontSize: ScreenAdapterUtils.setSp(12),
),
),
),
],
),
);
}
Future<List<VideoGoodsModel>> getSearchGoodsList() async { Future<List<VideoGoodsModel>> getSearchGoodsList() async {
ResultData resultData = await HttpManager.post(LiveAPI.goodsList, { ResultData resultData = await HttpManager.post(LiveAPI.goodsList, {
'keyword': _keyword, 'keyword': _keyword,

Loading…
Cancel
Save