ufoPassport.vue 7.63 KB
<template>
  <div class="full">

    <div class="header">
      <div class="back-wrapper flex" @touchend="onBack">
        <div class="back"></div>
      </div>
      <div class="title flex">
          <span class="title-inner">UFO PASSPORT</span>
      </div>
    </div>

    <div style="width: 100%;">
      <div class="user-item">
        <WidgetAvatar class="avatar-box" :class="{'avatar-opacity': userPassportInfo.headIcon}" :src="userPassportInfo.headIcon" :width="100" :height="100"></WidgetAvatar>
        <p class="user-name">{{userPassportInfo.content}}</p>
        <p class="user-time">{{userPassportInfo.timeStr}}购于UFO飞碟好物</p>
      </div>

      <div class="product-item">
        <div class="medal-img"></div>
        <ImgSize class="product-image" :src="shareIdentifyInfo.productImageUrl" :width="200" :height="200"></ImgSize>
        <div class="product-size">{{shareIdentifyInfo.productSize}}码</div>
        <div class="product-name">{{shareIdentifyInfo.productName}}</div>
        <div class="provideo-btn" @click="playVideoOperation(shareIdentifyInfo.vedioFileUrl)"></div>
        <VideoPlayer ref="videoPlay" class="play-video" :source="shareIdentifyInfo.vedioFileUrl"></VideoPlayer>
        <div class="identify-plat">{{shareIdentifyInfo.identifyPlat}}</div>
        <div class="identify-name">{{shareIdentifyInfo.identifyUserName}}</div>
        <div class="identify-level">资深鉴定师</div>
        <div class="identify-image"></div>
      </div>

      <div v-if="ufoPassportProductList.length > 0" class="recommend-shoes">
        <div class="rec-little">撞鞋不可怕,谁没谁尴尬</div>
        <div class="rec-large">你想要的球鞋,这里都有</div>

        <div class="recommend-list">
          <ul>
            <li v-for="item in ufoPassportProductList" :key="item.id" @click="goProductDetail(item.id)">
              <ImgSize class="pro-img" :src="item.default_images" :width="200" :height="200"></ImgSize>
            </li>
          </ul>
        </div>
      </div>

      <div class="operate-wrap">
        <button class="login-btn" @click="loginToUFoPage">登录UFO</button>
      </div>

    </div>
  </div>
</template>

<script>
import WidgetAvatar from './components/widget-avatar';
import ImgSize from '../../../components/img-size';
import VideoPlayer from '../../../components/video-player';

import {createNamespacedHelpers} from 'vuex';
const {mapState, mapMutations, mapActions} = createNamespacedHelpers('invite/invite');

export default {
  name: 'ufoPassport',
  components: { WidgetAvatar, ImgSize, VideoPlayer },
  data() {
    return {
    };
  },
  computed: {
    ...mapState(['ufoPassportProductList', 'shareIdentifyInfo', 'userPassportInfo']),
  },
  methods: {
    ...mapMutations({
    }),
    ...mapActions(['fetchUfoPassportProductList', 'fetchUfoShareIdentifyInfo']),
    onBack() {
      this.$yoho.finishPage({});
    },
    loginToUFoPage() {
      this.$yoho.goNewPage({
        url: 'https://union.yoho.cn/union/app-downloads.html?union_type=100000000000349&client_id=1927079456&openby:yohobuy= {"action":"go.ufo","params":{"pagename":"home"}}'
      });
    },
    goProductDetail(productId) {
      this.$yoho.goUfoProductDetail(productId);
    },
    playVideoOperation(videoUrl) {
      if (!videoUrl) {
        return;
      }
      this.$refs.videoPlay.parentHandleclick();
    }
  },
  mounted() {
    this.fetchUfoShareIdentifyInfo(
      { tagId: this.$route.params.tagId }
    );

    this.fetchUfoPassportProductList();
  }
};
</script>

