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
89b9c71f
Commit
89b9c71f
authored
Sep 16, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 订单详情页埋点
parent
ecf0e7e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
6 deletions
+76
-6
OrderDetailActivity.kt
.../yidian/shenghuoquan/buserorder/ui/OrderDetailActivity.kt
+8
-4
OrderCommodityInfoView.kt
...enghuoquan/buserorder/ui/widget/OrderCommodityInfoView.kt
+7
-0
OrderDetailViewModel.kt
...shenghuoquan/buserorder/viewmodel/OrderDetailViewModel.kt
+61
-2
No files found.
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/ui/OrderDetailActivity.kt
View file @
89b9c71f
...
...
@@ -70,16 +70,16 @@ class OrderDetailActivity : BaseMvvmActivity<BorderActivityOrderDetailBinding, O
}
override
fun
onDoBack
()
{
vm
.
commitWidgetBuriedPoint
(
"return_key"
)
//
vm.commitWidgetBuriedPoint("return_key")
XPageManager
.
pop
(
null
)
}
override
fun
onContractPickupPoint
()
{
vm
.
commitWidgetBuriedPoint
(
"call_up"
)
vm
.
commit
Click
WidgetBuriedPoint
(
"call_up"
)
}
override
fun
onGotoMarketingDetail
()
{
vm
.
commitWidgetBuriedPoint
(
"activity_icon"
)
//
vm.commitWidgetBuriedPoint("activity_icon")
}
override
fun
onApplyRefundSuccess
()
{
...
...
@@ -88,6 +88,10 @@ class OrderDetailActivity : BaseMvvmActivity<BorderActivityOrderDetailBinding, O
}
override
fun
onContractSeller
()
{
vm
.
commitWidgetBuriedPoint
(
"contact_seller"
)
vm
.
commitClickWidgetBuriedPoint
(
"contact_seller"
)
}
override
fun
onApplyRefund
()
{
vm
.
commitClickWidgetBuriedPoint
(
"apply_refund"
)
}
}
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/ui/widget/OrderCommodityInfoView.kt
View file @
89b9c71f
...
...
@@ -71,6 +71,8 @@ class OrderCommodityInfoView @JvmOverloads constructor(context: Context, attrs:
}
},
null
,
R
.
color
.
color_FD7823
).
show
()
// 回调申请退款
callback
?.
onApplyRefund
()
})
// 监听申请退款接口请求结果
vm
.
applyRefundResult
.
observe
(
context
as
LifecycleOwner
,
{
...
...
@@ -132,5 +134,10 @@ class OrderCommodityInfoView @JvmOverloads constructor(context: Context, attrs:
* 联系卖家
*/
fun
onContractSeller
()
/**
* 申请退款
*/
fun
onApplyRefund
()
}
}
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/viewmodel/OrderDetailViewModel.kt
View file @
89b9c71f
package
com.yidian.shenghuoquan.buserorder.viewmodel
import
android.text.TextUtils
import
androidx.lifecycle.LiveData
import
androidx.lifecycle.MutableLiveData
import
com.yidian.bcommon.mvvm.BaseViewModel
...
...
@@ -7,6 +8,8 @@ import com.yidian.bcommon.utils.CPointUtils
import
com.yidian.shenghuoquan.buserorder.dto.OrderDetailDto
import
com.yidian.shenghuoquan.buserorder.http.OrderRemoteDataSource
import
com.yidian.shenghuoquan.buserorder.http.callback.IGetOrderDetailCallback
import
com.yidian.shenghuoquan.buserorder.manager.OrderStatus
import
com.yidian.shenghuoquan.buserorder.manager.OrderStatusManager
import
org.json.JSONObject
import
timber.log.Timber
...
...
@@ -28,8 +31,16 @@ class OrderDetailViewModel : BaseViewModel() {
override
fun
getOrderDetailSuccess
(
result
:
OrderDetailDto
?)
{
if
(
_orderDetailData
.
value
==
null
)
{
_orderDetailData
.
value
=
result
// 订单详情页面曝光埋点只上报一次
commitPageBuriedPoint
()
if
(
result
==
null
)
return
// 订单详情按钮曝光埋点只上报一次
if
(!
TextUtils
.
isEmpty
(
result
.
placeList
.
phone
))
{
commitViewWidgetBuriedPoint
(
"call_up"
)
}
commitViewWidgetBuriedPoint
(
"contact_seller"
)
if
(
OrderStatusManager
.
getOrderStatus
(
result
.
orderStatus
)
==
OrderStatus
.
ORDER_STATUS_PAID
)
{
commitViewWidgetBuriedPoint
(
"apply_refund"
)
}
return
}
_orderDetailData
.
value
=
result
}
...
...
@@ -122,4 +133,52 @@ class OrderDetailViewModel : BaseViewModel() {
CPointUtils
.
performCommitLog
(
jsonObject
)
Timber
.
tag
(
"BUserOrderBuriedPoint"
).
d
(
"commit order detail widget log: $jsonObject"
)
}
/**
* 按钮点击埋点
*/
fun
commitClickWidgetBuriedPoint
(
widgetName
:
String
)
{
// 埋点数据包装
val
jsonObject
=
JSONObject
()
jsonObject
.
put
(
"eventName"
,
"CLICK_WIDGET"
)
val
contextJsonObject
=
JSONObject
()
contextJsonObject
.
put
(
"page"
,
"ORDER_DETAIL_PAGE"
)
jsonObject
.
put
(
"contextMap"
,
contextJsonObject
)
val
entitiesJsonObject
=
JSONObject
()
val
widgetInfoJsonObject
=
JSONObject
()
widgetInfoJsonObject
.
put
(
"widget_type"
,
"BUTTON"
)
widgetInfoJsonObject
.
put
(
"widget_name"
,
widgetName
)
entitiesJsonObject
.
put
(
"widget_info"
,
widgetInfoJsonObject
)
jsonObject
.
put
(
"entitiesMap"
,
entitiesJsonObject
)
val
propertiesJsonObject
=
JSONObject
()
propertiesJsonObject
.
put
(
"event_id"
,
"SHQ_R_1625468015092"
)
jsonObject
.
put
(
"propertiesMap"
,
propertiesJsonObject
)
jsonObject
.
put
(
"logType"
,
1
)
CPointUtils
.
performCommitLog
(
jsonObject
)
Timber
.
tag
(
"BUserOrderBuriedPoint"
).
d
(
"commit order detail widget log: $jsonObject"
)
}
/**
* 按钮曝光埋点
*/
fun
commitViewWidgetBuriedPoint
(
widgetName
:
String
)
{
// 埋点数据包装
val
jsonObject
=
JSONObject
()
jsonObject
.
put
(
"eventName"
,
"VIEW_WIDGET"
)
val
contextJsonObject
=
JSONObject
()
contextJsonObject
.
put
(
"page"
,
"ORDER_DETAIL_PAGE"
)
jsonObject
.
put
(
"contextMap"
,
contextJsonObject
)
val
entitiesJsonObject
=
JSONObject
()
val
widgetInfoJsonObject
=
JSONObject
()
widgetInfoJsonObject
.
put
(
"widget_type"
,
"BUTTON"
)
widgetInfoJsonObject
.
put
(
"widget_name"
,
widgetName
)
entitiesJsonObject
.
put
(
"widget_info"
,
widgetInfoJsonObject
)
jsonObject
.
put
(
"entitiesMap"
,
entitiesJsonObject
)
val
propertiesJsonObject
=
JSONObject
()
propertiesJsonObject
.
put
(
"event_id"
,
"SHQ_R_1625560990174"
)
jsonObject
.
put
(
"propertiesMap"
,
propertiesJsonObject
)
jsonObject
.
put
(
"logType"
,
1
)
CPointUtils
.
performCommitLog
(
jsonObject
)
Timber
.
tag
(
"BUserOrderBuriedPoint"
).
d
(
"commit order detail widget log: $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