Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_xunmi
Project
Project
Details
Activity
Releases
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
android
android_xunmi
Commits
1cb53fb1
Commit
1cb53fb1
authored
Oct 15, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加umeng电商
parent
7f7073f4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
91 additions
and
0 deletions
+91
-0
UmengManager.kt
...app/src/main/java/com/mints/xunmi/manager/UmengManager.kt
+61
-0
MainFragmentPresenter.kt
...a/com/mints/xunmi/mvp/presenters/MainFragmentPresenter.kt
+3
-0
MyPresenter.kt
...c/main/java/com/mints/xunmi/mvp/presenters/MyPresenter.kt
+3
-0
PositionPresenter.kt
.../java/com/mints/xunmi/mvp/presenters/PositionPresenter.kt
+3
-0
Vip2Activity.kt
...rc/main/java/com/mints/xunmi/ui/activitys/Vip2Activity.kt
+7
-0
Vip3Activity.kt
...rc/main/java/com/mints/xunmi/ui/activitys/Vip3Activity.kt
+7
-0
VipActivity.kt
...src/main/java/com/mints/xunmi/ui/activitys/VipActivity.kt
+7
-0
No files found.
position/app/src/main/java/com/mints/xunmi/manager/UmengManager.kt
0 → 100644
View file @
1cb53fb1
package
com.mints.xunmi.manager
import
com.mints.xunmi.MintsApplication
import
com.umeng.analytics.MobclickAgent
import
java.lang.Exception
import
java.util.HashMap
/**
* 电商场景
*/
object
UmengManager
{
/**
* 指注册设备数,在App内用户注册成功的设备数,
* 请在注册成功后执行此事件,系统会追踪点击后续15日(含当日)的激活并注册行为,
* 一个用户在App内多次注册,注册设备数只算1次
*/
fun
register
(
userid
:
String
)
{
try
{
val
vo
=
HashMap
<
String
,
String
>()
vo
[
"userid"
]
=
userid
MobclickAgent
.
onEvent
(
MintsApplication
.
getContext
(),
"__register"
,
vo
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
/**
* 在App内通过用账号“登录”成功的设备数,
* 在登录成功后执行此事件,系统将记录此事件。追踪点击后续15日(含当日)的激活并登录的行为,
* 一个用户在App内多次登录,登录设备数只算1次。
*/
fun
login
(
userid
:
String
)
{
try
{
val
vo
=
HashMap
<
String
,
String
>()
vo
[
"userid"
]
=
userid
MobclickAgent
.
onEvent
(
MintsApplication
.
getContext
(),
"__login"
,
vo
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
/**
* 在有付费场景中,在支付成功后后执行此事件,
* 系统将记录此事件。追踪点击后续15日(含当日)的激活并成功支付的行为,
* 一个用户在App内多次付费,“付费设备数”只算1次;
* “付费金额”每次支持的金额累加; “付费次数“每次支持累加
*/
fun
pay
(
userid
:
String
,
orderid
:
String
,
amount
:
String
)
{
try
{
val
vo
=
HashMap
<
String
,
String
>()
vo
[
"userid"
]
=
userid
vo
[
"orderid"
]
=
orderid
vo
[
"item"
]
=
"buyVip"
vo
[
"amount"
]
=
amount
MobclickAgent
.
onEvent
(
MintsApplication
.
getContext
(),
"__finish_payment"
,
vo
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
}
\ No newline at end of file
position/app/src/main/java/com/mints/xunmi/mvp/presenters/MainFragmentPresenter.kt
View file @
1cb53fb1
...
...
@@ -12,6 +12,7 @@ import com.mints.xunmi.common.Constant
import
com.mints.xunmi.common.DeviceInfo
import
com.mints.xunmi.manager.AppHttpManager
import
com.mints.xunmi.manager.JpushManager
import
com.mints.xunmi.manager.UmengManager
import
com.mints.xunmi.manager.UserManager
import
com.mints.xunmi.mvp.model.BaseResponse
import
com.mints.xunmi.mvp.model.LocationBean
...
...
@@ -231,6 +232,8 @@ class MainFragmentPresenter : BasePresenter<MainFragmentView>() {
UserManager
.
getInstance
().
saveUserInfo
(
data
)
val
consumer
=
data
.
getConsumer
()
if
(
consumer
!=
null
)
{
UmengManager
.
register
(
data
.
consumer
.
pk_id
.
toString
())
UmengManager
.
login
(
data
.
consumer
.
pk_id
.
toString
())
saveTerminalInfo
(
context
)
}
checkProductType
()
...
...
position/app/src/main/java/com/mints/xunmi/mvp/presenters/MyPresenter.kt
View file @
1cb53fb1
...
...
@@ -10,6 +10,7 @@ import com.mints.library.utils.json.JsonUtil
import
com.mints.xunmi.common.AppConfig
import
com.mints.xunmi.common.DeviceInfo
import
com.mints.xunmi.manager.AppHttpManager
import
com.mints.xunmi.manager.UmengManager
import
com.mints.xunmi.manager.UserManager
import
com.mints.xunmi.mvp.model.BaseResponse
import
com.mints.xunmi.mvp.model.LocationBean
...
...
@@ -102,6 +103,8 @@ class MyPresenter : BasePresenter<MyView>() {
UserManager
.
getInstance
().
saveUserInfo
(
data
)
val
consumer
=
data
.
getConsumer
()
if
(
consumer
!=
null
)
{
UmengManager
.
register
(
data
.
consumer
.
pk_id
.
toString
())
UmengManager
.
login
(
data
.
consumer
.
pk_id
.
toString
())
saveTerminalInfo
(
context
,
consumer
)
}
}
...
...
position/app/src/main/java/com/mints/xunmi/mvp/presenters/PositionPresenter.kt
View file @
1cb53fb1
...
...
@@ -9,6 +9,7 @@ import com.mints.library.utils.json.JsonUtil
import
com.mints.xunmi.common.AppConfig
import
com.mints.xunmi.common.DeviceInfo
import
com.mints.xunmi.manager.AppHttpManager
import
com.mints.xunmi.manager.UmengManager
import
com.mints.xunmi.manager.UserManager
import
com.mints.xunmi.mvp.model.BaseResponse
import
com.mints.xunmi.mvp.model.LocationBean
...
...
@@ -43,6 +44,8 @@ class PositionPresenter : BasePresenter<PositionView>() {
UserManager
.
getInstance
().
saveUserInfo
(
data
)
val
consumer
=
data
.
getConsumer
()
if
(
consumer
!=
null
)
{
UmengManager
.
register
(
data
.
consumer
.
pk_id
.
toString
())
UmengManager
.
login
(
data
.
consumer
.
pk_id
.
toString
())
saveTerminalInfo
(
context
,
consumer
)
}
}
...
...
position/app/src/main/java/com/mints/xunmi/ui/activitys/Vip2Activity.kt
View file @
1cb53fb1
...
...
@@ -11,6 +11,7 @@ import com.mints.xunmi.BuildConfig
import
com.mints.xunmi.R
import
com.mints.xunmi.common.Constant
import
com.mints.xunmi.manager.JpushLoginManager
import
com.mints.xunmi.manager.UmengManager
import
com.mints.xunmi.manager.UserManager
import
com.mints.xunmi.mvp.model.VipBean
import
com.mints.xunmi.mvp.model.WxPayParamBean
...
...
@@ -206,6 +207,9 @@ class Vip2Activity : BaseActivity()
RxPay
(
this
).
requestWXpay
(
str
)
.
subscribe
({
isPay
->
if
(
isPay
)
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
UmengManager
.
pay
(
UserManager
.
getInstance
().
userID
,
wxParanBean
.
tid
.
toString
(),
vipList
!!
[
0
].
price
.
toString
())
}
//支付成功
UserManager
.
getInstance
().
vipFlag
=
true
}
...
...
@@ -220,6 +224,9 @@ class Vip2Activity : BaseActivity()
RxPay
(
this
).
requestAlipay
(
wxParanBean
.
params
.
params
)
.
subscribe
({
isPay
->
if
(
isPay
)
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
UmengManager
.
pay
(
UserManager
.
getInstance
().
userID
,
wxParanBean
.
tid
.
toString
(),
vipList
!!
[
0
].
price
.
toString
())
}
//支付成功
UserManager
.
getInstance
().
vipFlag
=
true
}
...
...
position/app/src/main/java/com/mints/xunmi/ui/activitys/Vip3Activity.kt
View file @
1cb53fb1
...
...
@@ -12,6 +12,7 @@ import com.mints.xunmi.BuildConfig
import
com.mints.xunmi.R
import
com.mints.xunmi.common.Constant
import
com.mints.xunmi.manager.JpushLoginManager
import
com.mints.xunmi.manager.UmengManager
import
com.mints.xunmi.manager.UserManager
import
com.mints.xunmi.manager.VipPayManager
import
com.mints.xunmi.mvp.model.VipBean
...
...
@@ -203,6 +204,9 @@ class Vip3Activity : BaseActivity()
RxPay
(
this
).
requestWXpay
(
str
)
.
subscribe
({
isPay
->
if
(
isPay
)
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
UmengManager
.
pay
(
UserManager
.
getInstance
().
userID
,
wxParanBean
.
tid
.
toString
(),
vipList
!!
[
vipAdapter
?.
getPosition
()].
price
.
toString
())
}
//支付成功
UserManager
.
getInstance
().
vipFlag
=
true
}
...
...
@@ -217,6 +221,9 @@ class Vip3Activity : BaseActivity()
RxPay
(
this
).
requestAlipay
(
wxParanBean
.
params
.
params
)
.
subscribe
({
isPay
->
if
(
isPay
)
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
UmengManager
.
pay
(
UserManager
.
getInstance
().
userID
,
wxParanBean
.
tid
.
toString
(),
vipList
!!
[
vipAdapter
?.
getPosition
()].
price
.
toString
())
}
//支付成功
UserManager
.
getInstance
().
vipFlag
=
true
}
...
...
position/app/src/main/java/com/mints/xunmi/ui/activitys/VipActivity.kt
View file @
1cb53fb1
...
...
@@ -12,6 +12,7 @@ import com.mints.xunmi.BuildConfig
import
com.mints.xunmi.R
import
com.mints.xunmi.common.Constant
import
com.mints.xunmi.manager.JpushLoginManager
import
com.mints.xunmi.manager.UmengManager
import
com.mints.xunmi.manager.UserManager
import
com.mints.xunmi.mvp.model.VipBean
import
com.mints.xunmi.mvp.model.WxPayParamBean
...
...
@@ -181,6 +182,9 @@ class VipActivity : BaseActivity()
RxPay
(
this
).
requestWXpay
(
str
)
.
subscribe
({
isPay
->
if
(
isPay
)
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
UmengManager
.
pay
(
UserManager
.
getInstance
().
userID
,
wxParanBean
.
tid
.
toString
(),
vipList
!!
[
vipAdapter
?.
getPosition
()].
price
.
toString
())
}
//支付成功
UserManager
.
getInstance
().
vipFlag
=
true
}
...
...
@@ -195,6 +199,9 @@ class VipActivity : BaseActivity()
RxPay
(
this
).
requestAlipay
(
wxParanBean
.
params
.
params
)
.
subscribe
({
isPay
->
if
(
isPay
)
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
UmengManager
.
pay
(
UserManager
.
getInstance
().
userID
,
wxParanBean
.
tid
.
toString
(),
vipList
!!
[
vipAdapter
?.
getPosition
()].
price
.
toString
())
}
//支付成功
UserManager
.
getInstance
().
vipFlag
=
true
}
...
...
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