BigModuleMarketing.vue 5.51 KB
<!--
 * @Description: 右下
 * @Author: huyue
 * @Date: 2024-01-26 21:05:56
 * @LastEditors: huyue
 * @LastEditTime: 2024-07-12 10:47:23
-->
<template>
  <div class="big-module-marketing-box" @click="openDia">
    <BoxTitle :title="'基于大模型生成营销活动话术'" :textAlign="'center'" class="top-title" :fontSize="20"></BoxTitle>
    <div>基于大模型能力,快速生成个性化的活动标题、营销文案和活动海报,提升门店营销效率。</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-2" v-show="showR" class="ai-reply"></p>
    <BigModuleMarketingDia v-if="dialogShow" :isShow="dialogShow" @closeDialog="closeDialog"></BigModuleMarketingDia>
  </div>
</template>

<script>
let t = null
import BigModuleMarketingDia from './BigModuleMarketingDia.vue'
export default {
  name: 'BigModuleMarketing',
  components: {
    BigModuleMarketingDia
  },
  data() {
    return {
      showQ: false,
      showR: false,
      pNode: null,
      isLoading: false,
      hasAvtivity: false,
      dialogShow: false
    }
  },

  mounted() {
    this.pNode = document.getElementById('qestion-2')
    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
          }, 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)
    },
    openDia() {
      this.dialogShow = true
      console.log(111)
    },
    closeDialog() {
      console.log(7777777);
      this.dialogShow = false
    }
  },
  destroyed() {
    clearInterval(t)
  }
}
</script>

<style lang="scss" scoped>
.big-module-marketing-box {
  position: relative;
  box-sizing: border-box;
  width: 30.31vw;
  height: 38.48vh;
  background-image: url(../../../assets/images/big-module-marketing-bg.png);
  background-size: 100% 100%;
  font-size: 12px;
  color: #09aef2;
  text-align: center;
  padding: 0 3.28vw 2.59vh 3.28vw;
  margin-top: 1.4vh;
  .top-title {
    margin-bottom: 1.93vh;
  }
  img {
    width: 19.33vw;
    height: 28.56vh;
    margin-top: 1.44vh;
  }
  .send {
    display: inline-block;
    position: absolute;
    right: 9vw;
    top: 22vh;
  }
  .ask-question {
    position: absolute;
    right: 10vw;
    width: 120px;
    height: 16px;
    top: 11.5vh;
  }
  .ai-reply {
    position: absolute;
    // width: 155px;
    // height: 22px;
    left: 9.2vw;
    top: 15.5vh;
    font-size: 5px;
  }
  .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: 6.6vw;
}
.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>