<template>
  <div id="tool">
    <div class="cropper" v-if="cropperShow">
      <vueCropper
        ref="cropper"
        :img="option.img"
        :outputSize="option.size"
        :outputType="option.outputType"
        :info="option.info"
        :full="option.full"
        :canMove="option.canMove"
        :canMoveBox="option.canMoveBox"
        :original="option.original"
        :autoCrop="option.autoCrop"
        :autoCropWidth="option.autoCropWidth"
        :autoCropHeight="option.autoCropHeight"
        :fixedBox="option.fixedBox"
      ></vueCropper>
      <div class="cropperOpt">
        <span @click="cropperShow=false">取消</span>
        <span @click="croppSure">完成</span>
      </div>
    </div>
    <!-- 21天模板 -->
    <div id="posterCon" class="posterCon_21" v-if="days==21||days==150">
      <div id="posterBox">
        <div id="poster21Box" :style="{background: uploadPic?'none':backgroundColor}">
          <img class="poster21BoxPhoto" :src="uploadPic" v-show="uploadPic">
          <img class="poster21BoxBg" :src="templateUrl">
        </div>
        <div id="posterBoxText">
          <p>{{posterText2}}</p>
          <p>{{posterText1}}</p>
        </div>
        <div id="addpicBox">
          <img @click="selectPic" src="../assets/addpic.png">
        </div>
        <div id="posterBom">
          <div id="posterTime">
            <div :style="{background: backgroundColor}">
              <input type="tel" id="currentDayInput" @blur="inputBlur" v-model="currentDay" placeholder="请输入" maxlength="2">
              <span>/{{days}}</span>
            </div>
            <p :style="{color: backgroundColor}">“让护眼，像刷牙一样成为习惯”</p>
          </div>
          <div id="posterQRcode">
            <div :style="{background: backgroundColor}">
              <img :src="qrcodeUrl">
            </div>
            <p>扫码参与</p>
            <p>护眼活动</p>
          </div>
        </div>
      </div>
      <img src="../assets/shadow.png">
    </div>
    <!-- 60天模板 -->
    <div id="posterCon" class="posterCon_60" v-if="days==60">
      <div id="posterBox">
        <img :src="templateUrl">
        <div id="posterBoxText">
          <div>
            <p>{{posterText2}}</p>
            <p>{{posterText1}}</p>
          </div>
          <div :style="{background: backgroundColor}">欧欧眼保仪</div>
        </div>
        <div id="addpicBox">
          <img @click="selectPic" src="../assets/addpicBlack.png">
          <img :src="uploadPic" v-show="uploadPic">
        </div>
        <div id="posterBom">
          <div id="posterBomWrap" :style="{background: backgroundColor}">
            <div id="posterTime">
              <div>
                <input type="tel" id="currentDayInput" @blur="inputBlur" v-model="currentDay" placeholder="请输入" maxlength="2">
                <span>/{{days}}</span>
              </div>
              <p>“让护眼，像刷牙一样成为习惯”</p>
            </div>
            <div id="posterQRcode">
              <div>
                <img :src="qrcodeUrl">
              </div>
              <p>扫码参与护眼活动</p>
            </div>
          </div>
        </div>
      </div>
      <img src="../assets/shadow.png">
    </div>
    <div id="createButton">
      <span @click="upload">上传截图</span>
      <span @click="create">生成海报</span>
    </div>
    <!-- 21天海报 -->
    <div id="posterOut" v-if="days==21||days==150">
      <!-- <img :src="templateUrl"> -->
      <div id="posterOut21Box">
        <img class="poster21BoxPhoto" :src="uploadPic" v-show="uploadPic">
        <img class="poster21BoxBg" :src="templateUrl">
      </div>
      <div id="posterOutText">
        <p>{{posterText2}}</p>
        <p>{{posterText1}}</p>
      </div>
      <!-- <div id="posterOutAddpicBox">
        <img :src="uploadPic">
      </div> -->
      <div id="posterOutBom">
        <div id="posterOutTime">
          <div :style="{background: backgroundColor}">
            <span>{{currentDay}}</span>/{{days}}
          </div>
          <p :style="{color: backgroundColor}">“让护眼，像刷牙一样成为习惯”</p>
        </div>
        <div id="posterOutQRcode">
          <div :style="{background: backgroundColor}">
            <img :src="qrcodeUrl">
          </div>
          <p>扫码参与</p>
          <p>护眼活动</p>
        </div>
      </div>
    </div>
    <!-- 60天海报 -->
    <div id="posterOut" class="posterOut_60" v-if="days==60">
      <img :src="templateUrl">
      <div id="posterOutText">
        <div>
          <p>{{posterText2}}</p>
          <p>{{posterText1}}</p>
        </div>
        <div :style="{background: backgroundColor}">欧欧眼保仪</div>
      </div>
      <div id="posterOutAddpicBox">
        <img :src="uploadPic">
      </div>
      <div id="posterOutBom">
        <div id="posterOutWrap" :style="{background: backgroundColor}">
          <div id="posterOutTime">
            <div>
              <span>{{currentDay}}</span>/{{days}}
            </div>
            <p>“让护眼，像刷牙一样成为习惯”</p>
          </div>
          <div id="posterOutQRcode">
            <div>
              <img :src="qrcodeUrl">
            </div>
            <p>扫码参与护眼活动</p>
          </div>
        </div>
      </div>
    </div>
    <div id="poster" v-show="showPoster" @touchmove.prevent>
      <img :src="posterUrl">
      <img id="posterClose" @click="close" src="../assets/icon_close.png">
    </div>
    <div class="applyDialog" v-show="applyDialogShow">
      <div class="applyDialogCon">
        <p>您还未报名，报名后可用。</p>
        <div>
          <span @click="applyDialogShow=false">我知道了</span>
          <span @click="toIndex">前往报名</span>
        </div>
      </div>
    </div>
    <div class="tipDialog" v-show="tipDialogShow">
      <div class="tipDialogCon">
        <p>{{tipDialogText}}</p>
        <span @click="tipDialogShow=false">知道了</span>
      </div>
    </div>
    <div class="createDialog" v-show="createDialogShow">
      <div class="createDialogCon">
        <p>如何打卡：</p>
        <p>1.长按生成的海报保存</p>
        <p>2.将海报发朋友圈并截图</p>
        <p>3.回到活动工具，点击上传截图</p>
        <div>
          <span @click="createDialogShow=false">我知道了</span>
        </div>
      </div>
    </div>
    <navigation :is-x="isX" :apply-status="applyStatus" :tool-status="toolStatus" :mine-status="mineStatus"></navigation>
    <div id="guideBox" @click="guide" v-if="guideStatus==0">
      <img v-if="guideId==1" src="../assets/guide1.jpg">
      <img v-else-if="guideId==2" src="../assets/guide2.jpg">
      <img v-else-if="guideId==3" src="../assets/guide3.jpg">
      <img v-else="guideId==4" src="../assets/guide4.jpg">
    </div>
    <loading :loadingShow="loadingShow"></loading>
  </div>
