<template>
  <view class="page-raw-ingoods">
    <view class="header">
      <view class="left">
        <u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
      </view>
      <view class="title">mes菜单</view>
      <view class="right"></view>
    </view>
    <view class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 生产 </view>
      </view>
      <!-- <view v-for="item in newmenuList" :key="item.path"> -->
      <view class="tubiao">
        <u-icon
          v-for="item in newmenuList"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-01.png"
        ></u-icon>
      </view>
      <!-- </view> -->
    </view>

    <view class="container" v-if="newmenuList2.length > 0">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 原料 </view>
      </view>
      <!-- <view v-for="item in newmenuList" :key="item.path"> -->
      <view class="tubiao">
        <u-icon
          v-for="item in newmenuList2"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-01.png"
        ></u-icon>
      </view>
    </view>
  </view>
</template>

<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { session } from '@/store/modules/session';
@Component
export default class RawAppointment extends BasePage {
  childData: any;
  menuList = session.getMenus;
  newmenuList: any = [];
  newmenuList2: any = [];
  onReady() {
    this.newmenuList = this.menuList.filter((item) => item.perms == 'mesCh');
    this.newmenuList2 = this.menuList.filter((item) => item.perms == 'mesYl');
  }
}
</script>

<style lang="scss" scoped>
.page-raw-ingoods {
  background-color: #f4f7fc;
  padding-top: 150rpx;
  min-height: 100%;

  .header {
    position: fixed;
    top: 0;
    // padding-top: 18px;
    left: 0;
    right: 0;
    z-index: 99;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    background-color: #d9001b;
    /* height: 46px; */
    line-height: 46px;
    color: #fff;
    font-size: 34rpx;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 1px 2px #e87675;
    padding: 60rpx 0rpx 0rpx;
    .title {
      flex: 3;
    }
    .left,
    .right {
      flex: 1;
    }
    .icon {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 88rpx;
      height: 88rpx;
    }
  }

  .container {
    background-color: #ffffff;
    padding: 20rpx;
    border: 2rpx solid #9093992e;
    margin-top: 12rpx;
    border-radius: 4rpx;
    // padding: 30rpx 15rpx 0;
    .toptitle {
      display: flex;
      flex-direction: row;
      padding: 6rpx;
      .shuxian {
        border: 2rpx solid red;
        margin-right: 24rpx;
      }
      .title {
        // margin-bottom: 10rpx;
      }
    }
    .tubiao {
      margin-left: 40rpx;
    }
  }
}
::v-deep .u-icon {
  padding: 17rpx;
}
::v-deep .u-icon__label {
  width: 124rpx;
  text-align: center;
}
</style>
