|
@@ -0,0 +1,32 @@
|
|
|
+import request from '../../utils/request.js'
|
|
|
+import { getMobileCache } from '../../utils/user'
|
|
|
+
|
|
|
+class Statistics extends request {
|
|
|
+ static done(params) {
|
|
|
+ const accountInfo = wx.getAccountInfoSync()
|
|
|
+ const pages = getCurrentPages()
|
|
|
+ const path = pages[pages.length - 1].route
|
|
|
+ const options = wx.getLaunchOptionsSync()
|
|
|
+ const referrerInfo = options.referrerInfo || {}
|
|
|
+ const extraData = referrerInfo.extraData || {}
|
|
|
+ const department = extraData.department || '';
|
|
|
+
|
|
|
+ let postParam = {
|
|
|
+ source: 'WX_MINI_APP',
|
|
|
+ channel: params.channel || '',
|
|
|
+ module: params.module,
|
|
|
+ action: params.action,
|
|
|
+ appid: accountInfo.miniProgram.appId,
|
|
|
+ path,
|
|
|
+ scene: options.scene,
|
|
|
+ fromAppid: referrerInfo.appId || '',
|
|
|
+ department,
|
|
|
+ mobile: getMobileCache(),
|
|
|
+ businessId: params.businessId || '',
|
|
|
+ }
|
|
|
+
|
|
|
+ this.postRequest(`${this.BASE_URL}open/statistics/record-app-visit-log`, postParam, true).then(_=>{}).catch(_=>{})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export default Statistics
|