alibaba / GaiaX

动态模板引擎是一套轻量化、跨平台、高性能的纯原生移动端卡片渲染动态化解决方案
https://youku-gaiax.github.io/
Apache License 2.0
1.2k stars 142 forks source link

主模板JS 更新数据源,子模版 track埋点获取不到JS 更改数据源的值。 #457

Closed youjiaxichenyun closed 9 months ago

youjiaxichenyun commented 10 months ago

主模板JS 更新数据源,子模版点击事件的 track埋点获取不到JS 更改数据源的值。

模板:

归档(4).zip

mock 数据 { "data": { "buttons": [ { "titleType": 2, "dynamicInterval": "", "subtitle": "摇一摇寻车", "dynamicTitleUrl": "", "extParams": { "flashingFrequency": "", "flashingResult": "", "flashingPopupsImage1": "http://ccimgs224.oss.aliyuncs.com/customer/20230615/648b03127349556c6f93a127", "model": 2, "flashingStatus": 0, "flashingTime": "", "flashingPopupsImage2": "http://ccimgs224.oss.aliyuncs.com/customer/20230615/648b031b7349556c6f93a129", "appletsFlashingPopupsImage2": "http://ccimgs224.oss.aliyuncs.com/customer/20230619/648fc43fc60ad25e845d7783", "appletsFlashingPopupsImage1": "http://ccimgs224.oss.aliyuncs.com/customer/20230619/648fc439c60ad25e845d7781" }, "sort": "", "functionType": "flashing", "titleText": "", "jumpUrl": "smart-cabin-h5/home?pageStyle=3&orderNo=1828681705513220&tab=flashing", "titleUrl": "http://ccimgs224.oss.aliyuncs.com/customer/20230615/648a7c0b26652456f9c4d426", "intelligentCabinStatus": 32 }, { "titleType": 2, "dynamicInterval": "", "subtitle": "音乐随心听", "dynamicTitleUrl": "", "extParams": "", "sort": "", "functionType": "music", "titleText": "音乐随身听", "jumpUrl": "smart-cabin-h5/home?pageStyle=3&orderNo=1828681705513220", "titleUrl": "http://ccimgs224.oss.aliyuncs.com/customer/20230913/6501688e03668167a445a099", "intelligentCabinStatus": "" }, { "titleType": 2, "dynamicInterval": "", "subtitle": "调节气温", "dynamicTitleUrl": "", "extParams": "", "sort": "", "functionType": "airCondition", "titleText": "", "jumpUrl": "smart-cabin-h5/home?pageStyle=3&orderNo=1828681705513220&tab=airCondition", "titleUrl": "http://ccimgs224.oss.aliyuncs.com/customer/20230309/6409794da88ca510e2cdf48f", "intelligentCabinStatus": 12 }, { "titleType": 2, "dynamicInterval": "", "subtitle": "一键换气", "dynamicTitleUrl": "", "extParams": "", "sort": "", "functionType": "ventilation", "titleText": "一键换气主标题", "jumpUrl": "smart-cabin-h5/home?pageStyle=3&orderNo=1828681705513220&tab=ventilation&pageStyle=3", "titleUrl": "http://ccimgs224.oss.aliyuncs.com/customer/20230311/640c3b09a88ca510e2cdffcb", "intelligentCabinStatus": 1 } ], "background": { "carIcon": "", "backgroundImage": "https://ccimgs.oss-cn-hangzhou.aliyuncs.com/car/insurance/20231010/1696916207018MuulpWFXxvif", "titleText": "智能车控", "jumpUrl": "smart-cabin-h5/home?pageStyle=3&orderNo=1828681705513220" }, "function": 31 }, "DynamicExtend": { "orderNo": "12345678", "companyNo": "8888888", "uid": "0000000000" } }

子版本item的点击埋点事件: "track": { "GBCarControlContentItem": { "eventId": "'J161311'", "type": "'0'", "param1": "$itemExtendMap.orderNo", "param2": "$itemExtendMap.companyNo", "param3": "$itemExtendMap.uid", "param4": "$functionType" } } $itemExtendMap.orderNo 和 $itemExtendMap.companyNo 和$itemExtendMap.uid 取不到值

biezhihua commented 10 months ago

@youjiaxichenyun 基于那个分支的JS代码?

biezhihua commented 10 months ago

@youjiaxichenyun 你可以先用main分支的代码验证一下你这个问题。 如果还是有问题,我找时间跟进一下。