<template>
  <div class="industrialPolicy">
    <div class="peripheralBody">
      <van-tabs :active="active" @change="onChange">
        <van-tab title="全部" :name="0"></van-tab>
        <van-tab title="大类" :name="1" v-for="(item,index) in typeList"></van-tab>
      </van-tabs>
      <div class="peripheralBox">
        <div class="peripheralItem" v-for="item in peripheralList" @tap="toDetail(item)">
            <span class="peripheralName">{{item.name}}</span>
          <div class="peripheralItemRow2">2021-03-21  12：00 &nbsp;|&nbsp; 园区管委会</div>
          <div class="tagBox">
             <span class="periTag" v-for="type in item.type">{{type}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { policyList,getUserLocalStorageInfo,policyListAll } from "@/js_sdk/http.js";
export default {
  name: "peripheralService",
  data(){
    return{
      active: 0,
      peripheralList:[
        {name:'关于入住企业规模发展奖励',type:['小类','大类']},
        {name:'关于入住企业规模发展奖励',type:['小类','大类']},
      ],
      typeList:[],
      userId:getUserLocalStorageInfo().userId
    }
  },
  mounted() {
    this.getList()
  },
  methods:{
    onChange(e) {
      console.log(e)
    },
    getList(){
      policyListAll().then(res=>{
        this.typeList = res.data
        console.log(this.typeList,'11111')
      })
      // policyList({userId:this.userId}).then(res=>{
      //
      // })
    },
    toDetail(item) {
      uni.navigateTo({
        url:'/pages/subPackages/industrialPolicy/detail'
      })
    }
  }
}
</script>

<style lang="scss">
.industrialPolicy{
  .peripheralBody{
    background: white;
    margin-top: 24rpx;
    padding: 32rpx;
    box-sizing: border-box;
    height: 1424rpx;
    .peripheralBox{
      margin-top: 8rpx;
      .peripheralItem{
        width: 686rpx;
        height: 204rpx;
        box-sizing: border-box;
        border-radius: 16rpx;
        background: #F5F7FA;
        padding: 32rpx;
        margin-top: 24rpx;
          .peripheralName{
            color:#222222;
            font-size: 32rpx;
            font-weight: 600;
          }
        .peripheralItemRow2{
          color: #888888;
          font-size: 28rpx;
          margin-top: 14rpx;
        }
        .tagBox{
          display: flex;
          flex-wrap: wrap;
        }
        .periTag{
          display: flex;
          align-items: center;
          justify-content: center;
          width: 92rpx;
          height: 48rpx;
          background: rgba(3, 101, 249, 0.20);
          color: rgba(3, 101, 249, 1);
          border-radius: 8rpx;
          margin: 16rpx 16rpx 0 0;
          font-size: 24rpx;
        }
      }
    }
  }
}
</style>
