<template>
  <div class="buyGoodDivC">
    <div class="ui-modal-body" :style="styleData.uiModalBody">
      <div class="goodContainer">
        <div class="goodItemDiv" v-for="(item, index) in giftBagData.exposedGoods">
          <img class="goodImgDiv" :src="item.skuImg" />
          <div class="goodRightDiv">
            <div class="goodNameDiv">{{ item.skuName }}</div>
            <div class="goodPriceDiv">{{ item.skuPrice }}</div>
          </div>
        </div>
      </div>
      <div class="prizeContainer">
        <div class="prizeItemDiv" v-for="(item, index) in giftBagData.prizeData">
          <span>
            <span v-if="item.prizeType == '1' || item.prizeType == '4'">{{ item.beanNum }}</span>
            <span v-else-if="item.prizeType == '101'">{{ item.priceInfo }}</span>
            <span v-else-if="item.prizeType == '102'">{{ item.priceInfo }}</span>
          </span>
          <span>
            <span v-if="item.prizeType == '101' || item.prizeType == '102'">元</span>
            <span v-else-if="item.prizeType == '1'">个</span>
            <span v-else-if="item.prizeType == '4'"></span>
          </span>
          <span>{{ item.prizeTypeName }}</span>
        </div>
      </div>
      <div class="btnDiv" @click="btnClick()">加购领好礼</div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['styleData', 'giftBagData'],
  data() {
    return {};
  },
  created() {
    console.log(this.giftBagData, '加购礼包模板数据');
  },
  methods: {
    //收下礼包
    btnClick() {
      this.$emit('btnClickEmit', {});
    }
  }
};
</script>

<style lang="scss" scoped="scoped">
.buyGoodDivC {
  .goodContainer {
    width: 100%;
    height: 2.3rem;
    overflow-y: scroll;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-direction: column;
    position: absolute;
    top: 2.4rem;
    .goodItemDiv {
      background: url(https://img10.360buyimg.com/imgzone/jfs/t1/115545/12/18913/2224/5f745840E0e45ea24/4215f6c3fb192091.png) no-repeat;
      background-size: 100%;
      width: 4.5rem;
      height: 1.1rem;
      flex-shrink: 0;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      font-size: 0.24rem;
      color: #333333;
      margin-bottom: 0.1rem;
      .goodImgDiv {
        border: 0;
        max-width: 100% !important;
        vertical-align: middle;
        width: 1rem;
        height: 1rem;
        margin-left: 0.1rem;
      }
      .goodRightDiv {
        margin-left: 0.2rem;
        width: 3.2rem;
        text-align: left;
        .goodNameDiv {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        .goodPriceDiv {
          color: rgb(242, 60, 60);
        }
      }
    }
  }
  .prizeContainer {
    background: url(https://img10.360buyimg.com/imgzone/jfs/t1/132303/35/11182/45009/5f745840Ea79b7769/178ca3855e559215.png) no-repeat;
    background-size: 100%;
    width: 5rem;
    height: 2.79rem;
    position: absolute;
    left: 0;
    bottom: 0;
    pointer-events: none;
    padding-top: 1rem;
    box-sizing: border-box;
    .prizeItemDiv {
      font-size: 0.36rem;
      color: #ffecb1;
      width: 100%;
      text-align: center;
    }
  }
  .btnDiv{
    background: url(https://img10.360buyimg.com/imgzone/jfs/t1/140721/23/9739/14379/5f74583fEb2530034/f24f4589f7b58b59.png) no-repeat;
      background-size: 100%;
      width: 4rem;
      height: .89rem;
      margin: 0rem auto 0;
      padding-top: .1rem;
      box-sizing: border-box;
      text-align: center;
      font-size: .42rem;
      color: #d01b35;
      position: absolute;
      bottom: -1rem;
      left: calc(50% - 2rem);
  }
}
</style>
