友盟统计

master
yujialong 1 year ago
parent 79b808404a
commit d23d45f8a6
  1. 4
      config/request.js
  2. 16
      directives/auth.js
  3. 12
      directives/index.js
  4. 20
      libs/uma.js
  5. 4
      main.js
  6. 9
      manifest.json
  7. 5
      package-lock.json
  8. 3
      package.json
  9. 3
      pages/index/index.vue
  10. 21
      pages/workbench/workbench.vue

@ -5,9 +5,9 @@
*/
export default {
// baseURL: 'https://huorantech.cn/',
baseURL: 'https://huorantech.cn/',
// baseURL: 'http://192.168.31.152:9000/',
baseURL: 'http://121.37.12.51/',
// baseURL: 'http://121.37.12.51/',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},

@ -1,16 +0,0 @@
/**
* @description 鉴权指令
* 当传入的权限当前用户没有时会移除该组件
* 用例<Tag v-auth>text</Tag> <Tag v-auth="'user:'">text</Tag>
* */
export default {
inserted(el, binding, vnode) {
const btnText = el.innerText
const btnPermissions = uni.getStorageSync('auth')
if (btnText && btnPermissions && btnPermissions.length) {
const isPermission = btnPermissions.includes(btnText)
// 如果按钮集合里没有该权限,就把该按钮给去除
!isPermission && el.parentNode && el.parentNode.removeChild(el)
}
},
};

@ -1,12 +0,0 @@
/**
* 插件
* */
import auth from './auth'
export default {
async install(Vue, options) {
// 指令
Vue.directive('auth', auth)
}
};

@ -0,0 +1,20 @@
// #ifdef MP-WEIXIN
import uma from 'umtrack-wx';
uma.init({
appKey: '64cc98d5a1a164591b62da3e', // 由友盟分配的APP_KEY
useOpenid: true,
// 使用Openid进行统计,此项为false时将使用友盟+uuid进行用户统计。
// 使用Openid来统计微信小程序的用户,会使统计的指标更为准确,对系统准确性要求高的应用推荐使用Openid
autoGetOpenid: true,
// 使用openid进行统计时,是否授权友盟自动获取Openid,
// 如若需要,请到友盟后台"设置管理-应用信息"(https://mp.umeng.com/setting/appset)中设置appId及secret
debug: true,// 是否打开调试模式
uploadUserInfo: true, // 自动上传用户信息,设为false取消上传,默认为false
enableVerify: true
});
uma.install = function(Vue) {
Vue.prototype.$uma = uma;
}
export default uma;
// #endif

@ -3,11 +3,11 @@
import Vue from 'vue'
import App from './App'
import util from '@/libs/util'
import plugins from '@/directives'
import uma from './libs/uma'
Vue.config.productionTip = false
Vue.prototype.$util = util
Vue.use(plugins)
Vue.use(uma)
App.mpType = 'app'

@ -45,6 +45,7 @@
}
},
/* SDK */
"sdkConfigs" : {},
"quickapp" : {},
/* */
"mp-weixin" : {
@ -57,7 +58,13 @@
"usingComponents" : true,
"optimization" : {
"subPackages" : true
},
"uniStatistics" : {
"enable" : false
}
},
"vueVersion" : "2"
"vueVersion" : "2",
"uniStatistics" : {
"version" : "2"
}
}

5
package-lock.json generated

@ -705,6 +705,11 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="
},
"umtrack-wx": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/umtrack-wx/-/umtrack-wx-2.8.0.tgz",
"integrity": "sha512-F5ul+Q7bDJ6MDrn9ysPAyB9nyP1vCxLGUBkSJ4uvknt8rjmX4tqy1IUnJuWKj9ZH2BtkjRFpldQXJSlLDOYfhQ=="
},
"unique-filename": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz",

@ -10,6 +10,7 @@
"上拉筛选"
],
"dependencies": {
"copy-webpack-plugin": "^5.0.3"
"copy-webpack-plugin": "^5.0.3",
"umtrack-wx": "^2.8.0"
}
}

@ -277,9 +277,6 @@
transform: rotate(20deg);
}
.logo {
// position: absolute;
// top: 10rpx;
// left: 0;
width: 70rpx;
margin-right: 14rpx;
}

@ -17,19 +17,19 @@
</view>
<ul class="entry">
<li v-if="auth('工作台:客户')" @click="$util.to('/order/clients/clients')">
<li v-if="auth('工作台:客户')" @click="toModule('client')">
<image class="icon" src="@/static/image/workbench/index3.png" mode="widthFix"></image>
<view class="text">客户</view>
</li>
<li v-if="auth('工作台:方案')" @click="$util.to('/team/plans/plans')">
<li v-if="auth('工作台:方案')" @click="toModule('plan')">
<image class="icon" src="@/static/image/workbench/index4.png" mode="widthFix"></image>
<view class="text">方案</view>
</li>
<li v-if="auth('工作台:学习')" @click="$util.to('/team/study/study')">
<li v-if="auth('工作台:学习')" @click="toModule('study')">
<image class="icon" src="@/static/image/workbench/index5.png" mode="widthFix"></image>
<view class="text">学习</view>
</li>
<li v-if="auth('工作台:资讯')" @click="$util.to('/team/info/info')">
<li v-if="auth('工作台:资讯')" @click="toModule('info')">
<image class="icon" src="@/static/image/workbench/index6.png" mode="widthFix"></image>
<view class="text">资讯</view>
</li>
@ -283,6 +283,19 @@
uni.setStorageSync('teamId', teamId)
this.getAuth()
},
//
toModule(i) {
this.$uma.trackEvent(i) //
let path = '/order/clients/clients'
if (i === 'plan') {
path = '/team/plans/plans'
} else if (i === 'study') {
path = '/team/study/study'
} else if (i === 'info') {
path = '/team/info/info'
}
this.$util.to(path, { type: i })
},
//
toPanel(i) {
this.$util.errMsg('功能暂未开放!')

Loading…
Cancel
Save