 <template>
  <div class="mymaster2" style="margin-top: 2.6rem">
    <!-- <%--                <div class="obtitlebg" style="top:2.58rem;"><div class="obtitletext" style="color:#440f0f">我的召唤师</div></div>--%> -->
    <div
      class="person-item captain"
      style="width: 6rem; position: absolute; top: -0.7rem"
    >
      <div class="personicon">
        <div class="personiconinfo">
          <img
            :src="
              userImg == ''
                ? 'https://img10.360buyimg.com/imgzone/jfs/t1/21383/2/6633/3879/5c5138d8E0967ccf2/91da57c5e2166005.jpg'
                : userImg
            "
            style="width: 100%; height: 100%; border-radius: 50%"
          />
        </div>
      </div>
      <div class="persontag" style="width: 100%; margin-top: 0rem">
        {{ nickName | twostar }}
      </div>
      <template v-if="sendStatus == 1">
        <div style="color: #f8ce82; font-size: 0.28rem; font-weight: 700">
          成功瓜分<template v-if="prizeType == 1">京豆</template
          ><template v-if="prizeType == 4">积分</template>
        </div>
      </template>
      <template v-else>
        <!-- <%--<img style="width: 2rem;height: 0.3rem" src="https://img10.360buyimg.com/imgzone/jfs/t25387/132/2427695807/1347/afca95da/5be442f2Nb12c6a67.png">--%> -->
        <div style="color: #ccc; font-size: 0.26rem">
          等待瓜分<template v-if="prizeType == 1">京豆</template
          ><template v-if="prizeType == 4">积分</template>...
        </div>
      </template>
    </div>
  </div>
</template>

<script>
import { goToSkuPage } from "../../../util/tools.js";
import apis1 from "../../../util/apis1.js";
import store from "../../../store/store.js";
export default {
  components: {
    store,
  },
  props: ["datas", "keyData", "styleData", "isTemplate"],
  data() {
    return {
      exposureList: [],
      userImg: "",
      nickName: "",
      sendStatus: 1,
      prizeType: 0,
    };
  },
  mounted() {
    this.exposureList = [];
  },
  created() {
    this.initData();
  },
  methods: {
    initData() {
      this.publicData.$emit("isKe", false);
      this.shareUserId = store.state.shareUserId;
      let goodsList = apis1[this.datas.goodsList];
      var shareUserId = this.shareUserId;
      goodsList(shareUserId, (data) => {
        this.exposureList = data.data;
        this.userImg = data.data.shareImage;
        this.nickName = data.data.shareNick;
        this.sendStatus = data.data.captainList[0].sendStatus;
        this.prizeType = data.data.prizeType;
      });
    },
    goToBuy(sku) {
      goToSkuPage(sku);
    },
  },
};
</script>

<style>
.mymaster2 .captain .personicon {
  background: url(//img10.360buyimg.com/imgzone/jfs/t1/44471/2/3818/15272/5d1095e8Eee9f1893/7b027e0805550400.png)
    no-repeat;
  background-size: 100%;
  height: 1.7rem;
  width: 1.8rem;
}
.mymaster2 .captain .personicon .personiconinfo {
  width: 1.5rem;
  height: 1.5rem;
}
.mymaster2 .persontag {
  margin-bottom: 0;
}

.mymaster2 .captain .persontag {
  color: #fff;
}

.mymaster2 {
  width: 7.21rem;
  min-height: 3rem;
  /*border: 2px solid #fff;*/
  border-radius: 0.2rem;
  margin: 0.6rem auto 0;
  background: url(//img10.360buyimg.com/imgzone/jfs/t1/69059/7/2771/32919/5d108f8aE65dac15f/583437223034341a.png)
    no-repeat;
  background-size: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  position: relative;
  margin-top: 0.5rem;
}
</style>