This commit is contained in:
hackrobot
2024-09-26 16:44:39 +08:00
parent 492353dd90
commit 80eab42e9a
2 changed files with 58 additions and 34 deletions

View File

@@ -1,21 +1,20 @@
import { Component } from 'react'
import SDK from 'sr-sdk-h5'
import { Component } from "react";
import SDK from "sr-sdk-h5";
import './app.scss'
import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
import "./app.scss";
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({
* 有数埋点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: "bi72fccc7184ef45f9",
/**
* 传入自定义的后台上报接口若传入则token将无意义
@@ -51,7 +50,7 @@ import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
/**
* 小程序appid
*/
appid: ''
appid: "",
});
// window.srt.setChan({chan_id: 'xxx'}) // 设置渠道渠道信息将会被设置在props.chan对象中
@@ -59,16 +58,16 @@ import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
// window.srt.setUser({user_id: 'xxx'}) // 设置用户信息用户信息将会被设置在props.wx_user对象中
class App extends Component {
componentDidMount () {}
componentDidMount() {}
componentDidShow () {}
componentDidShow() {}
componentDidHide () {}
componentDidHide() {}
// this.props.children 是将要会渲染的页面
render () {
return this.props.children
render() {
return this.props.children;
}
}
export default App
export default App;

View File

@@ -1,18 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="format-detection" content="telephone=no,address=no">
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
<title>数字游民CNA</title>
<link rel="icon" href="./images/nomadcna.ico" type="image/x-icon" />
<script><%= htmlWebpackPlugin.options.script %></script>
</head>
<body>
<div id="app"></div>
</body>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta
content="width=device-width,initial-scale=1,user-scalable=no"
name="viewport"
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="format-detection" content="telephone=no,address=no" />
<meta name="apple-mobile-web-app-status-bar-style" content="white" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>数字游民CNA</title>
<link rel="icon" href="./images/nomadcna.ico" type="image/x-icon" />
<script>
<%= htmlWebpackPlugin.options.script %>
</script>
<!-- Matomo -->
<script>
var _paq = (window._paq = window._paq || []);
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
var u = "//matomo.digitalnomadchina.com/";
_paq.push(["setTrackerUrl", u + "matomo.php"]);
_paq.push(["setSiteId", "1"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.async = true;
g.src = u + "matomo.js";
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Matomo Code -->
</head>
<body>
<div id="app"></div>
</body>
</html>