BigModuleMarketingDia.vue 6.59 KB
<template>
  <div class="mask" v-if="isShow">
    <div class="dialog-wrap">
      <div class="dialog">
        <div class="dialog-title">
          基于大模型生成营销活动话术
          <div class="close" @click.stop="closeHandle">
            <img src="@/assets/images/icon-close.png" />
          </div>
        </div>
        <div class="content-box">
          <!-- <BoxTitle :title="'基于大模型生成营销活动话术'" :textAlign="'center'" class="top-title" :fontSize="20"></BoxTitle> -->
          <div class="text">基于大模型的能力,快速生成个性化的活动标题、营销文案和活动海报,提升门店营销效率。</div>
          <div v-show="isLoading" class="loadding">
            <div class="wrap">
              <div class="round"></div>
              <div class="round"></div>
              <div class="round"></div>
              <div class="round"></div>
              <div class="round"></div>
              <div class="round"></div>
              <div class="round"></div>
            </div>
          </div>
          <img :src="require(`../../../assets/images/${hasAvtivity ? 'activity-matekting' : 'big-module-marketing-img'}.png`)" alt="" />
          <img v-show="showQ" class="ask-question" src="../../../assets/images/ask-question.png" alt="" />
          <p id="qestion-3" v-show="showR" class="ai-reply"></p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
let t = null
export default {
  name: 'BigModuleMarketingDia',
  props: {
    isShow: Boolean
  },
  data() {
    return {
      showQ: false,
      showR: false,
      pNode: null,
      isLoading: false,
      hasAvtivity: false
    }
  },
  watch: {
    isShow(val) {
      console.log(val, '------------弹窗');
    }
  },
  mounted() {
    this.pNode = document.getElementById('qestion-3')
    this.send()
    t = setInterval(this.send, 7000)
  },
  methods: {
    send() {
      if (!this.showQ) {
        this.showText()
      } else {
        this.showQ = false
        this.showR = false
        this.isLoading = false
        this.hasAvtivity = false
        this.pNode.innerHTML = ''
        setTimeout(() => {
          this.showText()
        }, 1000)
      }
    },
    showText() {
      this.showQ = true
      setTimeout(() => {
        this.showR = true
        this.addText()
        setTimeout(() => {
          this.isLoading = true
          setTimeout(() => {
            this.isLoading = false
            this.hasAvtivity = true
            this.showR = false
          }, 3000)
        }, 1000)
      }, 1000)
    },
    addText() {
      const str = '我们为您生成以下方案,请查看“营销模型解析”'
      let i = 0
      const timer = setInterval(() => {
        if (i < str.length - 1) {
          this.pNode.innerHTML = this.pNode.innerHTML + str[i]
          i = i + 1
        } else {
          clearInterval(timer)
        }
      }, 17)
    },
    closeHandle() {
      this.$emit('closeDialog')
    }
  },
  destroyed() {
    clearInterval(t)
  }
}
</script>

<style lang="scss" scoped>
.mask {
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 99;
  left: 0px;
  top: 0px;
  background: rgba(0, 0, 0, 0.8);
}
.dialog-wrap {
  width: 67.31vw;
  height: 90.38vh;
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  background-image: url('../../../assets/images/bg-5.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transform: translate(-50%, -50%);
  border-radius: 5px;
  padding: 3.9vh 3.67vw;
  box-sizing: border-box;
  .close {
    width: 60px;
    height: 60px;
    position: absolute;
    right: -28vw;
    top: -3vh;
    cursor: pointer;
  }
  .dialog-title {
    width: 20.19vw;
    height: 4.39vh;
    text-align: center;
    font-size: 30px;
    font-weight: 900;
    color: #19ECFF;
    margin: 0 auto;
    position: relative;
    line-height: 1.39vh;
  }
  .content-box {
      position: relative;
      .text {
        padding-top: 5.33vh;
        font-weight: 500;
        font-size: 20px;
        color: #09AEF2;
      }
    img {
      width: 42.59vw;
      height: 63.46vh;
      margin-top: 3.46vh;
    }
    .send {
      display: inline-block;
      position: absolute;
      right: 9vw;
      top: 22vh;
    }
    .ask-question {
      position: absolute;
      right: 18.5vw;
      width: 200px;
      height: 26px;
      top: 17.5vh;
    }
    .ai-reply {
      position: absolute;
      left: 17vw;
      top: 25vh;
      padding: 5px 10px;
    }
    .activity-form {
      position: absolute;
      width: 293px;
      height: 133px;
      bottom: 1.33vh;
      left: 7.7vw;
    }
  }
  p {
      margin: 0;
      background-color: #eee;
      box-sizing: border-box;
      padding: 3px 5px;
      font-size: 7px;
      color: #333;
      border-radius: 3px;
    }
    .loadding {
      position: absolute;
      right: 12vw;
      top: 22vh;
    }
    .wrap {
      margin: 120px 0 0 240px;
      width: 25px;
      height: 25px;
      position: relative;
      /* transform-origin: 设置的效果搭配边框看,效果更加明显 */
      /* border: 1px solid #e9e9e9; */
    }

    .round {
      position: absolute;
      width: 11px;
      height: 11px;
      border-radius: 50%;
      background-color: rgb(241, 141, 157);
      /* 加上动画效果 */
      animation: circleRound 2.8s ease infinite;
      /* 设置旋转中心,搭配.wrap的border看 */
      transform-origin: 50% 25px;
    }

    /* 注意z-index层级关系,依次递减 */
    .round:nth-child(1) {
      z-index: 7;
    }

    /* 注意动画延后animation-delay播放,依次递增 */
    /* 至于小圆球则越来越小 */
    .round:nth-child(2) {
      height: 10px;
      width: 10px;
      background-color: rgb(199, 136, 185);
      animation-delay: 0.2s;
      z-index: 6;
    }

    .round:nth-child(3) {
      height: 9px;
      width: 9px;
      background-color: rgb(153, 69, 223);
      animation-delay: 0.4s;
      z-index: 5;
    }

    .round:nth-child(4) {
      height: 8px;
      width: 8px;
      background-color: rgb(69, 141, 223);
      animation-delay: 0.6s;
      z-index: 4;
    }

    .round:nth-child(5) {
      height: 7px;
      width: 7px;
      background-color: rgb(69, 223, 203);
      animation-delay: 0.8s;
      z-index: 3;
    }

    .round:nth-child(6) {
      height: 6px;
      width: 6px;
      background-color: rgb(100, 223, 69);
      animation-delay: 1s;
      z-index: 2;
    }

    .round:nth-child(7) {
      height: 5px;
      width: 5px;
      background-color: rgb(223, 200, 69);
      animation-delay: 1.2s;
      z-index: 1;
    }

    @keyframes circleRound {
      to {
        transform: rotate(1turn);
      }
    }
}
</style>