</template>
<script>
import navigation from '../components/navigaton/navigation.vue'
import html2canvas from 'html2canvas'
import request from '../utils/request'
import loading from '../components/loading/loading.vue'

export default {
  data() {
    return{
      option: {
        img: '', // 裁剪图片的地址
        info: true, // 裁剪框的大小信息
        outputSize: 1, // 剪切后的图片质量（0.1-1）
        full: true, // 输出原图比例截图 props名full
        outputType: 'png', // 裁剪生成额图片的格式
        canMove: true,  // 能否拖动图片
        original: false,  // 上传图片是否显示原始宽高
        canMoveBox: true,  // 能否拖动截图框
        autoCrop: true, // 是否默认生成截图框
        autoCropWidth: 200,
        autoCropHeight: 150,
        fixedBox: false // 截图框固定大小
      },
      cropperShow: false,


      posterUrl: '',
      showPoster: false,
      isX: false,
      applyStatus: false,
      toolStatus: true,
      mineStatus: false,
      loadingShow: false,//加载

      posterText1: '明亮眼睛',
      posterText2: '光明的视界',
      qrcodeUrl:'',
      templateUrl:'',
      backgroundColor:'',
      days:'',
      currentDay: '',
      enrollStatus: '',
      uploadPic: '',// 上传的头像地址
      status: '',

      activityId: '',

      applyDialogShow: false,
      createDialogShow: false,

      appId: '', // 必填，公众号的唯一标识
      timestamp: '', // 必填，生成签名的时间戳
      nonceStr: '', // 必填，生成签名的随机串
      signature: '',// 必填，签名

      tipDialogShow: false,
      tipDialogText: '',

      guideStatus: 1,//是否进行过新手引导 1：已经引导过 0：未引导过
      guideId: 1,// 引导顺序

    }
  },
  components: {
    navigation, loading
  },
  mounted() {
    let _url = document.location.href.split('#')[0]
    request({
      url: '/api/MarketingToolApi/Wechat/getSignPackage',
      method: 'post',
      data: {
        url : _url,
        token: localStorage.getItem("token")
      }
    }).then(response => {
      this.appId = response.data.appId
      this.nonceStr = response.data.nonceStr
      this.signature = response.data.signature
      this.timestamp = response.data.timestamp

      wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: this.appId, // 必填，公众号的唯一标识
        timestamp: this.timestamp, // 必填，生成签名的时间戳
        nonceStr: this.nonceStr, // 必填，生成签名的随机串
        signature: this.signature,// 必填，签名
        jsApiList: ['chooseImage','uploadImage','hideMenuItems'] // 必填，需要使用的JS接口列表
      })
      wx.ready(function(){


        wx.hideMenuItems({
          menuList: ["menuItem:share:qq","menuItem:share:weiboApp","menuItem:share:facebook","menuItem:share:QZone","menuItem:copyUrl","menuItem:openWithQQBrowser","menuItem:openWithSafari","menuItem:share:email","menuItem:share:brand"] // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮
        });

      })
      wx.error(function(res){})
    })

    this.loadingShow = true
    request({
      url: '/api/MarketingToolApi/Posters/template',
      method: 'post',
      data: {
        token: localStorage.getItem("token")
      }
    }).then(response => {
      this.loadingShow = false
      this.activityId = response.data.activityId
      this.qrcodeUrl = response.data.qrcodeUrl
      this.posterText1 = response.data.note1
      this.posterText2 = response.data.note2
      this.templateUrl = response.data.templateUrl
      this.backgroundColor = response.data.backgroundColor
      this.days = response.data.days
      this.enrollStatus = response.data.enrollStatus
      this.status = response.data.status

      this.guideStatus = response.data.guideStatus

      if(this.days==60){
        this.option.autoCropWidth = document.documentElement.clientWidth
        this.option.autoCropHeight = document.documentElement.clientWidth/1.364
      }else{
        this.option.autoCropWidth = document.documentElement.clientWidth
        this.option.autoCropHeight = document.documentElement.clientWidth/0.883
      }
      
      // if(this.days!=60){
        // var deviceW = document.documentElement.clientWidth;
        // var deviceH = document.documentElement.clientHeight;
        // alert(deviceW+'，'+deviceH)
        
        // let pic = document.getElementById("posterOutAddpicBox")
        // console.log(pic)
        // if(deviceW == 375 && deviceH == 603){//iPhone 678
        //   // pic.style.top = '80px'
        //   pic.style.width = '200px'
        //   pic.style.height = '200px'
        // }else if(deviceW == 375 && deviceH == 724){//iPhoneX
        //   // pic.style.top = '80px'
        //   pic.style.width = '225px'
        //   pic.style.height = '225px'
        // }
        // // else if(deviceW == 414 && deviceH == 808){//iPhoneXR iPhoneXS Max
        // //   pic.style.width = '266px'
        // //   pic.style.height = '266px'
        // // }
        // else if(deviceW >= 393 && deviceH >= 667){
        //   pic.style.width = '230px'
        //   pic.style.height = '230px'
        // }
      // }
    })
  },
  methods: {
    croppSure() {//裁剪完成
      this.$refs.cropper.getCropData(data=>{
        this.option.img = ''
        this.previews = {}
        this.uploadPic = data
        this.cropperShow = false
      })
    },

    create() {
      // 使input失去焦点
      document.getElementById("currentDayInput").blur()
      if(this.enrollStatus==1){//已报名
        if(this.status==2){
          this.tipDialogText = '活动已结束'
          this.tipDialogShow = true
          return
        }
        if(this.status==3){
          this.tipDialogText = '活动暂未开始'
          this.tipDialogShow = true
          return
        }
        if(!this.uploadPic){
          this.tipDialogText = '您还未上传照片'
          this.tipDialogShow = true
          return
        }
        if(!this.currentDay){
          this.tipDialogText = '您还未输入打卡天数'
          this.tipDialogShow = true
          return
        }
        document.documentElement.scrollTop = document.body.scrollTop = 0
        this.loadingShow = true
        let me = this
        setTimeout(function(){
          html2canvas(document.getElementById('posterOut'), {
            useCORS: true,
            backgroundColor:null,
            allowTaint: false
          }).then(canvas => {
            me.posterUrl = canvas.toDataURL('image/png')
            me.loadingShow = false
            me.showPoster = true
            me.createDialogShow = true
          })
        },100)
      }else{
        this.applyDialogShow = true
      }
      
    },
    upload() {
      if(this.enrollStatus==1){//已报名
        if(this.status==2){
          this.tipDialogText = '活动已结束'
          this.tipDialogShow = true
          return
        }
        if(this.status==3){
          this.tipDialogText = '活动暂未开始'
          this.tipDialogShow = true
          return
        }
        let me = this
        wx.chooseImage({
          count: 1, // 默认9
          sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
          sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
          success: function (res) {
            // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
            wx.uploadImage({
              localId: res.localIds[0], // 需要上传的图片的本地ID，由chooseImage接口获得
              isShowProgressTips: 1, // 默认为1，显示进度提示
              success: function (resServer) {
                // 返回图片的服务器端ID serverId
                me.loadingShow = true
                request({
                  url: '/api/MarketingToolApi/Posters/addPoster',
                  method: 'post',
                  data: {
                    token: localStorage.getItem("token"),
                    activityId: me.activityId,
                    day: me.currentDay,
                    mediaId: resServer.serverId
                  }
                }).then(response => {
                  me.loadingShow = false
                  if(response.errno==200){
                    me.tipDialogText = '上传成功'
                    me.tipDialogShow = true
                  }else{
                    me.tipDialogText = '上传失败，请重新上传'
                    me.tipDialogShow = true
                  }
                })
              }
            })
          }
        })
      }else{
        this.applyDialogShow = true
      }
    },
    close() {
      this.showPoster = false
    },
    toIndex() {
      this.$router.push({name: 'index'})
    },
    selectPic() {
      if(this.enrollStatus==1){//已报名
        if(this.status==2){
          this.tipDialogText = '活动已结束'
          this.tipDialogShow = true
          return
        }
        if(this.status==3){
          this.tipDialogText = '活动暂未开始'
          this.tipDialogShow = true
          return
        }
        let me = this
        wx.chooseImage({
          count: 1, // 默认9
          sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
          sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
          success: function (res) {
            var u = navigator.userAgent, app = navigator.appVersion;
            var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
            // if (isiOS) {
              // me.uploadPic = res.localIds[0] // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
            // }else{
              wx.getLocalImgData({
                localId: res.localIds[0], // 图片的localID
                success: function (res) {
                  if (res.localData.substr(0, 5) != 'data:') {
                    // me.uploadPic = 'data:image;base64,' + res.localData

                    // me.option.img = 'data:image/jpeg;base64,' + res.localData
                    me.option.img = URL.createObjectURL(me.dataURLtoBlob('data:image/jpeg;base64,' + res.localData))
                    me.cropperShow = true
                  }else{
                    // me.uploadPic = res.localData // localData是图片的base64数据，可以用img标签显示
                  
                    // me.option.img = res.localData
                    me.option.img = URL.createObjectURL(me.dataURLtoBlob(res.localData))
                    me.cropperShow = true
                  }
                }
              })
            // }
          }
        })
      }else{
        this.applyDialogShow = true
      }
    },
    inputBlur(){
      var u = navigator.userAgent, app = navigator.appVersion
      var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
	    if (isIOS) {
	    	this.blurAdjust()
      }
    },
    // 解决苹果不回弹页面
    blurAdjust(e){
      setTimeout(()=>{
        if(document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA'){
          return
        }
        let result = 'pc';
        if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
          result = 'ios'
        }else if(/(Android)/i.test(navigator.userAgent)) {  //判断Android
          result = 'android'
        }
        
        if( result = 'ios' ){
          document.getElementById('posterBox').scrollIntoViewIfNeeded(true);
        }
      },100)
    },
    guide() {
      this.guideId+=1
      if(this.guideId>4){
        console.log('引导完成')
        this.loadingShow = true
        request({
          url: '/api/MarketingToolApi/users/guide',
          method: 'post',
          data: {
            token: localStorage.getItem("token")
          }
        }).then(response => {
          this.loadingShow = false
          this.guideStatus = 1
        })
      }
    },

    dataURLtoBlob(dataurl) {
        var arr = dataurl.split(','),
            mime = arr[0].match(/:(.*?);/)[1],
            bstr = atob(arr[1]),
            n = bstr.length,
            u8arr = new Uint8Array(n);
        while (n--) {
            u8arr[n] = bstr.charCodeAt(n);
        }
        return new Blob([u8arr], { type: mime });
    }
  }
}
</script>
<style lang="scss">
  #tool{
    // height: 100%;
    padding-bottom: 80px;
    position: relative;
    #guideBox{
      position: fixed;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      background: rgb(119,119,119);
      z-index: 9999;
      img{
        width: 100%;
      }
    }
    .cropper{
      position: fixed;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      z-index: 10000;
      .cropperOpt{
        position: absolute;
        bottom: 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        span{
          color: #fff;
          font-weight: 500;
          padding: 15px 20px;
        }
      }
    }
    
  }
  #posterCon{
    padding-top: 10px;
    >img{
      height: 30px;
      width: 290px;
      display: block;
      margin: 0 auto;
    }
  }
  #posterBox{
    background-color: #fff;
    width: 304px;
    height: 440px;
    position: relative;
    margin: 0 auto;
    #poster21Box{
      height: 77.8%;
      width: 100%;
      position: relative;
      img{
        height: 100%;
        width: 100%;
      }
      .poster21BoxPhoto{
        position: absolute;
      }
      .poster21BoxBg{
        position: absolute;
      }
    }
    >img{
      height: 77.8%;
      width: 100%;
      display: block;
    }
    #addpicBox{
      width: 170px;
      height: 170px;
      position: absolute;
      top: 66px;
      left: 30px;
      img{
        width: 170px;
        height: 170px;
        position: absolute;
      }
      img:nth-child(1){
        z-index: 1;
      }
      img:nth-child(2){
        z-index: 0;
      }
    }
    #posterBoxText{
      font-size: 15px;
      color: #fff;
      position: absolute;
      right: 15px;
      top: 19px;
      display: flex;
      p{
        width: 15px;
        line-height: 15px;
        word-wrap: break-word;/*英文的时候需要加上这句，自动换行*/
        margin-right: 5px;
        text-align: center;
      }
      p:nth-child(1){
        margin-top: 17px;
      }
    }
    #posterBom{
      display: flex;
      justify-content: space-between;
      #posterTime{
        padding: 25px 0 0 33px;
        >div{
          width: 100%;
          height: 42px;
          line-height: 42px;
          color: #fff;
          font-size: 30px;
          input{
            color: #fff;
            font-size: 30px;
            font-weight: 600;
            background: none;
            border: none;
            width: 40px;
            height: 36px;
            line-height: 36px;
            text-align: right;
            padding: 0;
          }
          input::-webkit-input-placeholder {
            font-size: 12px;
            line-height: 36px;
            color: #fff;
          }
          input::-moz-input-placeholder {
            font-size: 12px;
            line-height: 36px;
            color: #fff;
          }
          input::-ms-input-placeholder {
            font-size: 12px;
            line-height: 36px;
            color: #fff;
          }
        }
        >p{
          font-size: 6px;
          margin-top: 4px;
        }
      }
      #posterQRcode{
        padding: 12px 50px 0 0;
        >div{
          padding: 3px;
          width: 49px;
          height: 49px;
          margin-bottom: 2px;
          img{
            display: block;
            width: 100%;
            height: 100%;
          }
        }
        p{
          font-size: 8px;
          color: #000000;
          font-weight: 500;
          text-align: center;
        }
      }
    }
  }

  #posterCon.posterCon_60 {
    #posterBox{
      background: none;
      overflow: hidden;
      >img{
        z-index: 1;
        position: relative;
      }
      #addpicBox{
        width: 100%;
        height: 223px;
        position: absolute;
        top: 0;
        left: 0;
        img{
          position: absolute;
        }
        img:nth-child(1){
          width: 120px;
          height: 120px;
          z-index: 2;
          left: 50%;
          margin-left: -60px;
          top: 50%;
          margin-top: -60px;
        }
        img:nth-child(2){
          width: 100%;
          height: 100%;
          z-index: 0;
        }
      }
    }
    #posterBoxText{
      color: #fff;
      position: absolute;
      right: 20px;
      top: 230px;
      display: flex;
      z-index: 2;
      font-weight: 500;
      div:nth-child(1){
        color: #000000;
        display: flex;
        p{
          font-size: 9px;
          width: 9px;
          line-height: 10px;
          word-wrap: break-word;/*英文的时候需要加上这句，自动换行*/
          text-align: center;
          margin: 0 4px 0 0;
        }
      }
      div:nth-child(2){
        font-size: 16px;
        color: #fff;
        width: 24px;
        line-height: 16px;
        word-wrap: break-word;/*英文的时候需要加上这句，自动换行*/
        text-align: center;
        height: 100%;
        padding: 4px;
      }
    }
    #posterBom{
      padding: 2px 19px 20px;
      background-color: #fff;
      #posterBomWrap{
        width: 100%;
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
        display: flex;
        justify-content: space-between;
        padding-bottom: 5px;
      }
      #posterTime{
        padding: 0 0 0 15px;
        >div{
          width: 100%;
          height: 62px;
          line-height: 62px;
          font-size: 50px;
          input{
            color: #fff;
            font-size: 50px;
            font-weight: 600;
            background: none;
            border: none;
            width: 63px;
            height: 60px;
            line-height: 60px;
            text-align: right;
            padding: 0;
          }
          input::-webkit-input-placeholder {
            font-size: 12px;
            line-height: 60px;
            color: #fff;
          }
          input::-moz-input-placeholder {
            font-size: 12px;
            line-height: 60px;
            color: #fff;
          }
          input::-ms-input-placeholder {
            font-size: 12px;
            line-height: 60px;
            color: #fff;
          }
        }
        >p{
          color: #fff;
          font-size: 12px;
          margin-top: -8px;
        }
      }
      #posterQRcode{
        padding: 8px 15px 0 0;
        >div{
          padding: 0;
          width: 56px;
          height: 56px;
          margin-bottom: 1px;
          img{
            display: block;
            width: 100%;
            height: 100%;
          }
        }
        p{
          color: #fff;
          font-size: 7px;
          font-weight: 500;
          text-align: center;
        }
      }
    }
  }

  #posterOut{
    background-color: #fff;
    width: 300px;
    height: 500px;
    position: fixed;
    top: -2000px;
    // position: relative;
    // top: 0;
    z-index: 999999;
    #posterOut21Box{
      height: 72%;
      width: 100%;
      position: relative;
      img{
        height: 100%;
        width: 100%;
      }
      .poster21BoxPhoto{
        position: absolute;
      }
      .poster21BoxBg{
        position: absolute;
      }
    }
    >img{
      height: 72%;
      width: 100%;
      display: block;
    }
    #posterOutAddpicBox{
      width: 180px;
      height: 180px;
      position: absolute;
      top: 70px;
      left: 30px;
      img{
        width: 100%;
        height: 100%;
      }
    }
    #posterOutText{
      font-size: 20px;
      color: #fff;
      position: absolute;
      right: 10px;
      top: 30px;
      display: flex;
      p{
        width: 20px;
        line-height: 22px;
        word-wrap: break-word;/*英文的时候需要加上这句，自动换行*/
        margin-right: 8px;
        text-align: center;
      }
      p:nth-child(1){
        margin-top: 34px;
      }
    }
    #posterOutBom{
      display: flex;
      justify-content: space-between;
      #posterOutTime{
        padding: 22px 0 0 19px;
        >div{
          width: 140px;
          height: 66px;
          line-height: 66px;
          text-align: center;
          color: #fff;
          font-size: 54px;
          span{
            font-weight: 600;
          }
        }
        >p{
          font-size: 10px;
          margin-top: 4px;
        }
      }
      #posterOutQRcode{
        padding: 8px 19px 0 0;
        >div{
          padding: 6px;
          width: 80px;
          height: 80px;
          margin-bottom: 4px;
          img{
            display: block;
            width: 100%;
            height: 100%;
          }
        }
        p{
          font-size: 15px;
          color: #000000;
          font-weight: 500;
          text-align: center;
          line-height: 17px;
        }
      }
    }
  }
  
  #posterOut.posterOut_60{
    background-color: #fff;
    width: 100%;
    height: auto;
    position: fixed;
    top: -2000px;
    // top: 0;
    z-index: 999999;
    >img{
      height: 450px;
      width: 100%;
      display: block;
      z-index: 1;
      position: relative;
    }
    #posterOutAddpicBox{
      width: 100%;
      height: 270px;
      position: absolute;
      top: 0;
      left: 0;
      z-index: 0;
      img{
        width: 100%;
        height: 100%;
      }
    }
    #posterOutText{
      color: #fff;
      position: absolute;
      right: 25px;
      top: 290px;
      display: flex;
      z-index: 2;
      font-weight: 500;
      div:nth-child(1){
        color: #000000;
        display: flex;
        p{
          font-size: 14px;
          width: 14px;
          line-height: 14px;
          word-wrap: break-word;/*英文的时候需要加上这句，自动换行*/
          text-align: center;
          margin: 0 8px 0 0;
        }
      }
      div:nth-child(2){
        font-size: 22px;
        color: #fff;
        width: 30px;
        line-height: 22px;
        word-wrap: break-word;/*英文的时候需要加上这句，自动换行*/
        text-align: center;
        height: 100%;
        padding: 4px;
      }
    }
    #posterOutBom{
      padding: 2px 23px 20px;
      background-color: #fff;
      #posterOutWrap{
        width: 100%;
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
        display: flex;
        justify-content: space-between;
        padding-bottom: 5px;
      }
      #posterOutTime{
        padding: 20px 0 0 20px;
        >div{
          width: 100%;
          height: 70px;
          line-height: 70px;
          font-size: 70px;
          span{
            font-weight: 600;
          }
        }
        >p{
          color: #fff;
          font-size: 13px;
          margin-top: 0;
        }
      }
      #posterOutQRcode{
        padding: 8px 15px 0 0;
        >div{
          padding: 0;
          width: 88px;
          height: 88px;
          margin-bottom: 1px;
          img{
            display: block;
            width: 100%;
            height: 100%;
          }
        }
        p{
          color: #fff;
          font-size: 11px;
          font-weight: 500;
          text-align: center;
        }
      }
    }
  }

  #createButton{
    padding: 0 31px;
    display: flex;
    justify-content: space-between;
  }
  #createButton span{
    display: inline-block;
    height: 38px;
    line-height: 38px;
    width: 149px;
    text-align: center;
    border-radius: 19px;
    font-size: 18px;
    color: #FFFFFF;
    background-color: #44D7B6;
  }


  #poster{
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ccc;
    img{
      width: 304px;
      height: 440px;
    }
    #posterClose{
      width: 37px;
      height: 37px;
      position: absolute;
      top: 20px;
      right: 20px;
    }
  }


