Commit a8842e53 authored by hewenhao's avatar hewenhao

feat: 添加埋点

parent 9944c6a0
...@@ -11,6 +11,7 @@ type UserGuideProps<T extends ComponentType<any>> = { ...@@ -11,6 +11,7 @@ type UserGuideProps<T extends ComponentType<any>> = {
onFinish?: () => void; onFinish?: () => void;
isActive?: boolean; isActive?: boolean;
compnent?: T; compnent?: T;
guideViewId?: string;
onClickConent?: () => void; onClickConent?: () => void;
verticalPadding?: number; verticalPadding?: number;
horizonPadding?: number; horizonPadding?: number;
...@@ -19,7 +20,7 @@ type UserGuideProps<T extends ComponentType<any>> = { ...@@ -19,7 +20,7 @@ type UserGuideProps<T extends ComponentType<any>> = {
} & GetProps<T> } & GetProps<T>
function UserGuideView<T extends ComponentType<any> = typeof View> (props: UserGuideProps<T>) { function UserGuideView<T extends ComponentType<any> = typeof View> (props: UserGuideProps<T>) {
const { isActive, wrapClass, guideContent, verticalPadding = 0, horizonPadding = 0, onFinish, onClickConent, compnent: Comp = View, ...rest } = props const { isActive, wrapClass, guideViewId, guideContent, verticalPadding = 0, horizonPadding = 0, onFinish, onClickConent, compnent: Comp = View, ...rest } = props
const [rect, setRect] = useState({ width: 80, height: 80, top: 0, left: 0 }) const [rect, setRect] = useState({ width: 80, height: 80, top: 0, left: 0 })
const [_isActive, setIsActive] = useState(false) const [_isActive, setIsActive] = useState(false)
const scrollRef = useRef(0) const scrollRef = useRef(0)
...@@ -63,7 +64,7 @@ function UserGuideView<T extends ComponentType<any> = typeof View> (props: UserG ...@@ -63,7 +64,7 @@ function UserGuideView<T extends ComponentType<any> = typeof View> (props: UserG
{_isActive && ( {_isActive && (
<RootPortal> <RootPortal>
<View className={classNames(styles.contentWrap, wrapClass)} catchMove style={style}> <View className={classNames(styles.contentWrap, wrapClass)} catchMove style={style}>
<View className={styles.content} onClick={onClickConent}> <View className={styles.content} onClick={onClickConent} id={guideViewId}>
</View> </View>
{guideContent} {guideContent}
</View> </View>
......
...@@ -50,13 +50,13 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => { ...@@ -50,13 +50,13 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => {
<> <>
<View className={classNames(styles.wrap, isEyeProtectionMode && styles.eye_protection)}> <View className={classNames(styles.wrap, isEyeProtectionMode && styles.eye_protection)}>
<View className={styles.inner}> <View className={styles.inner}>
<View className={styles.left} onClick={() => _switchTab(0, '/pages/main/main')}> <View className={styles.left} onClick={() => _switchTab(0, '/pages/main/main')} id="app_tab_1">
{selected === 0 && ( {selected === 0 && (
<Image src="/assets/tabbar/personal-bg.png" className={classNames(styles.bg, styles.left)}></Image> <Image src="/assets/tabbar/personal-bg.png" className={classNames(styles.bg, styles.left)}></Image>
)} )}
<Image src="/assets/tabbar/personal-on.png" className={styles.icon} /> <Image src="/assets/tabbar/personal-on.png" className={styles.icon} />
</View> </View>
<View className={styles.right} onClick={() => _switchTab(1, '/pages/group/index')}> <View className={styles.right} onClick={() => _switchTab(1, '/pages/group/index')} id="app_tab_2">
{selected === 1 && ( {selected === 1 && (
<Image src="/assets/tabbar/group-bg.png" className={classNames(styles.bg, styles.right)}></Image> <Image src="/assets/tabbar/group-bg.png" className={classNames(styles.bg, styles.right)}></Image>
)} )}
...@@ -64,7 +64,7 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => { ...@@ -64,7 +64,7 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => {
<Image src="/assets/tabbar/group-on.png" className={classNames(styles.icon, { [styles.hasPoint]: hasPoint })}> <Image src="/assets/tabbar/group-on.png" className={classNames(styles.icon, { [styles.hasPoint]: hasPoint })}>
</Image> </Image>
{isActiveGuide && ( {isActiveGuide && (
<View className={styles.guide_content} onClick={handleClickGuide}> <View className={styles.guide_content} onClick={handleClickGuide} id="app_tab_2_guide">
<Image src={tutorialAssets['guide-arrow-2.png'].u} className={styles.guide_arrow}></Image> <Image src={tutorialAssets['guide-arrow-2.png'].u} className={styles.guide_arrow}></Image>
</View> </View>
)} )}
......
...@@ -84,6 +84,7 @@ const GameCompleteAchieve = () => { ...@@ -84,6 +84,7 @@ const GameCompleteAchieve = () => {
className={styles.btn_continue} className={styles.btn_continue}
hoverClass={styles.is_active} hoverClass={styles.is_active}
onClick={handleContinue} onClick={handleContinue}
id="game_complete_continue"
> >
继续 继续
</View> </View>
......
...@@ -207,6 +207,7 @@ const GameCompleteHead = () => { ...@@ -207,6 +207,7 @@ const GameCompleteHead = () => {
<UserGuideView <UserGuideView
className={styles.item} className={styles.item}
onClick={goWrong} onClick={goWrong}
id="err_question"
isActive={isActive} isActive={isActive}
compnent={View} compnent={View}
wrapClass={styles.content_wrap} wrapClass={styles.content_wrap}
...@@ -217,7 +218,7 @@ const GameCompleteHead = () => { ...@@ -217,7 +218,7 @@ const GameCompleteHead = () => {
<View className={styles.guide}> <View className={styles.guide}>
<View className={styles.guide_inner}> <View className={styles.guide_inner}>
<Image src={tutorialAssets['cat.png'].u} className={styles.guide_icon}></Image> <Image src={tutorialAssets['cat.png'].u} className={styles.guide_icon}></Image>
<View className={styles.guide_modal} onClick={completeGuide}> <View className={styles.guide_modal} onClick={completeGuide} id="err_question_guide">
<View> <View>
点击此处,可以查看<Text className={styles.em}>本次闯关的错题</Text>哦~ 点击此处,可以查看<Text className={styles.em}>本次闯关的错题</Text>哦~
</View> </View>
......
...@@ -51,6 +51,7 @@ const ModalContinue = () => { ...@@ -51,6 +51,7 @@ const ModalContinue = () => {
className={styles.btn_left} className={styles.btn_left}
hoverClass={styles.is_active} hoverClass={styles.is_active}
onClick={() => submit()} onClick={() => submit()}
id="fail_game_give_up"
> >
放弃 放弃
</View> </View>
...@@ -58,6 +59,7 @@ const ModalContinue = () => { ...@@ -58,6 +59,7 @@ const ModalContinue = () => {
className={classNames(styles.btn_right, !canGoNext && styles.disabled)} className={classNames(styles.btn_right, !canGoNext && styles.disabled)}
hoverClass={canGoNext ? styles.is_active : null} hoverClass={canGoNext ? styles.is_active : null}
onClick={handleReborn} onClick={handleReborn}
id="fail_game_reborn"
> >
<Image src={require('@/pages/main/assets/ph.png')} className={styles.icon}></Image> <Image src={require('@/pages/main/assets/ph.png')} className={styles.icon}></Image>
<Text>-1 继续</Text> <Text>-1 继续</Text>
......
...@@ -21,7 +21,7 @@ const PageFooter = (props: PageFooterProps) => { ...@@ -21,7 +21,7 @@ const PageFooter = (props: PageFooterProps) => {
<View <View
className={styles.btn_left} className={styles.btn_left}
hoverClass={styles.is_active} hoverClass={styles.is_active}
id="question_cancel_btn" id="question_clear_btn"
onClick={() => clearUserAnswer()} onClick={() => clearUserAnswer()}
> >
<Image src={require('../assets/btn-clear-icon.png')} className={styles.icon}></Image> <Image src={require('../assets/btn-clear-icon.png')} className={styles.icon}></Image>
......
...@@ -30,7 +30,7 @@ const GuideModal = () => { ...@@ -30,7 +30,7 @@ const GuideModal = () => {
<View>部落PK大赛</View> <View>部落PK大赛</View>
</View> </View>
</View> </View>
<View className={classNames(styles.dialog)} onClick={() => completeGroupGuide()}> <View className={classNames(styles.dialog)} onClick={() => completeGroupGuide()} id="complete_group_guide">
<View> <View>
除此之外,每个部落还有专属排行榜,后续还会有【部落PK大赛】等活动。 除此之外,每个部落还有专属排行榜,后续还会有【部落PK大赛】等活动。
<Text className={styles.em}>期待你带领你的部落一起成长,获得更多奖励!</Text> <Text className={styles.em}>期待你带领你的部落一起成长,获得更多奖励!</Text>
......
...@@ -38,11 +38,11 @@ const TopHeader = () => { ...@@ -38,11 +38,11 @@ const TopHeader = () => {
<View className={styles.avatar}> <View className={styles.avatar}>
<Text className={styles.name}>{userInfo?.nickName ?? ''}</Text> <Text className={styles.name}>{userInfo?.nickName ?? ''}</Text>
</View> </View>
<View className={styles.score} onClick={goStore}> <View className={styles.score} onClick={goStore} id="group_header_score">
<Image src={require('@/pages/main/assets/score.png')} className={styles.icon} /> <Image src={require('@/pages/main/assets/score.png')} className={styles.icon} />
<Text>{point}</Text> <Text>{point}</Text>
</View> </View>
<View className={styles.ph} onClick={goStore}> <View className={styles.ph} onClick={goStore} id="group_header_ph">
<Image src={require('@/pages/main/assets/ph.png')} className={styles.icon} /> <Image src={require('@/pages/main/assets/ph.png')} className={styles.icon} />
<Text>{cardNum}</Text> <Text>{cardNum}</Text>
</View> </View>
......
...@@ -148,7 +148,7 @@ const Group = () => { ...@@ -148,7 +148,7 @@ const Group = () => {
<Modal isVisible={isVisible} tilte="学习部落名" onClose={setFalse}> <Modal isVisible={isVisible} tilte="学习部落名" onClose={setFalse}>
<View className={styles.modal}> <View className={styles.modal}>
<View className={styles.modal_body} onClick={_genGroundNo}> <View className={styles.modal_body} onClick={_genGroundNo} id="group_gen_name">
<Input className={styles.modal_input} disabled value={groupNo} /> <Input className={styles.modal_input} disabled value={groupNo} />
<Image className={styles.modal_refresh} mode="widthFix" src={assets['refresh.png'].u} /> <Image className={styles.modal_refresh} mode="widthFix" src={assets['refresh.png'].u} />
</View> </View>
......
...@@ -43,11 +43,11 @@ const MainHeader = () => { ...@@ -43,11 +43,11 @@ const MainHeader = () => {
<View className={styles.avatar}> <View className={styles.avatar}>
<Text className={styles.name}>{userInfo?.nickName ?? ''}</Text> <Text className={styles.name}>{userInfo?.nickName ?? ''}</Text>
</View> </View>
<View className={classNames(styles.score, cs.bounce_btn)} onClick={goStore} hoverClass={cs.bounce_btn_hover}> <View className={classNames(styles.score, cs.bounce_btn)} onClick={goStore} hoverClass={cs.bounce_btn_hover} id="main_header_score">
<Image src={require('../assets/score.png')} className={styles.icon} /> <Image src={require('../assets/score.png')} className={styles.icon} />
<Text>{point}</Text> <Text>{point}</Text>
</View> </View>
<View className={classNames(styles.ph, cs.bounce_btn)} onClick={goStore} hoverClass={cs.bounce_btn_hover}> <View className={classNames(styles.ph, cs.bounce_btn)} onClick={goStore} hoverClass={cs.bounce_btn_hover} id="main_header_ph">
<Image src={require('../assets/ph.png')} className={styles.icon} /> <Image src={require('../assets/ph.png')} className={styles.icon} />
<Text>{cardNum}</Text> <Text>{cardNum}</Text>
</View> </View>
......
...@@ -146,6 +146,7 @@ const StageComp = (props: StageProps) => { ...@@ -146,6 +146,7 @@ const StageComp = (props: StageProps) => {
horizonPadding={0} horizonPadding={0}
wrapClass={styles.guide_wrap} wrapClass={styles.guide_wrap}
onClickConent={handleCompleteGuide} onClickConent={handleCompleteGuide}
guideViewId="firt_stage_guide"
guideContent={( guideContent={(
<View className={styles.tutorial}> <View className={styles.tutorial}>
<Image src={tutorial['arrow.png'].u} className={styles.tutorial_arrow}></Image> <Image src={tutorial['arrow.png'].u} className={styles.tutorial_arrow}></Image>
......
...@@ -170,8 +170,12 @@ export default function ShareModal () { ...@@ -170,8 +170,12 @@ export default function ShareModal () {
</View> </View>
<View className={styles.footer}> <View className={styles.footer}>
<Text className={styles.cancel} onClick={handleCancel}>暂不加入</Text> <Text className={styles.cancel} onClick={handleCancel} id="join_group_cancel">暂不加入</Text>
<Text className={styles.confirm} onClick={() => run({ groupId: detail.groupId!, shareUserId: detail.shareUserId! })}> <Text
className={styles.confirm}
onClick={() => run({ groupId: detail.groupId!, shareUserId: detail.shareUserId! })}
id="join_group_confirm"
>
确定加入 确定加入
</Text> </Text>
</View> </View>
......
...@@ -49,7 +49,7 @@ const ShortCut = (props: ShortCutProps) => { ...@@ -49,7 +49,7 @@ const ShortCut = (props: ShortCutProps) => {
return ( return (
<EyeProtectionView className={styles.shortcut}> <EyeProtectionView className={styles.shortcut}>
<View className={classNames(styles.shortcutInner, isHide && styles.is_hide)} onClick={props.onClick}> <View className={classNames(styles.shortcutInner, isHide && styles.is_hide)} onClick={props.onClick} id="main_shortcut">
<Image src={assets['short-cut-bg.png'].u} className={styles.bg}></Image> <Image src={assets['short-cut-bg.png'].u} className={styles.bg}></Image>
<Image src={assets['short-cut-arrow.png'].u} className={classNames(styles.arrow, ((!isHide && isDown) || (isHide && !isDown)) && styles.isDown)}></Image> <Image src={assets['short-cut-arrow.png'].u} className={classNames(styles.arrow, ((!isHide && isDown) || (isHide && !isDown)) && styles.isDown)}></Image>
</View> </View>
......
...@@ -46,6 +46,7 @@ const ModalArea = (props: ModalAreaProps) => { ...@@ -46,6 +46,7 @@ const ModalArea = (props: ModalAreaProps) => {
className={classNames(styles.btn, !current && styles.disabled)} className={classNames(styles.btn, !current && styles.disabled)}
onClick={handleConfirm} onClick={handleConfirm}
loading={loading} loading={loading}
id="main_confirm_area"
hoverClass={styles.btn_on} hoverClass={styles.btn_on}
>继续</Button> >继续</Button>
</View> </View>
......
...@@ -46,6 +46,7 @@ const ModalGrade = (props: ModalGradeProps) => { ...@@ -46,6 +46,7 @@ const ModalGrade = (props: ModalGradeProps) => {
loading={loading} loading={loading}
className={classNames(styles.btn, !current && styles.disabled)} className={classNames(styles.btn, !current && styles.disabled)}
onClick={handleConfirm} onClick={handleConfirm}
id="main_confirm_grade"
hoverClass={styles.btn_on} hoverClass={styles.btn_on}
>继续</Button> >继续</Button>
</View> </View>
......
...@@ -16,7 +16,7 @@ const ModalGroupGuide = (props: ModalGroupGuideProps) => { ...@@ -16,7 +16,7 @@ const ModalGroupGuide = (props: ModalGroupGuideProps) => {
<View className={styles.result_wrap} catchMove> <View className={styles.result_wrap} catchMove>
<Image src={tutorialAssets['cat.png'].u} className={styles.result_cat} /> <Image src={tutorialAssets['cat.png'].u} className={styles.result_cat} />
<View className={styles.result_main}> <View className={styles.result_main}>
<View className={classNames(styles.dialog)} onClick={() => onConfirm()}> <View className={classNames(styles.dialog)} onClick={() => onConfirm()} id="group_guide_1">
<View> <View>
阿喵老师很高兴看到你在不断进步,接下来我要传授你一个 阿喵老师很高兴看到你在不断进步,接下来我要传授你一个
<Text className={styles.em}>得到大量水晶的好方法</Text>。 <Text className={styles.em}>得到大量水晶的好方法</Text>。
......
...@@ -57,7 +57,7 @@ const ModalResult = (props: ModalResultProps) => { ...@@ -57,7 +57,7 @@ const ModalResult = (props: ModalResultProps) => {
<View className={styles.result_wrap} catchMove> <View className={styles.result_wrap} catchMove>
<Image src={tutorialAssets['cat.png'].u} className={styles.result_cat} /> <Image src={tutorialAssets['cat.png'].u} className={styles.result_cat} />
<View className={styles.result_main}> <View className={styles.result_main}>
<View className={classNames(styles.dialog, isLevel1 && styles.is_lower)} onClick={() => onConfirm()}> <View className={classNames(styles.dialog, isLevel1 && styles.is_lower)} onClick={() => onConfirm()} id="main_confirm_info_result">
{renderContent()} {renderContent()}
<View className={styles.continue}> <View className={styles.continue}>
<View className={styles.continue_btn}> <View className={styles.continue_btn}>
......
...@@ -94,10 +94,15 @@ const Scene6 = (props: Scene6Props) => { ...@@ -94,10 +94,15 @@ const Scene6 = (props: Scene6Props) => {
<View> <View>
<View className={styles.input}> <View className={styles.input}>
<View className={styles.input_item}>{name}</View> <View className={styles.input_item}>{name}</View>
<Image src={assets['touzi.png'].u} className={classNames(styles.input_icon, isGenerating && styles.is_gen)} onClick={handleGen}></Image> <Image
src={assets['touzi.png'].u}
className={classNames(styles.input_icon, isGenerating && styles.is_gen)}
onClick={handleGen}
id="main_guide_6_gen_name"
></Image>
</View> </View>
<View className={styles.input_tip}> <View className={styles.input_tip}>
{/* 确定后奖励<Image src={assets['score.png'].u} className={styles.score}></Image><Text className={styles.em}>+100</Text> */} * 可点击右侧按钮随机生成名字
</View> </View>
</View> </View>
<View className={styles.bottom}></View> <View className={styles.bottom}></View>
......
...@@ -101,8 +101,8 @@ const ExchangeItem = (props: ExchangeItemProps) => { ...@@ -101,8 +101,8 @@ const ExchangeItem = (props: ExchangeItemProps) => {
<View>张</View> <View>张</View>
</View> </View>
<View className={styles.footer}> <View className={styles.footer}>
<View className={styles.cancel} onClick={() => onCancel()}>取消</View> <View className={styles.cancel} onClick={() => onCancel()} id="market_exchange_cancel">取消</View>
<View className={classNames(styles.confirm, val < 1 && styles.disbaled)} onClick={handleConfirm}> <View className={classNames(styles.confirm, val < 1 && styles.disbaled)} onClick={handleConfirm} id="market_exchange_confirm">
确定 确定
{isGuideActive && ( {isGuideActive && (
<View className={styles.guide}> <View className={styles.guide}>
......
...@@ -22,7 +22,7 @@ const GuideFinish = (props: ModalAreaProps) => { ...@@ -22,7 +22,7 @@ const GuideFinish = (props: ModalAreaProps) => {
<Image src={tutorialAssets['guide-point.png'].u} className={styles.icon}></Image> <Image src={tutorialAssets['guide-point.png'].u} className={styles.icon}></Image>
<View className={styles.count}>答题卡 +{pointToCardNum}</View> <View className={styles.count}>答题卡 +{pointToCardNum}</View>
<View className={styles.tips}>接下来开启你的闯关之旅吧!</View> <View className={styles.tips}>接下来开启你的闯关之旅吧!</View>
<Button className={styles.btn} onClick={handleConfirm}>好的</Button> <Button className={styles.btn} onClick={handleConfirm} id="market_guide_finish">好的</Button>
</View> </View>
</RootPortal> </RootPortal>
) )
......
...@@ -33,7 +33,7 @@ const ModalReceivePoint = (props: ReceivePointProps) => { ...@@ -33,7 +33,7 @@ const ModalReceivePoint = (props: ReceivePointProps) => {
<Image src={giftAssets['point-receive.png'].u} className={styles.icon}></Image> <Image src={giftAssets['point-receive.png'].u} className={styles.icon}></Image>
<View className={styles.count}>水晶 +100</View> <View className={styles.count}>水晶 +100</View>
<View className={styles.tips}>阿喵老师的奖励,继续加油哦~</View> <View className={styles.tips}>阿喵老师的奖励,继续加油哦~</View>
<Button className={styles.btn} onClick={handleConfirm} loading={loading}>领取</Button> <Button className={styles.btn} onClick={handleConfirm} loading={loading} id="market_guide_receive">领取</Button>
</View> </View>
</RootPortal> </RootPortal>
) )
......
...@@ -157,7 +157,7 @@ const StudyMarket = () => { ...@@ -157,7 +157,7 @@ const StudyMarket = () => {
<View className={styles.guide_content}> <View className={styles.guide_content}>
<Image src={tutorialAssets['cat-2.png'].u} className={styles.guide_cat} /> <Image src={tutorialAssets['cat-2.png'].u} className={styles.guide_cat} />
<View className={styles.guide_main}> <View className={styles.guide_main}>
<View className={classNames(styles.dialog)} onClick={() => nextStoreGuide()}> <View className={classNames(styles.dialog)} onClick={() => nextStoreGuide()} id="market_guide_1">
<View> <View>
在这里,可以兑换闯关消耗的<Text className={styles.em}>答题卡</Text>,以及 在这里,可以兑换闯关消耗的<Text className={styles.em}>答题卡</Text>,以及
<Text className={styles.em}>成长奖励</Text>哦~ <Text className={styles.em}>成长奖励</Text>哦~
......
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