<template>
  <div class="pop">
    <van-sticky class="sticky">
      <div class="header flex">
        <div class="back">
          <backIcon @cancel="cancel" back="cancel"/>
        </div>
        <!-- 筛选 -->
        {{ $t('option.l') }}
        <div class="href" @click="$router.push('/add-work-order')">
          <!-- 创建 -->
          {{ $t('work.l6') }}
        </div>
      </div>
    </van-sticky>
    <div class="section">
      <div class="label">
        <!-- 工单类型 -->
        {{ $t('work.l2') }}
      </div>
      <div class="ul flex">
        <div class="li" :class="{active: type == 1}" @click="type = 1">
          <!-- 账号类 -->
          {{ $t('work.l3') }}
        </div>
        <div class="li" :class="{active: type == 2}" @click="type = 2">
          <!-- 操作类 -->
          {{ $t('work.l4') }}
        </div>
        <div class="li" :class="{active: type == 3}" @click="type = 3">
          <!-- 资金类 -->
          {{ $t('work.l5') }}
        </div>
        <div class="li" :class="{active: type == 4}" @click="type = 4">
          <!-- 其他 -->
          {{ $t('inform.l22') }}
        </div>
      </div>
    </div>
    <!-- <div class="padding"></div>
    <div class="section1">
      <div class="li flex">
        <div>开始时间</div>
        <img class="right" src="/img/icon/right.png" alt="极度证券">
      </div>
      <div class="li flex">
        <div>结束时间</div>
        <img class="right" src="/img/icon/right.png" alt="极度证券">
      </div>
    </div> -->
    <div class="padding"></div>
    <div class="section2">
      <div class="li flex">
        <div class="label">
          <!-- 工单编号/标题 -->
          {{ $t('work.l7') }}
        </div>
        <div class="right flex">
          <div class="flex" @click="radio = 1">
            <img v-show="radio != 1" class="radio" src="/img/icon/radio.png" alt="极度证券">
            <img v-show="radio == 1" class="radio" src="/img/icon/radio1.png" alt="极度证券">
            <div>
              <!-- 工单编号 -->
              {{ $t('work.l8') }}
            </div>
          </div>
          <div class="flex" @click="radio = 2">
            <img v-show="radio != 2" class="radio" src="/img/icon/radio.png" alt="极度证券">
            <img v-show="radio == 2" class="radio" src="/img/icon/radio1.png" alt="极度证券">
            <div>
              <!-- 工单标题 -->
              {{ $t('work.l9') }}
            </div>
          </div>
        </div>
      </div>
      <div class="li flex">
        <!-- 编号  标题 -->
        <div class="label">{{radio == 1 ? $t('work.l10') : $t('work.l11')}}</div>
        <div class="right">
          <!-- 请输入 -->
          <el-input v-model="input" :placeholder="$t('common.l48')"></el-input>
        </div>
      </div>
    </div>
    <div class="fixed flex">
      <div class="btn ltn" @click="reset">
        <!-- 重置 -->
        {{ $t('common.l44') }}
      </div>
      <div class="btn rtn" @click="submit">
        <!-- 确认 -->
        {{ $t('common.l3') }}
      </div>
    </div>
  </div>
</template>
<script>
import backBar from '@/components/backBar'
export default {
  components: {
    backBar
  },
  data () {
    return {
      type: '',
      radio: 1,
      input: ''
    }
  },
  methods: {
    submit() {
      this.$emit('success', {
        type: this.type,
        radio: this.radio,
        input: this.input,
      })
    },
    reset() {
      this.type = ''
      this.radio = 1
      this.input = ''
    },
    cancel() {
      this.$emit('cancel')
    }
  }
}
</script>
<style lang="less" scoped>
.pop {
  min-height: 100vh;
}
.sticky {
  background-color: var(--bg-);
}
.header {
  position: relative;
  justify-content: space-between;
  height: 50px;
  font-size: 18px;
  font-weight: 600;
  background-color: var(--bg-);
  padding-left: 9px;
  padding-right: 17px;
  .href {
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
  }
}
.section {
  background-color: var(--bg-);
  padding: 12px 18px 15px;
  .label {
    font-size: 16px;
    color: #4F4F4F;
    margin-bottom: 12px;
  }
  .ul {
    column-gap: 12px;
    row-gap: 12px;
    flex-wrap: wrap;
  }
  .li {
    cursor: pointer;
    background-color: #F4F7FA;
    border-radius: 6px;
    flex: 1;
    padding: 11px 6px;
    // min-width: 76px;
    text-align: center;
    color: #4F4F4F;
    &.active {
      color: #fff;
      background-color: #000;
    }
  }
}
.section1 {
  background-color: var(--bg-);
  padding: 0 18px;
  .li {
    justify-content: space-between;
    height: 53px;
    font-size: 16px;
    color: #4F4F4F;
    cursor: pointer;
    &+.li {
      border-top: 1px solid #EDEDED;
    }
  }
  .right {
    width: 7px;
  }
}
.section2 {
  background-color: var(--bg-);
  padding: 0 18px;
  .li {
    height: 53px;
    font-size: 16px;
    color: #4F4F4F;
    &+.li {
      border-top: 1px solid #EDEDED;
    }
  }
  .label {
    width: 133px;
  }
  .right {
    flex: 1;
    min-width: 10%;
    max-width: 100%;
    &.flex {
      justify-content: space-between;
      >.flex {
        cursor: pointer;
      }
    }
  }
  .radio {
    width: 16px;
    margin-right: 5px;
  }
}
.padding {
  height: 10px;
  background-color: #F9FBFF;
}
.fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 18px 32px;
  background-color: var(--bg-);
  column-gap: 11px;
  .btn {
    flex: 1;
    cursor: pointer;
    line-height: 42px;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
  }
  .ltn {
    background-color: #F4F8F9;
    color: #4F4F4F;
  }
  .rtn {
    background-color: #000;
    color: #fff;
  }
}
::v-deep {
  .el-input__inner {
    border: none;
    padding: 0;
  }
}
</style>