@extends('layouts.advert.layout')
@section('css')
    <link rel="stylesheet" href="/assets/css/resourcelist.css">
@endsection
@section('title','软文资源')
@section('content')
    @include('layouts.advert.cart')

    {{--筛选区域--}}
<section class="mtb20 wrap minh-ad">
        <div class="wrap-container">
            <div class="clear container zst-filter">
                <div class="filter-header clear">
                    <!-- <label class="yun-batch" onclick="keywordsSearch(this)" for="batchSearchPop">批量搜索</label> -->
                    <div class="yun-search zst-search">
                        <input class="search con-keydown" id="name" type="text" name="search" data-title="关键词" data-search="name"
                               placeholder="请输入软文资源名称">
                        <span class="icon--search con-click" id="nameSearch" onclick="keywordsSearch()"></span>
                    </div>
                </div>
                <div class="mainWidth batchResultBox resHide">
                    <div class="resultBox clear">
                        <div class="tit">批量查询结果：</div>
                        <div class="successRes"><b class="successNum"></b>个资源查询成功</div>
                        <div class="failRes fails resHide"><b class="failNum"></b>个资源查询失败</div>
                        <label class="viewRes fails resHide" for="batchResultPop">查看失败资源</label>
                    </div>
                </div>
                <div class="_filter_ search1">
                    <div class="filters" data-tit="覆盖区域">
                        <label class="showMore" for="con1">更多</label>
                        <div class="tit">
                            <span>覆盖区域：</span>
                            <label><input type="radio" class="none filter" name="district" value="" checked><b>不限</b></label>
                        </div>
                        <input type="checkbox" class="none con" id="con1">
                        <div class="con clear">
                            @foreach($condition['district'] as $item)
                            <label><input  @if($item->id == $status['district']) checked @endif  type="radio" class="none filter" name="district" value="{{$item->id}}"><b>{{ $item->name }}</b></label>
                            @endforeach
                        </div>
                    </div>
                    <div class="filters" data-tit="频道分类">
                        <label class="showMore" for="con2">更多</label>
                        <div class="tit">
                            <span>频道分类：</span>
                            <label><input type="radio" class="none filter" name="channel" value="" checked=""><b>不限</b></label>
                        </div>
                        <input type="checkbox" class="none con" id="con2">
                        <div class="con clear">
                            @foreach($condition['channel'] as $item)
                                <label><input type="radio" @if($item->id == $status['channel']) checked @endif   class="none filter" name="channel" value="{{$item->id}}"><b>{{ $item->name }}</b></label>
                            @endforeach
                        </div>
                    </div>
                    <div class="filters" data-tit="会员价格">
                        <div class="rFilter priceFilter clear">
                            {{--<input type="text" class="blur price1" autocomplete="off"><span>-</span>
                            <input type="text" class="blur price2" autocomplete="off">
                            <b class="ok">确定</b>--}}
                        </div>
                        <div class="tit">
                            <span>会员价格：</span>
                            <label><input type="radio" class="none filter" name="price" value="" checked=""><b>不限</b></label>
                        </div>
                        <div class="con clear">
                            @foreach($condition['price'] as $item)
                            <label><input type="radio"  @if($item->id == $status['price']) checked @endif   class="none filter" name="price" value="{{$item->id}}"><b>
                                    @if($item->type==1)
                                        {{$item->per_value}}元以下
                                    @elseif($item->type==3)
                                        {{$item->per_value}}元以上
                                    @else
                                        {{$item->min.'-'.$item->max}}元
                                    @endif
                                </b>
                            </label>
                            @endforeach
                        </div>
                    </div>
                    <div class="filters" data-tit="出稿时间">
{{--                        <div class="rFilter dateFilter clear">
                            <input type="text" class="blur price1" autocomplete="off"><span>-</span>
                            <input type="text" class="blur price2" autocomplete="off">
                            <b class="ok">确定</b>
                        </div>--}}
                        <div class="tit">
                            <span>出稿时间：</span>
                            <label><input type="radio"  class="none filter" name="period" value="" checked=""><b>不限</b></label>
                        </div>
                        <div class="con clear">
                            @foreach($condition['period'] as $item)
                                <label><input type="radio"  @if($item->id == $status['period']) checked @endif  class="none filter" name="period" value="{{$item->id}}"><b>
                                        @if($item->type==1)
                                            {{$item->per_value}}小时以内
                                        @elseif($item->type==3)
                                            {{$item->per_value}}小时以上
                                        @else
                                            {{$item->min.'-'.$item->max}}小时
                                        @endif
                                    </b></label>
                            @endforeach
                         </div>
                    </div>
                    <div class="filters" data-tit="收录类型">
                        <div class="tit">
                            <span>收录类型：</span>
                            <label><input type="radio"  class="none filter" name="collection" value="" checked=""><b>不限</b></label>
                        </div>
                        <div class="con clear">
                            @foreach($condition['collection'] as $item)
                                <label><input type="radio"  @if($item->id == $status['collection']) checked @endif class="none filter" name="collection" value="{{$item->id}}"><b data-name="{{ $item->name }}">{{ $item->name }}</b></label>
                            @endforeach
                        </div>
                    </div>
                    <div class="filters" data-tit="网站类型">
                        <div class="tit">
                            <span>网站类型：</span>
                            <label><input type="radio" class="none filter" name="website" value="" checked=""><b>不限</b></label>
                        </div>
                        <div class="con clear">
                            @foreach($condition['website'] as $item)
                                <label><input type="radio" @if($item->id == $status['website']) checked @endif   class="none filter" name="website" value="{{$item->id}}"><b data-name="{{ $item->name }}">{{$item->name}}</b></label>
                            @endforeach
                        </div>
					</div>
					<div class="filters selected" data-tit="已选择">
                        
                    </div>
                </div>
		        
            </div>
            <div class="list-content mt30 bgff plr20 pb20">
                <table class="table" id="searchTable">
                    <thead>
                    <tr>
                        <th style="width: 380px;">资源名称</th>
                        <th class="td-center">普通价格</th>
                        <th class="td-center">会员价格<img class="vip-img" src="/images/VIPlogo/V1.png" alt=""></th>
                        <th class="td-center">
                            <span>总发稿数</span>
                        </th>
                        <th class="td-center">
                            <span>网站类型</span>
                        </th>
                        <th class="td-center collect">
                            <span>收录</span>
                        </th>

                        <th class="td-center" style="width:190px;">操作</th>
                    </tr>
                    </thead>
                    <!-- 列表模板 -->
                    <tbody>
                    @if(count($data))
                        @foreach($data as $item)
                        <tr class="item-list">
                            <td style="width: 380px;">
                                <div class="res avatar article"  style="width: 80px;">

                                    <img class="list-img"  @if($item->created_from != 'cloud') src="{{ env('IMG_URL').$item->logo }}"
                                         @else src="{{$item->logo }}"  @endif onerror="javascript:this.src= '/images/avatar_icon.png'">
                                </div>
                                <div class="info" style="max-width: 280px;">
                                    <div class="res-name" data-resname="{{ mb_substr($item->name,0,30) }}">
                                        <a href="javascript:;" rel="nofollow" target="_blank">{{ mb_substr($item->name,0,30)  }}</a>
                                        {{--<i class="baidu-i" title="">{{ count($item->website) ? $item->website[0]['name'] : ''}}</i>--}}
                                    </div>
                                    <div class="res-desc" title="{{$item->slogan}}">{{ mb_substr($item->slogan,0,30)}}</div>
                                    <div class="finish-hour">平均出稿时间 {{$item->draft_time??$item->success_rate}}小时</div>
                                    <div class="finish-rate">出稿率 {{$item->draft}}%</div>
                                </div>
                            </td>
                            <td class="td-center">
                                <div data-price="{{$item->quota_min}}">￥{{$item->quota_min}}</div>
                            </td>
                            <td class="td-center">
                                <div class="red-price" data-price="{{$item->quota_min}}">￥{{$item->sale}}</div>
                            </td>
                           {{-- <td class="td-center">
                                <div class="order-count">{{ count($item->order)}}</div>
                            </td>--}}
                            <td class="td-center">
                                <div class="order-count">{{$item->order}}</div>
                            </td>
                            <td class="td-center">
                                <p class="web-category">{{ count($item->website) ? $item->website[0]['name'] : '无'}}</p>
                                {{--<p class="baidu">{{$item->collect[0]['name']}}</p>--}}
                            </td>
                            <td class="td-center">
                                <p class="entry-form no"></p>
                                <p class="entry-level">{{ count($item->collect) ? $item->collect[0]['name'] : '无'}}</p>
                            </td>
                            <td class="handle" data-id="" style="width:190px;">
                                <span  style="text-align:center;" class="detail-i _showDetail_" title="查看详情" data-show="detail" data-resid="{{ $item->id }}">查看详情</span>
                                <span  style="text-align:center;" class="quote-i _addQuote_" title="加入购物车" data-resid="{{ $item->id }}" data-type="{{$menu}}">加入购物车</span>
                            </td>
                        </tr>
                        @endforeach
                    @endif
                    </tbody>
                </table>
            </div>
        </div>
    </section>
