<template>
  <div>
    <back :title="titlename"></back>
    <div class="content">
      <!-- 意见建议 -->
      <div class="jjlist" v-for="item in suggestList">
        <div class="listinfo">
          <div class="list_top" @click="detail(item)">
            <div class="list_top_left">
              <!-- <img src="../assets/images/ad_icon1.png" alt=""> -->
              <div>
                <p>建议场景： {{ item.suggestScene }}</p>
                <p>
                  反馈状态：
                  <template v-if="item.feedbackStatus == 1">已回复</template>
                  <template v-if="item.feedbackStatus == 2">未回复</template>
                </p>
                <p>反馈时间： {{ item.feedbackTime }}</p>
              </div>
            </div>
            <p>
              <template v-if="item.readFlag == 1 && item.feedbackStatus == 1"
                >待查看</template
              >
              <template v-if="item.feedbackStatus == 2">未回复</template>
              <template v-if="item.readFlag == 2">已查看</template>
            </p>
          </div>
          <!-- <div class="list_bot">
						<p>拒收</p>
						<p>代收</p>
						<p>延迟</p>
						<p>签收</p>
					</div> -->
        </div>
      </div>
      <van-button color="#0c2469" @click="tj">意见建议</van-button>
    </div>

    <!-- 底部 -->
    <!-- <tabbar></tabbar> -->
  </div>
</template>

<script>
import { Toast, Dialog } from "vant";
export default {
  data() {
    return {
      titlename: "意见建议",
      userId: "",
      suggestList: [] //建议列表
    };
  },
  created: function() {
    this.isLogin();
    this.userId = localStorage.getItem("userId");
    this.getSuggestList();
  },
  methods: {
    //跳转
    getSuggestList() {
      this.$http
        .post(
          this.$store.state.host + "/solic/getSuggestList.do",
          {
            userId: this.userId
          },
          { emulateJSON: true }
        )
        .then(
          res => {
            //发送成功
            if (res.body.msg == "success") {
              this.suggestList = res.body.suggestList;
            }
          },
          res => {
            //发送失败
          }
        );
    },

    //详情
    detail(item) {
      if (item.feedbackStatus == 1) {
        this.$router.push({ path: "/SuggestInfo", query: { id: item.id } });
      }
    },
    tj() {
      this.$router.push({ path: "/Suggest", query: {} });
    }
  }
};
</script>

