import 'package:app_package/app_package.dart';
import 'package:flutter/material.dart';
import 'package:wisdom_cli/wisdom_cli.dart';

///收费二维码弹出层
class QrcodeModalComponent extends StatelessWidget {
  const QrcodeModalComponent({
    Key? key,
    this.arrearsFeeTotal,
    this.houseName,
    this.communityId,
    this.houseId,
  }) : super(key: key);
  final String? arrearsFeeTotal;
  final String? houseName;
  final String? communityId;
  final String? houseId;

  ///收费二维码弹出层
  static show(
    context, {
    String? arrearsFeeTotal,
    String? houseName,
    String? communityId,
    String? houseId,
  }) {
    WBottomModalUtil.show(
      context,
      title: Text('收费二维码'),
      body: QrcodeModalComponent(
        arrearsFeeTotal: arrearsFeeTotal,
        houseName: houseName,
        communityId: communityId,
        houseId: houseId,
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Wisdom.column(
      padding: EdgeInsets.all(15.pt),
      children: <Widget>[
        WisText('$houseName', size: 15.pt),
        Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            WisText('欠费总额：', size: 15.pt, height: 2),
            WisText(
              '￥$arrearsFeeTotal',
              size: 15.pt,
              height: 2,
              color: Color(0xffF94F48),
            ),
          ],
        ),
        Wisdom(
          padding: EdgeInsets.all(15.pt),
          child: WImage.network(
            '${APPConfig.baseURL}/app/admin/assetBill/v1/seePayQrCode?communityId=$communityId&houseId=$houseId',
          ),
        ).asExpanded(),
        WisText('扫描二维码进行缴费', size: 15.pt, height: 2.5),
      ],
    );
  }
}
