Commit 624a0f3c authored by haiyoucuv's avatar haiyoucuv

music

parent 25ac54b0
......@@ -5,11 +5,9 @@ import { observer } from "mobx-react";
import "./sharepage.less";
import { dateFormatter, getUrlParam, isMiniprogram, windowJumpUrl } from "@src/utils/utils";
import API from "@src/api";
import { handleLogClick, handleLogExposure } from "../../../MD";
import store from "../../store";
import { LOG_KEY, MatterShareOpt, MatterViewDuration, MatterViewOpt, pageView, pageViewD, sensorLog } from "../../utils/sensors";
import { extranceName } from "../../utils/constants";
import { isFlowCancellationError } from "mobx";
import shareStore from "@src/store/share";
import { Button } from "@src/components/Button";
@observer
......@@ -31,26 +29,18 @@ class Sharepage extends React.Component {
await store.checkBindStatus();
API.outside();
// await this.getShareInfo();
MatterViewOpt("b12112", {
MatterViewOpt("b12850", {
page_name: "分享落地页",
});
if (getUrlParam("inviteCode")) {
sensorLog(LOG_KEY.exposure, "b12112", "d12113", {
button_name: "为TA助力按钮",
sensorLog(LOG_KEY.exposure, "b12850", "d12851", {
button_name: "立即为TA助力按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
} else if(getUrlParam("worksNum")){
sensorLog(LOG_KEY.exposure, "b12112", "d12116", {
button_name: "为TA点赞按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
} else {
sensorLog(LOG_KEY.exposure, "b12112", "d12114", {
sensorLog(LOG_KEY.exposure, "b12850", "d12852", {
button_name: "立即参与按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
}
// setTimeout(() => {
......@@ -82,30 +72,17 @@ class Sharepage extends React.Component {
API.outside();
let indexUrl = CFG.indexUrl
const worksNum = getUrlParam("worksNum")
MatterViewDuration("b12112", +new Date() - this.startTime);
if (getUrlParam("inviteCode")) {
sensorLog(LOG_KEY.click, "b12112", "d12113", {
button_name: "为TA助力按钮",
sensorLog(LOG_KEY.click, "b12850", "d12851", {
button_name: "立即为TA助力按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
handleLogClick(49)
} else if(worksNum){
indexUrl = CFG.workPage
sensorLog(LOG_KEY.click, "b12112", "d12116", {
button_name: "立即参与",
page_name: "为TA点赞按钮",
entrance: extranceName[CFG.channel],
});
handleLogClick(52)
} else {
sensorLog(LOG_KEY.click, "b12112", "d12114", {
sensorLog(LOG_KEY.click, "b12850", "d12852", {
button_name: "立即参与按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
handleLogClick(50)
}
if (getUrlParam("inviteCode")) {
......@@ -126,7 +103,6 @@ class Sharepage extends React.Component {
CFG.channel +
`${!!getUrlParam("inviteCode") ? "&inviteCode=" + getUrlParam("inviteCode") : ""}` +
`${!!CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""}` +
`${!!worksNum ? `&worksNum=${worksNum}` : ""}` +
`&agentCode=${CFG.agentCode || ""}&actPlatforms=${CFG.actPlatforms || ""}&actId=${CFG.actId || ""}`;
// alert(url)
location.href = url;
......
......@@ -16,6 +16,7 @@ import musicStore from "@src/store/musicStore";
import MusicBtn from "@src/components/MusicBtn/MusicBtn";
import API from "@src/api";
import { isWeChat } from "@src/utils/share";
import { LOG_KEY, MatterShareOpt, MatterViewDuration, MatterViewOpt, pageView, sensorLog } from "@src/utils/sensors";
@observer
......@@ -29,6 +30,33 @@ class Userhomepage extends React.Component {
};
async componentDidMount() {
this.startTime = +new Date();
MatterViewOpt("b12833", {
page_name: "活动首页",
});
sensorLog(LOG_KEY.exposure, "b12833", "d12838", {
button_name: "邀请好友助力按钮",
page_name: "活动首页",
});
sensorLog(LOG_KEY.exposure, "b12833", "d12837", {
button_name: "抽奖按钮",
page_name: "活动首页",
});
sensorLog(LOG_KEY.exposure, "b12833", "d12836", {
button_name: "邀请明细按钮",
page_name: "活动首页",
});
sensorLog(LOG_KEY.exposure, "b12833", "d12835", {
button_name: "奖品按钮",
page_name: "活动首页",
});
sensorLog(LOG_KEY.exposure, "b12833", "d12834", {
button_name: "规则按钮",
page_name: "活动首页",
});
if (isWeChat()) {
if (!await store.checkBindStatus()) return;
}
......@@ -40,14 +68,28 @@ class Userhomepage extends React.Component {
}
componentWillUnmount() {
MatterViewDuration("b12833", +new Date() - this.startTime,{
page_name: "活动首页",
});
}
/** 规则按钮*/
clickRule = () => {
sensorLog(LOG_KEY.click, "b12833", "d12834", {
button_name: "规则按钮",
page_name: "活动首页",
});
if (!store.checkActTime("rule")) return;
modalStore.pushPop("RulePop");
};
/** 奖品按钮*/
clickPrize = () => {
sensorLog(LOG_KEY.click, "b12833", "d12835", {
button_name: "奖品按钮",
page_name: "活动首页",
});
if (!store.checkActTime("prize")) return;
if (!store.setIndex?.privacy) {
modalStore.pushPop("Yinsirulepop");
......@@ -58,6 +100,10 @@ class Userhomepage extends React.Component {
/** 抽奖按钮*/
clickDraw = () => {
sensorLog(LOG_KEY.click, "b12833", "d12837", {
button_name: "抽奖按钮",
page_name: "活动首页",
});
if (!store.checkActTime()) return;
API.assistJoin();
store.changePage(PAGE_MAP.DRAW_PAGE);
......@@ -73,11 +119,19 @@ class Userhomepage extends React.Component {
};
clickDetails = () => {
sensorLog(LOG_KEY.click, "b12833", "d12836", {
button_name: "邀请明细按钮",
page_name: "活动首页",
});
if (!store.checkActTime()) return;
store.changePage(PAGE_MAP.LIKE_LOG_PAGE);
};
clickInvite = () => {
MatterShareOpt("b12833", "d12838", {
button_name: "邀请好友助力按钮",
page_name: "活动首页",
})
if (!store.checkActTime()) return;
shareStore.doInvite();
API.assistJoin();
......
......@@ -134,6 +134,7 @@ export const sensorLog = (logKey, bid, did, options) => {
location_type: "活动",
agent_code: store.setIndex?.agentCode,
act_id: CFG.actId,
entrance: extranceName[CFG.channel],
...options
});
};
......@@ -153,6 +154,7 @@ export const pageViewD = (bid, did, options) => {
location_type: "活动",
agent_code: store.setIndex?.agentCode,
act_id: CFG.actId,
entrance: extranceName[CFG.channel],
...options
});
};
......@@ -177,6 +179,7 @@ export const pageView = (bid, options) => {
location_type: "活动",
agent_code: store.setIndex?.agentCode,
act_id: CFG.actId,
entrance: extranceName[CFG.channel],
...options
});
};
......@@ -242,4 +245,4 @@ export const MatterViewDuration = (bid, time, options) => {
$event_duration: time,
...options
});
};
\ No newline at end of file
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment