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,8 +1,8 @@
import { Component } from 'react' import { Component } from "react";
import SDK from 'sr-sdk-h5' import SDK from "sr-sdk-h5";
import './app.scss' import "./app.scss";
import 'taro-ui/dist/style/index.scss' // 全局引入一次即可 import "taro-ui/dist/style/index.scss"; // 全局引入一次即可
/** /**
* 有数埋点SDK 默认配置 * 有数埋点SDK 默认配置
@@ -11,11 +11,10 @@ import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
*/ */
window.srt = new SDK({ window.srt = new SDK({
/** /**
* 有数 - ka‘接入测试用’ 分配的 app_id,对应的业务 * 有数 - ka‘接入测试用’ 分配的 app_id,对应的业务
*/ */
token: 'bi72fccc7184ef45f9', token: "bi72fccc7184ef45f9",
/** /**
* 传入自定义的后台上报接口,若传入则token将无意义 * 传入自定义的后台上报接口,若传入则token将无意义
@@ -51,7 +50,7 @@ import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
/** /**
* 小程序appid * 小程序appid
*/ */
appid: '' appid: "",
}); });
// window.srt.setChan({chan_id: 'xxx'}) // 设置渠道,渠道信息将会被设置在props.chan对象中 // window.srt.setChan({chan_id: 'xxx'}) // 设置渠道,渠道信息将会被设置在props.chan对象中
@@ -67,8 +66,8 @@ class App extends Component {
// this.props.children 是将要会渲染的页面 // this.props.children 是将要会渲染的页面
render() { render() {
return this.props.children return this.props.children;
} }
} }
export default App export default App;

View File

@@ -1,16 +1,41 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <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
<meta name="apple-mobile-web-app-capable" content="yes"> content="width=device-width,initial-scale=1,user-scalable=no"
<meta name="apple-touch-fullscreen" content="yes"> name="viewport"
<meta name="format-detection" content="telephone=no,address=no"> />
<meta name="apple-mobile-web-app-status-bar-style" content="white"> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" > <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> <title>数字游民CNA</title>
<link rel="icon" href="./images/nomadcna.ico" type="image/x-icon" /> <link rel="icon" href="./images/nomadcna.ico" type="image/x-icon" />
<script><%= htmlWebpackPlugin.options.script %></script> <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> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>