Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
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
bp
ShenghuoquanBusiness
Commits
679e944c
Commit
679e944c
authored
Sep 16, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改确认订单埋点
parent
a0a3103e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
30 deletions
+17
-30
ConfirmOrderViewModel.kt
...henghuoquan/buserorder/viewmodel/ConfirmOrderViewModel.kt
+17
-30
No files found.
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/viewmodel/ConfirmOrderViewModel.kt
View file @
679e944c
...
...
@@ -87,7 +87,9 @@ class ConfirmOrderViewModel : BaseViewModel() {
couponsAvailableList
.
value
=
it
.
couponList
calculateCouponsAvailableNum
(
it
.
couponList
)
// 上传页面埋点信息
commitPageBuriedPoint
()
for
(
i
in
1
..
3
)
{
commitPageBuriedPoint
(
i
)
}
}
}
...
...
@@ -267,37 +269,27 @@ class ConfirmOrderViewModel : BaseViewModel() {
* 页面浏览的埋点
* 页面可见且有业务数据时上传
*/
private
fun
commitPageBuriedPoint
()
{
// 遍历商品列表
val
skuIdText
=
StringBuilder
()
val
skuNameText
=
StringBuilder
()
val
value
=
_goodsSuccessEvent
.
value
value
?.
forEachIndexed
{
index
,
s
->
skuIdText
.
append
(
s
.
goodsSkuId
)
skuNameText
.
append
(
s
.
goodsName
)
if
(
index
<
value
.
size
-
1
)
{
skuIdText
.
append
(
","
)
skuNameText
.
append
(
","
)
}
}
private
fun
commitPageBuriedPoint
(
weightKey
:
Int
)
{
// 埋点数据包装
val
jsonObject
=
JSONObject
()
jsonObject
.
put
(
"eventName"
,
"
EXPOSE_PAGE
"
)
jsonObject
.
put
(
"eventName"
,
"
VIEW_WIDGET
"
)
val
contextJsonObject
=
JSONObject
()
contextJsonObject
.
put
(
"page"
,
"ORDER_CONFIRMATION_PAGE"
)
val
smallOrderInfoJsonObject
=
JSONObject
()
smallOrderInfoJsonObject
.
put
(
"marketing_id"
,
marketingInfo
?.
marketingId
)
smallOrderInfoJsonObject
.
put
(
"marketing_name"
,
marketingInfo
?.
marketingName
)
smallOrderInfoJsonObject
.
put
(
"marketing_type"
,
"SPELL_MEAL"
)
smallOrderInfoJsonObject
.
put
(
"goods_sku_id"
,
skuIdText
.
toString
())
smallOrderInfoJsonObject
.
put
(
"goods_sku_name"
,
skuNameText
.
toString
())
contextJsonObject
.
put
(
"small_order_info"
,
smallOrderInfoJsonObject
)
jsonObject
.
put
(
"contextMap"
,
contextJsonObject
)
val
entitiesJsonObject
=
JSONObject
()
val
widgetInfoJsonObject
=
JSONObject
()
widgetInfoJsonObject
.
put
(
"widget_type"
,
"BUTTON"
)
var
weightName
=
""
when
(
weightKey
)
{
1
->
weightName
=
"return_key"
2
->
weightName
=
"self_pick_up_site"
3
->
weightName
=
"immediate_payment"
}
widgetInfoJsonObject
.
put
(
"widget_name"
,
weightName
)
entitiesJsonObject
.
put
(
"widget_info"
,
widgetInfoJsonObject
)
jsonObject
.
put
(
"entitiesMap"
,
entitiesJsonObject
)
val
propertiesJsonObject
=
JSONObject
()
propertiesJsonObject
.
put
(
"event_id"
,
"SHQ
NG_R_1628749670667
"
)
propertiesJsonObject
.
put
(
"event_id"
,
"SHQ
_R_1625560823085
"
)
jsonObject
.
put
(
"propertiesMap"
,
propertiesJsonObject
)
jsonObject
.
put
(
"logType"
,
1
)
CPointUtils
.
performCommitLog
(
jsonObject
)
...
...
@@ -313,11 +305,6 @@ class ConfirmOrderViewModel : BaseViewModel() {
jsonObject
.
put
(
"eventName"
,
"CLICK_WIDGET"
)
val
contextJsonObject
=
JSONObject
()
contextJsonObject
.
put
(
"page"
,
"ORDER_CONFIRMATION_PAGE"
)
val
smallOrderInfoJsonObject
=
JSONObject
()
smallOrderInfoJsonObject
.
put
(
"marketing_id"
,
marketingInfo
?.
marketingId
)
smallOrderInfoJsonObject
.
put
(
"marketing_name"
,
marketingInfo
?.
marketingName
)
smallOrderInfoJsonObject
.
put
(
"marketing_type"
,
"SPELL_MEAL"
)
contextJsonObject
.
put
(
"small_order_info"
,
smallOrderInfoJsonObject
)
jsonObject
.
put
(
"contextMap"
,
contextJsonObject
)
val
entitiesJsonObject
=
JSONObject
()
val
widgetInfoJsonObject
=
JSONObject
()
...
...
@@ -332,7 +319,7 @@ class ConfirmOrderViewModel : BaseViewModel() {
entitiesJsonObject
.
put
(
"widget_info"
,
widgetInfoJsonObject
)
jsonObject
.
put
(
"entitiesMap"
,
entitiesJsonObject
)
val
propertiesJsonObject
=
JSONObject
()
propertiesJsonObject
.
put
(
"event_id"
,
"SHQ
NG_R_1628749896356
"
)
propertiesJsonObject
.
put
(
"event_id"
,
"SHQ
_R_1625456607092
"
)
jsonObject
.
put
(
"propertiesMap"
,
propertiesJsonObject
)
jsonObject
.
put
(
"logType"
,
1
)
CPointUtils
.
performCommitLog
(
jsonObject
)
...
...
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