<div class="container">


<?php if(count($ad)): ?>
    <div class="mshop-bar">
        <a href="<?php echo $ad[0]['ad_url']; ?>">
            <img src="<?php echo URL($ad[0]['ad_file']); ?>" alt=""
                 onerror="onerrorImage('<?php echo e(Theme::asset()->url('images/index/shop-bar.jpg')); ?>',$(this))">
        </a>
    </div>
<?php endif; ?>

<div class="mshop-filter service-filter clearfix">
    <div class="col-xs-12">
        <div class="classify showSideDown ">
            <span class="title">服务商分类</span>
            <a class="<?php echo (!isset($merge['category']) || $merge['category']==$pid)?'mactive':''; ?>"
               href="<?php echo URL('bre/service'); ?>">全部
            </a>
            <?php $__empty_1 = true; foreach($category as $k => $v): $__empty_1 = false; ?>
                <?php if($k < 7): ?>
                <a class="<?php echo (isset($merge['category']) && $merge['category']==$v['id'])?'mactive':''; ?>"
                   href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,'page'), ['category'=>$v['id']])); ?>">
                    <?php echo e($v['name']); ?>

                </a>
                <?php endif; ?>
            <?php endforeach; if ($__empty_1): ?>
            <?php endif; ?>
            <?php if(count($area)>7): ?>
                <div class="pull-right select-fa-angle-down">
                    <i class="fa fa-angle-down text-size14 show-next"></i>
                </div>
            <?php endif; ?>

            <?php /*服务商筛选*/ ?>
            <div class="col-md-12 col-xs-12 serivcelist-type">
                <div class="row">
                <?php if(count($category)>7): ?>
                    <div class="col-md-offset-1 cor99">
                        <div class="">
                            <?php foreach(array_slice($category,7,(count($category)-7)) as $v): ?>
                                <a class="<?php echo (isset($merge['category']) && $merge['category']==$v['id'])?'mactive':''; ?>"
                                   href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,'page'), ['category'=>$v['id']])); ?>"><?php echo e($v['name']); ?></a>
                            <?php endforeach; ?>
                        </div>
                    </div>
                <?php endif; ?>
                </div>
            </div>
        </div>


        <div class="showSideDown">
            <span class="title">服务商地区</span>
            <?php if(isset($_GET['province'])): ?>
                <a class="<?php echo ( $merge['province']==$area_pid)?'mactive':''; ?>"
                   href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except(array_except($merge,['keywords','page']),['area','city','province']))); ?>">
                    全部
                </a>
                <?php foreach(array_slice($area,0,7) as $v): ?>
                    <a class="<?php echo (isset($merge['area']) && $merge['area']==$v['id'])?'mactive':''; ?>"
                       href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,['page','province']), ['city'=>$v['id']])); ?>">
                        <?php echo e($v['name']); ?>

                    </a>
                <?php endforeach; ?>
            <?php elseif(isset($_GET['city'])): ?>
                <a class="<?php echo ($merge['city']==$area_pid)?'mactive':''; ?>" href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,['area','city','province','page']))); ?>">
                    全部
                </a>
                <?php foreach(array_slice($area,0,7) as $v): ?>
                    <a class="<?php echo (isset($merge['area']) && $merge['area']==$v['id'])?'mactive':''; ?>"
                       href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,['page','city']), ['area'=>$v['id']])); ?>">
                        <?php echo e($v['name']); ?>

                    </a>
                <?php endforeach; ?>
            <?php elseif(isset($_GET['area'])): ?>
                <a class="<?php echo (!isset($_GET['area']) && $merge['area']==$area_pid)?'mactive':''; ?>"
                   href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,['area','city','province','keywords','page']))); ?>">
                    全部
                </a>
                <?php foreach(array_slice($area,0,7) as $v): ?>
                    <a class="<?php echo (isset($merge['area']) && $merge['area']==$v['id'])?'mactive':''; ?>"
                       href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,'page'), ['area'=>$v['id']])); ?>">
                        <?php echo e($v['name']); ?>

                    </a>
                <?php endforeach; ?>
            <?php else: ?>
                <a class="mactive"
                   href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,['area','city','keywords','page']),['province'=>0])); ?>">
                    全部
                </a>
                <?php foreach(array_slice($area,0,7) as $v): ?>
                    <a class="<?php echo (isset($merge['area']) && $merge['area']==$v['id'])?'mactive':''; ?>"
                       href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,'page'), ['province'=>$v['id']])); ?>">
                        <?php echo e($v['name']); ?>

                    </a>
                <?php endforeach; ?>
            <?php endif; ?>

            <?php if(count($area)>7): ?>
                <div class="pull-right select-fa-angle-down">
                    <i class="fa fa-angle-down text-size14 show-next"></i>
                </div>
            <?php /*<?php endif; ?>


            <?php if(count($area)>7): ?>*/ ?>
                <div class="col-xs-12 clearfix service-area">
                    <div class="row">
                        <div class="col-md-offset-1 cor99">
                            <div class="row">
                                <?php if(isset($_GET['province'])): ?>
                                    <?php foreach(array_slice($area,7,(count($area)-7)) as $v): ?>
                                        <a class="<?php echo (isset($merge['area']) && $merge['area']==$v['id'])?'mactive':''; ?>"
                                           href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,['page','province']), ['city'=>$v['id']])); ?>"><?php echo e($v['name']); ?></a>
                                    <?php endforeach; ?>
                                <?php elseif(isset($_GET['city'])): ?>
                                    <?php foreach(array_slice($area,7,(count($area)-7)) as $v): ?>
                                        <a class="<?php echo (isset($merge['area']) && $merge['area']==$v['id'])?'mactive':''; ?>"
                                           href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,['page','city']), ['area'=>$v['id']])); ?>"><?php echo e($v['name']); ?></a>
                                    <?php endforeach; ?>
                                <?php elseif(isset($_GET['area'])): ?>
                                    <?php foreach(array_slice($area,7,(count($area)-7)) as $v): ?>
                                        <a class="<?php echo (isset($merge['area']) && $merge['area']==$v['id'])?'mactive':''; ?>"
                                           href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,'page'), ['area'=>$v['id']])); ?>"><?php echo e($v['name']); ?></a>
                                    <?php endforeach; ?>
                                <?php else: ?>
                                    <?php foreach(array_slice($area,7,(count($area)-7)) as $v): ?>
                                        <a class="<?php echo (isset($merge['area']) && $merge['area']==$v['id'])?'mactive':''; ?>"
                                           href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,'page'), ['province'=>$v['id']])); ?>"><?php echo e($v['name']); ?></a>
                                    <?php endforeach; ?>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            <?php endif; ?>

        </div>

    </div>
