part of user_coupon;

class BuildItem extends StatelessWidget {
  final CouponModel model;
  const BuildItem({
    Key? key,
    required this.model
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ColorFiltered(
      colorFilter: ColorFilter.mode(Colors.transparent, BlendMode.saturation),
      child: Container(
        margin: EdgeInsets.only(left: 10,top: 10,right: 5),
        child: Stack(
          children: [
            Container(
              child:Image.asset('assets/images/coupon_bg.png') ,
            ),
            Container(
            height: 105,
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(
                  width:120 ,
                  height: 100,
                  child: Column(
                    children: [
                      RichText(
                        text: TextSpan(
                          children: <TextSpan>[
                            TextSpan(
                              text: '￥',
                              style: TextStyle(fontSize: 15,fontWeight: Fonts.boldSemi,height: 1.5,color: Colors.white)
                            ),
                            TextSpan(
                                text: '5',
                                style: TextStyle(fontSize: 40,fontWeight: Fonts.boldSemi,height: 1.5,color: Colors.white)
                            ),
                          ]
                        ),
                      ),
                      Text('满${model.normPrice}可用',style: TextStyle(fontSize: 11,height: 1.5,color: Colors.white),)
                    ],
                  ),
                  // color: Colors.cyan,
                ),
                Expanded(
                  child: Container(
                    margin: EdgeInsets.only(left:15,right: 15 ),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Text(model.couponName??'',style: TextStyle(fontSize: 16,fontWeight: Fonts.medium,height: 1.5,color: Colours.c3),),
                            Gaps.vGaps5,
                            Text('满${model.normPrice}减${model.reducedPrice}元',style: TextStyle(fontSize: 12,height: 1.5,color: Colours.c9),),
                            Gaps.vGaps5,
                            Text(model.endTime??'',style: TextStyle(fontSize: 12,height: 1.5,color: Colours.c9),),
                          ],
                        ),
                        Container(
                          width: 65,
                          height: 24,
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(15),
                              color: Colors.white,
                              border: Border.all(width: 1,color: AppTheme.primary)
                          ),
                          child: const Text('立即使用',style: TextStyle(fontSize: 12,fontWeight: Fonts.medium,color: AppTheme.primary),),
                        )
                      ],
                    ),
                  ),
                )

              ],
            ),
          )
          ],
        ),
      ),
    );
  }
}
