|
@@ -28,25 +28,7 @@
|
|
|
})();
|
|
|
|
|
|
;(function () {
|
|
|
- function setMiniAppInfo () {
|
|
|
- try {
|
|
|
- var title = document.title
|
|
|
- var meta = document.querySelector('meta[name="mini-app-data"]');
|
|
|
- if (meta) {
|
|
|
- title = meta.getAttribute('content');
|
|
|
- }
|
|
|
- wx.miniProgram.postMessage({ data: {
|
|
|
- post: 'share',
|
|
|
- type: 'common',
|
|
|
- desc: '默认标题',
|
|
|
- title: title
|
|
|
- }})
|
|
|
- } catch (e) {
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- setMiniAppInfo()
|
|
|
|
|
|
function loadJS (url, success) {
|
|
|
var scripts = document.getElementsByTagName('script')
|
|
@@ -70,6 +52,31 @@
|
|
|
document.getElementsByTagName('head')[0].appendChild(domScript);
|
|
|
}
|
|
|
|
|
|
+ function initMiniAppInfo () {
|
|
|
+ function setMiniAppInfo () {
|
|
|
+ try {
|
|
|
+ var title = document.title
|
|
|
+ var meta = document.querySelector('meta[name="mini-app-data"]');
|
|
|
+ if (meta) {
|
|
|
+ title = meta.getAttribute('content');
|
|
|
+ }
|
|
|
+ wx.miniProgram.postMessage({ data: {
|
|
|
+ post: 'share',
|
|
|
+ type: 'common',
|
|
|
+ desc: '默认标题',
|
|
|
+ title: title
|
|
|
+ }})
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ loadJS('res2.wx.qq.com/open/js/jweixin-1.6.0.js', function () {
|
|
|
+ setMiniAppInfo()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ initMiniAppInfo()
|
|
|
+
|
|
|
try {
|
|
|
// 初始化JTrack
|
|
|
var sdkVersion = 142
|