<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" v-if="giftBagData.isShowPrice == 1">{{ item.skuPrice }}</div>
          </div>
        </div>
      </div>
       <div class="prizeBox">
          <div class="prizeItemDiv" v-for="(item, index) in giftBagData.prizeData" :key="index">
          {{item.prizeName}}
        </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: 4.2rem;
    overflow-y: scroll;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-direction: column;
    position: absolute;
    top: 1.8rem;
    .goodItemDiv {
      background: url(https://img10.360buyimg.com/imgzone/jfs/t1/234073/29/24433/15952/66c82d4cFa212ed0d/43ce085904015baf.png) no-repeat;
      background-size: 100%;
      width: 4.91rem;
      height: 1.59rem;
      flex-shrink: 0;
      display: flex;
      justify-content: flex-start;
      // align-items: center;
      padding-top: .1rem;
      font-size: 0.24rem;
      color: #333333;
      margin-bottom: 0.1rem;
      .goodImgDiv {
        border: 0;
        max-width: 100% !important;
        vertical-align: middle;
        width: 1.2rem;
        height: 1.2rem;
        margin-left: 0.2rem;
      }
      .goodRightDiv {
        margin-left: 0.2rem;
        width: 3.2rem;
        text-align: left;
        .goodNameDiv {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          color: #fff;
        }
        .goodPriceDiv {
          color: #fff;
        }
      }
    }
  }
   .prizeBox {
      font-size: 0.36rem;
      color: #fff;
      width: 4.6rem;
      height: .54rem;
      text-align: center;
      border-radius: .27rem;
      background: #d9838c;
      margin:0 auto;
      position: absolute;
      bottom: .7rem;
      left:calc(50% - 2.4rem);
      .prizeItemDiv {
          width: 33%;
          height: 100%;
          font-size: 0.28rem;
          display: flex;
          justify-content: center;
          align-items: center;
        }
    }
  .btnDiv{
    background: url(https://img10.360buyimg.com/imgzone/jfs/t1/109569/4/49058/27674/66c82d4dFd26889eb/8002444f5c9e6fe6.png) no-repeat;
      background-size: 100%;
      width: 3.64rem;
      height: .78rem;
      margin: 0rem auto 0;
      padding-top: .1rem;
      box-sizing: border-box;
      text-align: center;
      font-size: .42rem;
      color: #d01b35;
      position: absolute;
      bottom: -.25rem;
      left: calc(50% - 3.64rem / 2);
  }
}
</style>
