Commit 679e944c authored by shiyl's avatar shiyl

修改确认订单埋点

parent a0a3103e
...@@ -87,7 +87,9 @@ class ConfirmOrderViewModel : BaseViewModel() { ...@@ -87,7 +87,9 @@ class ConfirmOrderViewModel : BaseViewModel() {
couponsAvailableList.value = it.couponList couponsAvailableList.value = it.couponList
calculateCouponsAvailableNum(it.couponList) calculateCouponsAvailableNum(it.couponList)
// 上传页面埋点信息 // 上传页面埋点信息
commitPageBuriedPoint() for (i in 1..3) {
commitPageBuriedPoint(i)
}
} }
} }
...@@ -267,37 +269,27 @@ class ConfirmOrderViewModel : BaseViewModel() { ...@@ -267,37 +269,27 @@ class ConfirmOrderViewModel : BaseViewModel() {
* 页面浏览的埋点 * 页面浏览的埋点
* 页面可见且有业务数据时上传 * 页面可见且有业务数据时上传
*/ */
private fun commitPageBuriedPoint() { private fun commitPageBuriedPoint(weightKey: Int) {
// 遍历商品列表
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(",")
}
}
// 埋点数据包装 // 埋点数据包装
val jsonObject = JSONObject() val jsonObject = JSONObject()
jsonObject.put("eventName", "EXPOSE_PAGE") jsonObject.put("eventName", "VIEW_WIDGET")
val contextJsonObject = JSONObject() val contextJsonObject = JSONObject()
contextJsonObject.put("page", "ORDER_CONFIRMATION_PAGE") 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) jsonObject.put("contextMap", contextJsonObject)
val entitiesJsonObject = JSONObject() 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) jsonObject.put("entitiesMap", entitiesJsonObject)
val propertiesJsonObject = JSONObject() val propertiesJsonObject = JSONObject()
propertiesJsonObject.put("event_id", "SHQNG_R_1628749670667") propertiesJsonObject.put("event_id", "SHQ_R_1625560823085")
jsonObject.put("propertiesMap", propertiesJsonObject) jsonObject.put("propertiesMap", propertiesJsonObject)
jsonObject.put("logType", 1) jsonObject.put("logType", 1)
CPointUtils.performCommitLog(jsonObject) CPointUtils.performCommitLog(jsonObject)
...@@ -313,11 +305,6 @@ class ConfirmOrderViewModel : BaseViewModel() { ...@@ -313,11 +305,6 @@ class ConfirmOrderViewModel : BaseViewModel() {
jsonObject.put("eventName", "CLICK_WIDGET") jsonObject.put("eventName", "CLICK_WIDGET")
val contextJsonObject = JSONObject() val contextJsonObject = JSONObject()
contextJsonObject.put("page", "ORDER_CONFIRMATION_PAGE") 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) jsonObject.put("contextMap", contextJsonObject)
val entitiesJsonObject = JSONObject() val entitiesJsonObject = JSONObject()
val widgetInfoJsonObject = JSONObject() val widgetInfoJsonObject = JSONObject()
...@@ -332,7 +319,7 @@ class ConfirmOrderViewModel : BaseViewModel() { ...@@ -332,7 +319,7 @@ class ConfirmOrderViewModel : BaseViewModel() {
entitiesJsonObject.put("widget_info", widgetInfoJsonObject) entitiesJsonObject.put("widget_info", widgetInfoJsonObject)
jsonObject.put("entitiesMap", entitiesJsonObject) jsonObject.put("entitiesMap", entitiesJsonObject)
val propertiesJsonObject = JSONObject() val propertiesJsonObject = JSONObject()
propertiesJsonObject.put("event_id", "SHQNG_R_1628749896356") propertiesJsonObject.put("event_id", "SHQ_R_1625456607092")
jsonObject.put("propertiesMap", propertiesJsonObject) jsonObject.put("propertiesMap", propertiesJsonObject)
jsonObject.put("logType", 1) jsonObject.put("logType", 1)
CPointUtils.performCommitLog(jsonObject) CPointUtils.performCommitLog(jsonObject)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment