incomeItem.vue 2.26 KB
<template>
  <div class="assets-record-container">
    <div class='assets-record-left-view'>
      <img class='assets-record-image-style' :src="imgSrc" />
      <span class='assets-record-income-desc'>{{data.tradeDesc}}</span>
      </div>
      <div class='assets-record-middle-view'>
        <p class='assets-record-code-txt'>{{data.goodsName}}</p>
        <p class='assets-record-time-txt'>{{data.time}}</p>
      </div>

    <div class='assets-record-right-view'>
      <p class='assets-record-income-txt'>{{data.tradeType === 5 ? '-': '+'}}{{data.amount}}</p>
    </div>
  </div>
</template>

<script>
import trade1 from '../../../../statics/image/mine/tradeType1.png';
import trade2 from '../../../../statics/image/mine/tradeType2.png';
export default {
  name: 'income-item',
  props: {
      data: {
          type: Object,
          default: {}
      }
  },
  created(){

  },
  computed: {
    imgSrc() {
      return this.data.tradeType === 5 ?trade2: trade1
    }
  },
  data() {
    return {

    };
  },
};
</script>

<style lang="scss" scoped>
@import "../../../../statics/scss/variable";
  .assets-record-container {
    display: flex;
  margin: 0 40px;
  justify-content: space-between;
  align-items: center;
  height: 140px;
  border-bottom: solid 1px #E0E0E0;
}

.assets-record-left-view {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 120px;
}
.assets-record-middle-view {
  display: flex;
  flex-direction: column;
  margin-left: 20px;
  flex: 1;
  overflow: hidden;
}
.assets-record-right-view {
  display: flex;
  flex-direction: column;
  align-items:flex-end;
  width: 20%;
}
.assets-record-image-style {
  width: 48px;
  height: 48px;
}
.assets-record-code-txt {
  width: 100%;
  font-family: PingFang-SC-Regular;
  font-size: 28px;
  color: #000000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assets-record-time-txt {
  font-family: SFProText-Regular;
  font-size: 24px;
  color: #999999;
  margin-top: 12px;
}
.assets-record-income-txt {
  font-weight: bold;
  font-size: 28px;
  color: black;
  @include num
}
.assets-record-income-tip-txt {
  font-family: PingFang-SC-Regular;
  font-size: 20px;
  color: #D0021B;
}
.assets-record-income-desc {
  color: #444;
  margin-top: 5px;
}
</style>