/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2022-04-14 14:37:41
 * @LastEditTime : 2023-02-10 11:37:24
 * @Description  : Do not edit
 */

part of '../index.dart';

class _TabScoreComponent extends StatelessWidget {
  const _TabScoreComponent({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    PrivateReportDetailStore _store =
        Provider.of<PrivateReportDetailStore>(context);
    final colorScheme = WTheme.of(context).colorScheme;
    return WisScrollView(key: _store.reportScoreKey, slivers: <Widget>[
      SliverToBoxAdapter(
        child: Wisdom.column(
          margin: EdgeInsets.all(15.pt),
          padding: EdgeInsets.symmetric(horizontal: 15.pt, vertical: 15.pt),
          crossAxisAlignment: CrossAxisAlignment.start,
          borderRadius: BorderRadius.circular(4.pt),
          color: Colors.white,
          children: [
            if (_store.reportDetail?.linkId != null &&
                _store.reportDetail?.linkId != '') ...[
              Wisdom.row(
                margin: EdgeInsets.only(bottom: 10.pt),
                children: [
                  WisText(
                    '整体评分',
                    size: 18.pt,
                    bold: true,
                  ),
                  SizedBox(width: 10.pt),
                  WisText(
                    '${_store.scoreDetail?.globalScore ?? '--'}',
                    color: _store.scoreDetail?.globalScore != null &&
                            _store.scoreDetail!.globalScore! >= 4
                        ? colorScheme.primary
                        : _store.scoreDetail?.globalScore == null
                            ? colorScheme.mainTitle
                            : colorScheme.red,
                    size: 18.pt,
                  ),
                ],
              ),
              Wisdom.row(
                children: [
                  WisText(
                    '保洁评分',
                    size: 15.pt,
                    bold: true,
                  ),
                  SizedBox(width: 10.pt),
                  WisText(
                    '${_store.scoreDetail?.cleanScore ?? '--'}',
                    color: _store.scoreDetail?.cleanScore != null &&
                            _store.scoreDetail!.cleanScore! >= 4
                        ? colorScheme.primary
                        : _store.scoreDetail?.cleanScore == null
                            ? colorScheme.mainTitle
                            : colorScheme.red,
                  ),
                ],
              ),
              Wisdom.row(
                margin: EdgeInsets.only(top: 10.pt),
                children: [
                  Wisdom.rich(
                    children: [
                      TextSpan(
                        text: '评价：',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                      TextSpan(
                        text: '${_store.scoreDetail?.cleanEvaluate ?? '无'}',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                    ],
                  ).asExpanded(),
                ],
              ),
              Divider(height: 20.pt),
              Wisdom.row(
                children: [
                  WisText(
                    '秩序评分',
                    size: 15.pt,
                    bold: true,
                  ),
                  SizedBox(width: 10.pt),
                  WisText(
                    '${_store.scoreDetail?.orderScore ?? '--'}',
                    color: _store.scoreDetail?.orderScore != null &&
                            _store.scoreDetail!.orderScore! >= 4
                        ? colorScheme.primary
                        : _store.scoreDetail?.orderScore == null
                            ? colorScheme.mainTitle
                            : colorScheme.red,
                    size: 15.pt,
                  ),
                ],
              ),
              Wisdom.row(
                margin: EdgeInsets.only(top: 10.pt),
                children: [
                  Wisdom.rich(
                    children: [
                      TextSpan(
                        text: '评价：',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                      TextSpan(
                        text: '${_store.scoreDetail?.orderEvaluate ?? '无'}',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                    ],
                  ).asExpanded(),
                ],
              ),
              Divider(height: 20.pt),
              Wisdom.row(
                children: [
                  WisText(
                    '设备评分',
                    size: 15.pt,
                    bold: true,
                  ),
                  SizedBox(width: 10.pt),
                  WisText(
                    '${_store.scoreDetail?.equipmentScore ?? '--'}',
                    color: _store.scoreDetail?.equipmentScore != null &&
                            _store.scoreDetail!.equipmentScore! >= 4
                        ? colorScheme.primary
                        : _store.scoreDetail?.equipmentScore == null
                            ? colorScheme.mainTitle
                            : colorScheme.red,
                    size: 15.pt,
                  ),
                ],
              ),
              Wisdom.row(
                margin: EdgeInsets.only(top: 10.pt),
                children: [
                  Wisdom.rich(
                    children: [
                      TextSpan(
                        text: '评价：',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                      TextSpan(
                        text: '${_store.scoreDetail?.equipmentEvaluate ?? '无'}',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                    ],
                  ).asExpanded(),
                ],
              ),
              Divider(height: 20.pt),
              Wisdom.row(
                children: [
                  WisText(
                    '绿化评分',
                    size: 15.pt,
                    bold: true,
                  ),
                  SizedBox(width: 10.pt),
                  WisText(
                    '${_store.scoreDetail?.greeningScore ?? '--'}',
                    color: _store.scoreDetail?.greeningScore != null &&
                            _store.scoreDetail!.greeningScore! >= 4
                        ? colorScheme.primary
                        : _store.scoreDetail?.greeningScore == null
                            ? colorScheme.mainTitle
                            : colorScheme.red,
                    size: 15.pt,
                  ),
                ],
              ),
              Wisdom.row(
                margin: EdgeInsets.only(top: 10.pt),
                children: [
                  Wisdom.rich(
                    children: [
                      TextSpan(
                        text: '评价：',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                      TextSpan(
                        text: '${_store.scoreDetail?.greeningEvaluate ?? '无'}',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                    ],
                  ).asExpanded(),
                ],
              ),
              Divider(height: 20.pt),
              Wisdom.row(
                children: [
                  WisText(
                    '智能化评分',
                    size: 15.pt,
                    bold: true,
                  ),
                  SizedBox(width: 10.pt),
                  WisText(
                    '${_store.scoreDetail?.intelligentScore ?? '--'}',
                    color: _store.scoreDetail?.intelligentScore != null &&
                            _store.scoreDetail!.intelligentScore! >= 4
                        ? colorScheme.primary
                        : _store.scoreDetail?.intelligentScore == null
                            ? colorScheme.mainTitle
                            : colorScheme.red,
                    size: 15.pt,
                  ),
                ],
              ),
              Wisdom.row(
                margin: EdgeInsets.only(top: 10.pt),
                children: [
                  Wisdom.rich(
                    children: [
                      TextSpan(
                        text: '评价：',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                      TextSpan(
                        text:
                            '${_store.scoreDetail?.intelligentEvaluate ?? '无'}',
                        style: TextStyle(fontSize: 14.pt),
                      ),
                    ],
                  ).asExpanded(),
                ],
              ),
            ] else ...[
              WEmptyWidget(text: WisText('暂无评分')),
            ]
          ],
        ),
      ),
    ]);
  }
}
