Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
c0443700
Commit
c0443700
authored
Mar 05, 2020
by
konghaorui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充外部传入ffrom字段入口
parent
059db176
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
71 additions
and
130 deletions
+71
-130
DemoAppLifecycles.kt
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.kt
+0
-7
config.gradle
config.gradle
+1
-1
NimApplication.java
m-im/src/main/java/com/yidianling/im/config/NimApplication.java
+6
-3
NimSDKOptionConfig.java
m-im/src/main/java/com/yidianling/im/config/NimSDKOptionConfig.java
+26
-24
GlobalConfig.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/GlobalConfig.kt
+15
-1
YDLConstants.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/YDLConstants.kt
+2
-2
PlatformRamImpl.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/data/PlatformRamImpl.kt
+5
-22
ModularUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/ModularUtils.kt
+0
-29
ActionCountUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
+16
-14
BIConstants.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/BIConstants.kt
+0
-25
NewH5Activity.java
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
+0
-2
No files found.
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.kt
View file @
c0443700
...
@@ -32,7 +32,6 @@ import com.ydl.ydlcommon.utils.YdlBuryPointUtil
...
@@ -32,7 +32,6 @@ import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.config.NimApplication
import
com.yidianling.im.config.NimApplication
import
com.yidianling.tests.home.plugin.TestPlugin
import
io.flutter.view.FlutterMain
import
io.flutter.view.FlutterMain
import
io.reactivex.functions.Action
import
io.reactivex.functions.Action
...
@@ -55,12 +54,6 @@ class DemoAppLifecycles : IAppLifecycles {
...
@@ -55,12 +54,6 @@ class DemoAppLifecycles : IAppLifecycles {
initThirdServiceSDK
(
application
)
initThirdServiceSDK
(
application
)
//Flutter 初始化需要在主线程中执行
//Flutter 初始化需要在主线程中执行
FlutterMain
.
startInitialization
(
application
)
FlutterMain
.
startInitialization
(
application
)
TestPlugin
.
testDelegate
=
object
:
TestPlugin
.
TestPluginDelegate
{
override
fun
getHideBack
():
Boolean
{
return
true
}
}
YDLCommonPlugin
.
pluginDelegate
=
object
:
YDLCommonPlugin
.
CommonPluginDelegate
{
YDLCommonPlugin
.
pluginDelegate
=
object
:
YDLCommonPlugin
.
CommonPluginDelegate
{
override
fun
getAppTheme
():
HashMap
<
String
,
String
>
{
override
fun
getAppTheme
():
HashMap
<
String
,
String
>
{
val
map
=
HashMap
<
String
,
String
>()
val
map
=
HashMap
<
String
,
String
>()
...
...
config.gradle
View file @
c0443700
ext
{
ext
{
kotlin_version
=
"1.3.21"
kotlin_version
=
"1.3.21"
dev_mode
=
fals
e
dev_mode
=
tru
e
ydl_app
=
[
ydl_app
=
[
appName
:
"心理咨询壹点灵"
,
appName
:
"心理咨询壹点灵"
,
...
...
m-im/src/main/java/com/yidianling/im/config/NimApplication.java
View file @
c0443700
...
@@ -4,6 +4,7 @@ import android.app.Application;
...
@@ -4,6 +4,7 @@ import android.app.Application;
import
android.content.Context
;
import
android.content.Context
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.SDKOptions
;
import
com.netease.nimlib.sdk.auth.LoginInfo
;
import
com.netease.nimlib.sdk.auth.LoginInfo
;
import
com.netease.nimlib.sdk.uinfo.model.UserInfo
;
import
com.netease.nimlib.sdk.uinfo.model.UserInfo
;
import
com.netease.nimlib.sdk.util.NIMUtil
;
import
com.netease.nimlib.sdk.util.NIMUtil
;
...
@@ -44,9 +45,13 @@ public class NimApplication {
...
@@ -44,9 +45,13 @@ public class NimApplication {
}
}
public
void
initIm
(
Application
app
,
Class
activity
)
{
public
void
initIm
(
Application
app
,
Class
activity
)
{
initIm
(
app
,
activity
,
new
SDKOptions
());
}
public
void
initIm
(
Application
app
,
Class
activity
,
SDKOptions
sdkOptions
)
{
IMCache
.
setContext
(
app
);
IMCache
.
setContext
(
app
);
// 初始化云信SDK
// 初始化云信SDK
NIMClient
.
init
(
app
,
loginInfo
(),
NimSDKOptionConfig
.
getSDKOptions
(
app
,
activity
));
NIMClient
.
init
(
app
,
loginInfo
(),
NimSDKOptionConfig
.
prepareSDKOptions
(
app
,
activity
,
sdkOptions
));
// 以下逻辑只在主进程初始化时执行
// 以下逻辑只在主进程初始化时执行
if
(
NIMUtil
.
isMainProcess
(
app
))
{
if
(
NIMUtil
.
isMainProcess
(
app
))
{
...
@@ -65,8 +70,6 @@ public class NimApplication {
...
@@ -65,8 +70,6 @@ public class NimApplication {
}
}
}
}
// 如果已经存在用户登录信息,返回LoginInfo,否则返回null即可
// 如果已经存在用户登录信息,返回LoginInfo,否则返回null即可
private
LoginInfo
loginInfo
(){
private
LoginInfo
loginInfo
(){
UserResponseBean
loginBean
=
ImIn
.
INSTANCE
.
getUserResponse
();
UserResponseBean
loginBean
=
ImIn
.
INSTANCE
.
getUserResponse
();
...
...
m-im/src/main/java/com/yidianling/im/config/NimSDKOptionConfig.java
View file @
c0443700
...
@@ -13,7 +13,6 @@ import com.netease.nimlib.sdk.msg.model.IMMessage;
...
@@ -13,7 +13,6 @@ import com.netease.nimlib.sdk.msg.model.IMMessage;
import
com.ydl.ydlcommon.base.BaseApp
;
import
com.ydl.ydlcommon.base.BaseApp
;
import
com.ydl.ydlcommon.base.config.YDLConstants
;
import
com.ydl.ydlcommon.base.config.YDLConstants
;
import
com.ydl.ydlcommon.utils.YDLCacheUtils
;
import
com.ydl.ydlcommon.utils.YDLCacheUtils
;
import
com.yidianling.im.BuildConfig
;
import
com.yidianling.im.R
;
import
com.yidianling.im.R
;
import
com.yidianling.im.config.constants.UserPreferences
;
import
com.yidianling.im.config.constants.UserPreferences
;
import
com.yidianling.im.config.provider.CustomUserInfoProvider
;
import
com.yidianling.im.config.provider.CustomUserInfoProvider
;
...
@@ -31,37 +30,38 @@ import java.io.IOException;
...
@@ -31,37 +30,38 @@ import java.io.IOException;
class
NimSDKOptionConfig
{
class
NimSDKOptionConfig
{
static
SDKOptions
getSDKOptions
(
Context
context
,
Class
activity
)
{
static
SDKOptions
prepareSDKOptions
(
Context
context
,
Class
activity
,
SDKOptions
options
)
{
SDKOptions
options
=
new
SDKOptions
();
//线上环境关闭
//线上环境关闭
if
(
BaseApp
.
Companion
.
getInstance
().
getGlobalConfig
().
getAppDebug
())
{
if
(
BaseApp
.
Companion
.
getInstance
().
getGlobalConfig
().
getAppDebug
())
{
//配置检查
//配置检查
options
.
checkManifestConfig
=
true
;
options
.
checkManifestConfig
=
true
;
}
}
//key配置---逻辑更改:修复切换环境功能
if
(
TextUtils
.
isEmpty
(
options
.
appKey
))
{
if
(
BaseApp
.
Companion
.
getInstance
().
getGlobalConfig
().
getAppDebug
())
{
//key配置---逻辑更改:修复切换环境功能
String
appEnv
=
BaseApp
.
Companion
.
getInstance
().
getGlobalConfig
().
getAppEnv
();
if
(
BaseApp
.
Companion
.
getInstance
().
getGlobalConfig
().
getAppDebug
())
{
String
appEnv
=
BaseApp
.
Companion
.
getInstance
().
getGlobalConfig
().
getAppEnv
();
//debug包根据url判断使用正式或者测试key
String
cacheAppEnv
=
YDLCacheUtils
.
Companion
.
getCacheApi
();
//debug包根据url判断使用正式或者测试key
//这边不能加BuildConfig.DEBUG,因为发布了aar之后,必定为release,导致切换云信的环境失败
String
cacheAppEnv
=
YDLCacheUtils
.
Companion
.
getCacheApi
();
if
(!
TextUtils
.
isEmpty
(
cacheAppEnv
))
{
//这边不能加BuildConfig.DEBUG,因为发布了aar之后,必定为release,导致切换云信的环境失败
if
(
YDLConstants
.
ENV_TEST
.
equals
(
cacheAppEnv
))
{
if
(!
TextUtils
.
isEmpty
(
cacheAppEnv
))
{
options
.
appKey
=
"9a8cefe97b7690537fc1334091af9208"
;
if
(
YDLConstants
.
ENV_TEST
.
equals
(
cacheAppEnv
))
{
options
.
appKey
=
"9a8cefe97b7690537fc1334091af9208"
;
}
else
{
options
.
appKey
=
"4e258ba5cdf489fa188274ebf0fb5669"
;
}
}
else
{
}
else
{
options
.
appKey
=
"4e258ba5cdf489fa188274ebf0fb5669"
;
if
(
YDLConstants
.
ENV_TEST
.
equals
(
appEnv
)||
YDLConstants
.
ENV_AUTO_TEST
.
equals
(
appEnv
))
{
options
.
appKey
=
"9a8cefe97b7690537fc1334091af9208"
;
}
else
{
options
.
appKey
=
"4e258ba5cdf489fa188274ebf0fb5669"
;
}
}
}
}
else
{
}
else
{
if
(
YDLConstants
.
ENV_TEST
.
equals
(
appEnv
)||
YDLConstants
.
ENV_AUTO_TEST
.
equals
(
appEnv
))
{
//release包始终使用正式key
options
.
appKey
=
"9a8cefe97b7690537fc1334091af9208"
;
options
.
appKey
=
"4e258ba5cdf489fa188274ebf0fb5669"
;
}
else
{
options
.
appKey
=
"4e258ba5cdf489fa188274ebf0fb5669"
;
}
}
}
}
else
{
//release包始终使用正式key
options
.
appKey
=
"4e258ba5cdf489fa188274ebf0fb5669"
;
}
}
// 如果将新消息通知提醒托管给SDK完成,需要添加以下配置。
// 如果将新消息通知提醒托管给SDK完成,需要添加以下配置。
...
@@ -103,7 +103,9 @@ class NimSDKOptionConfig {
...
@@ -103,7 +103,9 @@ class NimSDKOptionConfig {
// 打开消息撤回未读数-1的开关
// 打开消息撤回未读数-1的开关
options
.
shouldConsiderRevokedMessageUnreadCount
=
true
;
options
.
shouldConsiderRevokedMessageUnreadCount
=
true
;
options
.
mixPushConfig
=
buildMixPushConfig
();
if
(
options
.
mixPushConfig
==
null
)
{
options
.
mixPushConfig
=
buildMixPushConfig
();
}
return
options
;
return
options
;
}
}
...
@@ -216,7 +218,7 @@ class NimSDKOptionConfig {
...
@@ -216,7 +218,7 @@ class NimSDKOptionConfig {
config
.
oppoCertificateName
=
"ydlUserOPPO"
;
config
.
oppoCertificateName
=
"ydlUserOPPO"
;
//VIVO 推送
//VIVO 推送
config
.
vivoCertificateName
=
"ydlUserVIVO"
;
config
.
vivoCertificateName
=
"ydlUserVIVO"
;
}
else
if
(
YDLConstants
.
FROM_XLZX
.
equals
(
appFrom
))
{
}
else
if
(
YDLConstants
.
FROM_XLZX
.
equals
(
appFrom
))
{
// 小米推送
// 小米推送
config
.
xmAppId
=
"2882303761517549919"
;
config
.
xmAppId
=
"2882303761517549919"
;
config
.
xmAppKey
=
"5111754949919"
;
config
.
xmAppKey
=
"5111754949919"
;
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/GlobalConfig.kt
View file @
c0443700
...
@@ -14,11 +14,15 @@ class GlobalConfig private constructor(var builder: Builder) {
...
@@ -14,11 +14,15 @@ class GlobalConfig private constructor(var builder: Builder) {
var
appFrom
:
String
=
YDLConstants
.
FROM_YDL
var
appFrom
:
String
=
YDLConstants
.
FROM_YDL
var
appEnv
:
String
=
YDLConstants
.
ENV_PROD
var
appEnv
:
String
=
YDLConstants
.
ENV_PROD
var
appDebug
:
Boolean
=
false
var
appDebug
:
Boolean
=
false
var
appName
:
String
=
""
var
appID
:
String
=
""
init
{
init
{
this
.
appFrom
=
builder
.
appFrom
this
.
appFrom
=
builder
.
appFrom
this
.
appEnv
=
builder
.
appEnv
this
.
appEnv
=
builder
.
appEnv
this
.
appDebug
=
builder
.
appDebug
this
.
appDebug
=
builder
.
appDebug
this
.
appName
=
builder
.
appName
this
.
appID
=
builder
.
appID
}
}
fun
initEnv
()
{
fun
initEnv
()
{
...
@@ -33,6 +37,8 @@ class GlobalConfig private constructor(var builder: Builder) {
...
@@ -33,6 +37,8 @@ class GlobalConfig private constructor(var builder: Builder) {
var
appBaseURL
:
String
?
=
null
var
appBaseURL
:
String
?
=
null
var
multipleUrl
:
HashMap
<
String
,
String
>
=
hashMapOf
()
var
multipleUrl
:
HashMap
<
String
,
String
>
=
hashMapOf
()
var
appDebug
:
Boolean
=
false
var
appDebug
:
Boolean
=
false
var
appID
:
String
=
""
var
appName
:
String
=
""
fun
setOkHttpClient
(
okHttpClient
:
OkHttpClient
)
{
fun
setOkHttpClient
(
okHttpClient
:
OkHttpClient
)
{
this
.
okHttpClient
=
okHttpClient
this
.
okHttpClient
=
okHttpClient
...
@@ -42,6 +48,14 @@ class GlobalConfig private constructor(var builder: Builder) {
...
@@ -42,6 +48,14 @@ class GlobalConfig private constructor(var builder: Builder) {
this
.
appBaseURL
=
baseURL
this
.
appBaseURL
=
baseURL
}
}
fun
setName
(
appName
:
String
)
{
this
.
appName
=
appName
}
fun
setId
(
appID
:
String
)
{
this
.
appID
=
appID
}
fun
setDebug
(
isDebug
:
Boolean
)
{
fun
setDebug
(
isDebug
:
Boolean
)
{
this
.
appDebug
=
isDebug
this
.
appDebug
=
isDebug
}
}
...
@@ -61,7 +75,7 @@ class GlobalConfig private constructor(var builder: Builder) {
...
@@ -61,7 +75,7 @@ class GlobalConfig private constructor(var builder: Builder) {
return
this
return
this
}
}
fun
setFrom
(
@YDLConstants
.
AppFrom
appFrom
:
String
):
Builder
{
fun
setFrom
(
appFrom
:
String
):
Builder
{
this
.
appFrom
=
appFrom
this
.
appFrom
=
appFrom
return
this
return
this
}
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/YDLConstants.kt
View file @
c0443700
...
@@ -16,8 +16,8 @@ object YDLConstants {
...
@@ -16,8 +16,8 @@ object YDLConstants {
// activity 跳转时传递数据的 bundle 的名称
// activity 跳转时传递数据的 bundle 的名称
const
val
BUNDLE
=
"bundle"
const
val
BUNDLE
=
"bundle"
const
val
FROM_YDL
=
"
yidianling
"
const
val
FROM_YDL
=
"
android
"
const
val
FROM_XLZX
=
"
xinlizixun
"
const
val
FROM_XLZX
=
"
ATK_7_android
"
//自定义注解,限制入参类型
//自定义注解,限制入参类型
@StringDef
(
FROM_YDL
,
FROM_XLZX
)
@StringDef
(
FROM_YDL
,
FROM_XLZX
)
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/data/PlatformRamImpl.kt
View file @
c0443700
...
@@ -2,7 +2,6 @@ package com.ydl.ydlcommon.data
...
@@ -2,7 +2,6 @@ package com.ydl.ydlcommon.data
import
com.meituan.android.walle.WalleChannelReader
import
com.meituan.android.walle.WalleChannelReader
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.config.YDLConstants
import
com.ydl.ydlcommon.bean.GlobalInfo
import
com.ydl.ydlcommon.bean.GlobalInfo
import
com.ydl.ydlcommon.router.YdlCommonOut
import
com.ydl.ydlcommon.router.YdlCommonOut
...
@@ -30,31 +29,15 @@ class PlatformRamImpl private constructor(): IPlatformRam {
...
@@ -30,31 +29,15 @@ class PlatformRamImpl private constructor(): IPlatformRam {
}
}
private
val
ydlChannel
:
String
by
lazy
{
private
val
ydlChannel
:
String
by
lazy
{
val
packageName
=
YdlCommonOut
.
getApp
().
packageName
val
appFrom
=
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
;
var
channel
=
WalleChannelReader
.
getChannel
(
YdlCommonOut
.
getApp
())
var
channel
=
WalleChannelReader
.
getChannel
(
YdlCommonOut
.
getApp
())
if
(
channel
.
isNullOrEmpty
()){
if
(
channel
.
isNullOrEmpty
()){
if
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
==
YDLConstants
.
FROM_YDL
){
channel
=
"${appFrom}_zhuzhan"
channel
=
"android_zhuzhan"
}
else
{
channel
=
"ATK_7_android_zhuzhan"
}
return
@lazy
channel
!!
return
@lazy
channel
!!
}
}
if
(
packageName
.
endsWith
(
"yidianling"
))
{
channel
=
"android_$channel"
channel
=
"$appFrom$channel"
}
else
if
(
packageName
.
endsWith
(
"yidianling_atk_3"
))
{
channel
=
"ATK_3_android_$channel"
}
else
if
(
packageName
.
endsWith
(
"yidianling_atk4"
))
{
channel
=
"ATK_4_android_$channel"
}
else
if
(
packageName
.
endsWith
(
"yidianling_atk5"
)
||
packageName
.
endsWith
(
"yidianling_atk9"
))
{
channel
=
"ATK_5_android_$channel"
}
else
if
(
packageName
.
endsWith
(
"yidianling_atk6"
))
{
channel
=
"ATK_6_android_$channel"
}
else
if
(
packageName
.
endsWith
(
"yidianling_atk7"
))
{
channel
=
"ATK_7_android_$channel"
}
else
if
(
packageName
.
endsWith
(
"xinlizixun"
))
{
channel
=
"ATK_7_android_$channel"
}
channel
?:
"android"
channel
?:
"android"
}
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/ModularUtils.kt
deleted
100644 → 0
View file @
059db176
package
com.ydl.ydlcommon.utils
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.config.YDLConstants
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/01/29
*
* 提示信息的封装类,使用单例 toast,防止重复弹出提示
*/
class
ModularUtils
private
constructor
()
{
companion
object
{
private
fun
getInstance
():
ModularUtils
{
return
Holder
.
INSTANCE
}
fun
isYDL
():
Boolean
{
return
YDLConstants
.
FROM_YDL
.
equals
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
)
}
}
private
object
Holder
{
val
INSTANCE
=
ModularUtils
()
}
}
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
View file @
c0443700
...
@@ -9,7 +9,6 @@ import android.util.Log
...
@@ -9,7 +9,6 @@ import android.util.Log
import
com.google.gson.Gson
import
com.google.gson.Gson
import
com.ydl.devicesidlib.DeviceIDHelper
import
com.ydl.devicesidlib.DeviceIDHelper
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.config.YDLConstants
import
com.ydl.ydlcommon.data.http.api.ApiRequestUtil
import
com.ydl.ydlcommon.data.http.api.ApiRequestUtil
import
com.ydl.ydlcommon.data.http.params.ActionDataBean
import
com.ydl.ydlcommon.data.http.params.ActionDataBean
import
com.ydl.ydlcommon.data.http.params.BaiduActionDataBean
import
com.ydl.ydlcommon.data.http.params.BaiduActionDataBean
...
@@ -35,9 +34,19 @@ import java.util.*
...
@@ -35,9 +34,19 @@ import java.util.*
class
ActionCountUtils
{
class
ActionCountUtils
{
companion
object
{
companion
object
{
const
val
TAG
:
String
=
"ActionCountUtils"
const
val
TAG
:
String
=
"ActionCountUtils"
var
appId
:
String
=
""
var
appName
:
String
=
""
var
packageName
:
String
=
""
/**
* appId:消息端来源 - ydl:ydl-app-android-user、xlzx:ydl-app-android-xlzx
* appName:应用名称 - "心理咨询" else "壹点灵心理咨询"
*/
fun
init
(
id
:
String
,
name
:
String
){
packageName
=
BaseApp
.
instance
.
packageName
appId
=
id
appName
=
name
}
/**
/**
* BI埋点封装方法
* BI埋点封装方法
* 传入埋点事件名称 格式:xxx|xxx
* 传入埋点事件名称 格式:xxx|xxx
...
@@ -111,7 +120,7 @@ class ActionCountUtils {
...
@@ -111,7 +120,7 @@ class ActionCountUtils {
}
}
actionDataParams
.
time
(
System
.
currentTimeMillis
())
actionDataParams
.
time
(
System
.
currentTimeMillis
())
actionDataParams
.
appVersion
(
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()))
actionDataParams
.
appVersion
(
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()))
actionDataParams
.
appId
(
BIConstants
.
APP_ID
)
actionDataParams
.
appId
(
appId
)
actionDataParams
.
api
(
api
)
actionDataParams
.
api
(
api
)
actionDataParams
.
manufacturer
(
android
.
os
.
Build
.
BRAND
.
trim
().
toUpperCase
())
actionDataParams
.
manufacturer
(
android
.
os
.
Build
.
BRAND
.
trim
().
toUpperCase
())
actionDataParams
.
model
(
android
.
os
.
Build
.
MODEL
)
actionDataParams
.
model
(
android
.
os
.
Build
.
MODEL
)
...
@@ -161,10 +170,6 @@ class ActionCountUtils {
...
@@ -161,10 +170,6 @@ class ActionCountUtils {
* 百度检测数据埋点调用的方法
* 百度检测数据埋点调用的方法
*/
*/
fun
baiduCount
(
partId
:
String
,
position
:
String
,
convertType
:
Int
)
{
fun
baiduCount
(
partId
:
String
,
position
:
String
,
convertType
:
Int
)
{
val
appFrom
=
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
if
(
YDLConstants
.
FROM_YDL
!=
appFrom
)
{
return
}
val
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
val
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
baiduCount
(
userId
,
partId
,
position
,
""
,
""
,
convertType
)
baiduCount
(
userId
,
partId
,
position
,
""
,
""
,
convertType
)
}
}
...
@@ -177,9 +182,6 @@ class ActionCountUtils {
...
@@ -177,9 +182,6 @@ class ActionCountUtils {
api
:
String
,
api
:
String
,
convertType
:
Int
convertType
:
Int
)
{
)
{
var
appId
=
"ydl-app-android-"
+
(
if
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
==
YDLConstants
.
FROM_XLZX
)
"xlzx"
else
"user"
)
try
{
try
{
val
actionDataParams
=
ActionDataBean
.
Builder
()
val
actionDataParams
=
ActionDataBean
.
Builder
()
actionDataParams
.
partId
(
partId
)
actionDataParams
.
partId
(
partId
)
...
@@ -188,7 +190,7 @@ class ActionCountUtils {
...
@@ -188,7 +190,7 @@ class ActionCountUtils {
actionDataParams
.
time
(
System
.
currentTimeMillis
())
actionDataParams
.
time
(
System
.
currentTimeMillis
())
actionDataParams
.
appVersion
(
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()))
actionDataParams
.
appVersion
(
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()))
actionDataParams
.
appId
(
BIConstants
.
APP_ID
)
actionDataParams
.
appId
(
appId
)
actionDataParams
.
api
(
api
)
actionDataParams
.
api
(
api
)
actionDataParams
.
manufacturer
(
android
.
os
.
Build
.
BRAND
.
trim
().
toUpperCase
())
actionDataParams
.
manufacturer
(
android
.
os
.
Build
.
BRAND
.
trim
().
toUpperCase
())
actionDataParams
.
model
(
android
.
os
.
Build
.
MODEL
)
actionDataParams
.
model
(
android
.
os
.
Build
.
MODEL
)
...
@@ -199,13 +201,13 @@ class ActionCountUtils {
...
@@ -199,13 +201,13 @@ class ActionCountUtils {
actionDataParams
.
screenHeight
(
RxDeviceTool
.
getScreenHeight
(
RxTool
.
getContext
()
!!
))
actionDataParams
.
screenHeight
(
RxDeviceTool
.
getScreenHeight
(
RxTool
.
getContext
()
!!
))
val
baiduActionDataParams
=
BaiduActionDataBean
.
Builder
()
val
baiduActionDataParams
=
BaiduActionDataBean
.
Builder
()
baiduActionDataParams
.
pkname
=
BIConstants
.
PACKAGE_NAME
baiduActionDataParams
.
pkname
=
packageName
baiduActionDataParams
.
deviceType
=
2
baiduActionDataParams
.
deviceType
=
2
baiduActionDataParams
.
deviceId
(
DeviceIDHelper
.
getInstance
().
deviceId
)
baiduActionDataParams
.
deviceId
(
DeviceIDHelper
.
getInstance
().
deviceId
)
baiduActionDataParams
.
convertType
(
convertType
)
baiduActionDataParams
.
convertType
(
convertType
)
baiduActionDataParams
.
convertTime
(
System
.
currentTimeMillis
()
/
1000
)
baiduActionDataParams
.
convertTime
(
System
.
currentTimeMillis
()
/
1000
)
baiduActionDataParams
.
appid
(
0
.
toLong
())
baiduActionDataParams
.
appid
(
0
.
toLong
())
baiduActionDataParams
.
appName
(
BIConstants
.
APP_NAME
)
baiduActionDataParams
.
appName
(
appName
)
baiduActionDataParams
.
androidId
(
DeviceTool
.
getAndroidID
())
baiduActionDataParams
.
androidId
(
DeviceTool
.
getAndroidID
())
baiduActionDataParams
.
ip
(
""
)
baiduActionDataParams
.
ip
(
""
)
baiduActionDataParams
.
ipv6
(
""
)
baiduActionDataParams
.
ipv6
(
""
)
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/BIConstants.kt
View file @
c0443700
package
com.ydl.ydlcommon.utils.actionutil
package
com.ydl.ydlcommon.utils.actionutil
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.config.YDLConstants
/**
/**
* Created by xj on 2019/7/1.
* Created by xj on 2019/7/1.
*/
*/
class
BIConstants
{
class
BIConstants
{
companion
object
{
companion
object
{
/**
* 消息端来源
* ydl:ydl-app-android-user
* xlzx:ydl-app-android-xlzx
*/
var
APP_ID
:
String
=
""
get
()
{
return
"ydl-app-android-"
+
(
if
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
==
YDLConstants
.
FROM_XLZX
)
"xlzx"
else
"user"
)
}
var
APP_NAME
:
String
=
""
get
()
{
return
if
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
==
YDLConstants
.
FROM_XLZX
)
"心理咨询"
else
"壹点灵心理咨询"
}
var
PACKAGE_NAME
:
String
=
""
get
()
{
return
if
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
==
YDLConstants
.
FROM_XLZX
)
"com.cxzapp.xinlizixun"
else
"com.cxzapp.yidianling"
}
/**
/**
* 操作系统
* 操作系统
*/
*/
...
...
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
View file @
c0443700
...
@@ -125,7 +125,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
...
@@ -125,7 +125,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
protected
final
static
int
FILE_CHOOSER_RESULT_CODE
=
10000
;
protected
final
static
int
FILE_CHOOSER_RESULT_CODE
=
10000
;
protected
IJavascriptHandler
jtoJHandle
;
protected
IJavascriptHandler
jtoJHandle
;
protected
String
appFrom
;
private
boolean
loadFailed
;
private
boolean
loadFailed
;
private
LinearLayout
llWebView
;
private
LinearLayout
llWebView
;
...
@@ -375,7 +374,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
...
@@ -375,7 +374,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
setUrlHeightParams
();
setUrlHeightParams
();
EventBus
.
getDefault
().
register
(
this
);
EventBus
.
getDefault
().
register
(
this
);
jtoJHandle
=
WebModularServiceUtils
.
Companion
.
getWebService
().
getJavascripHandler
(
this
,
tellData
=
tellData
);
jtoJHandle
=
WebModularServiceUtils
.
Companion
.
getWebService
().
getJavascripHandler
(
this
,
tellData
=
tellData
);
appFrom
=
BaseApp
.
instance
.
getGlobalConfig
().
getAppFrom
();
init
();
init
();
if
(
startType
==
1
)
{
if
(
startType
==
1
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment