<template>
    <view>
        <view style="display: flex; flex-direction: column" @touchstart="touchStart">
            <view class="navigator">
                <view
                    class="navigatorBar"
                    hover-class="none"
                    :style="'padding-top:' + (statusBarHeight + (navigationBarHeight - menuButtonHeight) / 2) + 'px'"
                    :hover-stop-propagation="false"
                >
                    <view class="tabs display-flex" :style="'width:128px;text-align:center;margin-top:'+()">
                        <view class="tarbar" style="" @tap="choosenTop" data-id="1">
                            <view :class="'tarbarText ' + (toped == '1' ? 'active' : '')">标准</view>
                            <!-- <image wx:if="{{toped == '2'}}" src="../../assets/images/border-circle.svg" class="tarbarImg"></image> -->
                        </view>
                        <view class="tarbar" @tap="choosenTop" data-id="2">
                            <view :class="'tarbarText ' + (toped == '2' ? 'active' : '')">简版</view>
                            <!-- <image wx:if="{{toped == '1'}}" src="../../assets/images/border-circle.svg" class="tarbarImg"></image> -->
                        </view>
                    </view>
                </view>
                <view class="weui-search-bar weui-search-bar_focusing ysd-basebg-color" id="searchBar" style="line-height: 1">
                    <view class="cf v-center" hover-class="thover" @tap="goCity">
                        <view class="f16 cf085 dib">{{ searchCityParamStorage.name == '' ? '全国' : searchCityParamStorage.shortName }}</view>
                        <i class="iconfont icon-zhankai f10" style="margin: 1px 12px 0 6px; color: #fff"></i>
                    </view>
                    <form class="weui-search-bar__form specialXX flex-1">
                        <view class="weui-search-bar__box" @click.stop="goSearch">
                            <i class="iconfont icon-sousuo"></i>
                            <view :class="'weui-search-bar__input ' + (!chaShowed ? 'c9' : 'c3')" style="width: 160px">{{ inputVal }}</view>
                            <view class="iconfont icon-qingchu" v-if="chaShowed" style="color: #333" @click.stop="clearInput"></view>
                            <view class="search" @click.stop="searchKey" style="color: var(--color-ysd)">搜索</view>
                        </view>
                    </form>
                </view>
                <!-- <view class="display-flex p024">
      <view class="tarbar" bindtap="choosenTop" data-id="1">
        <view class="tarbarText {{toped == '1'?'active':''}}">简版</view>
        <image wx:if="{{toped == '1'}}" src="../../assets/images/border-circle.svg" class="tarbarImg"></image>
      </view>
      <view class="tarbar" style="margin-left: 48px;" bindtap="choosenTop" data-id="2">
        <view class="tarbarText {{toped == '2'?'active':''}}">标准</view>
        <image wx:if="{{toped == '2'}}" src="../../assets/images/border-circle.svg" class="tarbarImg"></image>
      </view>
      <view class="flex-1">
        <view class="newSearch" catchtap="goSearch">
          <i class="iconfont icon-sousuo mr8"></i>搜索
        </view>
      </view>
    </view> -->
                <view class="xgxg" id="menu">
                    <view class="display-flex" style="justify-content: space-beteween; height: 36px">
                        <view
                            :class="'csbf ' + (whichOneShow == 'gj' ? 'active' : '') + ' ' + (activez != '' && activez != 'all' ? 'activecolor' : '')"
                            @tap="chooseNl"
                            data-type="gj"
                        >
                            {{ firstMenu }}
                            <i class="iconfont icon-shouqi f12 fst ml8" v-if="whichOneShow == 'gj'"></i>
                            <i class="iconfont icon-zhankai f12 fst ml8" v-else data-type="gj"></i>
                            <scroll-view
                                class="gjFixed"
                                @click.stop="closeFix"
                                @touchmove.stop.prevent="cc"
                                v-if="whichOneShow == 'gj'"
                                :style="'margin-top:' + (statusBarHeight + (navigationBarHeight - menuButtonHeight) / 2 + 142) + 'px'"
                            >
                                <view class="bgf tl c3 por filterprice sort">
                                    <view class="f14 p016" data-id="all" @tap="chooseM" style="line-height: 42px" hover-class="thover">综合排序</view>
                                    <view :class="'f14 p016 ' + (activez == 'zuigao' ? 'cf00' : '')" data-id="zuigao" @tap="chooseM" style="line-height: 42px" hover-class="thover">
                                        工价优先
                                    </view>
                                    <view
                                        :class="'f14 p016 bb1 ' + (activez == 'zuijin' ? 'cf00' : '')"
                                        data-id="zuijin"
                                        @tap="chooseM"
                                        style="line-height: 42px"
                                        hover-class="thover"
                                    >
                                        距离优先
                                    </view>
                                </view>
                            </scroll-view>
                        </view>

                        <view
                            :class="'csbf ' + (whichOneShow == 'brand' ? 'active' : '') + ' ' + (selectBrandList.length > 0 ? 'activecolor' : '')"
                            @tap="chooseNl"
                            data-type="brand"
                        >
                            品牌
                            <i class="iconfont icon-shouqi f12 fst ml8" v-if="whichOneShow == 'brand' && selectBrandList.length <= 0"></i>
                            <i class="iconfont icon-zhankai f12 fst ml8" v-if="whichOneShow != 'brand' && selectBrandList.length <= 0" data-type="brand"></i>
                            <span v-if="selectBrandList.length > 0" class="specialnum" data-type="brand">{{ selectBrandList.length }}</span>
                            <scroll-view
                                class="gjFixed"
                                @click.stop="closeFix"
                                v-if="whichOneShow == 'brand'"
                                :style="'margin-top:' + (statusBarHeight + (navigationBarHeight - menuButtonHeight) / 2 + 142) + 'px'"
                            >
                                <view class="bgf tl c3 filterprice brand" @click.stop="cc">
                                    <view class="display-flex content">
                                        <block v-for="(item, index) in brandList" :key="index">
                                            <view @tap="selectBrand" :data-index="index" :class="item.checked ? 'brandactive' : ''">
                                                <image class="" :src="item.logo" mode="" :lazy-load="false" @error="" @load="" v-if="item.logo"></image>
                                                <image class="" v-else mode="aspectFit" src="https://matripe.oss-cn-beijing.aliyuncs.com/default.png"></image>
                                                {{ item.name }}
                                            </view>
                                        </block>
                                    </view>
                                    <view class="btmFix display-flex" style="justify-content: center">
                                        <view class="">
                                            <button class="resetBtn" style="font-weight: 400" @click.stop="reset" data-type="2">重置</button>
                                        </view>
                                        <view class="">
                                            <button type="primary" class="loginOut ysd-basebg-color" hover-class="thover" style="font-weight: 400" @click.stop="loginOut">
                                                确定
                                            </button>
                                        </view>
                                    </view>
                                </view>
                            </scroll-view>
                        </view>
                        <view
                            :class="'csbf ' + (whichOneShow == 'sex' ? 'active' : '') + ' ' + (sexid != '' && sexid != '-1' ? 'activecolor' : '')"
                            @tap="chooseNl"
                            data-type="sex"
                            style=""
                        >
                            {{ secondMenu }}
                            <i class="iconfont icon-shouqi f12 fst ml8" v-if="whichOneShow == 'sex'"></i>
                            <i class="iconfont icon-zhankai f12 fst ml8" v-else data-type="sex"></i>
                            <scroll-view
                                class="gjFixed"
                                @click.stop="closeFix"
                                @touchmove.stop.prevent="cc"
                                v-if="whichOneShow == 'sex'"
                                :style="'margin-top:' + (statusBarHeight + (navigationBarHeight - menuButtonHeight) / 2 + 142) + 'px'"
                            >
                                <view class="bgf tl c3 filterprice sort">
                                    <view :class="'f14 p016 ' + (sexid == '-1' ? 'cf00' : '')" data-id="-1" @tap="choosen" style="line-height: 42px" hover-class="thover">
                                        男女不限
                                    </view>
                                    <view :class="'f14 p016 ' + (sexid == '1' ? 'cf00' : '')" data-id="1" @tap="choosen" style="line-height: 42px" hover-class="thover">男</view>
                                    <view :class="'f14 p016 ' + (sexid == '2' ? 'cf00' : '')" data-id="2" @tap="choosen" style="line-height: 42px" hover-class="thover">女</view>
                                </view>
                            </scroll-view>
                        </view>
                        <view
                            :class="'csbf ' + (whichOneShow == 'special' ? 'active' : '') + ' ' + (selectJobList.length > 0 ? 'activecolor' : '')"
                            @tap="chooseNl"
                            data-type="special"
                        >
                            筛选
                            <i class="iconfont icon-shouqi f12 fst ml8" v-if="whichOneShow == 'special' && selectJobList.length <= 0"></i>
                            <i class="iconfont icon-zhankai f12 fst ml8" v-if="whichOneShow != 'special' && selectJobList.length <= 0" data-type="special"></i>
                            <span v-if="selectJobList.length > 0" class="specialnum" data-type="special">{{ selectJobList.length }}</span>
                            <scroll-view
                                class="gjFixed"
                                @click.stop="closeFix"
                                v-if="whichOneShow == 'special'"
                                :style="'margin-top:' + (statusBarHeight + (navigationBarHeight - menuButtonHeight) / 2 + 142) + 'px'"
                            >
                                <view class="bgf tl c3 filterprice" @click.stop="cc">
                                    <view class="specialtag">
                                        <view class="f14 c3">薪资福利</view>
                                        <view class="mt10 tagBox">
                                            <block v-for="(item, index) in tagArray1" :key="index">
                                                <view @tap="selectJobSpecialLabel" data-indexTag="1" :data-index="index" :class="'bgAc ' + (item.checked ? 'active' : '')">
                                                    {{ item.name }}
                                                </view>
                                            </block>
                                        </view>
                                        <view class="f14 c3 mt10">食宿保障</view>
                                        <view class="mt10 tagBox">
                                            <block v-for="(item, index) in tagArray3" :key="index">
                                                <view @tap="selectJobSpecialLabel" data-indexTag="3" :data-index="index" :class="'bgAc ' + (item.checked ? 'active' : '')">
                                                    {{ item.name }}
                                                </view>
                                            </block>
                                        </view>
                                        <view class="f14 c3 mt10">班制特色</view>
                                        <view class="mt10 tagBox">
                                            <block v-for="(item, index) in tagArray0" :key="index">
                                                <view @tap="selectJobSpecialLabel" data-indexTag="0" :data-index="index" :class="'bgAc ' + (item.checked ? 'active' : '')">
                                                    {{ item.name }}
                                                </view>
                                            </block>
                                        </view>
                                        <view class="f14 c3 mt10">其它特色</view>
                                        <view class="mt10 tagBox">
                                            <block v-for="(item, index) in tagArray2" :key="index">
                                                <view @tap="selectJobSpecialLabel" data-indexTag="2" :data-index="index" :class="'bgAc ' + (item.checked ? 'active' : '')">
                                                    {{ item.name }}
                                                </view>
                                            </block>
                                        </view>
                                    </view>
                                    <view class="btmFix display-flex" style="justify-content: center">
                                        <view class="">
                                            <button class="resetBtn" style="font-weight: 400" @click.stop="reset" data-type="1">重置</button>
                                        </view>
                                        <view class="">
                                            <button type="primary" class="loginOut ysd-basebg-color" hover-class="thover" style="font-weight: 400" @click.stop="loginOut">
                                                确定
                                            </button>
                                        </view>
                                    </view>
                                </view>
                            </scroll-view>
                        </view>
                    </view>
                    <scroll-view
                        class="filterTag"
                        :scroll-x="true"
                        :scroll-y="false"
                        scroll-top="0"
                        scroll-left="0"
                        scroll-into-view=""
                        :scroll-with-animation="false"
                        enable-flex
                        :enable-back-to-top="false"
                        @scrolltoupper=""
                        @scrolltolower=""
                        @scroll=""
                        v-if="selectBrandList.length > 0 || selectJobList.length > 0"
                    >
                        <view :class="'brandTag ' + (selectBrandList.length > 0 && selectJobList.length > 0 ? 'hascontent' : '')" v-if="selectBrandList.length > 0">
                            <block v-for="(item, index) in selectBrandList" :key="index">
                                <view class="">{{ item.name }}</view>
                            </block>
                        </view>
                        <view class="specialTag" v-if="selectJobList.length > 0">
                            <block v-for="(item, index) in selectJobList" :key="index">
                                <view class="">{{ item.name }}</view>
                            </block>
                        </view>
                    </scroll-view>
                </view>
            </view>

            <!-- 标准列表 -->
            <block v-if="toped == 1">
                <scroll-view
                    :scroll-y="whichOneShow == ''"
                    :enable-back-to-top="true"
                    @scrolltolower="onScrollToLower"
                    @refresherrefresh="onScrollRefresh"
                    refresher-enabled
                    :refresher-triggered="isTrigger"
                    class="jobCenterActive"
                    :scroll-with-animation="true"
                    :scroll-into-view="siv"
                    :style="'height:calc(100vh - ' + (navigatorHeight + 134) + 'px);margin-top:' + (statusBarHeight + (navigationBarHeight - menuButtonHeight) / 2 + 146) + 'px'"
                >
                    <!-- <view class="banner" style="display: none">
        <swiper indicator-dots="{{true}}" autoplay="{{true}}" loop="{{true}}" interval="2000" duration="500" class="innerSwiper" circular style="width: calc(100vw - 20px); height: calc(100vw / 3 - 21px / 3)" indicator-color="rgba(255,255,255,0.3)" indicator-active-color="#ffffff">
          <block wx:for="{{background}}" wx:key="*this">
            <swiper-item>
              <view class="swiper-item">
                <navigator url="/pages/specialArea/index?id=608" hover-class="none">
                  <image src="{{item}}" style="width: calc(100vw - 20px); height: calc(100vw / 3 - 20px / 3)"></image>
                </navigator>
              </view>
            </swiper-item>
          </block>
        </swiper>
      </view> -->
                    <!-- <view class="quickapply">
        <button class="text" size="mini" hover-class="none" catchgetphonenumber="getPhoneNumber" open-type="getPhoneNumber" catchtap="emptyMethod" hover-stop-propagation="false" wx:if="{{!isLogin}}">
          <view class="" hover-class="none" hover-stop-propagation="false" bindtap="changeRecordBillType" data-type="photo">
            <view class="info">
              <view>拍照报名</view>
              <view>快速报名</view>
            </view>
            <view class="t-icon t-icon-paizhao"></view>
          </view>
          <view class="" hover-class="none" hover-stop-propagation="false" bindtap="changeRecordBillType" data-type="record">
            <view class="info">
              <view>报名录单</view>
              <view>快速报名</view>
            </view>
            <view class="t-icon t-icon-ludan"></view>
          </view>
        </button>
        <button wx:else style="width: calc(100vw - 20px);">
          <view class="" hover-class="none" hover-stop-propagation="false" catchtap="chooseIdCard">
            <view class="info">
              <view>拍照报名</view>
              <view>快速报名</view>
            </view>
            <view class="t-icon t-icon-paizhao" />
          </view>
          <view class="" hover-class="none" hover-stop-propagation="false" catchtap="navigatorToRecord">
            <view class="info">
              <view>报名录单</view>
              <view>快速报名</view>
            </view>
            <view class="t-icon t-icon-ludan" />
          </view>
        </button>
      </view> -->
                    <!-- <view style="margin: 10px">
        <view class="p1612 display-flex bgf br8 spef">
          <view class="flex-1 tc" hover-class="thover" catchtap="toSpecialArea" data-id="608">
            <i class="t-icon t-icon-jinriretui" style="width: 48px; height: 48px"></i>
            <view class="stm">今日热推</view>
          </view>
          <view class="flex-1 tc" hover-class="thover" catchtap="toSpecialArea" data-id="602">
            <i class="t-icon t-icon-duanqigong" style="width: 48px; height: 48px"></i>
            <view class="stm">短期工</view>
          </view>
          <view class="flex-1 tc" hover-class="thover" catchtap="toSpecialArea" data-id="610">
            <i class="t-icon t-icon-hanjiagong" style="width: 48px; height: 48px"></i>
            <view class="stm">寒假工</view>
          </view>
          <view class="flex-1 tc" hover-class="thover" catchtap="toSpecialArea" data-id="603">
            <i class="t-icon t-icon-dalinggong" style="width: 48px; height: 48px"></i>
            <view class="stm">大龄工</view>
          </view>
        </view>
      </view> -->
                    <view :x:if="recordList != null && recordList.length > 0" class="" style="padding-top: 0; min-height: 100vh">
                        <view class="jcenter bgf br8">
                            <view class="listcontainer" style="border-top: 1px solid #f3f3f3">
                                <view
                                    class="jobOne"
                                    hover-start-time="50"
                                    hover-stay-time="0"
                                    :data-id="item.id"
                                    @tap="goDetail"
                                    :hover-class="item.recruitment == '1' ? 'ahover' : ''"
                                    :style="'background-color:' + (item.recruitment == '1' ? '#fff' : '#f5f5f5')"
                                    v-for="(item, index) in recordList"
                                    :key="index"
                                >
                                    <view class="p1020 jobIn" hover-class="none">
                                        <view class="display-flex">
                                            <view class="prImg">
                                                <image :src="item.logo" v-if="item.logo != null && item.logo != ''" mode="aspectFit" class="logoClass" alt=""></image>
                                                <image class="logoClass" v-else mode="aspectFit" src="https://matripe.oss-cn-beijing.aliyuncs.com/default.png"></image>
                                                <button
                                                    v-if="isLogin && hasUserInfo - 0 == 0"
                                                    :class="'collect v-center ' + (item.collected - 1 == 0 ? 'collectred' : '')"
                                                    open-type="getUserInfo"
                                                    style="width: 52px"
                                                    @tap="getUserInfoBtn"
                                                    data-type="4"
                                                    :data-collected="item.collected"
                                                    :data-jobid="item.id"
                                                    hover-stop-propagation
                                                >
                                                    <i class="iconfont icon-shoucang lh12" style="color: #888" v-if="item.collected - 2 == 0"></i>
                                                    <i class="iconfont icon-yishoucang lh12 ysd-base-color" style="" v-else></i>
                                                    <text :class="'f10  ' + (item.collected - 1 == 0 ? 'ysd-base-color' : 'c8')" style="line-height: 36px; margin-left: 2px">
                                                        {{ item.collected - 2 == 0 ? '收藏' : '已收藏' }}
                                                    </text>
                                                </button>
                                                <button
                                                    v-if="isLogin && hasUserInfo - 1 == 0"
                                                    :class="'collect v-center ' + (item.collected - 1 == 0 ? 'collectred' : '')"
                                                    @click.stop="collectPaste"
                                                    style="width: 52px"
                                                    :data-collected="item.collected"
                                                    :data-jobid="item.id"
                                                    hover-stop-propagation
                                                >
                                                    <i class="iconfont icon-shoucang lh12" style="color: #888" v-if="item.collected - 2 == 0"></i>
                                                    <i class="iconfont icon-yishoucang lh12 ysd-base-color" style="" v-else></i>
                                                    <text :class="'f10  ' + (item.collected - 1 == 0 ? 'ysd-base-color' : 'c8')" style="line-height: 12px; margin-left: 2px">
                                                        {{ item.collected - 2 == 0 ? '收藏' : '已收藏' }}
                                                    </text>
                                                </button>
                                                <button
                                                    v-if="!isLogin"
                                                    style="width: 52px"
                                                    class="collect"
                                                    open-type="getPhoneNumber"
                                                    @getphonenumber.stop.prevent="getPhoneNumber"
                                                    @click.stop="emptyMethod"
                                                    :data-collected="item.collected"
                                                    :data-jobid="item.id"
                                                    hover-stop-propagation
                                                >
                                                    <i class="iconfont icon-shoucang" style="color: #888"></i>
                                                    <text class="f10 c8" style="line-height: 18px; margin-left: 2px">收藏</text>
                                                </button>
                                            </view>
                                            <view class="flex-1 vsb">
                                                <view class="display-flex mt4">
                                                    <view class="storeName" v-if="item.jobName != null && item.jobName != ''">{{ item.jobName }}</view>
                                                    <view class="storeName" v-else>{{ item.aliasName }}</view>
                                                    <view class="hourPay">{{ item.salaryClassifyValue }}</view>
                                                </view>
                                                <view class="v-center mt12 mb12">
                                                    <view class="f14s c045 flex-1 display-flex">
                                                        <view class="overflowOmit" hover-class="none" :hover-stop-propagation="false" style="max-width: 220px">
                                                            {{ item.district == '' ? '' : item.district + ' | ' }}
                                                            <block v-if="item.distance != null && item.distance != '' && storeJobListSearchForm.sortTag == 2">
                                                                {{ item.distanceKm }}
                                                            </block>
                                                            <block v-else>{{ item.age }}</block>
                                                        </view>
                                                        <view class="fr f14s c633 fw400">{{ item.monthlyPay }}</view>
                                                    </view>
                                                </view>
                                                <view class="display-flex">
                                                    <view :class="'tttg ' + (item.isTagShow == true ? 'isTagShow' : '')">
                                                        <view class="t-icon t-icon-ziying1" v-if="item.signType == 1" style="background-repeat: no-repeat"></view>
                                                        <view class="tagsLi" v-for="(item1, index1) in item.jobSpecialLabelNameArray" :key="index1">{{ item1 }}</view>
                                                        <view class="tagsLi" v-if="item.jobSpecialLabelNameArray.length <= 0">暂无特色</view>
                                                    </view>
                                                    <view class="jobText bz f12">服务费: {{ item.fuWuFei ? item.fuWuFei : '-' }}</view>
                                                </view>
                                            </view>
                                        </view>
                                    </view>
                                </view>
                            </view>
                        </view>
                        <block v-if="(recordList == null || recordList.length == 0) && storeJobListSearchForm.keys != null && storeJobListSearchForm.keys != ''">
                            <view class="tc p20 f12 c045">没有符合条件的职位</view>
                        </block>
                        <block v-else>
                            <!-- <loading wx:if='{{loading}}' size='36px' className='inlineBlock'>
            加载中
          </loading> -->
                            <!-- <button wx:if="{{!isLogin}}" class="clickMore mb20" wx:if="{{!isLogin}}" open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber1" catchtap="emptyMethod">点击加载更多</button> -->
                            <block v-if="isLogin">
                                <view class="tc p20 f12 c045" v-if="!hasMoreData || recordList.length == 0">暂无更多数据</view>
                                <view class="tc p20 f12 c045" v-else>上滑加载更多</view>
                            </block>
                        </block>
                    </view>
                </scroll-view>
                <view v-if="recordList == null || (recordList.length == 0 && pageShow)" class="tc">
                    <view class="t-icon t-icon-zanwu" style="width: 80px; height: 80px; margin: 60px auto 20px"></view>
                    <view class="tc f14 c045">暂无记录</view>
                </view>
            </block>

            <!-- 简版列表 -->
            <block v-if="toped == 2">
                <view :x:if="recordList != null && recordList.length > 0" class="" style="padding-top: 0; min-height: 100vh">
                    <scroll-view
                        :scroll-y="whichOneShow == ''"
                        :enable-back-to-top="true"
                        @scrolltolower="onScrollToLower"
                        @refresherrefresh="onScrollRefresh"
                        refresher-enabled
                        :refresher-triggered="isTrigger"
                        class="jobCenterActive"
                        :scroll-with-animation="true"
                        :scroll-into-view="siv"
                        :style="
                            'height:calc(100vh - ' + (navigatorHeight + 134) + 'px);margin-top:' + (statusBarHeight + (navigationBarHeight - menuButtonHeight) / 2 + 146) + 'px'
                        "
                    >
                        <view :x:if="recordList != null && recordList.length > 0" class="" style="padding-top: 0; min-height: 100vh">
                            <view class="jcenter bgf br8">
                                <view class="listcontainer" style="border-top: 1px solid #f3f3f3">
                                    <view
                                        class="jobOne"
                                        hover-start-time="50"
                                        hover-stay-time="0"
                                        :data-item="item"
                                        :data-id="item.id"
                                        :data-index="index"
                                        @tap="goDrawer"
                                        hover-class="ahoverd"
                                        :style="'background-color:' + (item.recruitment == '1' ? '#fff' : '#f5f5f5') + ';padding: 0;'"
                                        v-for="(item, index) in recordList"
                                        :key="index"
                                    >
                                        <view class="jobIn" style="border-bottom: 1px dashed #cccccc; padding: 12px 0" hover-class="none">
                                            <view class="display-flex">
                                                <view class="lNum" style="width: 60px">{{ index < 9 ? '0' + (index + 1) : index + 1 }}</view>
                                                <view class="flex-1">
                                                    <view class="jobTitle2">{{ item.jobName }}</view>
                                                    <view class="jobText">{{ item.salaryClassifyValue }}，{{ item.age }}</view>
                                                </view>
                                                <view class="mt4">
                                                    <i
                                                        class="iconfont icon-yishoucang mt4"
                                                        v-if="item.collected - 1 == 0"
                                                        @click.stop="collectPaste($event, { collected: item.collected, jobid: item.id })"
                                                        :data-collected="item.collected"
                                                        :data-jobid="item.id"
                                                        style="margin-right: 12px; color: #ff4400; font-size: 18px"
                                                    ></i>
                                                    <i
                                                        class="iconfont icon-shoucang f20 mt4"
                                                        v-else
                                                        @click.stop="collectPaste($event, { collected: item.collected, jobid: item.id })"
                                                        :data-collected="item.collected"
                                                        :data-jobid="item.id"
                                                        style="margin-right: 13px"
                                                    ></i>
                                                </view>
                                            </view>
                                            <view class="display-flex">
                                                <view style="width: 60px; margin-right: 12px">
                                                    <view class="daili">代理</view>
                                                </view>
                                                <view class="flex-1">
                                                    <view class="jobText">{{ item.fuWuFei ? item.fuWuFei : '-' }}</view>
                                                </view>
                                            </view>
                                        </view>
                                    </view>
                                </view>
                            </view>
                        </view>

                        <block v-if="(recordList == null || recordList.length == 0) && storeJobListSearchForm.keys != null && storeJobListSearchForm.keys != ''">
                            <view class="tc p20 f12 c045">没有符合条件的职位</view>
                        </block>
                        <block v-else>
                            <!-- <loading wx:if='{{loading}}' size='36px' className='inlineBlock'>
            加载中
          </loading> -->
                            <!-- <button wx:if="{{!isLogin}}" class="clickMore mb20" wx:if="{{!isLogin}}" open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber1" catchtap="emptyMethod">点击加载更多</button> -->
                            <view class="tc p20 f12 c045" v-if="!hasMoreData || recordList.length == 0">暂无更多数据</view>
                            <view class="tc p20 f12 c045" v-else>上滑加载更多</view>
                        </block>
                    </scroll-view>
                </view>
                <view v-if="recordList == null || (recordList.length == 0 && pageShow)" class="tc">
                    <view class="t-icon t-icon-zanwu" style="width: 80px; height: 80px; margin: 60px auto 20px"></view>
                    <view class="tc f14 c045">暂无记录</view>
                </view>
                <view class="fixedNum">
                    <text class="f20">{{ currPage }}</text>
                    /{{ totalPage }}
                </view>
            </block>

            <scroll-view class="fadeIn" v-if="iosDialog1" style="position: relative; z-index: 999">
                <view class="weui-mask"></view>
                <view class="weui-dialog">
                    <view class="weui-dialog__hd">
                        <strong class="weui-dialog__title">登录后才能查看全部职位</strong>
                    </view>
                    <view class="weui-dialog__bd">
                        <view>现在登录吗?</view>
                    </view>
                    <view class="display-flex pb20">
                        <view class="flex-1 lflex v-center ysd-base-color" @tap="close" hover-class="thover">知道了</view>
                        <view class="rflex">
                            <button
                                class="login_now ysd-basebg-color"
                                type="primary"
                                open-type="getPhoneNumber"
                                @getphonenumber.stop.prevent="getPhoneNumber1"
                                hover-class="button-hover"
                                @click.stop="emptyMethod"
                            >
                                立即登录
                            </button>
                        </view>
                    </view>
                </view>
            </scroll-view>
            <scroll-view class="fadeIn" v-if="iosDialog2" style="position: relative; z-index: 999">
                <view class="weui-mask"></view>
                <view class="weui-dialog">
                    <view class="weui-dialog__hd">
                        <strong class="weui-dialog__title">请提供你的手机号</strong>
                    </view>
                    <view class="weui-dialog__bd">
                        <view>方便客服联系你，帮你推荐工作</view>
                    </view>
                    <view class="display-flex pb20 v-center">
                        <view class="flex-1 lflex p020" hover-class="thover">
                            <button open-type="getPhoneNumber" @getphonenumber.stop.prevent="getPhoneNumber1" @click.stop="emptyMethod" class="btnFlex" data-type="close">
                                好的
                            </button>
                        </view>
                    </view>
                </view>
            </scroll-view>
            <scroll-view class="fadeIn" v-if="phoneDialog" style="position: relative; z-index: 999">
                <view class="weui-mask"></view>
                <view class="weui-dialog p020" style="box-sizing: border-box">
                    <!-- <view class="weui-dialog__hd"><strong class="weui-dialog__title">{{pmdUserInfo.tel}}</strong></view> -->
                    <!-- <view class="weui-dialog__hd bb1">
            <view>
                <image wx:if="pmdUserInfo.imgSrc != ''" src="{{pmdUserInfo.imgSrc}}" style="width:56px;height:56px;border-radius:50%;"></image>
                <image wx:else src="http://matripe.oss-cn-beijing.aliyuncs.com/defaultAva.png" style="width:56px;height:56px;border-radius:50%;"></image>
            </view>
            <view class="f20 c3">{{pmdUserInfo.userName}}</view>
            <view class="f14 c9">客户经理</view>
            <view class="mt20 f22 c3">{{pmdUserInfo.tel}}</view>
        </view> -->
                    <view class="weui-dialog__hd bb1">
                        <!-- <image wx:if="pmdUserInfo.imgSrc != ''" src="{{pmdUserInfo.imgSrc}}" style="width:56px;height:56px;border-radius:50%;"></image> -->
                        <image src="http://matripe.oss-cn-beijing.aliyuncs.com/goodJob/bocaoLogo.png" style="width: 56px; height: 56px; border-radius: 50%"></image>
                        <view class="f20 c3">周耀锋</view>
                        <view class="f14 c9">专属客服</view>
                        <!-- <view class="mt20 f22 c3">{{pmdUserInfo.tel}}</view> -->
                        <view class="mt20 f22 c3">13937184434</view>
                    </view>
                    <view class="display-flex pb20" style="padding-top: 20px">
                        <view class="flex-1 lflex v-center" @tap="close" hover-class="thover">取消</view>
                        <view class="rflex">
                            <button class="" type="primary" @tap="makePhoneCall">呼叫</button>
                        </view>
                    </view>
                </view>
            </scroll-view>
        </view>
        <view class="drawerBox">
            <view :class="'drawerMask  ' + (drawerShow ? 'showDrawer' : '')" @tap="hideDrawer"></view>
            <view :class="'drawer ' + (drawerShow ? 'showDrawer' : '') + ' '">
                <view class="title display-flex bb1">
                    <span class="f18 fw500">{{ currentJobDrawer.jobName }}</span>
                    <i class="iconfont icon-guanbi f12 c3" style="line-height: 34px" @click="hideDrawer"></i>
                </view>
                <view class="content">
                    <view class="jobOne" hover-start-time="50" hover-stay-time="0" hover-class="ahoverd" style="padding: 0">
                        <view class="jobIn" style="border-bottom: 1px dashed #cccccc; padding: 12px 0" hover-class="none">
                            <view class="display-flex">
                                <view class="lNum" style="width: 60px">{{ currentJobDrawer.index < 9 ? '0' + (currentJobDrawer.index + 1) : currentJobDrawer.index + 1 }}</view>
                                <view class="flex-1">
                                    <view class="jobTitle2">{{ currentJobDrawer.jobName }}</view>
                                    <view class="jobText">{{ currentJobDrawer.salaryClassifyValue }}，{{ currentJobDrawer.age }}</view>
                                </view>
                                <view class="mt4">
                                    <i
                                        class="iconfont icon-yishoucang mt4"
                                        v-if="currentJobDrawer.collected - 1 == 0"
                                        @click.stop="collectPaste($event, { collected: currentJobDrawer.collected, jobid: currentJobDrawer.id })"
                                        :data-collected="currentJobDrawer.collected"
                                        :data-jobid="currentJobDrawer.id"
                                        style="margin-right: 12px; color: #ff4400; font-size: 18px"
                                    ></i>
                                    <i
                                        class="iconfont icon-shoucang f20 mt4"
                                        v-else
                                        @click.stop="collectPaste($event, { collected: currentJobDrawer.collected, jobid: currentJobDrawer.id })"
                                        :data-collected="currentJobDrawer.collected"
                                        :data-jobid="currentJobDrawer.id"
                                        style="margin-right: 13px"
                                    ></i>
                                </view>
                            </view>
                            <view class="display-flex">
                                <view style="width: 60px; margin-right: 12px">
                                    <view class="daili">代理</view>
                                </view>
                                <view class="flex-1">
                                    <view class="jobText">{{ currentJobDrawer.fuWuFei ? currentJobDrawer.fuWuFei : '-' }}</view>
                                </view>
                            </view>
                        </view>
                    </view>
                    <scroll-view :scroll-y="true" class="annunciate" style="white-space: pre-line">
                        <view class="info" hover-class="none" :hover-stop-propagation="false">
                            {{ currentJobDrawer.jobDesp }}
                        </view>
                    </scroll-view>
                    <view class="footer">
                        <span class="" @click="hideDrawer">
                            <view class="iconfont icon-xiala11 c9"></view>
                            <view class="f14" hover-class="none" :hover-stop-propagation="false">取消</view>
                        </span>
                        <span @click="copyClose">
                            <view class="iconfont icon-fuzhi c9"></view>
                            <view class="f14" hover-class="none" :hover-stop-propagation="false">复制</view>
                        </span>
                    </view>
                </view>
            </view>
        </view>
        <!-- <scroll-view class="fadeIn" wx:if="{{dialog1}}" style="position: fixed;z-index: 9999;">
  <view class="weui-mask" bindtap="close"></view>
  <view class="weui-half-screen-dialog">
    <view class="innerDia p1620">
      <view style="height: calc(75vh - 120px);overflow: auto;">

        <view class="f14 c3">薪资福利</view>
        <view class="mt10">
          <block wx:for="{{tagArray1}}" wx:for-item="item">
            <view bindtap='selectJobSpecialLabel' data-indexTag="1" data-index="{{index}}" class="bgAc {{item.checked ? 'active' : ''}}">{{item.name}}</view>
          </block>
        </view>
        <view class="f14 c3 mt10">食宿保障</view>
        <view class="mt10">
          <block wx:for="{{tagArray3}}" wx:for-item="item">
            <view bindtap='selectJobSpecialLabel' data-indexTag="3" data-index="{{index}}" class="bgAc {{item.checked ? 'active' : ''}}">{{item.name}}</view>
          </block>
        </view>
        <view class="f14 c3 mt10">班制特色</view>
        <view class="mt10">
          <block wx:for="{{tagArray0}}" wx:for-item="item">
            <view bindtap='selectJobSpecialLabel' data-indexTag="0" data-index="{{index}}" class="bgAc {{item.checked ? 'active' : ''}}">{{item.name}}</view>
          </block>
        </view>

        <view class="f14 c3 mt10">其它特色</view>
        <view class="mt10">
          <block wx:for="{{tagArray2}}" wx:for-item="item">
            <view bindtap='selectJobSpecialLabel' data-indexTag="2" data-index="{{index}}" class="bgAc {{item.checked ? 'active' : ''}}">{{item.name}}</view>
          </block>
        </view>


      </view>


      <view class="btmFix">
        <view class="display-flex">
          <view class="flex-1 pl20 pr10">
            <button class="resetBtn" style="font-weight:400;" catchtap="reset" data-type="1">
              重置
            </button>
          </view>
          <view class="flex-1 pl10 pr20">
            <button type='primary' class="loginOut ysd-basebg-color" hover-class="thover" style="font-weight:400;" catchtap="loginOut">
              确定
            </button>
          </view>
        </view>
      </view>

    </view>
  </view>
</scroll-view>

<scroll-view class="fadeIn" wx:if="{{dialog2}}" style="position: fixed;z-index: 9999;">
  <view class="weui-mask" bindtap="close"></view>
  <view class="weui-half-screen-dialog" style="height:60vh;">
    <view class="innerDia p1620">
      <view class="f14 c3">品牌</view>
      <view class="mt10">
        <block wx:for="{{brandList}}" wx:for-item="item">
          <view bindtap='selectBrand' data-index="{{index}}" class="bgAc {{item.checked ? 'active' : ''}}">{{item.name}}</view>
        </block>
      </view>

      <view class="btmFix">
        <view class="display-flex">
          <view class="flex-1 pl20 pr10">
            <button class="resetBtn" style="font-weight:400;" catchtap="reset" data-type="2">
              重置
            </button>
          </view>
          <view class="flex-1 pl10 pr20">
            <button type='primary' class="loginOut ysd-basebg-color" hover-class="thover" style="font-weight:400;" catchtap="loginOut">
              确定
            </button>
          </view>
        </view>
      </view>

    </view>
  </view>
</scroll-view> -->
    </view>
</template>

<script>
const app = getApp();
const commonUtil = require('../../utils/commonUtil.js');
export default {
    data() {
        return {
            toped: '2',
            chaShowed: false,
            isTrigger: false,

            // background: ["../../assets/images/banner1.jpg", "../../assets/images/banner2.jpg", "../../assets/images/banner3.jpg", "../../assets/images/banner4.jpg"],
            pullNum: 0,

            //下拉次数
            tabs: [],

            activeTab: 0,
            systemInfo: {},
            getMenuButtonBoundingClientRect: {},

            // 手机基础信息
            tabs2: [],

            loadMore: '',
            loadContent: ['马不停蹄加载更多数据中...', '-- 已经到底了，加不了咯 --'],
            statusBarHeight: uni.getStorageSync('statusBarHeight'),

            // 状态栏高度

            navigationBarHeight: uni.getStorageSync('navigationBarHeight'),

            // 导航栏高度

            menuButtonHeight: uni.getStorageSync('menuButtonHeight'),

            // 胶囊按钮高度

            menuButton: uni.getStorageSync('menuButtonInfo'),

            // 胶囊信息
            navigatorHeight: 60,

            activeTab2: 0,
            contentIndex: 0,
            latestClass: 0,
            zoneClass: 0,
            recordList: [],
            jobSpecialLabelNames: [],

            storeJobListSearchForm: {
                pageNum: 1,
                pageSize: 25,
                classify: 1,
                sex: -1,
                workTypeStr: '',
                lat: '',
                lng: '',
                jobClassify: '',
                sortTag: 0,
                jobSpecialLabelIds: '',
                cityName: '',
                brandIds: '',
                ucj: 1,
                keys: ''
            },

            loading: true,
            topJobList: [],
            hasLocation: false,
            chooseActive: false,

            //筛选是否高亮
            labelItems: [],

            checkedlabelItems: [],
            hasMoreData: true,

            //下拉是否还有更多数据
            inputShowed: false,

            inputVal: '搜索工作',
            wxCode: '',
            isCollect: false,
            collectTxt: '收藏',
            isLogin: false,
            hasUserInfo: 0,

            searchCityParamStorage: {
                name: '',
                shortName: ''
            },

            iosDialog1: false,
            iosDialog2: false,
            phoneDialog: false,
            triggered: false,
            pageShow: false,
            whichOneShow: '',
            siv: '',
            activez: '',
            sexid: '',

            // 性别筛选的id
            dialog1: false,

            dialog2: false,
            jobSpecialLabelList: [],
            brandList: [],
            firstMenu: '排序',

            // 工价筛选tab显示
            secondMenu: '性别',

            // 性别筛选tab显示
            selectBrandList: [],

            // 选中的品牌标签
            selectJobList: [],

            // 选中的特色标签
            tagArray0: [],

            tagArray1: [],
            tagArray2: [],
            tagArray3: [],
            recordBillType: '',

            // 报名类型(拍照或者直接报名)
            signType: 0,

            // 职位类型(自营 三方)
            recordCount: 0,

            totalPage: 0,
            currPage: 0,

            currentJobDrawer: {
                jobName: '',
                index: 0,
                salaryClassifyValue: '',
                age: '',
                collected: 0,
                id: '',
                fuWuFei: false,
                jobDesp: ''
            },

            // 当前简版职位抽屉信息
            // 简版职位抽屉显隐
            drawerShow: false,

            age: false
        };
    },
    onLoad(options) {
        var that = this;
        console.log(123);
        console.log(options);
        console.log(uni.getStorageSync('navigationBarHeight'));
        console.log(uni.getStorageSync('statusBarHeight'));
        console.log(that.menuButton);
        // let query = wx.createSelectorQuery()
        // console.log(query.select('#searchBar'));

        this.getListByTypeAndIndustry();
        this.getBrandNameAllList();

        // 查看是否授权
        uni.getSetting({
            success(res) {
                if (res.authSetting['scope.userInfo']) {
                    // 已经授权，可以直接调用 getUserInfo 获取头像昵称
                    uni.getUserInfo({
                        success: function (res) {
                            console.log(res.userInfo);
                        }
                    });
                }
            }
        });
        if (app.globalData.isNotEmptyCheck(options.fromSearchPage) && options.fromSearchPage == 1) {
            try {
                var searchCityParamStorage = uni.getStorageSync('searchCityParamStorage');
                if (searchCityParamStorage) {
                    console.log('searchCityParamStorage======', searchCityParamStorage);
                    that.storeJobListSearchForm.cityName = searchCityParamStorage.name;
                    if (app.globalData.isEmptyCheck(searchCityParamStorage.name)) {
                        that.storeJobListSearchForm.cityName = '全国';
                    }
                    that.setData({
                        searchCityParamStorage: searchCityParamStorage
                    });
                }
            } catch (e) {
                console.log('CatchClause', e);
                console.log('CatchClause', e);
                console.log('获取缓存设置的查询职位列表参数错误：', e);
            }
        } else {
            try {
                uni.removeStorageSync('searchJobListParamStorage');
            } catch (e) {
                console.log('CatchClause', e);
                console.log('CatchClause', e);
                console.log('删除缓存设置的查询职位列表参数错误：', e);
            }
            try {
                uni.removeStorageSync('searchCityParamStorage');
            } catch (e) {
                console.log('CatchClause', e);
                console.log('CatchClause', e);
                console.log('删除缓存设置的查询职位列表参数错误：', e);
            }
        }
        try {
            if (app.globalData.isScanQRCodes - 1 == 0) {
                uni.showToast({
                    title: '欢迎查看好工作',
                    icon: 'success',
                    duration: 2000
                });
                if (!getApp().globalData.isLogin) {
                    setTimeout(function () {
                        if (!getApp().globalData.isLogin) {
                            that.openIOS2();
                        }
                    }, 5000);
                }
            }
        } catch (e) {
            console.log('CatchClause', e);
            console.log('CatchClause', e);
            console.log('获取缓存设置的查询职位列表参数错误：', e);
        }
        console.log('options==============================1');
        console.log(options);
        console.log('options==============================2');
        if (app.globalData.isNotEmptyCheck(options.scene)) {
            //扫小程序码携带参数
            var sceneStr = decodeURIComponent(options.scene);
            var sceneJson = commonUtil.sceneToJson(sceneStr);
            console.log('sceneJson===', sceneJson);
            if (sceneJson.fromType == 1) {
                app.globalData.isCommission = 1;
                uni.setStorageSync('storageSyncAgencyUserId', sceneJson.userId);
            }

            //先设置代理人缓存人再登录
            app.globalData.getLoginUserTokenInfo();
        } else if (app.globalData.isNotEmptyCheck(options.fromType)) {
            //扫小程序普通二维码携带参数-来源ID
            console.log('options.fromType========' + options.fromType);
            if (options.fromType == 0) {
                console.log('options.id========' + options.id);
                console.log('options.userId========' + options.userId);
                try {
                    app.globalData.isCommission = 1;
                    uni.setStorageSync('fromQrCodeChannelContactId', options.id);
                    that.getAgencyUserId(options.id);
                } catch (e) {
                    console.log('CatchClause', e);
                    console.log('CatchClause', e);
                    console.log('0-扫描微信二维码，设置参数错误：', e);
                }
            } else if (options.fromType.indexOf('0&id=') >= 0) {
                //兼容2021-9-9之前的二维码
                var paramsTempId = options.fromType.replace('0&id=', '');
                console.log('&paramsTempId========' + paramsTempId);
                try {
                    app.globalData.isCommission = 1;
                    uni.setStorageSync('fromQrCodeChannelContactId', paramsTempId);
                    that.getAgencyUserId(paramsTempId);
                } catch (e) {
                    console.log('CatchClause', e);
                    console.log('CatchClause', e);
                    console.log('0-扫描微信二维码，设置参数错误：', e);
                }
            } else {
                //兼容2021-9-9之前的二维码
                var paramsTempId = options.fromType.replace('0,id=', '');
                console.log('=paramsTempId========' + paramsTempId);
                try {
                    app.globalData.isCommission = 1;
                    uni.setStorageSync('fromQrCodeChannelContactId', paramsTempId);
                    that.getAgencyUserId(paramsTempId);
                } catch (e) {
                    console.log('CatchClause', e);
                    console.log('CatchClause', e);
                    console.log('0-扫描微信二维码，设置参数错误：', e);
                }
            }
        } else {
            console.log('options.fromType===else=====' + options);
        }

        //this.wxLogin();
        let res = uni.getStorageSync('storeJobId'); //详情页返回
        console.log(res);
        if (app.globalData.isEmptyCheck(res.data)) {
            this.setData({
                recordList: []
            });
        } else {
            uni.removeStorageSync({
                key: 'storeJobId'
            });
        }
        console.log('on show');

        //登录=================================start
        if (app.globalData.isLogin) {
            this.setData({
                isLogin: app.globalData.isLogin,
                hasUserInfo: app.globalData.hasUserInfo
            });
        } else {
            // 由于 userLogin 是网络请求，可能会在 Page.onLoad 之后才返回
            // 所以此处加入 callback 以防止这种情况
            app.globalData.userLoginCallback = (res) => {
                this.setData({
                    isLogin: app.globalData.isLogin,
                    hasUserInfo: app.globalData.hasUserInfo
                });
            };
        }
        //登录=================================end

        this.getHopeJobLabels();
        let agencyUserId = options.agencyUserId;
        if (agencyUserId) {
            uni.setStorageSync('storageSyncAgencyUserId', agencyUserId);
            console.log('agencyUserId', agencyUserId);
            app.globalData.isCommission = 1;
        }
        // that.getJobList();
    },
    onReady() {},
    onShow() {
        let that = this;
        that.storeJobListSearchForm.pageNum = 1;
        this.setData({
            storeJobListSearchForm: that.storeJobListSearchForm,
            isLogin: app.globalData.isLogin,
            iosDialog2: app.globalData.isLogin ? false : that.iosDialog2,
            recordBillType: ''
        });
        // that.getJobList();
        if (!app.globalData.isLogin) {
            uni.setStorageSync('comeFromPage', 'collect');
            uni.redirectTo({
                url: '/pages/login/index'
            });
        } else {
            this.collectedStoreJobList();
        }
        console.log(app.globalData.headers);
        that.setData({
            recordList: []
        });
        this.getJobList();
        uni.removeStorage({
            key: 'townsManInfo'
        });
        uni.removeStorage({
            key: 'townsManInfoJob'
        });

        /*this.wxLogin();
        let res = wx.getStorageSync({
            key: "storeJobId"
        }); //详情页返回
         if (app.isEmptyCheck(res.data)) {
            this.setData({
                recordList: []
            });
        } else {
            wx.removeStorageSync({
                key: "storeJobId"
            });
        }
         console.log("on show");
        this.getHopeJobLabels();
        var reset = true;*/
    },
    methods: {
        // onPullDownRefresh:function(){
        // 	 this.getJobList();
        //      console.log(123);

        // 	wx.stopPullDownRefresh({
        // 		success() {
        // 			app.refreshSuccess();
        // 		}
        // 	});
        // },
        close() {
            let that = this;
            let brandList = that.brandList;
            let selectBrandList = that.selectBrandList;
            if (selectBrandList.length > 0) {
                for (let i = 0; i < brandList.length; i++) {
                    console.log('level1');
                    for (let j = 0; j < selectBrandList.length; j++) {
                        console.log('level2');
                        if (brandList[i].id == selectBrandList[j].id) {
                            return (brandList[i].checked = true);
                        } else {
                            brandList[i].checked = false;
                        }
                    }
                }
            } else {
                brandList.forEach((item) => {
                    item.checked = false;
                });
            }
            return brandList;
        },

        closeFix: function () {
            var that = this;
            // let brandList = 	that.close()
            // that.data.brandList.forEach((item) => {
            // 	if (that.data.selectBrandList.length > 0) {
            // 		that.data.selectBrandList.forEach((item1) => {
            // 			if (item.id != item1.id) {
            // 				console.log("isSame");
            // 				item.checked = false;
            // 				console.log(item.checked);
            // 			} else {
            // 				item.checked = true;
            // 			}
            // 		});
            // 	} else {
            // 		item.checked = false;
            // 	}
            // });
            // console.log(that.data.brandList);
            // console.log(that.data.selectBrandList);
            console.log('isout');
            setTimeout(() => {
                that.setData({
                    whichOneShow: '',
                    siv: ''
                });
                console.log(this.whichOneShow);
                console.log('112233');
            }, 1);
        },

        touchStart(e) {
            // console.log("滚起来", e);
            // this.setData({
            //   scrollStop: false
            // })
            this.setData({
                // whichOneShow: mark,
                siv: ''
            });
        },

        choosenTop(e) {
            var that = this;
            let id = e.currentTarget.dataset.id;
            console.log(id);
            that.setData({
                toped: id
            });
        },

        chooseNl: function (e) {
            var that = this;
            console.log(e);
            let mark = '';
            let type = e.target.dataset.type;
            let whichOneShow = that.whichOneShow;
            if (type == 'gj') {
                if (whichOneShow == 'gj') {
                    mark = '';
                } else {
                    mark = 'gj';
                }
            } else if (type == 'sex') {
                if (whichOneShow == 'sex') {
                    mark = '';
                } else {
                    mark = 'sex';
                }
            } else if (type == 'brand') {
                if (whichOneShow == 'brand') {
                    mark = '';
                } else {
                    mark = 'brand';
                }
            } else if (type == 'special') {
                if (whichOneShow == 'special') {
                    mark = '';
                } else {
                    mark = 'special';
                }
            }
            if (that.siv != 'menu') {
                setTimeout(() => {
                    that.setData({
                        whichOneShow: mark
                        // siv:'menu'
                    });
                    console.log(this.whichOneShow);
                }, 300);
                that.setData({
                    siv: 'menu'
                });
            }
        },

        toSpecialArea: function (e) {
            var id = e.currentTarget.dataset.id;
            uni.navigateTo({
                url: '../specialArea/index?id=' + id
            });
        },

        chooseM: function (e) {
            var str = e.currentTarget.dataset.id;
            console.log(str);
            var that = this;
            if (str == 'all') {
                that.storeJobListSearchForm.sortTag = 0;
                that.setData({
                    firstMenu: '排序',
                    // storeJobListSearchForm: tha  t.data.storeJobListSearchForm,
                    recordList: []
                });
                that.getJobList().then(() => {
                    that.setData({
                        siv: 'menu'
                    });
                });
            } else if (str == 'zuijin') {
                //距离最近
                if (that.storeJobListSearchForm.lng && that.storeJobListSearchForm.lat) {
                    that.storeJobListSearchForm.sortTag = 2;
                    that.setData({
                        firstMenu: '距离',
                        // storeJobListSearchForm: tha  t.data.storeJobListSearchForm,
                        recordList: []
                    });
                    that.getJobList().then(() => {
                        that.setData({
                            siv: 'menu'
                        });
                    });
                } else {
                    uni.getLocation({
                        type: 'gcj02',
                        success(res1) {
                            console.log('获取位置1');
                            app.globalData.lng = res1.longitude;
                            app.globalData.lat = res1.latitude;
                            that.storeJobListSearchForm.lng = res1.longitude;
                            that.storeJobListSearchForm.lat = res1.latitude;
                            that.storeJobListSearchForm.sortTag = 2;
                            that.storeJobListSearchForm.pageNum = 1;
                            that.setData({
                                firstMenu: '距离',
                                storeJobListSearchForm: that.storeJobListSearchForm,
                                recordList: []
                            });
                            that.getJobList().then(() => {
                                that.setData({
                                    siv: 'menu'
                                });
                            });
                            // var promise = new Promise(function(resolve,reject){
                            //     that.getJobList();
                            // });
                        },
                        fail() {
                            console.log('获取位置失败，打开位置设置界面');
                            // wx.openSetting({
                            // 	success(res) {
                            // 		console.log(res.authSetting);
                            // 		if (res.authSetting["scope.userLocation"]) {
                            // 			wx.getLocation({
                            // 				type: "gcj02",
                            // 				success(res1) {
                            // 					console.log("获取位置2");
                            // 					console.log(res1);
                            // 					app.globalData.lng = res1.longitude;
                            // 					app.globalData.lat = res1.latitude;

                            // 					that.data.storeJobListSearchForm.sortTag = 2;
                            // 					that.data.storeJobListSearchForm.lng = res1.longitude;
                            // 					that.data.storeJobListSearchForm.lat = res1.latitude;
                            // 					that.data.storeJobListSearchForm.pageNum = 1;
                            // 					that.setData({
                            // 						storeJobListSearchForm: that.data.storeJobListSearchForm,
                            // 						recordList: [],
                            // 					});
                            // 					that.getJobList().then(() => {
                            // 						that.setData({
                            // 							siv: "menu",
                            // 						});
                            // 					});
                            // 				},
                            // 				fail() {},
                            // 			});
                            // 		}
                            // 	},
                            // });
                        }
                    });
                }
            } else if (str == 'zuigao') {
                //工价最高
                that.storeJobListSearchForm.sortTag = 1;
                that.storeJobListSearchForm.pageNum = 1;
                that.setData({
                    storeJobListSearchForm: that.storeJobListSearchForm,
                    firstMenu: '工价',
                    recordList: []
                });
                that.getJobList().then(() => {
                    that.setData({
                        siv: 'menu'
                    });
                });
            }
            that.setData({
                activez: str
            });
        },

        watch() {},

        choosen: function (e) {
            var str = e.currentTarget.dataset.id;
            // var ageStr = e.currentTarget.dataset.str;
            console.log(str);
            var that = this;
            if (that.sexid == str) {
                str = '';
                this.secondMenu = '不限';
            } else if (str == '1') {
                this.secondMenu = '男';
            } else if (str == '2') {
                this.secondMenu = '女';
            } else if (str == '-1') {
                this.secondMenu = '不限';
            }
            that.setData({
                sexid: str,
                secondMenu: this.secondMenu
            });
            that.storeJobListSearchForm.pageNum = 1;
            that.storeJobListSearchForm.sex = str;
            that.setData({
                storeJobListSearchForm: that.storeJobListSearchForm,
                recordList: []
            });
            that.getJobList().then(() => {
                that.setData({
                    siv: 'menu'
                });
            });
        },

        onScrollRefresh: function () {
            var that = this;
            that.storeJobListSearchForm.pageNum = 1;
            that.setData({
                recordList: []
            });
            that.getJobList();

            // setTimeout(function(){
            //   that.setData({
            //     recordList: [],: false,
            //   })
            // },2000);
        },

        cc: function () {},

        close: function () {
            this.setData({
                dialog1: false,
                dialog2: false,
                iosDialog1: false,
                iosDialog2: false,
                phoneDialog: false
            });
        },

        openIOS1: function () {
            this.setData({
                iosDialog1: true
            });
        },

        openIOS2: function () {
            this.setData({
                iosDialog2: true
            });
        },

        showphone: function () {
            this.setData({
                phoneDialog: true
            });
        },

        searchKey: function (e) {
            console.log(e);
            this.recordList = [];
            this.storeJobListSearchForm.pageNum = 1;
            this.storeJobListSearchForm.keys = this.inputVal;
            this.getJobList();
        },

        showInput: function () {
            this.setData({
                inputShowed: true
            });
        },

        hideInput: function () {
            this.setData({
                inputVal: '',
                inputShowed: false
            });
        },

        onShareAppMessage1: function () {
            var path = commonUtil.getCurrentPageUrlWithArgs();
            if (app.globalData.isLogin && app.globalData.agencyStatus - 0 != 0) {
                //当前用户是代理人
                path += (path.indexOf('?') >= 0 ? '&' : '?') + 'agencyUserId=' + app.globalData.loginUserInfo.id;
            }
            console.log(path);
            return {
                title: '伯才',
                path: path
            };
        },

        goSearch() {
            uni.navigateTo({
                url: '../search/index?from=project'
            });
        },

        clearInput: function () {
            this.setData({
                inputVal: '搜索工作',
                chaShowed: false,
                inputShowed: false,
                hasMoreData: true
            });
            this.inputBlur();
            this.recordList = [];
            this.storeJobListSearchForm.pageNum = 1;
            this.storeJobListSearchForm.keys = '';
            this.getJobList();
        },

        inputTyping: function (e) {
            this.setData({
                inputVal: e.detail.value
            });
            console.log(this.inputVal == '');
            if (this.inputVal == '') {
                this.recordList = [];
                this.storeJobListSearchForm.pageNum = 1;
                this.storeJobListSearchForm.keys = '';
                this.getJobList();
            }
        },

        clear() {
            uni.clearStorage();
            console.log('清除成功');
        },

        inputBlur() {},

        getListByTypeAndIndustry: function () {
            var that = this;
            uni.request({
                url: app.globalData.ip + '/labels/getListByTypeAndIndustry',
                data: {
                    type: 90,
                    industry: 2
                },
                header: app.globalData.header,
                method: 'GET',
                success: function (res) {
                    console.log(res.data.data);
                    // that.setData({
                    // 	tagArray0: [],
                    // 	tagArray1: [],
                    // 	tagArray2: [],
                    // 	tagArray3: [],
                    // });
                    res.data.data.forEach((item) => {
                        if (item.typeClassify == '0') {
                            that.tagArray0.push(item);
                        } else if (item.typeClassify == '1') {
                            that.tagArray1.push(item);
                        } else if (item.typeClassify == '2') {
                            that.tagArray2.push(item);
                        } else if (item.typeClassify == '3') {
                            that.tagArray3.push(item);
                        }
                    });
                    that.setData({
                        tagArray0: that.tagArray0,
                        tagArray1: that.tagArray1,
                        tagArray2: that.tagArray2,
                        tagArray3: that.tagArray3
                    });
                    var jobSpecialLabelIdArray = that.storeJobListSearchForm.jobSpecialLabelIds.split(',');
                    res.data.data.forEach((item) => {
                        item['checked'] = false;
                        jobSpecialLabelIdArray.forEach((item1) => {
                            if (item.id == item1) {
                                item['checked'] = true;
                            }
                        });
                    });
                    that.setData({
                        jobSpecialLabelList: res.data.data
                    });
                }
            });
        },

        getBrandNameAllList: function () {
            var that = this;
            uni.request({
                url: app.globalData.ip + '/brand/getBrandNameAllList',
                data: {},
                header: app.globalData.header,
                method: 'GET',
                success: function (res) {
                    console.log(res);
                    var brandIdArray = that.storeJobListSearchForm.brandIds.split(',');
                    res.data.data.forEach((item) => {
                        item['checked'] = false;
                        brandIdArray.forEach((item1) => {
                            if (item.id == item1) {
                                item['checked'] = true;
                            }
                        });
                    });
                    that.setData({
                        brandList: res.data.data
                    });
                }
            });
        },

        selectJobSpecialLabel: function (e) {
            var that = this;
            var index = e.currentTarget.dataset.index;
            var indexTag = e.currentTarget.dataset.indextag;
            console.log(e);
            // debugger;
            if (indexTag == '0') {
                if (that.tagArray0[index].checked) {
                    that.tagArray0[index].checked = false;
                    // index1 = that.data.selectJobList.indexOf(that.data.tagArray0[index]);
                    // that.data.selectJobList.splice(index1, 1);
                } else {
                    that.tagArray0[index].checked = true;
                    // that.data.selectJobList.push(that.data.tagArray0[index]);
                }
                this.setData({
                    tagArray0: that.tagArray0
                });
            } else if (indexTag == '1') {
                if (that.tagArray1[index].checked) {
                    that.tagArray1[index].checked = false;
                    // index1 = that.data.selectJobList.indexOf(that.data.tagArray1[index]);
                    // that.data.selectJobList.splice(index1, 1);
                } else {
                    that.tagArray1[index].checked = true;
                    // that.data.selectJobList.push(that.data.tagArray1[index]);
                }
                this.setData({
                    tagArray1: that.tagArray1
                });
            } else if (indexTag == '2') {
                if (that.tagArray2[index].checked) {
                    that.tagArray2[index].checked = false;
                    // index1 = that.data.selectJobList.indexOf(that.data.tagArray2[index]);
                    // that.data.selectJobList.splice(index1, 1);
                } else {
                    that.tagArray2[index].checked = true;
                    // that.data.selectJobList.push(that.data.tagArray2[index]);
                }
                this.setData({
                    tagArray2: that.tagArray2
                });
            } else if (indexTag == '3') {
                if (that.tagArray3[index].checked) {
                    that.tagArray3[index].checked = false;
                    // index1 = that.data.selectJobList.indexOf(that.data.tagArray3[index]);
                    // that.data.selectJobList.splice(index1, 1);
                } else {
                    that.tagArray3[index].checked = true;
                    // that.data.selectJobList.push(that.data.tagArray3[index]);
                }
                this.setData({
                    tagArray3: that.tagArray3
                });
            }
            this.setData({
                selectJobList: that.selectJobList
            });
            // jobSpecialLabelList

            // if(that.data.jobSpecialLabelList[index].checked) {
            //   that.data.jobSpecialLabelList[index].checked = false;
            // } else {
            //   that.data.jobSpecialLabelList[index].checked = true;
            // }
            // this.setData({
            //   jobSpecialLabelList: that.data.jobSpecialLabelList
            // });
        },

        selectBrand: function (e) {
            var that = this;
            var index = e.currentTarget.dataset.index;
            if (that.brandList[index].checked) {
                that.brandList[index].checked = false;
                //  let index1 =  that.data.selectBrandList.indexOf(that.data.brandList[index])
                //   that.data.selectBrandList.splice(index1,1)
            } else {
                that.brandList[index].checked = true;
            }
            console.log(that.selectBrandList);
            this.setData({
                brandList: that.brandList
            });
        },

        reset: function (e) {
            var that = this;
            console.log(e);
            if (e.target.dataset.type == 1) {
                //特色
                that.jobSpecialLabelList.forEach((item) => {
                    // console.log(item);
                    if (item.checked) {
                        item.checked = false;
                    }
                });
                that.setData({
                    jobSpecialLabelList: that.jobSpecialLabelList,
                    tagArray0: that.tagArray0,
                    tagArray1: that.tagArray1,
                    tagArray2: that.tagArray2,
                    tagArray3: that.tagArray3,
                    selectJobList: [],
                    whichOneShow: ''
                });
                that.storeJobListSearchForm.jobSpecialLabelIds = '';
            } else if (e.target.dataset.type == 2) {
                //品牌
                that.brandList.forEach((item) => {
                    if (item.checked) {
                        item.checked = false;
                    }
                });
                that.setData({
                    brandList: that.brandList,
                    selectBrandList: [],
                    whichOneShow: ''
                });
                that.storeJobListSearchForm.brandIds = '';
            }
            that.storeJobListSearchForm.pageNum = 1;
            that.getJobList();
        },

        loginOut: function () {
            var that = this;
            var jobSpecialLabelIdArray = [];
            that.jobSpecialLabelList.forEach((item) => {
                if (item.checked) {
                    jobSpecialLabelIdArray.push(item.id);
                }
            });
            if (jobSpecialLabelIdArray.length > 0) {
                that.storeJobListSearchForm.jobSpecialLabelIds = jobSpecialLabelIdArray.join(',');
            } else {
                that.storeJobListSearchForm.jobSpecialLabelIds = '';
            }
            var brandIdArray = [];
            that.selectBrandList = [];
            that.brandList.forEach((item) => {
                if (item.checked) {
                    if (that.selectBrandList.indexOf(item) == -1) {
                        that.selectBrandList.push(item);
                    }
                    brandIdArray.push(item.id);
                }
            });
            that.selectJobList = [];
            let jobList = that.tagArray0.concat(that.tagArray1, that.tagArray2, that.tagArray3);
            jobList.forEach((item) => {
                if (item.checked) {
                    if (that.selectJobList.indexOf(item) == -1) {
                        that.selectJobList.push(item);
                    }
                }
            });
            if (brandIdArray.length > 0) {
                that.storeJobListSearchForm.brandIds = brandIdArray.join(',');
            } else {
                that.storeJobListSearchForm.brandIds = '';
            }
            that.storeJobListSearchForm.pageNum = 1;
            that.setData({
                recordList: [],
                siv: '',
                whichOneShow: '',
                selectBrandList: that.selectBrandList,
                selectJobList: that.selectJobList
            });
            that.getJobList();
        },

        onTabClick(e) {
            const index = e.detail.index;
            this.setData({
                activeTab: index
            });
        },

        onChange(e) {
            const index = e.detail.index;
            this.setData({
                activeTab: index
            });
        },

        findLocation() {
            var that = this;
            uni.getLocation({
                type: 'gcj02',
                success(res1) {
                    console.log('获取位置2');
                    console.log(res1);
                    app.globalData.lng = res1.longitude;
                    app.globalData.lat = res1.latitude;
                },
                fail() {}
            });
        },

        emptyMethod(e) {
            console.log(e);
        },

        chooseIdCard() {
            var that = this;
            uni.chooseImage({
                count: 1,
                sizeType: ['original', 'compressed'],
                sourceType: ['album', 'camera'],
                success(res) {
                    console.log(res);
                    uni.navigateTo({
                        url: `../newEnroll/enroll/index?applyType=1&imgUrl=${JSON.stringify(res)}`
                    });
                    // that.uploadIdcardImg(res);
                }
            });
        },

        navigatorToRecord() {
            uni.navigateTo({
                url: `../newEnroll/enroll/index?applyType=1`
            });
        },

        collectedStoreJobList() {
            var that = this;
            uni.request({
                url: app.globalData.ip + '/store/job/collected/list?ucj=1',
                method: 'GET',
                data: {},
                header: app.globalData.headers,
                success: function (res) {
                    console.log(res);
                    let collectList = res.data.data.recordList;
                    let jobs = that.recordList;
                    if (
                        collectList != null &&
                        collectList != '' &&
                        collectList != undefined &&
                        collectList.length != 0 &&
                        jobs != null &&
                        jobs != '' &&
                        jobs != undefined &&
                        jobs.length != 0
                    ) {
                        for (var j = 0; j != jobs.length; ++j) {
                            jobs[j].collected = 2;
                        }
                        for (var i = 0; i != collectList.length; ++i) {
                            for (var j = 0; j != jobs.length; ++j) {
                                if (collectList[i].storeJobId - jobs[j].id == 0) {
                                    jobs[j].collected = 1;
                                    break;
                                }
                            }
                        }
                        that.setData({
                            recordList: jobs
                        });
                    }
                },
                fail: function (res) {}
            });
        },

        getHopeJobLabels() {
            var that = this;
            uni.request({
                url: app.globalData.ip + '/labels/findAllHopeJobLabels',
                // ?category=4
                method: 'GET',
                data: {},
                success: function (res0) {
                    console.log('感兴趣职位 ↓↓↓');
                    console.log(res0);
                    if (res0.data.data != null) {
                        res0.data.data.forEach((item, index) => {
                            item['title'] = item.name;
                            item['checked'] = false;
                            if (index == 0 || index == 1) {
                                item['checked'] = true;
                            }
                        });
                    }
                    that.setData({
                        labelItems: res0.data.data == null ? [] : res0.data.data
                    });
                    that.initData();
                    console.log('感兴趣职位 赋值title↓↓↓');
                    console.log(res0);
                },
                fail: function (res) {
                    console.log(res);
                    uni.showToast({
                        title: '获取失败',
                        icon: 'none',
                        duration: 2000
                    });
                }
            });
        },

        makePhoneCall() {
            var that = this;
            uni.makePhoneCall({
                phoneNumber: '13937184434'
            });
        },

        goScreen() {
            uni.navigateTo({
                url: '../screen/index'
            });
        },

        goCity() {
            console.log('gocity');
            uni.navigateTo({
                url: '../city/index'
            });
        },

        initData() {
            var that = this;
            try {
                // 获取手机基础信息(头状态栏和标题栏高度)
                let systemInfo = uni.getSystemInfoSync();
                let getMenuButtonBoundingClientRect = uni.getMenuButtonBoundingClientRect();
                console.log(uni.getMenuButtonBoundingClientRect());
                this.setData({
                    systemInfo,
                    getMenuButtonBoundingClientRect
                });
            } catch (e) {
                console.log('CatchClause', e);
                console.log('CatchClause', e);
                console.log(e);
                uni.alert({
                    title: '温馨提示',
                    content: 'onLoad 执行异常'
                });
            }
            let res0 = uni.getStorageSync('checkedlabelItems');
            console.log(app.globalData.isNotEmptyCheck(res0.data));
            that.tabs2 = [
                {
                    name: '打勾推荐',
                    category: -1,
                    id: 406,
                    checked: true,
                    title: '打勾推荐'
                }
            ];
            if (app.globalData.isNotEmptyCheck(res0.data)) {
                for (var i = 0; i < res0.data.length; i++) {
                    res0.data[i]['title'] = res0.data[i].name;
                    // that.data.tabs2.push(res0.data[i]);
                }
                console.log('获取缓存'); // res0.data.unshift();
                // console.log(res.data.unshift({name: "打勾推荐", category: 3, id: 406, checked: true, title: "打勾推荐"}));
            } else {
                console.log('无感兴趣职位 push两个职位 ↓↓↓');
                console.log(that.labelItems);
                that.labelItems.forEach((item) => {
                    if (item.name == '理货员' || item.name == '餐饮服务员') {
                        // that.data.tabs2.push(item);
                    }
                }); // that.data.tabs2.push(that.data.labelItems[0], that.data.labelItems[1])
            }
            that.setData({
                tabs2: that.tabs2
            });
            let res = uni.getStorageSync('sex'); //性别
            if (app.globalData.isNotEmptyCheck(res.data)) {
                that.storeJobListSearchForm.sex = res.data;
                that.storeJobListSearchForm.pageNum = 1;
            } else {
                //   res.data = [];
            }
            let res2 = uni.getStorageSync('checkedJobItems'); //筛选职位
            let workTypeStrCurr = '';
            if (app.globalData.isNotEmptyCheck(res2.data)) {
                res2.data.forEach((item, index) => {
                    workTypeStrCurr += item.value + ',';
                });
                if (workTypeStrCurr.length > 0) {
                    workTypeStrCurr = workTypeStrCurr.substr(0, workTypeStrCurr.length - 1);
                }
                that.storeJobListSearchForm.workTypeStr = workTypeStrCurr;
                that.storeJobListSearchForm.pageNum = 1;
            } else {
                that.storeJobListSearchForm.workTypeStr = '';
                that.storeJobListSearchForm.pageNum = 1;
            }
            console.log(res.data + '===' + res2.data);
            if (res.data == -1 && (res2.data == null || res2.data == '')) {
                that.setData({
                    chooseActive: false
                });
            } else {
                that.setData({
                    chooseActive: true
                });
            }

            // this.getJobList();
        },

        getJobList() {
            var that = this;
            // debugger
            return new Promise(function (resolve, reject) {
                if (that.storeJobListSearchForm.sortTag == 2) {
                    //如果按照距离排序，拼接上坐标
                    that.storeJobListSearchForm.lng = app.globalData.lng;
                    that.storeJobListSearchForm.lat = app.globalData.lat;
                }
                console.log(that.inputVal);
                that.storeJobListSearchForm.keys = that.inputVal == '搜索工作' ? '' : that.inputVal;
                // debugger;
                uni.showLoading({
                    title: '加载中...'
                });
                console.log(that.storeJobListSearchForm);
                uni.request({
                    url: app.globalData.ip + '/overall/store/job/list',
                    method: 'POST',
                    header: app.globalData.headers,
                    data: that.storeJobListSearchForm,
                    success: function (res) {
                        console.log('职位列表↓↓↓↓');
                        console.log(res);
                        that.setData({
                            totalPage: res.data.data.pageCount,
                            currPage: res.data.data.currentPage
                        });
                        setTimeout(function () {
                            that.setData({
                                triggered: false
                            });
                        }, 1000);
                        if (res.data.data.recordList == null || res.data.data.recordList.length == 0 || res.data.data.recordList.length < that.storeJobListSearchForm.pageSize) {
                            var jobListTemp = commonUtil.disposeJobListData(res.data.data.recordList);
                            that.recordList = that.recordList.concat(jobListTemp);
                            that.setData({
                                recordList: that.recordList,
                                hasMoreData: false,
                                isTrigger: false
                            });
                        } else {
                            var jobListTemp = commonUtil.disposeJobListData(res.data.data.recordList);
                            that.recordList = that.recordList.concat(jobListTemp);
                            that.setData({
                                recordList: that.recordList,
                                isTrigger: false
                            });
                        }
                        uni.hideLoading({
                            success: (res) => {}
                        });
                        that.setData({
                            loading: false,
                            pageShow: true,
                            storeJobListSearchForm: that.storeJobListSearchForm
                        });
                        resolve();
                        that.getTag();
                        that.recordList.forEach((item, index) => {
                            if (
                                (app.globalData.isNotEmptyCheck(item.returnFeeType) && app.globalData.isNotEmptyCheck(item.returnFee)) ||
                                item.returnFeeType == '0' ||
                                item.returnFee == '0'
                            ) {
                                item['fuWuFei'] = commonUtil.getReturnFeeTypeName1ById(item.returnFeeType, item.returnFee);
                            } else {
                                item['fuWuFei'] = '';
                            }
                        });
                        that.setData({
                            recordList: that.recordList
                        });
                        if (that.recordList.length < res.data.data.recordCount) {
                            that.setData({
                                hasMoreData: true
                            });
                        } else {
                            that.setData({
                                hasMoreData: false
                            });
                        }
                    }
                });
            });
        },

        onScrollRefresh() {
            this.recordList = [];
            this.storeJobListSearchForm.pageNum = 1;
            this.getJobList();
        },

        getTag() {
            let that = this;
            let query = uni.createSelectorQuery().in(that);
            query
                .selectAll('.tttg')
                .boundingClientRect()
                .exec(function (res) {
                    res.forEach((item) => {
                        item.forEach((element, index) => {
                            if (element.width > 200) {
                                // that.data.recordList[index].isTagShow = true;
                                var age = 'recordList[' + index + '].isTagShow';
                                that.setData({
                                    [age]: true
                                });
                            }
                        });
                    });
                    // if(){

                    // }
                    // console.log(res);
                });
        },

        // 下拉加载更多
        onScrollToLower() {
            console.log('====================================================');
            var that = this;
            if (app.globalData.isLogin) {
                that.storeJobListSearchForm.pageNum = that.storeJobListSearchForm.pageNum + 1;
                if (that.hasMoreData) {
                    that.getJobList();
                }
                // 根据实际数据加载情况设定 loadMore 的值即可，分别为 load 和 over

                this.setData({
                    loadMore: 'load'
                    // loading:true
                });
            } else {
                if (that.pullNum == 0) {
                    that.openIOS1();
                }
            }
            that.pullNum = that.pullNum + 1;
        },

        handleTabClick(e) {
            var that = this;
            var index = e.detail.index;
            console.log(e.detail.index);
            let categoryCurr = that.tabs2[index].category; // that.data.tabs2.forEach((item,index2) => {
            //   if (index == index2) {
            //     categoryCurr = item.category
            //   }
            //   if( index == 0){
            //     categoryCurr = -1
            //   }
            // })

            this.setData({
                // [tabsName]: index,
                contentIndex: index
            });
            console.log(categoryCurr);
            that.storeJobListSearchForm.jobClassify = categoryCurr;
            that.storeJobListSearchForm.pageNum = 1;
            that.setData({
                recordList: []
            });
            that.getJobList();
        },

        /**
         * 标准详情
         *
         *
         */
        goDetail(e) {
            console.log(e);
            var that = this;
            uni.navigateTo({
                url: '../detail/index?storeJobId=' + e.currentTarget.dataset.id + '&wxCode=' + that.wxCode
            });
        },

        /**
         * 简版抽屉
         *
         *
         */
        goDrawer(event) {
            let that = this;
            uni.hideTabBar({
                success(e) {
                    that.setData({
                        currentJobDrawer: {
                            ...event.currentTarget.dataset.item,
                            index: event.currentTarget.dataset.index
                        },
                        drawerShow: true
                    });
                }
            });
            console.log(this.currentJobDrawer);
        },

        copyClose() {
            var that = this;
            var text = that.currentJobDrawer.jobDesp;
            uni.setClipboardData({
                data: text,
                success(res) {
                    uni.getClipboardData({
                        success(res) {
                            console.log(res.data); // data
                            uni.showToast({
                                title: '内容已复制',
                                icon: 'none',
                                duration: 1500
                            });
                        }
                    });
                }
            });
        },

        // showDrawer() {
        // 	this.setData({
        // 	});
        // },
        hideDrawer() {
            let that = this;
            that.setData({
                drawerShow: false
            });
            setTimeout(() => {
                uni.showTabBar({
                    success(e) {}
                });
            }, 300);
        },

        goEnroll(e) {
            console.log(e);
            // wx.navigateTo({
            //     url: "../newEnroll/index?applyType=0"
            // });
            var that = this;
            uni.removeStorageSync('townsManInfo');
            uni.removeStorageSync('townsManInfoJob');
            uni.removeStorageSync('storeInfoJob');

            // if(app.isNotEmptyCheck(wx.getStorage('townsManInfo'))){
            //   wx.removeStorageSync('townsManInfo')
            // }
            // if(app.isNotEmptyCheck(wx.getStorage('townsManInfoJob'))){
            //   wx.removeStorageSync('townsManInfoJob')
            // }
            // if(app.isNotEmptyCheck(wx.getStorage('storeInfoJob'))){
            //   wx.removeStorageSync('storeInfoJob')
            // }
            // wx.removeStorageSync('townsManInfoJob')
            console.log(app.globalData.loginUserInfo.tel);
            uni.setStorageSync('jobDetailStorage', that.recordList[e.currentTarget.dataset.idx]);
            let argument;
            argument = JSON.stringify(e.currentTarget.dataset.info).replace(/\=|\&/g, '3D');
            uni.navigateTo({
                url: `../newEnroll/enroll/index?applyType=1&info=${argument}`
            });
        },

        wxLogin() {
            var that = this;
            uni.login({
                success(res) {
                    if (res.code) {
                        that.setData({
                            wxCode: res.code
                        });
                    } else {
                        console.log('获取code失败！' + res.errMsg);
                    }
                }
            });
        },

        changeRecordBillType(e) {
            let that = this;
            console.log(e);
            that.setData({
                recordBillType: e.currentTarget.dataset.type
            });
        },

        getPhoneNumber(e) {
            var that = this;
            console.log(e);
            console.log(e.detail.errMsg);
            /*wx.setStorageSync({
                key: "jobDetailStorage",
                data: that.data.recordList[e.currentTarget.dataset.idx]
            });*/

            uni.setStorageSync('jobDetailStorage', that.recordList[e.currentTarget.dataset.idx]);

            // console.log(e);
            // console.log(e.detail.errMsg)
            // console.log(e.detail.iv)
            // console.log(e.detail.encryptedData)
            if ('getPhoneNumber:ok' == e.detail.errMsg) {
                //同意
                var iv = e.detail.iv;
                var encryptedData = e.detail.encryptedData;
                console.log(iv, '=-=========', encryptedData);
                uni.checkSession({
                    success() {
                        //session_key 未过期，并且在本生命周期一直有效
                        uni.request({
                            url: app.globalData.ip + '/getWechatTel',
                            data: {
                                code: that.wxCode,
                                iv: iv,
                                encryptedData: encryptedData,
                                type: 'yishoudan'
                            },
                            success: function (res) {
                                console.log(res);
                                app.globalData.openId = res.data.data.openId;
                                let promise = app.globalData.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
                                var collected = e.currentTarget.dataset.collected;
                                if (collected) {
                                    promise.then((res) => {
                                        that.setData({
                                            isLogin: app.globalData.isLogin
                                        });
                                        that.doCollected(collected, e.currentTarget.dataset.jobid);
                                        that.collectedStoreJobList();
                                    });
                                } else {
                                    if (that.recordBillType == 'photo' || that.recordBillType == 'record') {
                                        promise.then((res) => {
                                            if (that.recordBillType == 'photo') {
                                                that.chooseIdCard();
                                            } else {
                                                that.navigatorToRecord();
                                            }
                                        });
                                    } else {
                                        promise.then((res) => {
                                            let argument;
                                            argument = JSON.stringify(e.currentTarget.dataset.info).replace(/\=|\&/g, '3D');
                                            uni.navigateTo({
                                                url: `../newEnroll/enroll/index?applyType=1&info=${argument}`
                                            });
                                        });
                                    }
                                }
                            },
                            fail: function (res) {
                                console.log('获取用户手机号错误');
                            }
                        });
                    },
                    fail() {
                        // session_key 已经失效，需要重新执行登录流程
                        uni.login({
                            success(res) {
                                if (res.code) {
                                    console.log(res.code);
                                    //发起网络请求
                                    uni.request({
                                        url: app.globalData.ip + '/getWechatTel',
                                        data: {
                                            code: res.code,
                                            iv: iv,
                                            encryptedData: encryptedData,
                                            type: 'yishoudan'
                                        },
                                        success: function (res) {
                                            console.log(res);
                                            let promise = app.globalData.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
                                            var collected = e.currentTarget.dataset.collected;
                                            if (collected) {
                                                promise.then((res) => {
                                                    that.setData({
                                                        isLogin: app.globalData.isLogin
                                                    });
                                                    that.doCollected(collected, e.currentTarget.dataset.jobid);
                                                });
                                            } else {
                                                promise.then((res) => {
                                                    uni.navigateTo({
                                                        url: '../enroll/index?applyType=1'
                                                        //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber
                                                    });
                                                });
                                            }
                                        },
                                        fail: function (res) {
                                            console.log('获取用户手机号错误');
                                        }
                                    });
                                } else {
                                    console.log('获取手机号失败！' + res.errMsg);
                                }
                            }
                        });
                    }
                });
            } else {
                //拒绝
                var collected = e.currentTarget.dataset.collected;
                if (collected) {
                    try {
                        uni.setStorageSync('comeFromPage', 'index');
                    } catch (e) {
                        console.log('CatchClause', e);
                        console.log('CatchClause', e);
                        console.log('index-页面跳转，设置参数错误：', e);
                    }
                    uni.navigateTo({
                        url: '/pages/login/index'
                    });
                } else {
                    uni.navigateTo({
                        url: '../enroll/index?applyType=1'
                    });
                }
            }
            return false;
        },

        getPhoneNumber1(e) {
            var that = this;
            console.log(e);
            console.log(e.detail.errMsg);
            that.close();
            // console.log(e);
            // console.log(e.detail.errMsg)
            // console.log(e.detail.iv)
            // console.log(e.detail.encryptedData)

            if ('getPhoneNumber:ok' == e.detail.errMsg) {
                //同意
                var iv = e.detail.iv;
                var encryptedData = e.detail.encryptedData;
                uni.checkSession({
                    success() {
                        //session_key 未过期，并且在本生命周期一直有效
                        uni.request({
                            url: app.globalData.ip + '/getWechatTel',
                            data: {
                                code: that.wxCode,
                                iv: iv,
                                encryptedData: encryptedData,
                                type: 'yishoudan'
                            },
                            success: function (res) {
                                console.log(res);
                                let promise = app.globalData.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
                                promise.then((res) => {
                                    that.setData({
                                        isLogin: app.globalData.isLogin
                                    });
                                    that.onScrollToLower();
                                });
                            },
                            fail: function (res) {
                                console.log('获取用户手机号错误');
                            }
                        });
                    },
                    fail() {
                        // session_key 已经失效，需要重新执行登录流程
                        uni.login({
                            success(res) {
                                if (res.code) {
                                    console.log(res.code);
                                    //发起网络请求
                                    uni.request({
                                        url: app.globalData.ip + '/getWechatTel',
                                        data: {
                                            code: res.code,
                                            iv: iv,
                                            encryptedData: encryptedData,
                                            type: 'yishoudan'
                                        },
                                        success: function (res) {
                                            console.log(res);
                                            let promise = app.globalData.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
                                            promise.then((res) => {
                                                that.setData({
                                                    isLogin: app.globalData.isLogin
                                                });
                                            });
                                        },
                                        fail: function (res) {
                                            console.log('获取用户手机号错误');
                                        }
                                    });
                                } else {
                                    console.log('获取手机号失败！' + res.errMsg);
                                }
                            }
                        });
                    }
                });
            } else {
                //拒绝
                if (e.currentTarget.dataset.type != 'close') {
                    try {
                        uni.setStorageSync('comeFromPage', 'index');
                    } catch (e) {
                        console.log('CatchClause', e);
                        console.log('CatchClause', e);
                        console.log('index-页面跳转，设置参数错误：', e);
                    }
                    uni.navigateTo({
                        url: '/pages/login/index'
                    });
                } else {
                    that.close();
                }
            }
            return false;
        },

        getAgencyUserId(id) {
            var that = this;
            uni.request({
                url: app.globalData.ip + '/channel/contact/getAgencyUserId',
                method: 'GET',
                header: app.globalData.header,
                data: {
                    channelContactId: id
                },
                success: function (res) {
                    console.log('获取来源对应的代理人，来源ID：', id);
                    console.log(res);
                    try {
                        if (app.globalData.isNotEmptyCheck(res.data.data)) {
                            uni.setStorageSync('storageSyncAgencyUserId', res.data.data);
                        }
                        //先设置代理人缓存人再登录
                        app.globalData.getLoginUserTokenInfo();
                    } catch (e) {
                        console.log('CatchClause', e);
                        console.log('CatchClause', e);
                        console.log('0-扫描微信二维码，设置参数错误：', e);
                        //先设置代理人缓存人再登录
                        app.globalData.getLoginUserTokenInfo();
                    }
                },
                fail: function (res0) {
                    console.log('获取来源对应的代理人错误', id);
                }
            });
        },

        collectPaste(e, _dataset) {
            /* ---处理dataset begin--- */
            this.handleDataset(e, _dataset);
            /* ---处理dataset end--- */
            var txt;
            var that = this;
            var collected = e.currentTarget.dataset.collected;
            var storeJobId = e.currentTarget.dataset.jobid;
            that.doCollected(collected, storeJobId);
            // console.log(collected);
            // if(!this.data.isCollect){
            //     that.setData({
            //         isCollect: true,
            //         collectTxt:'已收藏'
            //     })
            //     txt = '收藏成功'
            // }else{
            //     that.setData({
            //         isCollect: false,
            //         collectTxt:'收藏'
            //     })
            // }
        },

        doCollected(collected, storeJobId) {
            var that = this;
            var url = '/user/collect/job/add';
            if (collected - 1 == 0) {
                url = '/user/collect/job/remove';
            }
            console.log(app.globalData.headers);
            //发起网络请求
            uni.request({
                url: app.globalData.ip + url,
                data: {
                    storeJobId: storeJobId
                },
                header: app.globalData.headers,
                method: 'GET',
                success: function (res) {
                    var txt;
                    if (collected - 1 == 0) {
                        //取消收藏
                        for (var i = 0; i != that.recordList.length; ++i) {
                            if (that.recordList[i].id - storeJobId == 0) {
                                that.recordList[i].collected = 2;
                                break;
                            }
                        }
                        txt = '取消收藏';
                    } else {
                        //收藏
                        for (var i = 0; i != that.recordList.length; ++i) {
                            if (that.recordList[i].id - storeJobId == 0) {
                                that.recordList[i].collected = 1;
                                break;
                            }
                        }
                        txt = '收藏成功';
                    }
                    that.recordList.forEach((item) => {
                        if (item.id == that.currentJobDrawer.id) {
                            that.currentJobDrawer = {
                                ...item,
                                index: that.currentJobDrawer.index ? that.currentJobDrawer.index : null
                            };
                        }
                    });
                    that.setData({
                        recordList: that.recordList,
                        currentJobDrawer: that.currentJobDrawer,
                        isLogin: app.globalData.isLogin
                    });
                    uni.showToast({
                        icon: 'none',
                        title: txt
                    });
                },
                fail: function (res) {
                    console.log('操作失败');
                }
            });
        },

        getUserInfoBtn: function (e) {
            console.log(e);
            let that = this;
            let type = e.currentTarget.dataset.type;
            var collected = e.currentTarget.dataset.collected;
            var storeJobId = e.currentTarget.dataset.jobid;
            let idx = e.currentTarget.dataset.idx;
            console.log(type);
            uni.getUserProfile({
                desc: '用于完善会员资料',
                // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
                success: (res) => {
                    console.log(res);
                    //发起网络请求
                    uni.request({
                        url: app.globalData.ip + '/updateUserWechatInfo',
                        data: {
                            nickName: res.userInfo.nickName,
                            avatarUrl: res.userInfo.avatarUrl,
                            gender: res.userInfo.gender,
                            country: res.userInfo.country,
                            province: res.userInfo.province,
                            city: res.userInfo.city
                        },
                        method: 'POST',
                        header: app.globalData.headers,
                        success: function (res) {
                            console.log(res);
                            app.globalData.hasUserInfo = 1;
                            that.setData({
                                hasUserInfo: 1
                            });
                            that.doMenuClick(type, collected, storeJobId, idx);
                        },
                        fail: function (res) {
                            that.doMenuClick(type, collected, storeJobId, idx);
                        }
                    });
                },
                fail: (res) => {
                    console.log(res);
                    that.doMenuClick(type, collected, storeJobId, idx);
                }
            });
        },

        doMenuClick: function (_type, _collected, _storeJobId, _idx) {
            let that = this;
            if (_type - 1 == 0) {
                //点击全国
                that.goCity();
            } else if (_type - 2 == 0) {
                //搜索
                that.showInput();
            } else if (_type - 3 == 0) {
                //筛选
                that.goScreen();
            } else if (_type - 4 == 0) {
                //收藏
                that.doCollected(_collected, _storeJobId);
            } else if (_type - 5 == 0) {
                //报名
                uni.setStorageSync('jobDetailStorage', that.recordList[_idx]);
                uni.navigateTo({
                    url: '../enroll/index?applyType=1&tel=' + app.globalData.loginUserInfo.tel
                });
            }
        },

        changSign(e) {
            let that = this;
            console.log(e);
            that.storeJobListSearchForm.pageNum = 1;
            if (e.target.dataset.type == 0 && that.signType != 0) {
                that.storeJobListSearchForm.signType = '';
                that.setData({
                    signType: e.target.dataset.type,
                    recordList: [],
                    storeJobListSearchForm: that.storeJobListSearchForm
                });
                that.getJobList();
            } else if (e.target.dataset.type == 1 && that.signType != 1) {
                that.storeJobListSearchForm.signType = 1;
                that.setData({
                    signType: e.target.dataset.type,
                    recordList: [],
                    storeJobListSearchForm: that.storeJobListSearchForm
                });
                that.getJobList();
            } else if (e.target.dataset.type == 2 && that.signType != 2) {
                that.storeJobListSearchForm.signType = 2;
                that.setData({
                    signType: e.target.dataset.type,
                    recordList: [],
                    storeJobListSearchForm: that.storeJobListSearchForm
                });
                that.getJobList();
            }
        }
    }
};
</script>
<style>
@import './index.css';
</style>
