You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.6 KiB

1 year ago
import App from './App'
import store from './store'
import '@/static/js/request.js'
import '@/static/js/CommonFunction.js'
12 months ago
// 引入字体样式
import "@/static/font/font.css"
10 months ago
import {
myMixins
} from '@/mixins/myMixins.js'
1 year ago
Vue.mixin(myMixins)
10 months ago
import {
QDTracker,
QDTMixin,
} from '@/static/js/uniapp/index';
// sdk包接入动作,推荐做在全局主入口main.js中
// 用于统一qdt的变量
let qdTracker;
// #ifdef MP
// 小程序的初始化
QDTracker.init({
10 months ago
debug: false, // 开启调试模式,默认关闭
10 months ago
disableCache: true,
appid: 'wxcb555ab174f22ec9', //小程序appid
// kfuin: 2852150212,
appkey: '0MA006654M5XP4YR', // 上面第二步里新增的appKey
10 months ago
application: '同里', // 小程序名称
10 months ago
apiHost: 'https://qidian.tongli.net', // 接口请求域名,请联系项目交付同事提供上报域名。
apiMethod: 'post',
encryptMode: 'close', // 加密模式 close-关闭 default-base64 aes-aes加密
// useId: false, //设置为true后。微信,百度需上报openid,支付宝需上报aliUserId。已废弃,可忽略。
enable_compression: true, // 开启压缩
track_interval: 0, // 发送间隔时间(ms)
batch_max_time: 1, // 批量发送数量
url: '',
session_interval: 30 * 60 * 1000, // session 间隔时间(ms)
autoTrack: { // 自动上报开关
appLaunch: true, //小程序启动事件是否自动上报
appShow: true, //小程序展示事件是否自动上报
appHide: true, //小程序隐藏事件是否自动上报
pageShow: true, //小程序页面浏览是否自动上报
pageHide: true, //小程序页面隐藏是否自动上报
pageShare: true, //小程序分享是否自动上报
mpClick: false, //小程序元素点击是否自动上报
// mpClick为当Page中定义的事件处理函数被触发时采集,目前只支持tap/ longtap/longpress三类事件;
},
});
// 初始化后可以立刻开始自定义上报
QDTracker.track('navButtonClick', {buttonName: '123', buttonSort: '123'});
// 小程序与web统一变量
qdTracker = QDTracker;
10 months ago
Vue.prototype.qdTracker = (a, b) => {
QDTracker.track(a, b);
}
10 months ago
// 注意:小程序为了补充每个Page事件,以mixin的形式进行页面混入
Vue.mixin(QDTMixin);
// #endif
1 year ago
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
10 months ago
store: store,
...App,
globalData: {
// 在这里定义全局数据
QDTracker: qdTracker
},
1 year ago
})
app.$mount()
// #endif
// #ifdef VUE3
10 months ago
import {
createSSRApp
} from 'vue'
1 year ago
export function createApp() {
10 months ago
const app = createSSRApp(App)
return {
app
}
1 year ago
}
// #endif