<template>
  <view class="content">
      <view
        class="fix-content-box"
        v-for="(item, index) in fixList"
        :key="index"
        style="justify-content: start; padding: 30rpx 0 30rpx 30rpx;border-radius: 0;"
        @click="goActiveDeatil(item.id)" >

        <view class="notice-content">
          <view class="notice-content-font">{{item.content}}</view>
          <view class="display-between" style="margin-top: 20rpx">
			<view class="notice-content-time">
				提交时间：{{item.time}}
			</view>  
			<view class="display-flex-start"  style="visibility: hidden;">
				<view class="notice-content-time">{{item.status}}</view>
			</view>
          </view>
        </view>
      </view>
     <image src="../../static/nodata.svg" mode="aspectFit" style="width: 100%;" v-if="fixList.length === 0"></image>
  </view>
</template>

<script>
import md5 from "@/common/md5.js";
export default {
  data() {
    return {
      message: "我的报修",
      themeColor: "#007AFF",
      mode: "selector",
      typeActive: true,
      indexType: 0,
      indexState: 0,
      fixList: [
		  /*
        {
          title: "暖气不热",
          time: "2023-08-18",
        },
        {
          title: "二楼暖气管道井漏水严重，同时发出严重的声响，请尽快处理",
          time: "2023-09-05",
        },
		*/
      ],
      activeListCopy: [],
    };
  },
  onLoad() {
    this.getFixList();
  },
  methods: {
    // goDeatil(id) {
    //   uni.navigateTo({
    //     url: "/pages/activity/activity_deatil?id=" + id,
    //   });
    // },
    getFixList() {
      let md5Sign = md5(
        "method=" +
          "user" +
          "&timestamp=" +
          getApp().globalData.globalTimestamp +
          "&secret=" +
          getApp().globalData.secret
      );
      let url =
        getApp().globalData.shareUrl +
        "api/api.php" +
        "?method=user&source=user&action=get_repair_list&timestamp=" +
        getApp().globalData.globalTimestamp +
        "&sign=" +
        md5Sign;
      let postData = {
        // page: 1,
        // page_size: 15,
		openId:getApp().globalData.open_id
      };
      uni.request({
        url: url,
        method: "POST",
        header: {
          "content-type": "application/x-www-form-urlencoded",
        },
        data: postData,
        success: (res) => {
          // console.log(res);
          if (res.data.code === 200) {
				this.fixList = res.data.data.list;
          }
        },
        fail: () => {
          console.log("连接失败");
        },
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
.fix-content-box {
	width: 90%;
  display: flex;
  padding: 30rpx 20rpx 30rpx 20rpx;
  background-color: #ffffff;
  box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  border-radius: 32rpx;
  margin-top: 20rpx;
  justify-content: space-between;
  .notice-content-font {
    font-size: 32rpx;
    color: #0d1937;
    font-weight: 600;
  }
  .notice-content-time {
	font-size: 26rpx;
	letter-spacing: 0.02em;
	color: #a7adba;
  }
}

}
.active {
  color: $uni-color-primary;
}
.color {
  background-color: #589cff !important;
}

</style>