<style lang="scss" scoped>
  .full {
    position: relative;
    background-color: #000;
  }

  .user-item {
    width: 100%;
    text-align: center;
  }

  .avatar-box {
    margin-top: 105px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 300ms ease-in-out;

    &.avatar-opacity {
      opacity: 1;
    }

    > img {
      width: 100%;
      height: 100%;
      display: block;
    }
  }

  .user-name {
    color: #fff;
    font-weight: bold;
    font-size: 40px;
    margin-top: 16px;
    line-height: 56px;
  }

  .user-time {
    color: #b0b0b0;
    font-size: 11px;
    margin-top: 8px;
    line-height: 32px;
  }

  .product-item {
    display: inline-block;
    text-align: center;
    width: calc(100% - 104px);
    margin-top: 40px;
    margin-left: 52px;
    margin-right: 52px;
    background-color: #fff;
    border-style: solid;
    border-width: 20px;
    border-color: #072f4a;

    .medal-img {
      position: absolute;
      top: 425px;
      right: 84px;
      width: 100px;
      height: 148px;
      background-repeat: no-repeat;
      background-image: url("~statics/image/passport/medal_img.png");
      background-size: contain;
    }

    .product-image {
      display: inline-block;
      margin-top: 16px;
      width: 120px;
      height: 120px;
    }

    .product-size {
      font-size: 24px;
      color: #000;
      line-height: 28px;
    }

    .product-name {
      margin-top: 8px;
      margin-left: calc(50% - 176px);
      font-size: 24px;
      color: #000;
      font-weight: 500;
      max-height: 60px;
      max-width: 352px;
    }

    .provideo-btn {
      display: inline-block;
      margin-top: 30px;
      height: 48px;
      width: 154px;
      background-image: url("~statics/image/passport/identy_video_btn.png");
      background-size: contain;
      background-repeat: no-repeat;
    }

    .play-video {
      display: block;
      height: 30px;
      opacity: 0;
    }

    .identify-plat {
      font-size: 22px;
      color: #000;
      letter-spacing: 0.5px;
      line-height: 26px;
    }

    .identify-name {
      margin-top: 18px;
      font-size: 28px;
      color: #000;
      line-height: 34px;
    }

    .identify-level {
      font-size: 22px;
      color: #000;
      line-height: 32px;
    }

    .identify-image {
      margin-top: 40px;
      height: 592px;
      background-image: url("~statics/image/passport/identy_img.png");
      background-size: contain;
    }
  }

  .recommend-shoes {
    display: inline-block;
    text-align: center;
    margin-top: 100px;

    .rec-little {
      font-size: 24px;
      color: #fff;
      line-height: 34px;
    }

    .rec-large {
      margin-top: 14px;
      font-size: 40px;
      color: #fff;
      line-height: 56px;
    }
  }

  .recommend-list {
    padding: 36px 44px 10px 52px;
    overflow: hidden;
    width: calc(100%);

    ul {
      width: 100%;
      overflow: hidden;
    }

    li {
      float: left;
      width: calc((100% - 24px) / 3);
      height: 210px;
      margin: 0 8px 8px 0;
      display: flex;
    }

    .pro-img {
      width: 100%;
      height: 100%;
    }
  }

  .operate-wrap {
    padding: 60px 52px 100px;

    .login-btn {
      width: 100%;
      display: block;
      font-size: 28px;
      line-height: 100px;
      color: #fff;
      background: #072f4a;
    }
  }

  .header {
    position: absolute;
    width: 100%;
    height: 45PX;
    padding-left: 20PX;
    padding-right: 20PX;
    background-color: #000;
    display: flex;
    align-items: stretch;
    box-sizing: border-box;

    .flex {
      display: flex;
      align-items: center;
    }

    .back-wrapper {
      height: 100%;
      width: 60PX;
    }

    .back {
      width: 24PX;
      height: 24PX;
      background: url(~statics/image/alipay/back@3x.png) no-repeat;
      background-size: cover;
    }

    .title {
      flex: 1;
      justify-content: center;
      font-size: 17PX;
      overflow: hidden;
      z-index: 1;
      color: #fff;
      font-weight: bold;

      .title-inner {
        max-width: 90%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
      }
    }
  }
</style>