购物车样式修改

master
zhang 5 years ago
parent 050528f38d
commit a5d1bc0da9

@ -141,6 +141,9 @@ class ShoppingCartGoodsModel extends Object {
Promotion promotion;
num commission;
num originalPrice;
int isImport;
int isFerme;
int storehouse;
ShoppingCartGoodsModel(
this.shoppingTrolleyId,
this.goodsId,
@ -156,6 +159,9 @@ class ShoppingCartGoodsModel extends Object {
this.promotion,
this.commission,
this.originalPrice,
this.isImport,
this.isFerme,
this.storehouse,
) {
this.selected = false;
}

@ -71,6 +71,9 @@ ShoppingCartGoodsModel _$ShoppingCartGoodsModelFromJson(
: Promotion.fromJson(json['promotion'] as Map<String, dynamic>),
json['commission'] as num,
json['originalPrice'] as num,
json['isImport'] as num,
json['isFerme'] as num,
json['storehouse'] as int,
);
}

@ -28,7 +28,8 @@ class BrandDetailGridItem extends StatelessWidget {
final VoidCallback buyClick;
final Function onBrandClick;
const BrandDetailGridItem({Key key, this.goods, this.buyClick, this.onBrandClick})
const BrandDetailGridItem(
{Key key, this.goods, this.buyClick, this.onBrandClick})
: super(key: key);
static final Color colorGrey = Color(0xff999999);
@override
@ -68,52 +69,51 @@ class BrandDetailGridItem extends StatelessWidget {
Container(
margin: EdgeInsets.only(top: ScreenAdapterUtils.setWidth(4)),
child: ExtendedText.rich(
TextSpan(
children: [
this.goods.isImport == 1
? WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Container(
alignment: Alignment.center,
width: 24,
height: 15,
decoration: BoxDecoration(
color: Color(0xFFCC1B4F),
borderRadius: BorderRadius.circular(
ScreenAdapterUtils.setWidth(3)),
),
child: Text(
'进口',
style: TextStyle(
color: Colors.white,
fontSize: ScreenAdapterUtils.setSp(10),
fontWeight: FontWeight.w600,
),
TextSpan(
children: [
this.goods.isImport == 1
? WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Container(
alignment: Alignment.center,
width: 24,
height: 15,
decoration: BoxDecoration(
color: Color(0xFFCC1B4F),
borderRadius: BorderRadius.circular(
ScreenAdapterUtils.setWidth(3)),
),
child: Text(
'进口',
style: TextStyle(
color: Colors.white,
fontSize: ScreenAdapterUtils.setSp(10),
fontWeight: FontWeight.w600,
),
),
)
: WidgetSpan(child: SizedBox()),
this.goods.isImport == 1
? WidgetSpan(
child: Container(
width: ScreenAdapterUtils.setWidth(5),
))
: WidgetSpan(child: SizedBox()),
TextSpan(
text: this.goods.goodsName,
style: AppTextStyle.generate(
ScreenAdapterUtils.setSp(15),
fontWeight: FontWeight.w600),
),
],
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
)
: WidgetSpan(child: SizedBox()),
this.goods.isImport == 1
? WidgetSpan(
child: Container(
width: ScreenAdapterUtils.setWidth(5),
))
: WidgetSpan(child: SizedBox()),
TextSpan(
text: this.goods.goodsName,
style: AppTextStyle.generate(ScreenAdapterUtils.setSp(15),
fontWeight: FontWeight.w600),
),
],
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
Container(
alignment: Alignment.centerLeft,
padding:
margin:
const EdgeInsets.only(left: 0, right: 0, top: 5, bottom: 5),
child: this.goods.description == null
? Container()
@ -125,13 +125,17 @@ class BrandDetailGridItem extends StatelessWidget {
color: Colors.black54, fontWeight: FontWeight.w300),
),
),
AppConfig.getShowCommission() ? _brandWidget() : Spacer(),
Spacer(),
AppConfig.getShowCommission() ? _brandWidget() : SizedBox(),
Spacer(),
_saleNumberWidget(this.goods),
SizedBox(height: ScreenAdapterUtils.setWidth(4),),
SizedBox(
height: ScreenAdapterUtils.setWidth(4),
),
Row(
children: [
Text(
'¥${this.goods.originalPrice.toStringAsFixed(0)}',
'¥${this.goods.originalPrice.toStringAsFixed(2)}',
style: TextStyle(
decoration: TextDecoration.lineThrough,
decorationColor: Color(0xff898989),
@ -149,7 +153,9 @@ class BrandDetailGridItem extends StatelessWidget {
),
],
),
SizedBox(height: ScreenAdapterUtils.setWidth(2),),
SizedBox(
height: ScreenAdapterUtils.setWidth(2),
),
Container(
width: double.infinity,
child: Row(
@ -341,7 +347,7 @@ class BrandDetailGridItem extends StatelessWidget {
}
}
_brandWidget() {
_brandWidget() {
return GestureDetector(
onTap: () {
if (onBrandClick != null) onBrandClick();
@ -366,7 +372,9 @@ class BrandDetailGridItem extends StatelessWidget {
width: 4,
),
Text(
TextUtils.isEmpty(this.goods.brandName) ? "" : this.goods.brandName,
TextUtils.isEmpty(this.goods.brandName)
? ""
: this.goods.brandName,
style: TextStyle(
color: Color(0xffc70404),
fontSize: ScreenAdapterUtils.setSp(12),

@ -11,7 +11,7 @@ class ItemTagWidget {
childAspectRatio: _displayList
? MediaQuery.of(context).size.width /
((MediaQuery.of(context).size.width - 20) * 150.0 / 350.0)
: 174/320,
: 174/330,
crossAxisCount: _displayList ? 1 : 2);
}

@ -7,6 +7,7 @@
* ====================================================
*/
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
import 'package:recook/constants/api.dart';
import 'package:recook/constants/header.dart';
@ -217,12 +218,48 @@ class _ShoppingCartItemState extends State<ShoppingCartItem> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
goods.goodsName,
ExtendedText.rich(
TextSpan(
children: [
goods.isImport == 1
? WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Container(
alignment: Alignment.center,
width: 24,
height: 15,
decoration: BoxDecoration(
color: Color(0xFFCC1B4F),
borderRadius: BorderRadius.circular(
ScreenAdapterUtils.setWidth(3)),
),
child: Text(
'进口',
style: TextStyle(
color: Colors.white,
fontSize: ScreenAdapterUtils.setSp(10),
fontWeight: FontWeight.w600,
),
),
),
)
: WidgetSpan(child: SizedBox()),
goods.isImport == 1
? WidgetSpan(
child: Container(
width: ScreenAdapterUtils.setWidth(5),
))
: WidgetSpan(child: SizedBox()),
TextSpan(
text: goods.goodsName,
style: AppTextStyle.generate(
ScreenAdapterUtils.setSp(15),
fontWeight: FontWeight.w600),
),
],
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: AppTextStyle.generate(ScreenAdapterUtils.setSp(14),
fontWeight: FontWeight.w300),
),
Container(
margin: EdgeInsets.only(top: 5),
@ -242,8 +279,44 @@ class _ShoppingCartItemState extends State<ShoppingCartItem> {
fontWeight: FontWeight.w300),
),
),
Container(
height: 10,
SizedBox(
height: ScreenAdapterUtils.setWidth(2),
),
goods.isFerme==1
? Row(
children: [
Container(
width: ScreenAdapterUtils.setWidth(32),
height: ScreenAdapterUtils.setWidth(14),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFFE5ED),
borderRadius: BorderRadius.circular(
ScreenAdapterUtils.setWidth(7.5)),
),
child: Text(
'包税',
style: TextStyle(
color: Color(0xFFCC1B4F),
fontSize: ScreenAdapterUtils.setSp(10),
),
),
),
SizedBox(
width: ScreenAdapterUtils.setWidth(2),
),
Text(
'进口税¥${(goods.price * 1.2 * 9.1 / 100).toDouble().toStringAsFixed(2)},由瑞库客承担',
style: TextStyle(
color: Color(0xFF666666),
fontSize: ScreenAdapterUtils.setSp(10)),
),
],
)
: SizedBox(),
SizedBox(
height: ScreenAdapterUtils.setWidth(7),
),
Row(
children: <Widget>[
@ -285,7 +358,6 @@ class _ShoppingCartItemState extends State<ShoppingCartItem> {
// ),
],
),
Container(
height: 7,
),

Loading…
Cancel
Save