<div class="popMid _popResDetail_" id="detailPop">
    <div class="bg">
        <div class="cell">
            <div class="midBox white radius"><label class="close trans"></label>
                <div class="tit">资源详情</div>
                <div class="box">
                    <div class="prd res-Pop">
                        <div class="resBase clear" data-tit="资源基本信息">
                            <div class="fl base clear">
                                <div class="headImg">
                                    <div class="res avatar article"><img class="list-img" src="" alt=""></div>
                                </div>
                                <div class="infos">
                                    <div class="name"><a class="resName" href="" target="_blank"></a><span>(ID : <b class="resId"></b>)</span></div>
                                    <div class="prices">
                                        <div>价格：<b>￥84</b></div>{{--<s>420</s>--}}<span title="用户评论得分">5 分</span>
                                    </div>
                                </div>
                            </div>
                           {{-- <div class="fr adds"><label class="addCart to" for="res_19275"></label><span class="_addQuote_" data-type="pop" data-resid="19275">加入报价单</span></div>--}}
                        </div>
                        <div class="resOther" id="sc_box">
                            <div class="sc_container">
                                <div class="resOrderInfo clear" data-tit="发稿相关信息">
                                    <div class="fl"><b>近期发稿<span class="resOrderCount">6</span></b>
                                        <div class="rates">
                                            <div>出稿率：<span class="success_rate">55.0%</span></div>
                                            <div>平均出稿时间：<span class="success_time">5.5小时</span></div>
                                        </div>
                                    </div>
                                    <div class="fl"><b>发稿案例</b>
                                        <div class="anli">
                                            <a href="" target="_blank"  title=""></a>
                                        </div>
                                    </div>
                                </div>
                                <div class="dArea resIntro" data-tit="资源说明">
                                    <div class="tits">资源说明</div>
                                    <div class="dList">
                                        <ul class="clear">
                                            <li class="clear "><b>网站名称：</b><span class="website-name"></span></li>
                                            <li class="clear "><b>网站类型：</b><span class="website-type"></span></li>
                                            <li class="clear "><b>覆盖区域：</b><span class="website-area">全国</span></li>
                                            <li class="clear "><b>收录参考：</b><span class="website-collect"></span></li>
                                            <li class="clear "><b>认证类型：</b><span class="website-material"></span></li>
                                            <li class="clear "><b>入口级别：</b><span class="website-entry"></span></li>
                                        </ul>
                                    </div>
                                </div>
                                <div class="dArea tgIntro " data-tit="会员价格" style="padding-bottom:10px;">
                                    <div class="tits">会员价格(元)</div>
                                    <div class="ptb20">
                                        <div style="position:relative;height:80px;width:100%;" id="vip-histogram"></div>
                                    </div>
                                </div>
                                <div class="dArea tgIntro" data-tit="投稿说明">
                                    <div class="tits">投稿说明</div>
                                    <div class="dList">
                                        <ul class="clear apply-condition">
                                            <li class="clear urlLimit_li"><b>接稿日期：</b><span class="tougao-date"></span></li>
                                            <li class="clear"><b>图片数量：</b><span class="img-count"></span></li>
                                            <li class="clear"><b>链接类型：</b><span class="link-type"></span></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    @if(!$member_info)
        @include('layouts.advert.info')
    @endif

    @if($data)
        {{$data->render('common.page')}}
    @endif
@endsection

