<template>
  <view class="promotionRecordList">
    <view class="item" v-for="(item, index) in list"
          @click="gotoItem(item)"
          :key="index">
      <image :src="item.image" style="width: 40%"></image>
      <view class="text">
        <view>
          <view class="title">
            {{ item.name }}
          </view>
          <view class="createBy">
            <view class="">
              推广时效：{{ item.tuTime }}天
            </view>
          </view>
        </view>

        <view>
          <view class="isPay">
            <view class="">
              价格：{{ item.price }}
            </view>
          </view>
          <view class="createTime">
            推广时间：{{ item.createTime }}
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: "promotionRecordList",
  props: ['list'],
  data() {
    return {};
  },
  methods: {
    gotoItem(item) {
      uni.navigateTo({
        url: '/pages_mine' + `/mine/sonPage/promotion/promotionDetail?id=${item.id}`
      })
	  // uni.navigateTo({
	  //   url: `/pages_mine/mine/sonPage/promotion/promotionDetail?item=${encodeURIComponent(JSON.stringify(item))}`
	  // })
    },

  },
}
</script>

<style lang="scss" scoped>
.promotionRecordList {
  width: 90%;

  .item {
    height: 220rpx;
    width: 100%;
    background-color: #fff;
    overflow: hidden;
    border-radius: 10rpx;
    color: #777;
    display: flex;
    font-size: 24rpx;
    margin: 30rpx 0;
    /* 为第一个.item设置不同的上边距 */
    &.first-item {
      margin-top: 0; /* 可以根据需要调整数值 */
    }

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

    .text {
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      padding: 10rpx 0 10rpx 16rpx;
      width: 52%;

      .title {
        font-size: 30rpx;
        font-weight: 600;
        color: #000;
      }

      .createBy {
        display: flex;
        justify-content: space-between;

        & > view {
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }

      .isPay {
        display: flex;
        color: #7395f4;
        justify-content: space-between;

        & > view {
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }

      .createTime {
        display: flex;
        justify-content: space-between;

        & > view {
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }


    }
  }
}
</style>