<template>
  <view class="app-container">
    <u-navbar
      leftText="返回"
      title="信息发布"
      :autoBack="true"
      :placeholder="true"
    />
    <view class="list-item active view-global" v-for="item in 2" :key="item">
      <view class="item-cell">
        <view class="cell-lable">信息标题：</view>
        <view class="cell-value">关于XXXXXXX安全的要求</view>
      </view>
      <view class="item-cell">
        <view class="cell-lable">发布时间：</view>
        <view class="cell-value">2023-09-12 16:20:00</view>
      </view>
      <view class="item-cell">
        <view class="cell-lable">发布人员：</view>
        <view class="cell-value">张三</view>
      </view>
      <view class="item-cell" style="align-items: flex-start">
        <view class="cell-lable">推送店铺：</view>
        <view class="cell-value"
          >XXX店铺、XXX店铺、XXX店铺、XXX店铺、XXX店铺</view
        >
      </view>
      <view class="item-cell" style="align-items: flex-start">
        <view class="cell-lable">信息内容：</view>
        <view class="cell-value"
          >XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXX</view
        >
      </view>
      <view class="cell-btn">
        <u-button
          text="删除"
          size="small"
          color="linear-gradient(90deg, #F8404C 0%, #FF5C66 100%)"
          :custom-style="{
            width: '130rpx',
            height: '65rpx',
            margin: '0',
          }"
        ></u-button>
        <u-button
          text="编辑"
          size="small"
          color="linear-gradient(90deg, #F17539 0%, #F6993C 100%)"
          v-show="item != 1"
          :custom-style="{
            width: '130rpx',
            height: '65rpx',
            margin: '0 20rpx 0 0',
          }"
          @click="handleAdd(1)"
        ></u-button>
      </view>
    </view>
    <fixed-buttom title="新增信息" @click="handleAdd()"></fixed-buttom>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    //新增
    handleAdd(id) {
      uni.$u.route({
        url: "/subViolation/ShengchanJiandu/MsgIssue/add",
        params: {
          id,
        },
      });
    },
    //复查
    handleFc() {
      uni.$u.route({
        url: "/subViolation/ShengchanJiandu/WorkOrder/info",
      });
    },
    //延期
    handleYq() {
      uni.$u.route({
        url: "/subViolation/ShengchanJiandu/WorkOrder/postpone",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.app-container {
  .list-item {
    background-color: #fff;
    border-radius: 16rpx;
    box-sizing: border-box;
    padding: 25rpx;
    margin-bottom: 30rpx;

    .item-cell {
      display: flex;
      align-items: center;

      .cell-lable {
        width: 200rpx;
        font-size: 28rpx;
        font-weight: 400;
        color: #9da2ab;
      }

      .cell-value {
        flex: 1;
        font-size: 28rpx;
        font-weight: 400;
        color: #2e2f31;
      }
    }

    .cell-btn {
      display: flex;
      flex-direction: row-reverse;
    }

    & > view:not(.cell-btn) {
      margin-bottom: 20rpx;
    }
  }

  & > .list-item:last-child {
    margin-bottom: 0;
  }
}
</style>
