<template>
  <div id="goods-1">
    <!-- <el-row>
      <el-col :span="24" class="main"> -->
    <el-col :span="24" v-for="(item, index) in list" :key="index">
      <el-col :span="24" class="goods" v-if="!item.is_set">
        <el-col :span="6" class="image">
          <el-image v-if="item.file && item.file.length != 0" :src="item.file[0].url" style="width: 120px; height: 100px"></el-image>
          <el-image v-else-if="item.goods.file && item.goods.file" :src="item.goods.file[0].url" style="width: 120px; height: 100px"></el-image>
          <el-image v-else-if="item.url" :src="item.url" style="width: 120px; height: 100px"> </el-image>
        </el-col>
        <el-col :span="18">
          <el-col :span="12">
            <el-col :span="24"> {{ item.goods.name }} </el-col>
            <el-col :span="24"> 规格：{{ item.name }} </el-col>
          </el-col>
          <el-col :span="12" class="money">
            <el-col :span="24" style="color: red; font-size: 20px">
              <p v-if="form.type == '0' && item.price">￥{{ item.price }}</p>
              <p v-else-if="form.type == '0' && !item.price">￥{{ item.sell_money }}</p>
              <p v-else-if="form.type == '1'">￥{{ item.group_config.money }}</p>
            </el-col>
            <el-col :span="24"> X{{ item.buy_num }} </el-col>
            <el-col :span="24">
              <span class="spanfour" style="color: blue; cursor: pointer" @click="toUrl(item.goods.url)"> 查看商品来源:{{ item.goods.source }}</span>
            </el-col>
            <el-col :span="24"> {{ item.is_afterSale == true ? '已申请售后' : '未申请售后' }} </el-col>
            <el-col :span="24">{{ item.is_rate == true ? '已评价' : '未评价' }}</el-col>
          </el-col>
        </el-col>
        <el-col :span="24" class="bode">
          <el-col :span="6">订单备注</el-col>
          <el-col :span="18" class="other">{{ item.remarks || '' }}</el-col>
        </el-col>
        <el-col :span="24" class="bode">
          <el-col :span="6">运费</el-col>
          <el-col :span="18" class="other" v-if="!item.goods.freight == '0'">{{ item.goods.freight }}</el-col>
          <el-col :span="18" class="other" v-else>包邮</el-col>
        </el-col>
      </el-col>
    </el-col>
    <!-- </el-col>
    </el-row> -->
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'goods-1',
  props: {
    list: { type: Array },
    form: { type: Object },
  },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    toUrl(url) {
      this.$emit('toUrl', url);
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.shop {
  padding: 4px 0;
  font-size: 18px;
  border-bottom: 1px solid #ccc;
}
.goods {
  padding: 10px 0;
  .image {
    padding: 0 10px 0 0;
  }
  .money {
    text-align: right;
  }
}
.other {
  text-align: right;
  word-break: break-all;
  p {
    color: red;
    font-size: 20px;
  }
  .spanfour {
    color: blue;
  }
}
.el-col {
  margin: 4px 0;
}
.bode {
  border-bottom: 1px solid rgb(238, 237, 237);
}
</style>
