Commit 954d8d21 by 侯体倬

feat: 埋点优化

parent cecaf436
...@@ -54,4 +54,8 @@ export default { ...@@ -54,4 +54,8 @@ export default {
uncollect_goods(data) { uncollect_goods(data) {
return requestPOST(`${process.env.OLSHOP_URL}/product/uncollect_goods?productId=${data.productId}&terminalProductId=${data.terminalProductId}`, data) return requestPOST(`${process.env.OLSHOP_URL}/product/uncollect_goods?productId=${data.productId}&terminalProductId=${data.terminalProductId}`, data)
}, },
// 根据 productId 查询商品信息
queryProductInformation(productId) {
return requestGET(`${process.env.OLSHOP_URL}/product/queryProductInformation?productId=${productId}`)
},
}; };
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
<div class="livedSelectionSpe"> <div class="livedSelectionSpe">
<div class="aaa" :style="{ 'z-index': show ? 999 : -999 }"> <div class="aaa" :style="{ 'z-index': show ? 999 : -999 }">
<div class="bg" v-if="show" @click="close"></div> <div class="bg" v-if="show" @click="close"></div>
<div class="goodsMess" :style="{'bottom':show?0:''}"> <div class="goodsMess" :style="{
'bottom': show ? 0 : '',
'padding-bottom': isIphonex ? '34px' : 0
}">
<div class="sku"> <div class="sku">
<!-- 关闭按钮 --> <!-- 关闭按钮 -->
<div class="close" @click="closeDia"> <div class="close" @click="closeDia">
...@@ -86,6 +89,7 @@ ...@@ -86,6 +89,7 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import { DFSImg } from "@/utils/index"; import { DFSImg } from "@/utils/index";
import live from "@/api/live"; import live from "@/api/live";
import goods from "@/api/goods";
const app = getApp(); const app = getApp();
export default { export default {
name: "", name: "",
...@@ -149,7 +153,12 @@ export default { ...@@ -149,7 +153,12 @@ export default {
}; };
}, },
components: {}, components: {},
computed: {}, computed: {
isIphonex() {
const res = wx.getSystemInfoSync();
return res.model.search('iPhone') != -1 && res.screenHeight >= 812;
}
},
created() { }, created() { },
onLoad() { }, onLoad() { },
mounted() { mounted() {
...@@ -391,9 +400,15 @@ export default { ...@@ -391,9 +400,15 @@ export default {
}) })
// 新华优选埋点 // 新华优选埋点
if (app.trackEvent) { if (app.trackEvent) {
app.trackEvent('resourceCartClick', { goods.queryProductInformation(this.getProductInfos[0].productId).then(res => {
resourceId: this.getProductInfos[0].productId, if (res.data.code == 200) {
resourceName: this.getProductInfos[0].pdtName let productCode = res.data.data.productCode;
if (typeof productCode === 'string') productCode = productCode.trim();
app.trackEvent('resourceCartClick', {
resourceId: productCode,
resourceName: res.data.data.productName
});
}
}) })
} }
this.show = false; this.show = false;
...@@ -678,6 +693,10 @@ export default { ...@@ -678,6 +693,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.is-iphonex {
padding-bottom: 34px;
}
.aaa { .aaa {
position: fixed; position: fixed;
width: 100%; width: 100%;
......
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