</div>

<section>
    <div class="">
        <div class="space-20"></div>
        <div class="text-size14 mshop-sort clearfix">
            <div class="pull-left">
                <a href="/bre/service">综合</a>
                <a href="<?php echo URL('bre/service').'?'.http_build_query(array_merge(array_except($merge,'page'), ['employee_praise_rate'=>1])); ?>">好评数 <i class="glyphicon glyphicon-arrow-down"></i></a>
            </div>
            <form method="get" action="<?php echo URL('bre/service').'?'.http_build_query($merge); ?>">
                <div class="pull-right">
                    <button class="mshop-sortbtn" type="submit"><i class="fa fa-search text-size18"></i></button>
                    <input class="mshop-sortinp" name="service_name" type="text" placeholder="搜索服务商名称"
                           <?php if(!empty($merge['service_name'])): ?>value="<?php echo e($merge['service_name']); ?>"<?php endif; ?>>
                </div>
            </form>
        </div>
        <div class="space-10"></div>
        <div class="index-service">
            <ul id="da-thumbs" class="da-thumbs clearfix">
                <?php if(!empty($list)): ?>
                    <?php foreach($list as $item): ?>
                        <li>
                            <div class="index-serwrap">
                                <div class="index-serimg">
                                    <a target="_blank" href="<?php if($item->shop_status == 1 && $item->shopId): ?>
                                    <?php echo url('shop/'.$item->shopId); ?> <?php else: ?><?php echo URL('bre/serviceEvaluateDetail/'.$item->id); ?><?php endif; ?>">
                                        <img src="<?php if($item->avatar): ?><?php echo URL($item->avatar); ?>

                                        <?php else: ?> <?php echo Theme::asset()->url('images/default_avatar.png'); ?> <?php endif; ?>" alt=""
                                             onerror="onerrorImage('<?php echo e(Theme::asset()->url('images/employ/bg2.jpg')); ?>',$(this))">
                                        <div class="index-serimgp">
                                            <div class="space-6"></div>
                                            <p class="no-margin-bottom">服务：<?php if(empty($item->skill)): ?>
                                                    暂无标签
                                                <?php else: ?>
                                                    <?php foreach($item->skill as $value): ?>
                                                        <?php echo $value; ?>&nbsp;&nbsp;
                                                    <?php endforeach; ?>
                                                <?php endif; ?></p>
                                            <div class="space-2"></div>
                                            <?php if($item->pre && $item->city): ?>
                                                <p><?php echo $item->pre.$item->city; ?></p>
                                            <?php endif; ?>

                                        </div></a>
                                </div>
                                <div class="index-serinfo">
                                    <div class="space-6"></div>
                                    <a class="cor-gray24 text-size14" target="_blank" href="<?php if($item->shop_status == 1 && $item->shopId): ?>
                                    <?php echo url('shop/'.$item->shopId); ?> <?php else: ?><?php echo URL('bre/serviceEvaluateDetail/'.$item->id); ?><?php endif; ?>">
                                        <?php echo $item->name; ?>

                                    </a>
                                    <div class="space-4"></div>
                                    <p class="no-margin-bottom clearfix">
                                        <span class="text-size12 pull-left">好评数
                                            <span class="cor-orange"><?php echo $item->employee_praise_rate; ?>个</span>
                                        </span>
                                    <span class="pull-right">
                                        <?php if(isset($item->auth) && $item->auth['bank'] == true): ?>
                                            <i class="bank-attestation"></i>
                                        <?php else: ?>
                                            <span class="s-servicericon bank-attestation-no"></span>
                                        <?php endif; ?>
                                        <?php if(isset($item->auth) && $item->auth['realname'] == true): ?>
                                            <i class="cd-card-attestation"></i>
                                        <?php else: ?>
                                            <span class="s-servicericon cd-card-attestation-no"></span>
                                        <?php endif; ?>
                                        <?php if($item->email_status == 2): ?>
                                            <i class="email-attestation"></i>
                                        <?php else: ?>
                                            <span class="s-servicericon email-attestation-no"></span>
                                        <?php endif; ?>
                                        <?php if(isset($item->auth) && $item->auth['alipay'] == true): ?>
                                            <i class="alipay-attestation"></i>
                                        <?php else: ?>
                                            <span class="s-servicericon alipay-attestation-no"></span>
                                        <?php endif; ?>
                                        <?php if(isset($item->auth) && $item->auth['enterprise'] == true): ?>
                                            <i class="com-attestation"></i>
                                        <?php else: ?>
                                            <span class="s-servicericon company-attestation-no"></span>
                                        <?php endif; ?>
                                    </span>
                                    </p>
                                </div>
                            </div>
                        </li>
                    <?php endforeach; ?>
                <?php endif; ?>
            </ul>
        </div>
        <div class="service-thumbs">
            <div class=" paging_bootstrap text-right">
                <ul class="pagination case-page-list">
                    <?php echo $list->appends($_GET)->render(); ?>


                </ul>
            </div>
        </div>
        <div class="space-30"></div>
    </div>
</section>
</div>
<?php echo Theme::asset()->container('custom-css')->usepath()->add('case-css', 'css/index/case.css'); ?>

<?php echo Theme::asset()->container('custom-js')->usepath()->add('General-js', 'js/General.js'); ?>

<?php echo Theme::asset()->container('custom-js')->usepath()->add('common-js', 'js/common.js'); ?>