<template>
  <view class="goodsItem u-border-one-one  u-flex-center">
    <image :src="value.goods_cover" v-if="value.goods_cover" class="u-goods200 u-ml15" mode=""></image>
    <image :src="value.goods_img" v-if="value.goods_img" class="u-goods200 u-ml15" mode=""></image>
    <view class="u-flex1 u-flex-column-start rightText u-ml30 ">
      <view class="u-text2 u-1A1A1A u-font28 textWidth u-text2">
        <text class="thirdTag" v-if="value.third">第三方</text><text>{{ value.goods_title }}</text>
      </view>
      <view style="justify-content: flex-end;" class="u-flex-column-start u-flex1">
        <text class="u-font22 u-999" v-if="value.sku_set_name">规格： {{ value.sku_set_name }}</text>
        <view class="u-font26 u-999 u-ml15" v-if="value.num">x {{ value.num }}</view>
        <view class="u-font26 u-999 u-ml15" v-if="value.number">x {{ value.number }}</view>
        <view class="u-flex-center botPrice">
          <view class="u-FF0000 u-font32 " v-if="isInter">{{ value.exchange_point }}积分</view>
          <view class="u-FF0000 u-font32 " v-else>
            <rich-text v-if="isGroup" :nodes="$mUtil.priceBigSmall(value.real_price)"></rich-text>
            <rich-text v-else :nodes="$mUtil.priceBigSmall(value.sale_price)"></rich-text>
          </view>
          <text class="u-del u-ml15 u-999" v-if="value.market_price && zhe && !isFree">￥{{ value.market_price }}</text>
          <text v-if="value.market_price && zhe && !isFree">
            <text class="u-ml15 u-999"
              v-if="isGroup">{{ ((value.real_price / value.market_price) * 10).toFixed(1) }}折</text>
            <text class="u-ml15 u-999" v-else>{{ ((value.sale_price / value.market_price) * 10).toFixed(1) }}折</text>
          </text>
          <!-- <text class="u-font26 u-666 u-ml15" v-if="value.num">x {{value.num}}</text>
					<text class="u-font26 u-666 u-ml15" v-if="value.number">x {{value.number}}</text> -->
        </view>
      </view>
    </view>
    <view class="u-FF0000 u-font28 back_status" v-if="value.rights_status == 1 && value.rights_type == 1">申请退款中</view>
    <view class="u-FF0000 u-font28 back_status" v-if="value.rights_status == 1 && value.rights_type == 2">申请退货中</view>
    <view class="u-FF0000 u-font28 back_status" v-if="value.rights_status == 2 && value.rights_type == 1">退款完成</view>
    <view class="u-FF0000 u-font28 back_status" v-if="value.rights_status == 2 && value.rights_type == 2">退货完成</view>
    <view class="btnComment_status" v-if="value.transaction_status == 5 && value.comment_status == 0 && position == 0"
      @click="evaluation(value.id)">去评价</view>
  </view>
</template>

<script>
  export default {
    props: {
      value: {
        type: Object,
        default: {}
      },
      position: {
        type: Number,
        default: 0
      },
      keys: {
        type: Number,
        default: 0
      },
      isGroup: {
        type: Boolean,
        default: false
      },
      isInter: {
        type: Boolean,
        default: false
      },
      zhe: {
        type: Boolean,
        default: true
      },
      isFree: {
        type: Boolean,
        default: true
      }
    },
    data() {
      return {
        price: 66.2
      };
    },
    methods: {
      evaluation(id) {
        let data = {
          id: id,
          keys: this.keys
        };
        this.$emit('parentevaluation', data);
      }
    }
  };
</script>

<style>
  .bottext {
    /* margin-top: 44rpx; */
  }

  .goodsItem {
    padding: 40rpx 0;
    position: relative;
    border-bottom: 1rpx solid #e7e7e7;
  }

  .thirdTag {
    display: inline-block;
    background: #30b885;
    border-radius: 10rpx;
    line-height: 40rpx;
    text-align: center;
    margin-right: 10rpx;
    padding: 0 10rpx;
    color: #fff;
    font-size: 26rpx;
  }

  .textWidth {
    /* width: 420rpx; */
    height: 80rpx;
    line-height: 40rpx;
  }

  .btnComment_status {
    position: absolute;
    right: 0;
    bottom: 30rpx;
    background-color: #FA6138;
    width: 180rpx;
    height: 60rpx;
    text-align: center;
    line-height: 60rpx;
    color: #fff;
    font-size: 28rpx;
    border-radius: 40rpx;
  }

  .back_status {
    position: absolute;
    right: 30rpx;
    bottom: 30rpx;
    text-align: center;
    line-height: 60rpx;
  }
</style>
