<template>
  <view class="task_page">
    <view class="card">
      <view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view>
      <view>{{taskInfo.content||''}}</view>
    </view>
    <view class="card">
      <view class="c_title">{{`判断条件: ${taskInfo.title||''}`}}</view>
      <view>{{taskInfo.content||''}}</view>
    </view>
  </view>
</template>

<script>
  import { Toast } from "../../libs/uniApi";
  import { serviceTaskDetails } from "@/api/task.js"
  export default {
    data() {
      return {
        taskInfo:{
          id: '',
          title: '',
          content: '',
          extend: {}
        },
      }
    },
    onLoad(options) {
      options.task_id?this.taskInfo.task_id=options.task_id:null;
      this.initTask();
    },
    onShow() {},
    methods: {
      async initTask(){
        let res = await serviceTaskDetails({
          id: this.taskInfo.id
        });
        console.log(res);
        this.taskInfo = res.data;
      },
    },
  }
</script>

<style lang="scss">
  .task_page {
    padding-top: 30rpx;

    .card {
      margin: 0 auto;
      margin-bottom: 28rpx;
      width: 694rpx;
      background-color: #fff;
      border-radius: 26rpx;
      padding: 28rpx;

      .c_title {
        font-size: 32rpx;
        font-weight: bold;
        color: #333333;
        margin-bottom: 20rpx;
      }

      .file {
        display: flex;
        justify-content: left;
        flex-wrap: wrap;

        &_item {
          flex-shrink: 0;
          width: 200rpx;
          height: 200rpx;
          margin: 0 auto;
          margin-bottom: 16rpx;
          border: 2px solid #ccc;
          border-radius: 10rpx;
          overflow: hidden;
          position: relative;

          .image {
            width: 100%;
            height: 100%;
          }

          .del {
            position: absolute;
            height: 40rpx;
            width: 40rpx;
            top: 10rpx;
            right: 10rpx;
          }
        }

        &_btn {
          flex-shrink: 0;
          width: 200rpx;
          height: 200rpx;
          margin: 0 auto;
          margin-bottom: 16rpx;
          border: 2px solid #ccc;
          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;
          border-radius: 10rpx;

          image {
            width: 100rpx;
            height: 100rpx;
          }
        }

        &_empty {
          flex-shrink: 0;
          width: 200rpx;
          height: 200rpx;
          margin: 0 auto;
          margin-bottom: 16rpx;
          border: 2px solid transparent;
        }
      }
    }
  }
</style>