<style lang="less" scoped>
.whrite_add {
  width: 6.6rem;
  padding: 0.4rem 0.2rem;
  /deep/.van-field__value {
    input {
      text-align: right;
    }
  }
  /deep/.van-popup__close-icon--top-right {
    top: 5px;
    right: 10px;
  }
}
.content {
  padding: 0.2rem 0.33rem 1.2rem;
  .tab {
    font-size: 0.36rem;
    color: #0c2469;
    padding: 0.2rem 0rem;
    div {
      display: flex;
      border: 0.01rem solid #0c2469;
      text-align: center;
      border-radius: 0.05rem;
      p {
        flex: 1;
        padding: 0.1rem 0rem;
      }
      p.active {
        background: #0c2469;
        color: white;
      }
    }
  }
  .jjlist {
    font-size: 0.3rem;
    color: #999999;
    .listinfo {
      background: white;
      padding: 0.33rem 0.33rem 0.2rem;
      border-radius: 0.05rem;
      margin-bottom: 0.2rem;
      position: relative;
      .list_top {
        display: flex;
        justify-content: space-between;
        .list_top_left {
          img {
            display: inline-block;
            width: 0.9rem;
            height: 0.9rem;
            position: relative;
            top: -0.3rem;
          }
          div {
            width: 4rem;
            margin-left: 0.2rem;
            display: inline-block;
            line-height: 150%;
            p:nth-of-type(1) {
              font-size: 0.3rem;
              font-weight: bold;
              color: #333;
            }
            p:nth-of-type(2) {
              font-size: 0.24rem;
              color: #333;
              span {
                width: 0.37rem;
                height: 0.37rem;
                color: white;
                border-radius: 50%;
                background: #cc9a09;
                display: inline-block;
                text-align: center;
                line-height: 0.37rem;
                margin-right: 0.1rem;
              }
            }
            p:nth-of-type(3) {
              font-size: 0.24rem;
              color: #333;
              span {
                width: 0.37rem;
                height: 0.37rem;
                color: white;
                border-radius: 50%;
                background: #cc9a09;
                display: inline-block;
                text-align: center;
                line-height: 0.37rem;
                margin-right: 0.1rem;
              }
            }
            p:nth-of-type(4) {
              font-size: 0.2rem;
            }
          }
        }
        > p {
          font-size: 0.24rem;
          color: #f5693d;
          font-weight: bold;
        }
      }
      .list_bot {
        text-align: right;
        border-top: 0.01rem solid #ededed;
        padding-top: 0.2rem;
        p {
          display: inline-block;
          font-size: 0.24rem;
          padding: 0.16rem 0.4rem;
          border-radius: 0.05rem;
        }
        p:nth-of-type(1) {
          border: 0.01rem solid #263fbf;
          color: #263fbf;
        }
        p:nth-of-type(2) {
          border: 0.01rem solid #408cc7;
          color: #408cc7;
        }
        p:nth-of-type(3) {
          border: 0.01rem solid #d5a43c;
          color: #d5a43c;
        }
        p:nth-of-type(4) {
          border: 0.01rem solid #e24444;
          color: #e24444;
        }
      }
      .fast {
        background: url(../assets/images/status.png) no-repeat center;
        background-size: 100% 100%;
        color: white;
        position: absolute;
        bottom: 0px;
        right: 0px;
        width: 1rem;
        height: 0.4rem;
        text-align: center;
        line-height: 0.4rem;
        font-size: 0.2rem;
      }
    }
  }
  button {
    width: 100%;
    margin-top: 0.3rem;
  }
  .sjlist {
    font-size: 0.3rem;
    color: #999999;
    .listinfo {
      background: white;
      padding: 0.33rem 0.33rem 0.2rem;
      border-radius: 0.05rem;
      margin-bottom: 0.2rem;
      .list_top {
        display: flex;
        justify-content: space-between;
        .list_top_left {
          img {
            display: inline-block;
            width: 0.9rem;
            height: 0.9rem;
            position: relative;
            top: -0.3rem;
          }
          div {
            width: 4rem;
            margin-left: 0.2rem;
            display: inline-block;
            line-height: 150%;
            p:nth-of-type(1) {
              font-size: 0.3rem;
              font-weight: bold;
              color: #333;
            }
            p:nth-of-type(3) {
              font-size: 0.24rem;
              color: #333;
              span {
                width: 0.37rem;
                height: 0.37rem;
                color: white;
                border-radius: 50%;
                background: #cc9a09;
                display: inline-block;
                text-align: center;
                line-height: 0.37rem;
                margin-right: 0.1rem;
              }
            }
            p:nth-of-type(4) {
              font-size: 0.2rem;
            }
          }
        }
        > p {
          font-size: 0.24rem;
          color: #f5693d;
          font-weight: bold;
        }
      }
      .list_bot {
        text-align: right;
        border-top: 0.01rem solid #ededed;
        padding-top: 0.2rem;
        p {
          display: inline-block;
          font-size: 0.24rem;
          padding: 0.16rem 0.4rem;
          border-radius: 0.05rem;
        }
        p:nth-of-type(1) {
          border: 0.01rem solid #263fbf;
          color: #263fbf;
        }
        p:nth-of-type(2) {
          border: 0.01rem solid #408cc7;
          color: #408cc7;
        }
        p:nth-of-type(3) {
          border: 0.01rem solid #d5a43c;
          color: #d5a43c;
        }
        p:nth-of-type(4) {
          border: 0.01rem solid #e24444;
          color: #e24444;
        }
      }
    }
  }
}
</style>
