|
@@ -97,9 +97,8 @@ const buyerReportId = ref('')
|
|
|
const competitorReportId = ref({})
|
|
|
const discountMsg = ref('')
|
|
|
const reportBtnList = ref([])
|
|
|
-const bubbleLeft = ref('10px')
|
|
|
const bubbleTimer = ref(null)
|
|
|
-const bubbleText = ref('')
|
|
|
+const currentBubbleIndex = ref(0)
|
|
|
const packageInfo = toRef({})
|
|
|
|
|
|
const entNameList = computed(() => {
|
|
@@ -302,23 +301,12 @@ const startBubbleAnimation = () => {
|
|
|
const btnLen = reportBtnList.value.length
|
|
|
if (btnLen === 0) return
|
|
|
nextTick(() => {
|
|
|
- const btnRefs = that.$refs.reportBtn
|
|
|
- let currentIndex = 0
|
|
|
if (bubbleTimer.value) clearInterval(bubbleTimer.value)
|
|
|
- if (btnLen === 1) {
|
|
|
- bubbleLeft.value = '10px'
|
|
|
- bubbleText.value = reportBtnList.value[0].marketText
|
|
|
+ if (btnLen.length === 1) {
|
|
|
+ currentBubbleIndex.value = 0
|
|
|
} else {
|
|
|
- bubbleText.value = reportBtnList.value[0].marketText
|
|
|
bubbleTimer.value = setInterval(() => {
|
|
|
- currentIndex = (currentIndex + 1) % btnLen
|
|
|
- const btn = btnRefs[currentIndex]
|
|
|
- if (btn) {
|
|
|
- bubbleLeft.value = btn?.offsetLeft - 10 + 'px'
|
|
|
- setTimeout(() => {
|
|
|
- bubbleText.value = reportBtnList.value[currentIndex].marketText
|
|
|
- }, 300)
|
|
|
- }
|
|
|
+ currentBubbleIndex.value = (currentBubbleIndex.value + 1) % btnLen
|
|
|
}, 2500)
|
|
|
}
|
|
|
})
|
|
@@ -408,21 +396,25 @@ onUnmounted(() => {
|
|
|
<span>{{ ent }}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <button
|
|
|
- class="flex flex-items-center report-btn"
|
|
|
- slot="reference"
|
|
|
- @click="handleDownload(item, index)"
|
|
|
- :ref="'reportBtn'"
|
|
|
- >
|
|
|
- <span>{{ item.text }}</span>
|
|
|
- <i class="j-icon j-icon-base icon-img-download"></i>
|
|
|
- <i class="j-icon j-icon-base icon-img-download-white"></i>
|
|
|
- </button>
|
|
|
+ <div class="btn-container" slot="reference">
|
|
|
+ <button
|
|
|
+ class="flex flex-items-center report-btn"
|
|
|
+ @click="handleDownload(item, index)"
|
|
|
+ :ref="'reportBtn'"
|
|
|
+ >
|
|
|
+ <span>{{ item.text }}</span>
|
|
|
+ <i class="j-icon j-icon-base icon-img-download"></i>
|
|
|
+ <i class="j-icon j-icon-base icon-img-download-white"></i>
|
|
|
+ </button>
|
|
|
+ <div
|
|
|
+ class="bubble-box"
|
|
|
+ :class="{ visible: currentBubbleIndex === index }"
|
|
|
+ >
|
|
|
+ {{ item.marketText }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
- <div v-show="bubbleText" class="bubble" :style="{ left: bubbleLeft }">
|
|
|
- {{ bubbleText }}
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -473,6 +465,27 @@ onUnmounted(() => {
|
|
|
.banner-right {
|
|
|
position: relative;
|
|
|
}
|
|
|
+ .btn-container {
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ .bubble-box {
|
|
|
+ position: absolute;
|
|
|
+ top: -14px;
|
|
|
+ left: 10px;
|
|
|
+ background: linear-gradient(101.8deg, #2abed1 0%, #0a6cff 100%);
|
|
|
+ padding: 1px 8px;
|
|
|
+ border-radius: 8px 2px 8px 2px;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 18px;
|
|
|
+ color: #fff;
|
|
|
+ opacity: 0;
|
|
|
+ transform: translateY(10px);
|
|
|
+ transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
|
+ &.visible {
|
|
|
+ opacity: 1;
|
|
|
+ transform: translateY(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
.report-btn {
|
|
|
margin-left: 20px;
|
|
|
padding: 3px 20px;
|