埋点,im,客服删除

This commit is contained in:
谢宇宁
2026-10-08 21:20:52 +07:00
parent c39daacc6d
commit d25c71dc51
146 changed files with 118 additions and 8495 deletions
+5 -34
View File
@@ -1,6 +1,6 @@
<template>
<div class="adv_swiper">
<div class="adv-container" v-if="props.list.length > 0" ref="advRef">
<div class="adv-container" v-if="props.list.length > 0">
<van-swipe
:show-indicators="isShowIndicators"
:autoplay="autoplay"
@@ -21,21 +21,16 @@
</template>
<script setup lang="ts">
import { jumpAdv } from '@/utils/index';
import { nextTick, ref, watch } from 'vue';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const emit = defineEmits(['load']);
const props = withDefaults(
defineProps<{
list: Types.App.AdsInfoListItem[];
height?: string;
isShowIndicators?: boolean;
clickType?: 'ads' | 'recreation';
/** ads:广告位广告,点击上报;recreation:娱乐模块;none:非广告内容(如案例图),不上报 */
clickType?: 'ads' | 'recreation' | 'none';
autoplay?: number;
adImpression?: AdImpressionType;
/** 为 true 时仅挂载当前/相邻项,减轻首屏 DecryptImg 与解密压力 */
lazyRender?: boolean;
}>(),
@@ -52,32 +47,8 @@ const props = withDefaults(
const load = () => {
emit('load');
};
// 广告展示埋点
const advRef = ref();
watch(
() => props.list,
() => {
if (props.list.length) {
nextTick(() => {
setAdImpression(advRef.value, props.list, {
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'horizontal_cover',
}).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem, clickType?: 'ads' | 'recreation') => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'horizontal_cover',
};
reportAdClickEvent(params);
jumpAdv(item, clickType);
const handleJumpAdv = (item: Types.App.AdsInfoListItem, clickType?: 'ads' | 'recreation' | 'none') => {
jumpAdv(item, clickType === 'none' ? undefined : clickType);
};
</script>
<style lang="scss" scoped>
+1 -21
View File
@@ -40,8 +40,7 @@
</div>
<Loading v-else class="coinVideoPayPopup__loading" />
<div class="coinVideoPayPopup__tips">
*如提示【交易失败】【账户风险】等,可重新发起订单,或在15分钟后重试支付。如支付未到账,请
<span @click.stop="goCustomerService">反馈客服订单号</span>
*如提示【交易失败】【账户风险】等,可重新发起订单,或在15分钟后重试支付。
</div>
</div>
<div class="coinVideoPayPopup__footer">
@@ -52,10 +51,6 @@
>
{{ payBtnText }}
</div>
<div class="coinVideoPayPopup__service">
支付问题反馈,点击联系
<span @click.stop="goCustomerService">在线客服</span>
</div>
</div>
</div>
</van-popup>
@@ -291,11 +286,6 @@ const goTransactionRecord = () => {
router.push('/transactionRecord');
};
const goCustomerService = () => {
emitClose();
router.push('/customerService');
};
const onPopupClosed = () => {
state.showRecharge = false;
};
@@ -508,14 +498,4 @@ watch(
opacity: 0.45;
pointer-events: none;
}
.coinVideoPayPopup__service {
margin-top: 12px;
font-size: 12px;
line-height: 18px;
text-align: center;
color: #dcdcdc;
span {
color: #ffd460;
}
}
</style>
-8
View File
@@ -281,7 +281,6 @@ import VideoApi from '@/service/video';
import { watchCount, compatibleAppStoreJump, innerJump } from '@/utils/index';
import { useUserStore } from '@/stores/user';
import { useRouter } from 'vue-router';
import { reportVideoCommentEvent } from '@/utils/eventReporter/videoComment';
const router = useRouter();
const userStore = useUserStore();
@@ -623,13 +622,6 @@ const sendBtn = async () => {
}
openLoading();
let res: any = await VideoApi.sendComment(req);
reportVideoCommentEvent({
videoInfo: state.videoInfo,
commentInfo: {
content: state.content,
image: state.img,
},
});
state.content = ''; // 评论输入框内容清空
state.lfCount++;
if (typeof res === 'object') {
+4 -4
View File
@@ -9,12 +9,12 @@
<p>1.请检测您的网络是否正常,手机是否开了VPN或10分钟后再尝试访问。</p>
<p>
2.前往官网地址
<span @click="download2">91PORN01.CC</span>
<span @click="download2">HUANGGUOMJ.NET</span>
下载最新版。
</p>
<p>
官方备用:
<span @click="download">91PORN01.CC</span>
<span @click="download">HUANGGUOMJ.NET</span>
</p>
<p>3.前往Telegram官方交流群</p>
<div class="footer-box">
@@ -30,13 +30,13 @@ import { ref } from 'vue';
import { compatibleAppStoreJump } from '@/utils/index';
const isShow = ref(true);
const download = () => {
compatibleAppStoreJump('https://91porn01.cc');
compatibleAppStoreJump('https://huangguomj.net');
};
const download1 = () => {
compatibleAppStoreJump('https://lolii.fm');
};
const download2 = () => {
compatibleAppStoreJump('https://91porn01.cc');
compatibleAppStoreJump('https://huangguomj.net');
};
const toPotato = () => {
compatibleAppStoreJump('https://t.me/hougong9527');
+3 -32
View File
@@ -1,6 +1,6 @@
<template>
<div class="fiveGridAdv">
<div class="fiveGrid" @touchstart.stop @touchmove.stop @touchend.stop v-if="state.advList.length > 0" ref="advRef">
<div class="fiveGrid" @touchstart.stop @touchmove.stop @touchend.stop v-if="state.advList.length > 0">
<div class="rectAdvBox" @click="handleJumpAdv(item)" v-for="item in state.advList" :key="item.id">
<lazyImg class="rectAdvIcon" :src="item.cover" />
<div class="rectName">{{ item.title }}</div>
@@ -9,18 +9,13 @@
</div>
</template>
<script setup lang="ts">
import { nextTick, reactive, ref, watch } from 'vue';
import { reactive } from 'vue';
import { jumpAdv } from '@/utils/index';
import { getAdItem } from '@/utils/getConfig';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const props = withDefaults(
defineProps<{
advType: number;
adImpression?: AdImpressionType;
}>(),
{
advType: 2,
@@ -29,32 +24,8 @@ const props = withDefaults(
const state = reactive({
advList: <any>(getAdItem(props.advType) || []), // 广告数据
});
// 广告展示埋点
const advRef = ref();
watch(
() => state.advList,
() => {
if (state.advList.length) {
nextTick(() => {
setAdImpression(advRef.value, state.advList, {
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'small_grid',
}).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem) => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'small_grid',
};
reportAdClickEvent(params);
jumpAdv(item);
jumpAdv(item, 'ads');
};
</script>
<style scoped lang="scss">
+3 -33
View File
@@ -1,6 +1,6 @@
<template>
<div class="fiveGridAdv">
<div class="fiveGrid" v-if="advList.length > 0" ref="advRef">
<div class="fiveGrid" v-if="advList.length > 0">
<div class="rectAdvBox" @click="handleJumpAdv(item)" v-for="item in advList" :key="item.id">
<lazyImg class="rectAdvIcon" :src="item.cover" />
<div class="rectName">{{ item.title }}</div>
@@ -9,48 +9,18 @@
</div>
</template>
<script setup lang="ts">
import { nextTick, ref, watch } from 'vue';
import { jumpAdv } from '@/utils/index';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const props = withDefaults(
withDefaults(
defineProps<{
advList: any;
adImpression?: AdImpressionType;
}>(),
{
advList: [],
},
);
// 广告展示埋点
const advRef = ref();
watch(
() => props.advList,
() => {
if (props.advList.length) {
nextTick(() => {
setAdImpression(advRef.value, props.advList, {
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'small_grid',
}).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem) => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'small_grid',
};
reportAdClickEvent(params);
jumpAdv(item);
jumpAdv(item, 'ads');
};
</script>
<style scoped lang="scss">
+1 -1
View File
@@ -119,7 +119,7 @@ function close() {
}
function jumpUrl() {
if (state.isClose) return (state.isClose = false);
jumpAdv(state.advObj);
jumpAdv(state.advObj, 'ads');
}
</script>
<style lang="scss" scoped>
+3 -32
View File
@@ -1,5 +1,5 @@
<template>
<div class="headerAdv" v-if="state.advList.length" ref="advRef">
<div class="headerAdv" v-if="state.advList.length">
<!-- 5宫格广告 -->
<div class="fiveGrid" v-if="props.type === 'five'">
<div class="rectAdvBox" @click="handleJumpAdv(item)" v-for="item in state.advList" :key="item.id">
@@ -19,21 +19,16 @@
</div>
</template>
<script setup lang="ts">
import { nextTick, reactive, ref, watch } from 'vue';
import { reactive } from 'vue';
import { getAdItem } from '@/utils/getConfig';
import { jumpAdv } from '@/utils/index';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const props = withDefaults(
defineProps<{
advType?: number;
type?: 'five' | 'swiper' | 'rows';
length?: number; //广告获取长度0-不限制
random?: boolean; //是否随机获取
adImpression?: AdImpressionType;
}>(),
{
advType: 28,
@@ -58,32 +53,8 @@ const init = () => {
}
};
init();
// 广告展示埋点
const advRef = ref();
watch(
() => state.advList,
() => {
if (state.advList.length) {
nextTick(() => {
setAdImpression(advRef.value, state.advList, {
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'small_grid',
}).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem) => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'small_grid',
};
reportAdClickEvent(params);
jumpAdv(item);
jumpAdv(item, 'ads');
};
</script>
<style scoped lang="scss">
+3 -32
View File
@@ -1,5 +1,5 @@
<template>
<div class="homeHeader" :data-type="state.advCoverType" v-if="state.advList?.length" ref="advRef">
<div class="homeHeader" :data-type="state.advCoverType" v-if="state.advList?.length">
<!-- 小方块布局 -->
<template v-if="state.advCoverType === 'small-cube'">
<div class="firstRow" v-if="firstRowList.length">
@@ -85,21 +85,16 @@
</div>
</template>
<script setup lang="ts">
import { reactive, computed, ref, watch, nextTick } from 'vue';
import { reactive, computed, ref } from 'vue';
import { getAdItem } from '@/utils/getConfig';
import { jumpAdv } from '@/utils/index';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const isStopAnimation = ref(false);
const props = withDefaults(
defineProps<{
advType: number;
showTitle?: boolean;
indicatorColor?: string;
adImpression?: AdImpressionType;
}>(),
{
indicatorColor: '#fff',
@@ -137,32 +132,8 @@ const init = () => {
}
};
init();
// 广告展示埋点
const advRef = ref();
watch(
() => state.advList,
() => {
if (state.advList.length) {
nextTick(() => {
setAdImpression(advRef.value, state.advList, {
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || advTypeText.value,
}).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem) => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || advTypeText.value,
};
reportAdClickEvent(params);
jumpAdv(item);
jumpAdv(item, 'ads');
};
const onTouchMove = () => {
isStopAnimation.value = true;
+3 -36
View File
@@ -1,7 +1,7 @@
<template>
<div class="announcementPopup">
<van-overlay :show="true" z-index="2001" @click="close()">
<div class="imgWrapper" ref="advRef">
<div class="imgWrapper">
<lazyImg
@click.stop="handleJumpAdv(currentAds[0])"
class="imgBox"
@@ -21,17 +21,12 @@
</div>
</template>
<script lang="ts" setup>
import { nextTick, reactive, ref, watch, computed } from 'vue';
import { reactive, ref, computed } from 'vue';
import { jumpAdv } from '@/utils/index';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const props = withDefaults(
defineProps<{
advList: Types.App.AdsInfoListItem[];
adImpression?: AdImpressionType;
}>(),
{
advList: () => [],
@@ -45,36 +40,8 @@ const currentIndex = ref(0);
const currentAds = computed(() => {
return state.advList.slice(currentIndex.value, currentIndex.value + 2);
});
const advRef = ref();
watch(
() => currentAds.value,
() => {
if (currentAds.value.length) {
nextTick(() => {
setAdImpression(
advRef.value,
currentAds.value,
{
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'popup',
},
// 'payload',
).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem) => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'popup',
};
reportAdClickEvent(params);
jumpAdv(item);
jumpAdv(item, 'ads');
};
const close = () => {
currentIndex.value += 2;
+1 -1
View File
@@ -64,7 +64,7 @@ const openVideo = () => {
return;
}
if (state.videoInfo.type) {
jumpAdv(state.videoInfo);
jumpAdv(state.videoInfo, 'ads');
return;
}
if (state.videoInfo.newsType == 'SEED_LINK') {
+1 -1
View File
@@ -223,7 +223,7 @@ const openVideo = () => {
// 必须读 props:列表刷新后组件可能复用,禁止缓存 setup 时的 videoInfo
const videoInfo = props.videoInfo;
if (videoInfo.type) {
jumpAdv(videoInfo);
jumpAdv(videoInfo, 'ads');
return;
}
// 点击的暗网视频,需要权限
-192
View File
@@ -1,192 +0,0 @@
<template>
<div v-if="!closed && ads.length" class="im-chat-notify-wrap">
<van-swipe
class="im-chat-notify-swipe"
vertical
:autoplay="ads.length > 1 ? 3000 : undefined"
:show-indicators="false"
:touchable="ads.length > 1"
>
<van-swipe-item v-for="ad in ads" :key="ad.id">
<div class="im-chat-notify" @click="onClaim(ad)">
<LazyImg class="im-chat-notify__cover" :src="ad.cover" :is-need-decypt="true" round />
<div class="im-chat-notify__body">
<div class="im-chat-notify__title-row">
<span class="im-chat-notify__title">{{ getAdTitle(ad) }}</span>
<span class="im-chat-notify__tag">广告</span>
</div>
</div>
<button type="button" class="im-chat-notify__btn" @click.stop="onClaim(ad)">
{{ getActionText(ad) }}
</button>
</div>
</van-swipe-item>
</van-swipe>
<button type="button" class="im-chat-notify__close-btn" aria-label="关闭" @click.stop="onClose">
<SvgIcon name="im-adv-close" class="im-chat-notify__close" color="#fff" />
</button>
</div>
</template>
<script lang="ts" setup>
import { computed, ref, watch } from 'vue';
import { IM_AD_POS, useImAdStore } from '@/stores/imAd';
import { jumpAdv } from '@/utils/index';
const emit = defineEmits<{
(e: 'visible-change', visible: boolean): void;
}>();
const imAdStore = useImAdStore();
const closed = ref(false);
const ads = computed(() => imAdStore.getByPosition(IM_AD_POS.CHAT_NOTIFY));
const isVisible = computed(() => !closed.value && ads.value.length > 0);
watch(
isVisible,
(visible) => {
emit('visible-change', visible);
},
{ immediate: true },
);
function getAdTitle(ad: Types.Im.AdItem) {
return ad.title || ad.description || '精选推荐';
}
function getActionText(ad: Types.Im.AdItem) {
const desc = ad.description?.trim();
if (desc && desc.length <= 4) return desc;
return '领取';
}
const onClaim = (ad: Types.Im.AdItem) => {
imAdStore.markClicked(ad.id);
jumpAdv(ad);
};
const onClose = () => {
closed.value = true;
};
</script>
<style lang="scss" scoped>
.im-chat-notify-wrap {
position: relative;
width: 100%;
background: #241317;
}
.im-chat-notify-swipe {
height: 68px;
:deep(.van-swipe__track) {
height: 68px;
}
:deep(.van-swipe-item) {
height: 68px;
}
}
.im-chat-notify {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
height: 68px;
padding: 10px 36px 10px 16px;
border-radius: 0;
background: rgba(229, 54, 92, 0.1);
box-sizing: border-box;
&__cover {
flex-shrink: 0;
width: 48px;
height: 48px;
overflow: hidden;
border-radius: 50%;
:deep(.lazy_img),
:deep(.laz_com),
:deep(.animationImg),
:deep(img) {
width: 48px;
height: 48px;
display: block;
object-fit: cover;
border-radius: 50%;
}
}
&__body {
flex: 1;
min-width: 0;
}
&__title-row {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
}
&__title {
font-size: 16px;
font-weight: 500;
line-height: 22px;
color: #fff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__tag {
flex-shrink: 0;
padding: 1px 6px;
border-radius: 6px;
background: #3d2f2f;
font-size: 10px;
line-height: 16px;
color: #fff;
}
&__btn {
flex-shrink: 0;
border: none;
height: 24px;
width: 48px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 12px;
background: #ff8800;
color: #fff;
font-size: 12px;
}
&__close-btn {
position: absolute;
right: 4px;
top: 50%;
z-index: 2;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
min-width: 44px;
min-height: 44px;
padding: 0;
border: none;
background: transparent;
cursor: pointer;
}
&__close {
flex-shrink: 0;
width: 10px;
height: 10px;
}
}
</style>
-71
View File
@@ -1,71 +0,0 @@
<template>
<div v-if="!closed && ads.length" class="session-ad-float">
<van-swipe class="ad-swipe" :autoplay="4000" :show-indicators="false" :loop="ads.length > 1">
<van-swipe-item v-for="(item, index) in ads" :key="item.id || index">
<DecryptImg :src="item.cover" class="ad-cover" round @click="onClick(item)" />
</van-swipe-item>
</van-swipe>
<div class="ad-close" @click.stop="closed = true">×</div>
</div>
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue';
import { IM_AD_POS, useImAdStore } from '@/stores/imAd';
import { jumpAdv } from '@/utils/index';
const imAdStore = useImAdStore();
const closed = ref(false);
const ads = computed(() => imAdStore.getByPosition(IM_AD_POS.FLOAT));
const onClick = (item: Types.Im.AdItem) => {
jumpAdv(item);
};
</script>
<style lang="scss" scoped>
.session-ad-float {
position: fixed;
right: 10px;
@include chat-layout-above-input;
z-index: 50;
}
.ad-swipe {
width: 60px !important;
height: 60px !important;
border-radius: 50%;
overflow: hidden;
}
.ad-cover {
width: 60px !important;
height: 60px !important;
border-radius: 50%;
overflow: hidden;
:deep(.img-decypt),
:deep(.vanImage),
:deep(.van-image),
:deep(.van-image__img) {
width: 60px !important;
height: 60px !important;
border-radius: 50%;
overflow: hidden;
}
}
.ad-close {
position: absolute;
top: 0;
right: 0;
width: 15px;
height: 15px;
line-height: 13px;
text-align: center;
border-radius: 50%;
background: rgba(255, 255, 255, 1);
color: #000;
font-size: 14px;
}
</style>
-129
View File
@@ -1,129 +0,0 @@
<template>
<Transition name="im-notify-slide">
<div v-if="notify" class="im-message-notify" @click="onOpen">
<LazyImg class="im-message-notify__avatar" :src="notify.peerAvatar" round eager />
<div class="im-message-notify__body">
<p class="im-message-notify__title">{{ notify.peerName }}</p>
<p class="im-message-notify__preview">{{ formatSessionPreview(notify.preview) }}</p>
</div>
<button type="button" class="im-message-notify__close" aria-label="关闭" @click.stop="onClose">×</button>
</div>
</Transition>
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import { useRouter } from 'vue-router';
import { showToast } from 'vant';
import ImApi from '@/service/im';
import { dismissImMessageNotify, imMessageNotify } from '@/utils/im/notify';
import { formatSessionPreview } from '@/utils/im/sessionList';
const router = useRouter();
const notify = computed(() => imMessageNotify.value);
const onClose = () => {
dismissImMessageNotify();
};
const onOpen = async () => {
const payload = notify.value;
if (!payload) return;
dismissImMessageNotify();
try {
const uid = await ImApi.resolveBusinessUid(payload.peerImUserId);
await router.push({
path: '/privateLetter',
query: { uid: String(uid) },
});
} catch (e) {
console.warn('[IM] 通知跳转失败:', e);
showToast('无法打开私信');
}
};
</script>
<style lang="scss" scoped>
.im-message-notify {
position: fixed;
top: calc(12px + env(safe-area-inset-top));
left: 12px;
right: 12px;
z-index: 300000;
display: flex;
align-items: center;
gap: 12px;
padding: 12px 14px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.98);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
box-sizing: border-box;
&__avatar {
flex-shrink: 0;
width: 44px;
height: 44px;
overflow: hidden;
border-radius: 50%;
:deep(.lazy_img),
:deep(.laz_com),
:deep(.animationImg),
:deep(img) {
width: 44px;
height: 44px;
display: block;
object-fit: cover;
border-radius: 50%;
}
}
&__body {
flex: 1;
min-width: 0;
}
&__title {
margin: 0;
font-size: 15px;
font-weight: 600;
color: #222;
line-height: 1.3;
}
&__preview {
margin: 4px 0 0;
font-size: 13px;
color: #666;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&__close {
flex-shrink: 0;
width: 24px;
height: 24px;
padding: 0;
border: none;
border-radius: 50%;
background: rgba(0, 0, 0, 0.06);
color: #666;
font-size: 18px;
line-height: 22px;
cursor: pointer;
}
}
.im-notify-slide-enter-active,
.im-notify-slide-leave-active {
transition: transform 0.25s ease, opacity 0.25s ease;
}
.im-notify-slide-enter-from,
.im-notify-slide-leave-to {
transform: translateY(-120%);
opacity: 0;
}
</style>
-32
View File
@@ -6,7 +6,6 @@
@touchstart.stop
@touchmove.stop
@touchend.stop
ref="advRef"
>
<div class="adv-container">
<van-swipe
@@ -31,12 +30,6 @@
</template>
<script setup lang="ts">
import { jumpAdv } from '@/utils/index';
import { nextTick, ref, watch } from 'vue';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const props = withDefaults(
defineProps<{
@@ -47,7 +40,6 @@ const props = withDefaults(
indicatorColor?: string;
showTitle?: boolean;
swiperKey?: string;
adImpression?: AdImpressionType;
}>(),
{
list: () => [],
@@ -58,31 +50,7 @@ const props = withDefaults(
swiperKey: '',
},
);
// 广告展示埋点
const advRef = ref();
watch(
() => props.list,
() => {
if (props.list.length) {
nextTick(() => {
setAdImpression(advRef.value, props.list, {
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'horizontal_cover',
}).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem, clickType?: 'ads' | 'recreation') => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'horizontal_cover',
};
reportAdClickEvent(params);
jumpAdv(item, clickType);
};
</script>
@@ -93,7 +93,7 @@ const jumpPage = (videoInfo: any) => {
return;
}
if (videoInfo.type) {
jumpAdv(videoInfo);
jumpAdv(videoInfo, 'ads');
return;
}
if (videoInfo.newsType == 'COVER') {
+3 -32
View File
@@ -1,7 +1,7 @@
<template>
<div class="nineGridPopup" v-if="appList.length > 0">
<van-overlay :show="isShow" z-index="2001" @click="emit('close')">
<div class="wrapper" ref="advRef">
<div class="wrapper">
<!-- <AdvSwiper
v-if="topList.length"
@click.stop
@@ -23,18 +23,13 @@
</div>
</template>
<script lang="ts" setup>
import { computed, nextTick, ref, watch } from 'vue';
import { computed, ref } from 'vue';
import { getAdItem } from '@/utils/getConfig';
import { AdType } from '@/enums/app';
import { jumpAdv } from '@/utils/index';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const props = defineProps<{
isOpen: boolean;
adImpression?: AdImpressionType;
}>();
const emit = defineEmits(['close']);
const isShow = computed(() => {
@@ -43,32 +38,8 @@ const isShow = computed(() => {
const appList = ref<Types.App.AdsInfoListItem[]>([]);
appList.value = getAdItem(AdType.QualityApplication) || [];
// const topList = getAdItem(AdType.TopAdvsList);
// 广告展示埋点
const advRef = ref();
watch(
appList,
() => {
if (appList.value.length) {
nextTick(() => {
setAdImpression(advRef.value, appList.value, {
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'multi_grid',
}).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem) => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'multi_grid',
};
reportAdClickEvent(params);
jumpAdv(item);
jumpAdv(item, 'ads');
};
</script>
<style lang="scss" scoped>
+2 -22
View File
@@ -72,10 +72,6 @@
<div class="payTip">1.因超时支付无法到账,请重新发起。</div>
<div class="payTip">2.每天发起支付不能超过5次,连续发起且未支付,账号可能被加入黑名单。</div>
<div class="payBtn" @click="toPay">¥{{ state.discountedPrice }}/{{ payBtnLabel }}</div>
<div class="customerService">
支付中如有问题,请咨询
<router-link class="contactCustomer" to="/customerService">在线客服</router-link>
</div>
</div>
</van-popup>
@@ -84,11 +80,10 @@
<div class="kindTipsBox">
<div class="title flex-center-center">温馨提示</div>
<div class="contents">
<p>1.订单支付后,一般会在1-10分钟内到账,如超时未到账,请联系在线客服为您处理。</p>
<p>1.订单支付后,一般会在1-10分钟内到账。</p>
<p>2.受特殊行业限制,如支付失败可尝试重新发起订单,系统将会随机切换备用的支付通道。</p>
<p>3.本APP有稳定的广告收益,产品稳定安全,请放心充值使用,如遇报毒提示忽略即可。</p>
</div>
<div class="messbg"></div>
<div class="cBtn" @click="comfinPay" v-if="!state.isPayLoading">确认支付</div>
<div class="cBtn" v-else>
<van-loading size="20px" type="spinner" color="rgb(255,255,255)">支付中...</van-loading>
@@ -100,7 +95,7 @@
<van-popup class="payTipPop" v-model:show="state.showPayTip">
<div class="payTipBox app-popup-surface">
<div class="paySubTitle app-popup-title">支付确认</div>
<div class="tipItem">1.订单支付后,一般会在3-5分钟内到账,如超时未到账,请联系在线客服为您处理。</div>
<div class="tipItem">1.订单支付后,一般会在3-5分钟内到账。</div>
<div class="tipItem">2.受特殊行业限制,如支付失败可尝试重新发起订单,系统将会随机切换备用的支付通道。</div>
<div class="tipItem">3.本APP有稳定的广告收益,产品稳定安全,请放心充值使用。</div>
<div class="question flex-center-center" @click="$router.push('paymentIssues')">
@@ -645,14 +640,6 @@ defineExpose({
border-radius: 43px;
margin: 20px auto;
}
.customerService {
font-size: 12px;
text-align: center;
padding-bottom: 30px;
.contactCustomer {
color: #ffc000;
}
}
}
}
:deep(.van-popup) {
@@ -688,13 +675,6 @@ defineExpose({
color: #fff;
}
}
.messbg {
width: 271px;
height: 101px;
margin: 0 auto 22px;
background: url('@/assets/images/png/messbg.png') no-repeat;
background-size: 100% 100%;
}
.cBtn {
width: 263px;
height: 44px;
+2 -31
View File
@@ -1,6 +1,6 @@
<template>
<div class="adv_swiper">
<div class="adv-container" v-if="props.list.length > 0" ref="advRef">
<div class="adv-container" v-if="props.list.length > 0">
<van-swipe ref="swipeRef" :show-indicators="false" :autoplay="autoTime" class="custom-swipe" @change="onChange">
<van-swipe-item
@click="handleJumpAdv(item, props.clickType)"
@@ -29,13 +29,9 @@
<script setup lang="ts">
import { jumpAdv } from '@/utils/index';
import { nextTick, ref, watch } from 'vue';
import { ref } from 'vue';
import type { SwipeInstance } from 'vant';
import { AdImpressionType, setAdImpression } from '@/utils/eventReporter/adImpression';
import { useRoute } from 'vue-router';
import { reportAdClickEvent } from '@/utils/eventReporter/adClick';
const route = useRoute();
const emit = defineEmits(['load']);
const swipeRef = ref<SwipeInstance>();
@@ -46,7 +42,6 @@ const props = withDefaults(
isShowIndicators?: boolean;
clickType?: 'ads' | 'recreation';
autoTime: number;
adImpression?: AdImpressionType;
}>(),
{
list: () => [],
@@ -66,31 +61,7 @@ const onChange = (index: number) => {
const load = () => {
emit('load');
};
// 广告展示埋点
const advRef = ref();
watch(
() => props.list,
() => {
if (props.list.length) {
nextTick(() => {
setAdImpression(advRef.value, props.list, {
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'fullscreen',
}).setupObserver();
});
}
},
{ immediate: true },
);
const handleJumpAdv = (item: Types.App.AdsInfoListItem, clickType?: 'ads' | 'recreation') => {
let params = {
...item,
page_key: props.adImpression?.page_key || (route.meta.pageKey as string) || '',
page_name: props.adImpression?.page_name || (route.meta.pageName as string) || '',
ad_type: props.adImpression?.ad_type || 'fullscreen',
};
reportAdClickEvent(params);
jumpAdv(item, clickType);
};
</script>
+3 -23
View File
@@ -102,14 +102,10 @@ export default {
<script lang="ts" setup>
import { ref, toRefs, watch, reactive, onActivated, computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { storeToRefs } from 'pinia';
import UserApi from '@/service/user';
import { useUserStore } from '@/stores/user';
import { useConfigStore } from '@/stores/config';
import { useGlobalStore } from '@/stores/global';
import { useImAdStore } from '@/stores/imAd';
import { imTotalUnread } from '@/utils/im/sdk';
import { analyticsEventNavigation } from '@/utils/eventReporter/analytics';
import setTheme from '@/assets/theme/index';
import { unlockShortVideoAudio } from '@/utils/shortVideoAudioUnlock';
import AiDramaFloatBubble from './AiDramaFloatBubble.vue';
@@ -180,31 +176,15 @@ onActivated(() => {
});
const onChange = (name: string) => {
UserStore.getCheckMessageTip();
if (name == 'home') {
analyticsEventNavigation('Home', '首页');
} else if (name == 'shortVideo') {
if (name == 'shortVideo') {
// 底部进短视频页:解锁会话有声,抖音/短剧后续竖滑可带声
unlockShortVideoAudio();
analyticsEventNavigation('ShortVideo', '抖音');
} else if (name == 'darkNet') {
analyticsEventNavigation('DarkWeb', '暗网');
} else if (name == 'aiUndress2') {
analyticsEventNavigation('AI', 'AI');
} else if (name == 'community') {
analyticsEventNavigation('Community', '社区');
} else if (name == 'mine') {
analyticsEventNavigation('Mine', '我的');
}
};
const { isNewsTip } = toRefs(UserStore);
const imAdStore = useImAdStore();
const { listHasUnclicked } = storeToRefs(imAdStore);
/** 我的页红点:业务未读 / IM 私信未读 / IM 列表广告未点击 */
const showRedDot = computed(() => {
return Boolean(isNewsTip.value) || Number(imTotalUnread.value) > 0 || listHasUnclicked.value;
});
/** 我的页红点:业务未读 */
const showRedDot = computed(() => Boolean(isNewsTip.value));
const backTop = (path: string) => {
let dom: any = null;
-3
View File
@@ -148,9 +148,6 @@ function jumpKeywords(type: any, id: any) {
case '9':
item.href = 'yinseinner://announcement';
break;
case '10':
item.href = 'yinseinner://kefu';
break;
case '11':
item.href = `yinseinner://horizontalVideo?id=${id}`;
break;
@@ -144,9 +144,6 @@ function jumpKeywords(type: any, id: any) {
case '9':
item.href = 'yinseinner://announcement';
break;
case '10':
item.href = 'yinseinner://kefu';
break;
case '11':
item.href = `yinseinner://horizontalVideo?id=${id}`;
break;
@@ -14,7 +14,6 @@ import { useUserStore } from '@/stores/user';
import { onActivated, onBeforeUnmount, onDeactivated, onMounted, Ref, ref, toRefs, reactive, inject } from 'vue';
import HlsJSPlayer from 'xgplayer-hls.js';
import UserApi from '@/service/user';
import { analyticsEventVideo } from '@/utils/eventReporter/analytics';
import { judgeTime } from '@/utils/index';
import {
bindXgTrialProgressGuard,
@@ -56,7 +55,6 @@ const emitTrialUnlockPopup = () => {
}, 300);
};
let player: any = null; //播放器实例
let isReport = ref(false); // 视频埋点锁
let isPreview = ref(false); // 是否预览视频
let videoUrl = ref(''); // 播放地址
let isPlayingH265 = false;
@@ -68,31 +66,8 @@ const state = reactive({
playTimer: <any>'', // 统计时使用:时间计时器
playTime: 0, // 统计时使用:播放时间
media: <any>{}, // 需要传入卖点的媒体数据对象
isCompleteReported: false, // 播放完成事件(>=95%)是否已上报,避免重复
isSecondPlayReported: false, // 播放超过 1 分钟后二次 play 埋点锁
});
// 进度达到 95% 视为播放完成(自然播放或拖动到 95% 都算)
const checkVideoComplete = () => {
if (state.isCompleteReported) return;
const duration = Number(player?.video?.duration) || 0;
const currentTime = Number(player?.video?.currentTime) || 0;
if (duration > 0 && currentTime / duration >= 0.9) {
state.isCompleteReported = true;
analyticsEventVideo(state.media, 'CARTOON', Math.ceil(currentTime || 1), 'video_complete', '播放完成');
}
};
const checkSecondVideoPlay = () => {
if (state.isSecondPlayReported) return;
const duration = Number(player?.video?.duration) || 0;
const currentTime = Number(player?.video?.currentTime) || 0;
if (currentTime / duration < 0.9) {
state.isSecondPlayReported = true;
analyticsEventVideo(state.media, 'CARTOON', Math.ceil(currentTime || 1), 'video_play', '播放');
}
};
onMounted(() => {
getInfo();
//获取免费观看次数
@@ -106,7 +81,6 @@ onMounted(() => {
videoTypeName: mediaInfo.value.videoTypeName,
lsjId: mediaInfo.value.lsjId,
};
analyticsEventVideo(state.media, 'CARTOON', 0, 'video_view', '展示');
});
/**
@@ -114,13 +88,9 @@ onMounted(() => {
*/
function pause() {
if (!player) return;
const wasPlaying = !player.paused;
player.pause();
clearInterval(state.playTimer);
state.playTimer = '';
if (wasPlaying) {
analyticsEventVideo(state.media, 'CARTOON', Math.ceil(player?.video?.currentTime || 1), 'video_pause', '暂停');
}
}
/**
* @description 判断是否预览视频
@@ -163,7 +133,6 @@ const getInfo = async () => {
/**
* @description 初始化播放器
*/
let suppressPlayAnalytics = false;
let trialLimitHandled = false;
let unbindTrialProgressGuard: (() => void) | null = null;
const pageActive = ref(true);
@@ -182,7 +151,6 @@ const destroyPlayer = (silent = false) => {
unbindH265Fallback?.();
unbindH265Fallback = null;
if (!player) return;
if (!silent) checkSecondVideoPlay();
destroySilently = silent;
try {
player.src = '';
@@ -244,9 +212,6 @@ const initVideo = () => {
req.tagID = parentInfo.value.tagDetails[0].id;
}
// VideoApi.getPlayVideo(req);
if (state.playTime > 1) {
// analyticsEventVideo(state.media, 'CARTOON', state.playTime, 'video_exit', '播放退出');
}
clearInterval(state.playTimer);
state.playTimer = '';
state.playTime = 0;
@@ -306,9 +271,6 @@ const initVideo = () => {
// 播放
player.on('play', () => {
emit('play', true);
if (!suppressPlayAnalytics) {
analyticsEventVideo(state.media, 'CARTOON', Math.ceil(player?.video?.currentTime || 1), 'video_play', '播放');
}
});
player.on('pause', () => {
emit('play', false);
@@ -316,7 +278,6 @@ const initVideo = () => {
player.on('timeupdate', () => {
if (!pageActive.value || !player.hasStart) return;
checkVideoComplete();
if (playCheck()) {
if (canResetTrialLimitHandled()) {
trialLimitHandled = false;
@@ -326,13 +287,9 @@ const initVideo = () => {
handleTrialLimitReached();
});
player.on('seeked', () => {
checkVideoComplete();
if (!player.hasStart) return;
const clamped = clampTrialSeek();
clearTrialSeekBlock();
window.setTimeout(() => {
suppressPlayAnalytics = false;
}, 300);
if (clamped) return;
if (!playCheck()) {
handleTrialLimitReached();
@@ -340,7 +297,6 @@ const initVideo = () => {
});
player.on('seeking', () => {
if (!player?.hasStart) return;
suppressPlayAnalytics = true;
if (isTrialPlaybackLimited()) {
setTrialFrameBlocked(true);
}
@@ -16,7 +16,6 @@ import HlsJSPlayer from 'xgplayer-hls.js';
import UserApi from '@/service/user';
import { addVideoHistory } from '@/utils';
import { HistoryVideoType } from '@/enums/app';
import { analyticsEventVideo } from '@/utils/eventReporter/analytics';
import { judgeTime } from '@/utils/index';
import {
bindXgTrialProgressGuard,
@@ -54,7 +53,6 @@ const emitTrialUnlockPopup = () => {
}, 300);
};
let player: any = null; //播放器实例
let isReport = ref(false); // 视频埋点锁
let isPreview = ref(false); // 是否预览视频
let videoUrl = ref(''); // 播放地址
/** 当前是否使用 H.265 资源 */
@@ -68,36 +66,12 @@ const state = reactive({
playTimer: <any>'', // 统计时使用:时间计时器
playTime: 0, // 统计时使用:播放时间
hideProgress: false,
isCompleteReported: false, // 播放完成事件(>=95%)是否已上报,避免重复
isSecondPlayReported: false, // 播放超过 1 分钟后二次 play 埋点锁
});
// 进度达到 95% 视为播放完成(自然播放或拖动到 95% 都算)
const checkVideoComplete = () => {
if (state.isCompleteReported) return;
const duration = Number(player?.video?.duration) || 0;
const currentTime = Number(player?.video?.currentTime) || 0;
if (duration > 0 && currentTime / duration >= 0.9) {
state.isCompleteReported = true;
analyticsEventVideo(videoInfo.value, 'MOVIE', Math.ceil(currentTime || 1), 'video_complete', '播放完成');
}
};
const checkSecondVideoPlay = () => {
if (state.isSecondPlayReported) return;
const duration = Number(player?.video?.duration) || 0;
const currentTime = Number(player?.video?.currentTime) || 0;
if (currentTime / duration < 0.9) {
state.isSecondPlayReported = true;
analyticsEventVideo(videoInfo.value, 'MOVIE', Math.ceil(currentTime || 1), 'video_play', '播放');
}
};
onMounted(() => {
getInfo();
//获取免费观看次数
getFreeWatchCount();
analyticsEventVideo(videoInfo.value, 'MOVIE', 0, 'video_view', '展示');
});
/**
@@ -105,13 +79,9 @@ onMounted(() => {
*/
const pause = () => {
if (!player) return;
const wasPlaying = !player.paused;
player.pause();
clearInterval(state.playTimer);
state.playTimer = '';
if (wasPlaying) {
analyticsEventVideo(videoInfo.value, 'MOVIE', Math.ceil(player?.video?.currentTime || 1), 'video_pause', '暂停');
}
};
/** 点击画面切换播放/暂停 */
@@ -189,7 +159,6 @@ const getInfo = async () => {
* @description 初始化播放器
*/
const previewStartFlag = ref(false); // 是否进行预览时间设置
let suppressPlayAnalytics = false;
let trialLimitHandled = false;
let unbindTrialProgressGuard: (() => void) | null = null;
const pageActive = ref(true);
@@ -208,7 +177,6 @@ const destroyPlayer = (silent = false) => {
unbindH265Fallback?.();
unbindH265Fallback = null;
if (!player) return;
if (!silent) checkSecondVideoPlay();
destroySilently = silent;
try {
player.src = '';
@@ -279,9 +247,6 @@ const initVideo = () => {
req.searchAccessTicket = props.searchAccessTicket;
}
VideoApi.getPlayVideo(req);
if (state.playTime > 1) {
// analyticsEventVideo(videoInfo.value, 'MOVIE', state.playTime, 'video_exit', '播放退出');
}
clearInterval(state.playTimer);
state.playTimer = '';
state.playTime = 1;
@@ -331,9 +296,6 @@ const initVideo = () => {
// 播放
player.on('play', () => {
emit('play');
if (!suppressPlayAnalytics) {
analyticsEventVideo(videoInfo.value, 'MOVIE', Math.ceil(player?.video?.currentTime || 1), 'video_play', '播放');
}
});
/** 仅当明确回到试看区内才清标记;回弹到 limit-ε 时 playCheck 为 true,不能清,否则半屏关了又弹 */
@@ -359,7 +321,6 @@ const initVideo = () => {
player.on('timeupdate', () => {
if (!pageActive.value || !player.hasStart) return;
emit('timeupdate', Number(player?.video?.currentTime) || 0);
checkVideoComplete();
if (playCheck()) {
if (canResetTrialLimitHandled()) {
trialLimitHandled = false;
@@ -369,7 +330,6 @@ const initVideo = () => {
handleTrialLimitReached();
});
player.on('seeked', () => {
checkVideoComplete();
if (!player.hasStart) return;
const clamped = clampTrialSeek();
clearTrialSeekBlock();
@@ -377,9 +337,6 @@ const initVideo = () => {
if (pageActive.value) {
emit('timeupdate', Number(player?.video?.currentTime) || 0);
}
window.setTimeout(() => {
suppressPlayAnalytics = false;
}, 300);
if (clamped) return;
if (!playCheck()) {
handleTrialLimitReached();
@@ -387,7 +344,6 @@ const initVideo = () => {
});
player.on('seeking', () => {
if (!player?.hasStart) return;
suppressPlayAnalytics = true;
if (needsTrialSeekLimit()) {
setTrialFrameBlocked(true);
}
-36
View File
@@ -30,7 +30,6 @@ import { computed, reactive, onBeforeUnmount, onDeactivated, onMounted, Ref, ref
import HlsJSPlayer from 'xgplayer-hls.js';
import { addVideoHistory } from '@/utils';
import { HistoryVideoType } from '@/enums/app';
import { analyticsEventVideo } from '@/utils/eventReporter/analytics';
import {
XG_HLS_FEED_OPTS,
XG_HLS_FEED_PRELOAD_OPTS,
@@ -130,7 +129,6 @@ const resetTrialLimitHandledIfNeeded = () => {
}
};
let player: any = null; //播放器实例
let suppressPlayAnalytics = false;
/** 实际播放的资源 key(可能为 H.265) */
let playResourceKey = '';
let isPlayingH265 = false;
@@ -274,19 +272,8 @@ const state = reactive({
beginTime: new Date(), // 统计时使用:开始时间
playTimer: <any>'', // 统计时使用:时间计时器
playTime: 0, // 统计时使用:播放时间
isCompleteReported: false, // 播放完成事件(>=95%)是否已上报,避免重复
});
// 进度达到 95% 视为播放完成(自然播放或拖动到 95% 都算)
const checkVideoComplete = () => {
if (state.isCompleteReported) return;
const duration = Number(player?.video?.duration) || 0;
const currentTime = Number(player?.video?.currentTime) || 0;
if (duration > 0 && currentTime / duration >= 0.95) {
state.isCompleteReported = true;
analyticsEventVideo(videoInfo.value, 'SP', state.playTime, 'video_complete', '播放完成');
}
};
/** 错峰预热定时器:滑到当前条时取消,避免仍等着才建播 */
let warmTimer: ReturnType<typeof setTimeout> | null = null;
@@ -300,7 +287,6 @@ const startPlaybackPipeline = () => {
if (!player) initVideo();
if (props.playbackActive) {
getFreeWatchCount();
analyticsEventVideo(videoInfo.value, 'SP', 0, 'video_view', '展示');
}
};
@@ -562,7 +548,6 @@ watch(
ensurePlay();
}
getFreeWatchCount();
analyticsEventVideo(videoInfo.value, 'SP', 0, 'video_view', '展示');
return;
}
unregisterShortVideoActiveUnmutePlay(kickUnmuteIfPlaying);
@@ -592,9 +577,6 @@ const addPlayCount = () => {
req.searchAccessTicket = props.searchAccessTicket;
}
VideoApi.getPlayVideo(req);
if (state.playTime > 1) {
analyticsEventVideo(videoInfo.value, 'SP', state.playTime, 'video_exit', '播放退出');
}
clearInterval(state.playTimer);
state.playTimer = '';
state.playTime = 0;
@@ -604,7 +586,6 @@ const addPlayCount = () => {
*/
const pause = () => {
if (!player) return;
const wasPlaying = !player.paused;
try {
const video = player.video as HTMLVideoElement | undefined;
video?.pause?.();
@@ -614,9 +595,6 @@ const pause = () => {
player.pause();
clearInterval(state.playTimer);
state.playTimer = '';
if (wasPlaying) {
analyticsEventVideo(videoInfo.value, 'SP', state.playTime, 'video_pause', '暂停');
}
};
/** 滑走/失活:停声停画,并作废未完成的起播/unmute 回调 */
@@ -749,9 +727,6 @@ const initVideo = () => {
// 播放
player.on('play', () => {
emit('play');
if (!suppressPlayAnalytics) {
analyticsEventVideo(videoInfo.value, 'SP', state.playTime, 'video_play', '播放');
}
});
player.on('timeupdate', () => {
if (!player.hasStart) return;
@@ -766,7 +741,6 @@ const initVideo = () => {
seekGuardTarget = -1;
}
emit('timeupdate', currentTime, duration);
checkVideoComplete();
if (playCheck()) {
resetTrialLimitHandledIfNeeded();
return;
@@ -777,11 +751,7 @@ const initVideo = () => {
player.on('seeked', () => {
seekGuardUntil = 0;
seekGuardTarget = -1;
checkVideoComplete();
if (!player.hasStart) return;
window.setTimeout(() => {
suppressPlayAnalytics = false;
}, 300);
if (!playCheck()) {
pause();
emitTrialUnlockPopup();
@@ -789,10 +759,6 @@ const initVideo = () => {
resetTrialLimitHandledIfNeeded();
}
});
player.on('seeking', () => {
if (!player?.hasStart) return;
suppressPlayAnalytics = true;
});
player.on('playing', () => {
if (activeSourceRefreshSeq) {
activeSourceRefreshSeq = 0;
@@ -1044,7 +1010,6 @@ defineExpose({
activeSourceRefreshSeq = ++sourceRefreshSeq;
seekGuardTarget = nextResumeAt;
seekGuardUntil = Date.now() + 2000;
suppressPlayAnalytics = true;
try {
player.src = nextPath;
} catch {
@@ -1129,7 +1094,6 @@ defineExpose({
}
seekGuardTarget = next;
seekGuardUntil = Date.now() + 2000;
suppressPlayAnalytics = true;
// 归零 / 近片头:只改 currentTime,避免 stopLoad/startLoad 造成多次加载后暂停
const softSeek = next <= 0.35;
try {
+2 -25
View File
@@ -11,23 +11,10 @@
"
>
<img class="close" src="@/assets/images/png/close1.png" @click.stop="closePopupAds" alt="" />
<AdvSwiper
:list="state.advList"
:isShowIndicators="false"
:adImpression="{
ad_type: 'small_grid',
}"
/>
<AdvSwiper :list="state.advList" :isShowIndicators="false" />
</div>
<template v-if="state.videoInfo.newsType == 'SHORT_ADV'">
<AdvSwiper
:list="[state.videoInfo]"
class="advSwiper"
height="100%"
:adImpression="{
ad_type: 'fullscreen',
}"
/>
<AdvSwiper :list="[state.videoInfo]" class="advSwiper" height="100%" />
</template>
<template v-else>
<!-- 图文播放器 -->
@@ -276,12 +263,6 @@ import { useConfigStore } from '@/stores/config';
import { usePaymentGuide } from '@/hooks/usePaymentGuide';
import { PaymentGuideScene } from '@/enums/home';
import { turnOnPaymentGuideLocalSwitch } from '@/utils/paymentGuideLocalSwitch';
import {
// getVideoType,
// reportCollectCommentEvent,
reportCollectFn,
// reportLikeCommentEvent,
} from '@/utils/eventReporter/videoComment';
const PaymentStatusPopup = defineAsyncComponent(() => import('@/components/paymentStatusPopup/index.vue'));
const PaymentGuidePopup = defineAsyncComponent(() => import('@/components/PaymentGuidePopup/index.vue'));
@@ -397,7 +378,6 @@ const clickLike = async () => {
state.videoInfo.vidStatus.hasLiked = true;
state.videoInfo.likeCount++;
showToast('点赞成功');
reportCollectFn(2, 1, state.videoInfo);
} else {
let req = {
type: LikeType.SHORT,
@@ -407,7 +387,6 @@ const clickLike = async () => {
state.videoInfo.vidStatus.hasLiked = false;
state.videoInfo.likeCount--;
showToast('取消成功');
reportCollectFn(2, 2, state.videoInfo);
}
} catch (e) {
console.log(e);
@@ -442,11 +421,9 @@ const clickCollect = async () => {
if (hasCollected) {
showToast('取消成功');
state.videoInfo.collectCount--;
reportCollectFn(1, 2, state.videoInfo);
} else {
showToast('收藏成功');
state.videoInfo.collectCount++;
reportCollectFn(1, 1, state.videoInfo);
}
});
};
@@ -186,10 +186,6 @@
<span class="payAmount">¥{{ payButton.price }}</span>
<span class="payAction">{{ payButton.action }}</span>
</div>
<div class="customerService">
支付问题反馈,点击联系
<span @click.stop="$router.push('customerService')">在线客服</span>
</div>
</div>
</div>
<!-- <Loading v-else :loading="state.loading" /> -->
@@ -1143,17 +1139,6 @@ onUnmounted(() => {
width: 100%;
margin: 0;
}
.customerService {
margin-top: 12px;
font-size: 12px;
line-height: 16px;
text-align: center;
color: rgba(220, 220, 220, 1);
span {
color: rgba(255, 212, 96, 1);
}
}
}
}
</style>