<template>
  <div class="tb-toolbar-container">

    <div class="main">
      <div class="main_box">
        <van-cell label="快速发布，收益多多" center :to="{name:'agriculturalTrusteeshipSocializationRelease'}">
          <template #title>
            <p style="color:#4E7FFF; ">发布产品</p>
          </template>
          <template #icon>
            <img src="../../../static/images/agriculturalTrusteeship/socialization/dialog_01.png" style="margin-right: 15PX" />
          </template>
        </van-cell>
      </div>
      <div class="main_box">
        <van-cell label="未发布的商品都在这" center :to="{name:'agriculturalTrusteeshipSocializationDraft'}">
          <template #title>
            <p style="color:#FF5D00; ">草稿箱</p>
          </template>
          <template #icon>
            <img src="../../../static/images/agriculturalTrusteeship/socialization/dialog_02.png" style="margin-right: 15PX" />
          </template>
          <template #default>
            <p style="background: #FBE6D9;color: #FF5D00;display: inline-block;padding: 0 5PX;border-radius: 5PX;">{{supplyDemandListYes1.length}}</p>
          </template>
        </van-cell>
      </div>
      <img src="../../../static/images/agriculturalTrusteeship/socialization/footer_close.png" alt="" class="add_btn" @click="openDialog">
    </div>
  </div>
</template>
<script>
import {supplyDemandList} from "@/api/agriculturalTrusteeship";
import Cookies from "js-cookie";

export default {
  name: "toolbar",
  data() {
    return {
      supplyDemandListYes1:[],
      query:{
        entityId:Cookies.get('ACCESS-SESSION-ID'),
        productType:''
      },
    };
  },
  created() {
    this.getList()
  },
  methods:{
    getList(){
      supplyDemandList(this.query).then(response => {
        response.rows.map(res=>{
          if(res.publishStatus == 2){
            this.supplyDemandListYes1.push(res);
          }
        })
      });
    },
    openDialog(){
      this.$parent.openDialog(false)
    }
  },
};
</script>
<style scoped lang="scss">
.tb-toolbar-container {
  z-index: 99999;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  background: rgba(255,255,255,0.95);
  .main{
    position: absolute;
    left: 0%;
    bottom: 0;
    width: 100%;
    .add_btn{
      position: relative;
      left: 50%;
      transform: translate(-50%,10%);
      margin-top:4vh;
    }
  }
  .main_box{
    width: 92%;
    margin: 0 auto;
    margin-top: 2vh;
    border-radius: 20PX;
    box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
    overflow: hidden;
    background-color: #FFF;
    padding: 2vh 4%;
    /deep/ .van-cell{
      padding: 0;
      margin-bottom: 10PX;
      &:last-child{
        margin-bottom: 0;
      }
    }
  }
}
</style>
