Files
gitlab-instance-0a899031_no…/src/app.js
hackrobot 82f04193dd 'init'
2025-03-25 18:13:10 -05:00

76 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Component } from 'react'
import SDK from 'sr-sdk-h5'
import './app.scss'
import 'animate.css';
import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
/**
* 有数埋点SDK 默认配置
* 使用方法请参考文档 https://mp.zhls.qq.com/youshu-docs/develop/sdk/Taro.html
* 如对有数SDK埋点接入有任何疑问请联系微信sr_data_service
*/
window.srt = new SDK({
/**
* 有数 - ka接入测试用 分配的 app_id对应的业务
*/
token: 'bi72fccc7184ef45f9',
/**
* 传入自定义的后台上报接口若传入则token将无意义
*/
// serverUrl: 'aaa.baidu.com',
/**
* 开启打印调试信息, 默认 false
*/
debug: true,
/**
* 代理配置,自动代理页面浏览事件、页面离开事件、点击事件,默认 false。建议开启
*/
autoTrack: true,
/**
* 自动开始上报,默认 true。建议开启
*/
autoStart: true,
/**
* 上报返回的钩子函数,返回 false 则代表不通过SDK不会清除本地记录会继续重拾
*/
// onUploaded?: () => {},
/**
* 跳过初始化时对 token 的必要检查
* 满足场景服务商转发SDK上报数据在服务端回填appid解决大量小程序同时接入的问题默认false
*/
// skipTokenCheck: false,
/**
* 小程序appid
*/
appid: ''
});
// window.srt.setChan({chan_id: 'xxx'}) // 设置渠道渠道信息将会被设置在props.chan对象中
// window.srt.setUser({user_id: 'xxx'}) // 设置用户信息用户信息将会被设置在props.wx_user对象中
class App extends Component {
componentDidMount () {}
componentDidShow () {}
componentDidHide () {}
// this.props.children 是将要会渲染的页面
render () {
return this.props.children
}
}
export default App