.applyDialog{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  background-color: rgba( 0, 0, 0,0.6);
  .applyDialogCon{
    background: #fff;
    width: 240px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -120px;
    margin-top: -60px;
    border-radius: 5px;
    text-align: center;
    padding: 30px 0 17px;
    font-size: 14px;
    color: #282B2F;
    span{
      display: inline-block;
      width: 100px;
      height: 28px;
      line-height: 28px;
      background: #F9BE3C;
      border-radius: 14px;
      font-size: 14px;
      color: #FFFFFF;
      margin-top: 30px;
    }
    span:nth-child(2){
      margin-left: 15px;
    }
  }
}

.createDialog{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  background-color: rgba( 0, 0, 0,0.6);
  .createDialogCon{
    background: #fff;
    width: 240px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -120px;
    margin-top: -120px;
    border-radius: 5px;
    text-align: center;
    padding: 30px 20px 17px;
    font-size: 14px;
    color: #282B2F;
    p{
      text-align: left
    }
    p:nth-child(1){
      margin-bottom: 10px;
    }
    span{
      display: inline-block;
      width: 100px;
      height: 28px;
      line-height: 28px;
      background: #F9BE3C;
      border-radius: 14px;
      font-size: 14px;
      color: #FFFFFF;
      margin-top: 30px;
    }
    span:nth-child(2){
      margin-left: 15px;
    }
  }
}
</style>