From d23d45f8a6b93ce8cd755a1ac260883f0dc6c586 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Fri, 4 Aug 2023 18:22:23 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=8B=E7=9B=9F=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/request.js | 4 ++--
directives/auth.js | 16 ----------------
directives/index.js | 12 ------------
libs/uma.js | 20 ++++++++++++++++++++
main.js | 4 ++--
manifest.json | 9 ++++++++-
package-lock.json | 5 +++++
package.json | 3 ++-
pages/index/index.vue | 3 ---
pages/workbench/workbench.vue | 21 +++++++++++++++++----
10 files changed, 56 insertions(+), 41 deletions(-)
delete mode 100644 directives/auth.js
delete mode 100644 directives/index.js
create mode 100644 libs/uma.js
diff --git a/config/request.js b/config/request.js
index d6c6600..6f3a944 100644
--- a/config/request.js
+++ b/config/request.js
@@ -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'
},
diff --git a/directives/auth.js b/directives/auth.js
deleted file mode 100644
index be3a722..0000000
--- a/directives/auth.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * @description 鉴权指令
- * 当传入的权限当前用户没有时,会移除该组件
- * 用例:text 或者:text
- * */
-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)
- }
- },
-};
diff --git a/directives/index.js b/directives/index.js
deleted file mode 100644
index 63e26af..0000000
--- a/directives/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * 插件
- * */
-
-import auth from './auth'
-
-export default {
- async install(Vue, options) {
- // 指令
- Vue.directive('auth', auth)
- }
-};
\ No newline at end of file
diff --git a/libs/uma.js b/libs/uma.js
new file mode 100644
index 0000000..2976ca7
--- /dev/null
+++ b/libs/uma.js
@@ -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
diff --git a/main.js b/main.js
index a0768de..803a916 100644
--- a/main.js
+++ b/main.js
@@ -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'
diff --git a/manifest.json b/manifest.json
index 959a70e..8ac00d2 100644
--- a/manifest.json
+++ b/manifest.json
@@ -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"
+ }
}
diff --git a/package-lock.json b/package-lock.json
index c999a27..eb2ff65 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -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",
diff --git a/package.json b/package.json
index bdcfc34..569edcd 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"上拉筛选"
],
"dependencies": {
- "copy-webpack-plugin": "^5.0.3"
+ "copy-webpack-plugin": "^5.0.3",
+ "umtrack-wx": "^2.8.0"
}
}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index b3be538..6962b00 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -277,9 +277,6 @@
transform: rotate(20deg);
}
.logo {
- // position: absolute;
- // top: 10rpx;
- // left: 0;
width: 70rpx;
margin-right: 14rpx;
}
diff --git a/pages/workbench/workbench.vue b/pages/workbench/workbench.vue
index a8312e2..4447db3 100644
--- a/pages/workbench/workbench.vue
+++ b/pages/workbench/workbench.vue
@@ -17,19 +17,19 @@
- -
+
-
客户
- -
+
-
方案
- -
+
-
学习
- -
+
-
资讯
@@ -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('功能暂未开放!')