<template>
  <view class="main">
    <image
        src="@/static/image/paySuccess.png"
        mode="scaleToFill"
        style="width:218rpx;height:54rpx;margin-top:150rpx"
    />
    <view class="content">
      <view class="content1" v-for="(item,index) in info">
      <view class="wrap1">
        画作{{index+1}}:
      </view>
      <view class="wrap2">
        <view class="wrap2_1">
          <view class="wrap2_1_1">
            <img :src="item.artworkImg" alt="">
          </view>
          <view class="wrap2_1_2">{{item.artworkNum}}</view>
          <view class="wrap2_1_3">{{item.artworkName}}</view>
        </view>
        <view class="wrap2_2">
          <view class="wrap2_2_1">
            <view class="wrap2_2_1_1">订单编号</view>
            <view class="wrap2_2_1_2">{{ item.num }}</view>
          </view>
          <view class="wrap2_2_1">
            <view class="wrap2_2_1_1">寄存地址</view>
            <view class="wrap2_2_1_2">{{item.warehouseName}}</view>
          </view>
          <view class="wrap2_2_1">
            <view class="wrap2_2_1_1">寄存期限</view>
            <view class="wrap2_2_1_2">{{item.endAt}}</view>
          </view>
          <view class="wrap2_2_1">
            <view class="wrap2_2_1_1">付款金额</view>
            <view class="wrap2_2_1_2">{{item.money}}</view>
          </view>
        </view>
      </view>
    </view>
    </view>
    <view class="tips">*请携带您的画作在时限之前到达寄存地</view>
    <view class="btns">
      <view @click="goHome" style="width: 280rpx;height:64rpx;border-radius: 40rpx;">
        <u-button text="返回首页" shape="circle" color="#626262"></u-button>
      </view>
      <view @click="goDetails" style="width: 280rpx;height:64rpx;border-radius: 40rpx">
        <u-button text="查看订单详情" shape="circle" color="#699A70"></u-button>
      </view>
    </view>
  </view>
</template>

<script>
import {postDataByParams} from "../../http/service";

export default {
  name: 'paySuccess',
  data() {
    return {
      listPaintings:[],
      info: []
    }
  },
  mounted() {

    this.getData()
  },
  methods: {
    goDetails(){
      uni.navigateTo({
        url:`/pages/confirm-order/index?type=detail&ID=${this.$mp.query.ID}`
      })
    },
    goHome(){
      uni.switchTab({
        url: "/pages/home/index",
      });
    },
    async getData() {
      const data1 = {
        ID: Number(this.$mp.query.ID)
      }
      const res1 = await postDataByParams('/api/v2/warehouse/detail', data1)
      if (res1.code === 200) {
        this.info = res1.data
      }
    },
    async getData1() {
      const data1 = {
        ID: Number(this.$mp.query.ID)
      }
      const res1 = await postDataByParams('/api/v2/warehouse/detail', data1)
      if (res1.code === 200) {
        this.info = res1.data
      }
    },
    async getData2() {
      const data1 = {
        ID: Number(this.$mp.query.ID)
      }
      const res1 = await postDataByParams('/api/v2/warehouse/detail', data1)
      if (res1.code === 200) {
        this.info = res1.data
      }
    }
  }
};
</script>

<style lang="scss" scoped>
.main {
  background: url("https://cdns.fontree.cn/fonchain-main/prod/image/407e7c22-eb62-411e-957b-b6c296fde530/artwork/a8a522e0-ca12-4e1f-8c67-996cb5287f47.png");
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  justify-content: start;
  align-items: center;
  padding: 32rpx;
  flex-direction: column;
  .content{
    margin-top: 60rpx;
    max-height: 800rpx;
    overflow-y: scroll;
    .content1{
      box-sizing: border-box;
      width: 686rpx;
      height: 390rpx;
      background-color: #fff;
      border-radius: 20rpx;
      padding-bottom: 20rpx;
      padding-top: 20rpx;
      padding-left: 20rpx;
      padding-right: 20rpx;
    &:not(:first-child){
      margin-top: 20rpx;
    }
      .wrap2{
        display: flex;
        padding-top: 18rpx;
        padding-bottom: 10rpx;
        .wrap2_2{
          margin-left: 34rpx;
          .wrap2_2_1{
            margin-top: 42rpx;
            &:first-child{
              margin-top: 0;
            }
            display: flex;
            .wrap2_2_1_1{
              margin-right: 60rpx;
              color: rgba(98, 98, 98, 1);
              font-size: 24rpx;
            }
            .wrap2_2_1_2{
              color: rgba(147, 147, 147, 1);
              font-size: 24rpx;
            }
          }
        }
        .wrap2_1{
          display: flex;
          flex-direction: column;
          align-items: center;
          .wrap2_1_3{
            color: rgba(147, 147, 147, 1);
            font-size: 24rpx;
          }
          .wrap2_1_2{
            margin-top: 10rpx;
            color: rgba(147, 147, 147, 1);
            font-size: 24rpx;

          }
          .wrap2_1_1{
            border-radius: 20rpx;
overflow: hidden;
            img{
              width: 190rpx;
              height: 190rpx;
            }
          }
        }
      }
      .wrap1{
        font-weight: bold;
        height: 60rpx;
        display: flex;
        align-items: center;

      }
    }
  }

  .info-right-item {
    color: #626262;
    display: flex;
    align-items: center;

    .title {
      padding-right: 56rpx;
      border-right: 1rpx solid #e4eaf1;
    }

    .content {
      padding-left: 34rpx;
    }
  }

  .info {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    height: 292rpx;
    border-radius: 20rpx;
    background: #fff;
    margin-top: 182rpx;
    padding: 20rpx;

    .info-right {
      width: 100%;
      margin-left: 34rpx;
      display: flex;
      flex-direction: column;
      color: #626262;
      justify-content: space-between;
    }
  }

  .order-info {
    box-sizing: border-box;
    margin-top: 20rpx;
    width: 100%;
    height: 292rpx;
    border-radius: 20rpx;
    padding: 22rpx 40rpx;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .tips {
    color: #76c458;
    margin-top: 170rpx;
  }

  .btns {
    margin-top: 30rpx;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
}
</style>