<template>
  <view class="contract-box">
    <view class="contract-top">
      <top-head :top-type="2"></top-head>
    </view>
    <view class="contract-data">
      <view class="data-input">
        <view class="input-item">
          <view class="item-detail">{{$t('index.contract.num')}}</view>
          <view class="item-detail">{{$t('index.contract.money')}}</view>
        </view>
        <view class="input-item">
          <view class="item-detail">100</view>
          <view class="item-detail item-img">
            <view class="text-img">
              <image src="@/static/img/index/bnb.png"></image>
            </view>
            <view class="text">BNB</view>
          </view>
        </view>
      </view>
      <view class="data-but">
        <button>定金</button>
      </view>
      <view class="data-button">
        <image src="@/static/img/index/msg.svg"></image>
        <view>{{$t('index.contract.word')}}>></view>
      </view>
    </view>
    <view class="contract-list">
      <view class="list-title">
        <view class="title-img">
          <image src="@/static/img/index/bnb2.png" mode="aspectFill"></image>
        </view>
        <view class="title-text">{{$t('index.contract.list.title')}}({{total}})</view>
      </view>
      <division></division>
      <contract-list @setTotal="setTotal"></contract-list>
    </view>
    <view class="contract-bottom"></view>
  </view>
</template>

<script>

import TopHead from "@/pages/index/components/top-head";
import Division from "@/pages/index/components/division";
import ContractList from "@/pages/index/components/contract-list";

export default {
  name: "contract",
  components: { ContractList, Division, TopHead},
  props: {},
  data() {
    return {
      total:0
    }
  },
  watch: {},
  mounted() {

  },
  methods: {
    setTotal(total){
      this.total=total
    },
    goToUrl(type) {
      switch (type) {
        case 1:
          uni.navigateTo({
            'url': 'pages/index/contract'
          })
          break
        case 2:
          uni.navigateTo({
            'url': 'pages/index/contract'
          })
          break
        case 3:
          uni.navigateTo({
            'url': 'pages/index/contract'
          })
          break
      }
    },
  }
}
</script>

<style scoped lang="scss">
.contract-box {
  box-shadow: 0 0 24rpx 0 rgba(0, 0, 0, 0.16);

  .contract-top {
    padding: 20rpx 0;
    background: #fff;
  }

  .contract-data {
    background: #fff;
    width: 90%;
    margin: 60rpx auto 0;
    border-radius: 20rpx;
    padding: 40rpx 20rpx;
    font-size: 36rpx;
    box-shadow: 0 8rpx 16rpx 0 rgba(0, 0, 0, 0.08);

    .data-input {
      border: 1rpx solid #000;
      overflow: hidden;
      border-radius: 10rpx;
      padding: 20rpx;

      .input-item {
        display: flex;
        justify-content: space-between;

        .item-detail {
          font-size: 26rpx;
        }
      }

      .item-img {
        display: flex;
        justify-content: right;

        .text-img {
          display: inline-block;
          border-radius: 50%;
          height: 60rpx;
          width: 60rpx;
          box-sizing: border-box;
          margin-right: 10rpx;

          image {
            width: 60rpx;
            height: 60rpx;
            z-index: 100;
          }
        }

        .text {
          line-height: 60rpx;
        }
      }

      .input-item:first-child {
        margin-bottom: 40rpx;
      }

      .input-item:last-child {
        height: 60rpx;

        .item-detail {
          font-size: 32rpx;
          line-height: 60rpx;
        }
      }
    }

    .data-but {
      border-radius: 20rpx;
      margin-top: 60rpx;

      button {
        height: 90rpx;
        line-height: 90rpx;
        text-align: center;
        background: rgb(0, 87, 255);
        color: #fff;
        font-size: 26rpx;
      }
    }

    .data-button {
      margin-top: 40rpx;
      display: flex;
      justify-content: right;
      image {
        width: 40rpx;
        height: 40rpx;
      }
      view {
        font-size: 26rpx;
        margin-left: 10rpx;
        color: rgb(0, 87, 255);
        line-height: 40rpx;
      }

    }

  }

  .contract-list {
    background: #fff;
    width: 90%;
    margin: 40rpx auto;
    border-radius: 10px;
    padding: 20px 10px;
    overflow: hidden;
    font-size: 13px;
    box-shadow: 0 8rpx 16rpx 0 rgba(0, 0, 0, 0.08);

    .list-title {
      display: flex;
      justify-content: left;

      .title-img {
        background: rgb(0, 87, 255);
        padding: 10rpx;
        border-radius: 20rpx;

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

      .title-text {
        margin-left: 20rpx;
        line-height: 100rpx;
        font-size: 34rpx;
        font-weight: bold;
      }
    }


  }

  .contract-bottom {
    height: 50rpx;
  }
}

</style>
