<template>
  <div class="page">
    <section class="dui-footer__wrap">
        <div class="dui-footer__btn" @click="onSend">转发</div>
    </section>
    <section class="dui-share__methods" v-if="showMask">
        <div class="mask" @click="onClose"></div>
        <div class="share-wrap">
            <div class="close" @click="onClose"></div>
            <h5>分享到微信</h5>
            <ul>
              <li class="J_weixin" @click="onGroup"> <div>微信群</div> </li>
              <li class="J_pengyouquan" @click="onFriend"> <div>朋友圈</div> </li>
            </ul>
        </div>
        <div class="gudide-des" v-if="showGuider">从菜单中点击转发分享</div>
        <div class="share-yindao" v-if="showGuider">
          <img src="//yun.dui88.com/h5/miniprogram/kejiji/images/guide.png" alt="">
        </div>
    </section>
  </div>
</template>

<script>
import { get, post } from "@js/request";
import { getUrlParameter, isWeChatApplet } from "@js/tooler";
import share from "@js/share";

const SCID = getUrlParameter('scid');
const API = {
  h5info: '/kjy/mp/content/getInitDaily'
}

const inMiniprogram = isWeChatApplet();

export default {
  data() {
    return {
      showMask: false,
      showGuider: false
    };
  },
  props: {
    scid: {
        type: Number,
        default: 0
    }
  },
  methods: {
    initData(){

    },
    onSend(){
        this.showMask = true;
        this.$emit("doshare");
    },
    onClose(){
        this.showMask = false;
        this.showGuider = false;
    },
    onGroup(){
        this.showGuider = true;
    },
    onFriend(){
        console.log(this.scid);
        wx.miniProgram.navigateTo({url: '/pages/share/main?scid=' + this.scid});
    }
  },
  created() {
    this.initData();
  }
};
</script>

<style lang="less" scoped>
.dui-footer__wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 0;
    background-color: #FFF;
    font-size: 0;
    .dui-footer__btn{
      width: 480px;
      font-size: 36px;
      line-height: 90/36;
      background: #486EFF;
      border-radius: 48.5px;
      color: #FFFFFF;
      letter-spacing: 0.4px;
      text-align: center;
      margin: 0 auto;
      &::before{
        content: '';
        background-image: url('//yun.duiba.com.cn/h5/miniprogram/kejiji/images/repost.png');
        width:31px;
        height: 31px;
        background-repeat: no-repeat;
        display: inline-block;
        background-size: 100%;
        margin-right: 20px;
      }
    }
}
.dui-share__methods {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    left: 0;
    z-index: 10;
    top: 0;
    .mask{
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
    }
    .share-wrap{
      position: absolute;
      height: 320px;
      left: 0;
      bottom: 0;
      width: 100%;
      background-color: #fff;
      box-sizing: border-box;
      z-index: 1;
    }
    h5{
      font-size: 36px;
      font-weight: normal;
      text-align: center;
      margin: 30px 0 40px 0;
      box-sizing: border-box;
    }
    .close{
      background-image: url('//yun.duiba.com.cn/h5/bonus-account/images/close.png');
      width: 30px;
      height: 30px;
      position: absolute;
      top: 10px;
      right: 10px;
      background-size: 100%;
      background-repeat: no-repeat;
      z-index: 9999;
    }
    .gudide-des{
      display: block;
      font-size: 32px;
      color: #fff;
      position: absolute;
      top: 35%;
      transform:translateY(-50%);
      left: 50%;
      transform: translateX(-50%)
    }
    .share-yindao{
      display: block;
      position: absolute;
      right: 150px;
      top: 30px;
      width: 350px;
      height: 385px;
      img{
        width: 100%;
        height: 100%;
      }
    }
    ul{
      width: 100%;
      margin: 0;
      display: flex;
      padding: 0;
      justify-content: center;
      align-items: center;
      li{
        list-style: none;
        font-size: 28px;
        margin: 0 75px;
      }
      .J_weixin{
        position: relative;
        height: 300px;
        display: flex;
        flex-direction: column;
        align-items: center;
        &::before{
          content: '';
          width:100px;
          height: 100px;
          background-image: url('//yun.duiba.com.cn/h5/miniprogram/kejiji/images/weiixn.png');
          background-size: 100%;
          background-repeat: no-repeat;  
          margin-bottom: 20px;        
        }

      }
      .J_pengyouquan{
        position: relative;
        height: 300px;
        display: flex;
        flex-direction: column;
        align-items: center;
        &::before{
          content: '';
          width:100px;
          height: 100px;
          background-image: url('//yun.duiba.com.cn/h5/miniprogram/kejiji/images/pengyouquan.png');
          background-size: 100%;
          background-repeat: no-repeat;  
          margin-bottom: 20px;        
        }

      }      
    }
}
</style>