part of user_order_refunded_details;



class RefundedDetailsPage extends StatefulWidget {
  final String totalPrice;//总价
  final String couponPrice;//优惠券优惠金额
  final String integralPrice;//积分抵扣金额
  const RefundedDetailsPage({Key? key,required this.totalPrice,
    required this.couponPrice,required this.integralPrice,}) : super(key: key);

  @override
  State<RefundedDetailsPage> createState() => _RefundedDetailsState();
}

class _RefundedDetailsState extends State<RefundedDetailsPage> {
  @override
  Widget build(BuildContext context) {
    bool a = true;
    return  Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        Container(
          color: Colors.white,
          padding: EdgeInsets.symmetric(vertical: 17.w),
          width: double.infinity,
          margin: EdgeInsets.fromLTRB(10.w, 0.w, 10.w, 0.w),
          child: Container(
            // color: Colors.red,
              child:Stack(
                children: [
                  const Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Text('金额明细',textAlign:TextAlign.center),
                    ],
                  ),
                  Positioned(
                    right: 0.w,
                    top: 0.w,
                    child: GestureDetector(
                      onTap: (){
                        context.pop();
                      },
                      child: SizedBox(
                        width: 20.w,
                        height: 20.w,
                        child: Image.asset('assets/images/close.png'),
                      ),
                    ),
                  )
                ],
              )
          ),
        ),
        SizedBox(height: 50.w,),
        Container(
          margin: EdgeInsets.only(left: 15.w,right: 17.5.w),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text('总价',style: TextStyle(fontSize: 16.w,color: Colours.c3,fontWeight: Fonts.medium),),
              Text('¥${widget.totalPrice}',style: TextStyle(fontSize: 17.w,color: Colours.cAB1941,fontWeight: Fonts.medium),),
            ],
          ),
        ),
        Container(
          margin: EdgeInsets.only(left: 15.w,right: 17.5.w,top:15.5.w),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text('优惠券抵扣',style: TextStyle(fontSize: 13.w,color: Colours.c9,),),
              buildItem(widget.couponPrice
              ),
            ],
          ),
        ),
        Container(
          margin: EdgeInsets.only(left: 15.w,right: 17.5.w,top:11.5.w,bottom: 39.5.w),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text('积分抵扣',style: TextStyle(fontSize: 13.w,color: Colours.c9,),),
              buildItem(widget.integralPrice),
            ],
          ),
        ),
      ],
    );
  }

  Widget buildItem(String show){
    if(show=='0.00'){
      return Text('0.00',style: TextStyle(fontSize: 13.w,color: Colours.c3,),);
    } else{
      return Text('减 ¥$show',style: TextStyle(fontSize: 13.w,color: Colours.cAB1941,fontWeight: Fonts.medium),);
    }
  }
}
