diff --git a/layers/templates/GrGallery01/index.vue b/layers/templates/GrGallery01/index.vue index 18b28c3..c75f2bb 100644 --- a/layers/templates/GrGallery01/index.vue +++ b/layers/templates/GrGallery01/index.vue @@ -65,11 +65,9 @@ const stopVideo = () => { } const onArrowClick = (direction, targetIndex) => { - const logTraking = - direction == 'prev' - ? getComponentGroupAry(props.components, 'arrow')?.groups[0] - : getComponentGroupAry(props.components, 'arrow')?.groups[1] - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) } onMounted(() => { diff --git a/layers/templates/GrGallery02/index.vue b/layers/templates/GrGallery02/index.vue index 7edce16..73b7715 100644 --- a/layers/templates/GrGallery02/index.vue +++ b/layers/templates/GrGallery02/index.vue @@ -57,11 +57,9 @@ const handleChange = ( const { locale } = useI18n() const { sendLog, useAnalyticsLogDataDirect } = useAnalytics() const onArrowClick = (direction, targetIndex) => { - const logTraking = - direction == 'prev' - ? getComponentGroupAry(props.components, 'arrow')?.groups[0] - : getComponentGroupAry(props.components, 'arrow')?.groups[1] - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) } diff --git a/layers/templates/GrGallery03/index.vue b/layers/templates/GrGallery03/index.vue index 5f77fae..115d773 100644 --- a/layers/templates/GrGallery03/index.vue +++ b/layers/templates/GrGallery03/index.vue @@ -60,11 +60,12 @@ const handleChange = ( 'buttonList' ) } -const {locale} = useI18n() +const { locale } = useI18n() const { sendLog, useAnalyticsLogDataDirect } = useAnalytics() const onArrowClick = (direction, targetIndex) => { - const logTraking = direction == 'prev' ? props.components.arrow.groups[0] : props.components.arrow.groups[1]; - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) } diff --git a/layers/templates/GrVisual02/index.vue b/layers/templates/GrVisual02/index.vue index e4a4595..938d894 100644 --- a/layers/templates/GrVisual02/index.vue +++ b/layers/templates/GrVisual02/index.vue @@ -71,11 +71,12 @@ const slideItemSize = { gap: 32, }, } -const {locale} = useI18n() +const { locale } = useI18n() const { sendLog, useAnalyticsLogDataDirect } = useAnalytics() const onArrowClick = (direction, targetIndex) => { - const logTraking = direction == 'prev' ? props.components.arrow.groups[0] : props.components.arrow.groups[1]; - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) } console.log('resourcesData.value===', resourcesData.value) diff --git a/layers/templates/GrVisual03/index.vue b/layers/templates/GrVisual03/index.vue index 60711db..f36c959 100644 --- a/layers/templates/GrVisual03/index.vue +++ b/layers/templates/GrVisual03/index.vue @@ -24,11 +24,9 @@ const slideData = computed(() => { }) const onArrowClick = direction => { - const logTraking = - direction == 'prev' - ? getComponentGroupAry(props.components, 'arrow')?.groups[0] - : getComponentGroupAry(props.components, 'arrow')?.groups[1] - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) }