|
|
|
@ -16,7 +16,7 @@ |
|
|
|
</div> |
|
|
|
<span class="pass-name">{{ yourpos }} </span> |
|
|
|
</li> |
|
|
|
<li v-for="(item, idx) of pathshop" :key="item.code" class="pass-item" :class="{ last: playIdx === idx }"> |
|
|
|
<li v-for="(item, idx) of pathshop" :id="item.shopNum" :key="item.code" class="pass-item" :class="{ last: playIdx === idx }"> |
|
|
|
<div class="lefts"> |
|
|
|
<img :src="item.isAddPrefix ? item.logoPath : item.logoPath" class="way-icon" alt="" /> |
|
|
|
</div> |
|
|
|
@ -92,12 +92,17 @@ function onPathPlayOver() { |
|
|
|
playIdx.value = props.pathshop.length |
|
|
|
} |
|
|
|
|
|
|
|
const scroll = ref() |
|
|
|
|
|
|
|
function onPathPlaying(e: any) { |
|
|
|
// console.log(e.data) //返回小人位置 {"pathArrIn": 0, "pathIndex": 1, "shopNum":"" } |
|
|
|
const { shopNum } = e.data |
|
|
|
if (shopNum) { |
|
|
|
const idx2 = props.pathshop.findIndex((val: any) => val.shopNum === shopNum) |
|
|
|
playIdx.value = idx2 |
|
|
|
if (scroll.value && document.getElementById(shopNum)) { |
|
|
|
scroll.value.scrollToElement(document.getElementById(shopNum)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//重置playIdx |
|
|
|
@ -123,6 +128,7 @@ const yourpos = computed(() => { |
|
|
|
const lastImage = computed(() => { |
|
|
|
return shop.value.logoUrl ?? require('@/assets/images/header/logo.svg') |
|
|
|
}) |
|
|
|
|
|
|
|
defineExpose({ |
|
|
|
resetPlayIdx |
|
|
|
}) |
|
|
|
|