Commit 0824cd13 by 侯体倬

原生小程序埋点

parent a674a603
......@@ -5586,9 +5586,9 @@
"dev": true
},
"mayi-analytics": {
"version": "1.1.24",
"resolved": "https://registry.npmjs.org/mayi-analytics/-/mayi-analytics-1.1.24.tgz",
"integrity": "sha512-pbJspryp05UuiodXfCFbeZkyM1BdPGC83XRJDo+LJhvfdyaiTXLykCfORRCDgTR0hIuINb8UjOc8/B6bkjWp8g==",
"version": "1.1.37",
"resolved": "https://registry.npmjs.org/mayi-analytics/-/mayi-analytics-1.1.37.tgz",
"integrity": "sha512-x0/dSzxc+hYRYw5ihpyje77Sg/H3SjecwXdaUACvbGHv0/uzLzY3GWIA23WTASZdKGR2OtJxXOM0Nqvpq8M9CA==",
"requires": {
"js-cookie": "^2.2.0",
"qs": "^6.7.0",
......
......@@ -22,7 +22,7 @@
"build:my": "node build/build.js my"
},
"dependencies": {
"mayi-analytics": "^1.1.24",
"mayi-analytics": "^1.1.37",
"mayi-front-tools": "^1.0.0",
"mpvue": "^2.0.0",
"mpvue-wxparse": "^0.6.5",
......
......@@ -45,7 +45,6 @@ export default {
// 页面配置信息
this.getThemePage(extConfig);
......@@ -55,14 +54,10 @@ export default {
console.log(mpApp, "this.mpApp");
mpApp.getShopInfo = this.getShopInfo
mpApp.getThemePage = this.getThemePage
},300)
},
methods: {
async setVisible(pageList, cb) {
......@@ -150,7 +145,8 @@ export default {
// 收集用户数据
this.$mpBehavior.init("mayi-moblie-shop-mp", res.data.data.id, {
mode: process.env.NODE_ENV,
gid: res.data.data.groupId
gid: res.data.data.groupId,
mixid: mixid
})
let mpApp = getApp();
......
......@@ -77,9 +77,10 @@ export default {
// })
// },
// 跳转到大转盘页
toPrizePage() {
toPrizePage(e) {
let link = `/turntable?turntableCode=${this.datas.componentData.turntableCode}`
console.log('tz', app);
app.trackCpn(e, this.datas.componentName)
app.$themeToLink({
type :1,
link : link
......
......@@ -45,7 +45,7 @@
class="goods-item"
:class="datas.componentData.columnNum == 2 ? 'style2' : 'style3'"
:style="{'padding-left': datas.componentData.proGap + 'px','width': getColumnWidth,}"
@click="onclickProduct(goodsList[index])"
@click="onclickProduct(goodsList[index], $event)"
>
<goodsItem :datas="datas" :items="item"></goodsItem>
</li>
......@@ -75,7 +75,7 @@
:style="{ width: getColumnWidth,'margin-right': datas.componentData.proGap + 'px' }"
class="goods-item"
:class="{ lastchild: swiperNum == index + 1 }"
@click="onclickProduct(goodsList[index])"
@click="onclickProduct(goodsList[index], $event)"
>
<div :style="{'margin-left':datas.componentData.proGap*2+'px'}">
<goodsItem :datas="datas" :items="item"></goodsItem>
......@@ -85,7 +85,7 @@
<!-- 瀑布流 -->
<div class="waterfallFlow" v-if="datas.componentData.style === 'waterfall'">
<div class="left">
<div v-for="(item,index) in goodsList" :key="index" @click="onclickProduct(goodsList[index])" :style="{'margin-bottom':datas.componentData.proGap + 'px','margin-right':datas.componentData.proGap/2 + 'px'}">
<div v-for="(item,index) in goodsList" :key="index" @click="onclickProduct(goodsList[index], $event)" :style="{'margin-bottom':datas.componentData.proGap + 'px','margin-right':datas.componentData.proGap/2 + 'px'}">
<goodsItem
v-if="index%2==0"
:datas="datas"
......@@ -94,7 +94,7 @@
</div>
</div>
<div class="right">
<div v-for="(item,index) in goodsList" :key="index" @click="onclickProduct(goodsList[index])" :style="{'margin-bottom':datas.componentData.proGap + 'px','margin-left':datas.componentData.proGap/2 + 'px'}">
<div v-for="(item,index) in goodsList" :key="index" @click="onclickProduct(goodsList[index], $event)" :style="{'margin-bottom':datas.componentData.proGap + 'px','margin-left':datas.componentData.proGap/2 + 'px'}">
<goodsItem
v-if="index%2==1"
:datas="datas"
......@@ -305,10 +305,11 @@ export default {
}
},
//点击商城跳转---基于微商城
onclickProduct(item) {
onclickProduct(item, e) {
let productId = item.productId;
let terminalProductId = item.terminalProductId;
let linkVal = `/goods/${productId}?terminalProductId=${terminalProductId}`;
app.trackCpn(e, this.datas.componentName, item)
app.$themeToLink({
type: 1,
link: linkVal
......
......@@ -4,7 +4,7 @@
class="links"
:style="{'background-color':datas.componentData['backgroundColor'],'color':datas.componentData['fontColor'],
'text-align':datas.componentData['arrowsSite'],'line-height':datas.componentData['initcharSize']+'em'}"
@click="onclickHandle()"
@click="onclickHandle"
>
<span
:style="{'font-size':datas.componentData['initcharSize']+'em'}"
......@@ -30,7 +30,8 @@ export default {
return {};
},
methods: {
onclickHandle() {
onclickHandle(e) {
app.trackCpn(e, this.datas.componentName, this.datas.componentData.link)
app.$themeToLink(this.datas.componentData.link);
}
},
......
......@@ -381,6 +381,8 @@ export default {
}
},
changeTab(res) {
let app = getApp()
app.trackCpn(null, this.datas.componentName, res.target)
console.log(this.$parent.$mp.page.selectAllComponents('.time-limited-discount'),'====111111222')
if(this.$parent.$mp.page.selectAllComponents('.time-limited-discount')){
this.$parent.$mp.page.selectAllComponents('.time-limited-discount').forEach(item => {
......
......@@ -12,7 +12,7 @@
>{{datas.componentData.abstract}}</div>
</div>
<!-- 图片区域 -->
<div class="imgcontent" @click="itemClick()">
<div class="imgcontent" @click="itemClick">
<image :src="datas.componentData.imageUrl" alt lazy-load="true" mode="widthFix" :style="{'width':'100%','display':'block'}" ></image>
<!-- 内部文字 -->
<div
......@@ -83,7 +83,8 @@ export default {
},
computed: {},
methods: {
itemClick() {
itemClick(e) {
app.trackCpn(e, this.datas.componentName, this.datas.componentData)
app.$themeToLink(this.datas.componentData.link);
}
},
......
......@@ -453,13 +453,14 @@ export default {
});
},
// 查看更多
viewMore() {
viewMore(e) {
let link ="";
if(this.articleStatus==1){
link= `/article/articleList?classifyId=${this.classifId}&categoryName=${this.classifName}`;
} else if(this.articleStatus==4){
link= `/article/articleList?tagIds=${this.tagIds.join(",")}`;
}
app.trackCpn(e, this.datas.componentName, 'ViewMore')
app.$themeToLink({
type :1,
link : link
......
......@@ -13,7 +13,7 @@
'padding-right':getPaddingList[3]['value']+'px',
'textAlign':getAlign,
'fontSize':getFontSize}"
@click="itemClick()"
@click="itemClick"
>{{getContent}}</p>
</div>
</template>
......@@ -108,7 +108,8 @@ export default {
}
},
methods: {
itemClick() {
itemClick(e) {
app.trackCpn(e, this.datas.componentName, this.datas.componentData)
app.$themeToLink(this.datas.componentData.link);
}
},
......
......@@ -23,6 +23,7 @@ import "@/utils/themeModule";
// import { themeToLinkInit } from "@/utils/themeModule";
import shop from "./api/shop";
import spokesman from "@/api/spokesman";
import live from "@/api/live"
Vue.config.productionTip = false
App.mpType = 'app'
......@@ -86,9 +87,29 @@ mpApp.webviewCallBack = function () { }
mpApp.shareInit = function () {};
mpApp.themeColorCallBack = function () {};
mpApp.indexBgCallBack = function(){ }
/**
* 组件点击行为收集
* @param {event} event 原生事件
* @param {*} componentInfo 完整信息
* @param {*} itemInfo 具体信息
*/
mpApp.trackCpn = (event, componentInfo, itemInfo) => {
console.log('tzBehavior测试-----', event);
let x = 0, y = 0;
if (event) {
if (event.x || event.detail.x) { x = event.x || event.detail.x }
if (event.y || event.detail.y) { y = event.y || event.detail.y }
}
mpBehavior.trackEvent('cpn_click', {
xAxis: x.toFixed(2) || 0, // x轴
yAxis: y.toFixed(2) || 0, // y轴
cpnInfo: JSON.stringify(componentInfo), // 完整信息
itemInfo: JSON.stringify(itemInfo) || '' // 具体信息
})
}
// 全局数据
mpApp.processEnv = process.env;
// 全局跳转 data为link对象
......@@ -138,6 +159,40 @@ function getThemePage({mixid,shopid}) {
}
// 当前用户 id
let userId
// 分销员 id
let spokesmanId
/**
* 全局页面切换监听
*/
wx.onAppRoute(res => {
// 获取当前页面信息
let currentPage = getCurrentPages()
// let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath
new Promise((resolve) => {
if (!spokesmanId) {
// 获取当前分销员 id
spokesman.getSpokesmanidByShare().then(res => {
if (res.data.data.spokesmanId) { spokesmanId = res.data.data.spokesmanId }
})
}
if (!userId) { // 防止多次调用
// 获取当前用户 id
live.getUserInfo().then(res => { userId = res.data.data.userId })
}
userId && resolve()
}).then(() => {
mpBehavior.trackPageView({
title: '',
location: res.path,
// path: fromPath.substring(0, fromPath.length - 5),
path: res.path,
sales: spokesmanId,
userId: userId
});
})
})
// if (!mpApp.globalData.setPopupStorage){
......
......@@ -236,8 +236,9 @@ export default {
const observer = performance.createObserver((entryList) => {
let getEntries=entryList.getEntries()
wx.reportPerformance(2001, getEntries[0]['duration'])
this.$mpBehavior.monitorPerformance(getEntries[0])
})
observer.observe({ entryTypes: ['render', 'script'] })
observer.observe({ entryTypes: ['render'] })
}
// 查询是否展示生日礼品
......
......@@ -32,8 +32,6 @@ Component({
console.log(getCurrentPages())
this.setData({
designateAreaObj: this.data.datas.componentData.designateAreaObj
})
......@@ -59,7 +57,6 @@ Component({
})
return
}
if (this.data.datas.componentInfo.visible == 1) {
let _this = this;
......@@ -84,7 +81,6 @@ Component({
if(this.data.changeLocation == 1){
return
}
wx.getLocation({
type: 'wgs84',
success(res) {
......@@ -192,7 +188,6 @@ Component({
console.log('定位失败')
if(!wx.getStorageSync('location')){
if(_this.data.designateAreaObj.id){
wx.setStorageSync('location', JSON.stringify({
id : _this.data.designateAreaObj.id,
regionName: _this.data.designateAreaObj.regionName,
......@@ -215,7 +210,6 @@ Component({
console.log('111111++++++++++++++++++++定位组件加载好了++++++++++++++++++++111')
},
pageLifetimes : {
show(){
console.log('组件页面出来show', this.data.designateAreaObj)
......@@ -295,7 +289,7 @@ Component({
*/
methods: {
//切换城市
changeTo(){
changeTo(e){
console.log(this.data.designateAreaObj)
this.setData({
......@@ -315,13 +309,13 @@ Component({
changeShow : false
})
wx.setStorageSync('location', change )
app.trackCpn(e, this.data.datas.componentName, 'tzChangeTo')
wx.reLaunch({
url: '/pages/home/main?changeLocation=1'
})
},
continueBrowser(){
continueBrowser(e){
console.log(this.data.designateAreaObj,'this.data.designateAreaObj')
wx.setStorageSync('location', JSON.stringify(this.data.designateAreaObj))
this.setData({
......@@ -329,23 +323,25 @@ Component({
changeShow: false
})
// wx.startPullDownRefresh()
app.trackCpn(e, this.data.datas.componentName, 'continueBrowser')
wx.reLaunch({
url: '/pages/home/main?changeLocation=1'
})
},
changeOtherCity(){
changeOtherCity(e){
console.log(getCurrentPages())
app.trackCpn(e, this.data.datas.componentName, 'changeOtherCity')
wx.navigateTo({
url: '/pages/changeAdr/main?areaGroupId=' + this.data.designateAreaObj.areaGroupId,
})
},
toSearchPage(){
toSearchPage(e){
app.trackCpn(e, this.data.datas.componentName, 'toSearchPage')
app.$themeToLink({
type : 1,
link: '/goodsSearch/goodsSearch'
})
}
},
})
......@@ -35,6 +35,7 @@ Component({
onClick(data) {
let item = data.currentTarget.dataset.item;
console.log(data.currentTarget.dataset.item, "iiii");
app.trackCpn(data, this.data.datas.componentName, item)
app.$themeToLink(item.link);
},
loadImg(e) {
......
......@@ -91,9 +91,7 @@ Component({
cube3H: res.height * (Math.ceil(_this.data.imgList.length / _this.data.datas.componentData.columnNum))
})
}
}
}
}).exec()
......@@ -132,7 +130,6 @@ Component({
wArr[_this.data.datas.componentData.columnNum - 1]
})
}
_this.setData({
w: wArr[_this.data.datas.componentData.columnNum - 1]
})
......@@ -178,6 +175,7 @@ Component({
onclickHandle(e){
let item = e.currentTarget.dataset.item
console.log(item)
app.trackCpn(e, this.data.datas.componentName, item)
app.$themeToLink(item.link)
}
}
......
......@@ -20,15 +20,15 @@ Component({
this.setData({
imgIcon: app.DFSImg(this.data.datas.componentData.backgroundImage, this.data.datas.componentData['sizeInfo']['width'] * 6, this.data.datas.componentData['sizeInfo']['width'] * 6,1)
})
},
/**
* 组件的方法列表
*/
methods: {
clickHandler(){
clickHandler(e){
console.log('浮窗点击', this.data.datas.componentData.link)
app.trackCpn(e, this.data.datas.componentName)
app.$themeToLink(this.data.datas.componentData.link)
}
}
......
......@@ -56,7 +56,6 @@ const componentOptions = {
detached() {}
},
attached() {
},
definitionFilter() {},
onPageScroll() {
......@@ -116,11 +115,11 @@ const componentOptions = {
// this.data.lists = lists;
this.setData({ lists: lists });
}
})
},
toSpokesmanHomePage() {
toSpokesmanHomePage(e) {
let linkVal = '/personalCenter/spokesmanCenter/mine/spokesmanHomePage?from=_goodsInfo'
app.trackCpn(e, this.data.datas.componentName)
$themeToLink({
type: 1,
link:linkVal,
......@@ -142,6 +141,7 @@ const componentOptions = {
toGoodsInfo(event) {
const item = event.currentTarget.dataset.item;
let linkVal = `/goods/${item.terminalProductGoods.productId}`
app.trackCpn(event, this.data.datas.componentName, item)
$themeToLink({
type: 1,
link:linkVal,
......
......@@ -57,10 +57,12 @@ const componentOptions = {
onChange(e) {
this.setData({ timeData: e.detail });
},
onclickProduct() {
onclickProduct(e) {
let { goodsType } = this.data.datas.componentData;
let {
shopName,
productId,
productName,
terminalProductId,
terminalGoodsMixId
} = this.data.items;
......@@ -70,17 +72,22 @@ const componentOptions = {
} else if (goodsType == 1) {
linkVal = `/pointShop/goodsDetail?productId${productId}&terminalProductId=${terminalProductId}&terminalGoodsMixId=${terminalGoodsMixId}`;
}
app.trackCpn(e, this.data.datas.componentName, {
shopName,productId,productName,terminalProductId,terminalGoodsMixId
})
$themeToLink({
type: 1,
link: linkVal
});
},
onclickBuynow() {
onclickBuynow(e) {
let { btnType } = this.data.datas.componentData;
let {
minProductGoodsMixid,
minProductGoodsId,
minGoodsId
productName,
minGoodsId,
shopName
} = this.data.items;
let linkVal = "";
if (btnType < 6) {
......@@ -92,10 +99,14 @@ const componentOptions = {
linkVal = `/order/orderConfirm?productGoodsMixId=${minProductGoodsMixid}&productGoodsId=${minProductGoodsId}&goodsId=${minGoodsId}&qty=1&goodsString=null&source=3`;
}
console.log(linkVal, "-------90");
app.trackCpn(e, this.data.datas.componentName, {
shopName,minGoodsId,productName,minProductGoodsId,minProductGoodsMixid
})
$themeToLink({ type: 1, link: linkVal });
},
toMerchants() {
toMerchants(e) {
let { orgId } = this.data.items;
app.trackCpn(e, this.data.datas.componentName, 'toMerchants')
$themeToLink({ type: 1, link: `/merchantsDetail/${orgId}` });
},
......
......@@ -341,7 +341,7 @@ const componentOptions = {
console.log("---触发分页加载");
this.getProductList(1, 2);
},
viewMore() {
viewMore(e) {
let {
goodsType,
style,
......@@ -358,6 +358,7 @@ const componentOptions = {
} else {
linkVal = `/pointShop/productList?categoryName=${categoryName}&categoryId=${categoryId}`;
}
app.trackCpn(e, this.data.datas.componentName, 'ViewMore查看更多')
$themeToLink({
type: 1,
link: linkVal
......
......@@ -45,7 +45,8 @@ Component({
* 组件的方法列表
*/
methods: {
toSearchPage(){
toSearchPage(e){
app.trackCpn(e, this.data.datas.componentName)
app.$themeToLink({
type: 1,
link: '/contentSearch/contentSearch?placeHolderText=' + (this.data.datas.componentData["placeHolderVal"] || '')
......
......@@ -73,7 +73,8 @@ Component({
})
},
toList(){
toList(e){
app.trackCpn(e, this.data.datas.componentName, '查看更多')
app.$themeToLink({
type: 1,
link: '/liveBroadcast/list'
......@@ -81,6 +82,7 @@ Component({
},
toLiveDetail(e){
let id = e.currentTarget.dataset.itemid
app.trackCpn(e, this.data.datas.componentName, id)
app.$themeToLink({
type: 1,
link: '/liveBroadcast/lived?liveId=' + id
......
......@@ -222,6 +222,7 @@ Component({
itemClick(e){
let item = e.currentTarget.dataset.item
console.log(item)
app.trackCpn(e, this.data.datas.componentName, item)
app.$themeToLink({
type: 1,
link: `/merchantsDetail/${ item.boundOrgId }`
......
......@@ -42,7 +42,9 @@ Component({
*/
methods: {
onclickHandle(e) {
app.$themeToLink(this.data.datas.componentData.noticeList[e.currentTarget.dataset.index].link)
let item = this.data.datas.componentData.noticeList[e.currentTarget.dataset.index]
app.trackCpn(e, this.data.datas.componentName, item)
app.$themeToLink(item.link)
},
getNoticeMargin() {
this.setData({
......
......@@ -37,7 +37,6 @@ Component({
WaterfallFlowListR : []
},
ready(){
if (this.data.datas.componentData.paddingList){
this.setData({
getPaddingList: this.data.datas.componentData.paddingList
......@@ -87,6 +86,7 @@ Component({
methods: {
itemClick(e){
let item = e.currentTarget.dataset.item
app.trackCpn(e, this.data.datas.componentName, item)
app.$themeToLink(item.link)
},
bindload(e){
......@@ -98,8 +98,6 @@ Component({
console.log(index,width,height)
this.setData({
lenI : this.data.lenI + 1
})
......@@ -130,9 +128,6 @@ Component({
['imgArr[' + ii + '].height']: it.height /b
})
})
}
}
......
......@@ -10,8 +10,6 @@ Component({
}
},
/**
* 组件的初始数据
*/
......@@ -29,7 +27,6 @@ Component({
this.setData({
img: app.DFSImg(this.data.datas.componentData.imageUrl,700,null,1)
})
console.log(this.data.datas.componentData,'this.data.datas.componentData.once')
if(!this.data.datas.componentData.once){
console.log('laizhelile')
......@@ -68,7 +65,6 @@ Component({
let routes = getCurrentPages()
let page = routes[routes.length - 1].route
return wx.getStorageSync(`${app.globalData.shopInfo.shopCode}_popFlag_${page}_${this.data.datas.id}`)
},
setPopFlag(value) {
app.globalData.setPopupStorage = 1;
......@@ -80,17 +76,18 @@ Component({
wx.setStorageSync('popUpList', popUpList)
console.log(app.globalData)
},
backHandle(){
backHandle(e){
this.setData({
domainShow : false
})
if(this.data.datas.componentData.once){
this.setPopFlag("true");
}
app.trackCpn(e, this.data.datas.componentName, '关闭自动弹窗广告')
clearTimeout(this.data.timeout);
},
onclickHandle() {
onclickHandle(e) {
app.trackCpn(e, this.data.datas.componentName, '点击自动弹窗广告')
app.$themeToLink(this.data.datas.componentData.link);
}
}
......
......@@ -32,7 +32,6 @@ const componentOptions = {
detached() {}
},
attached() {
},
definitionFilter() {},
onPageScroll() {
......@@ -46,7 +45,6 @@ const componentOptions = {
},
// 页面被隐藏
hide() {
},
// 页面尺寸变化时
resize() {}
......@@ -57,7 +55,8 @@ const componentOptions = {
// this.setData(showPop)
this.setData({ showPop: true });
},
setNewShop() {
setNewShop(e) {
app.trackCpn(e, '分销商组件')
// window.sessionStorage.setItem(getTokenTwo()+'currentState',0)
app.fenxiaoModel.getDistributorHomepage().then(res=>{
console.log(res,888888888)
......@@ -73,7 +72,6 @@ const componentOptions = {
})
},
copyShop() {
app.fenxiaoModel.oneClickShopQuickCopy({grossProfitMargin: parseFloat(this.data.distributionPrice1)}).then(res=>{
if(res == 'true') {
this.initShopDetail()
......
......@@ -52,7 +52,7 @@ Component({
})
this.queryBuyingShowList(0)
}
app.trackCpn(e, this.data.datas.componentName, e.currentTarget.dataset)
},
queryBuyingShowList(type){
if (this.data.datas.componentData["activityFlag"][0]["id"] == "" || !this.data.loaded){
......@@ -286,12 +286,14 @@ Component({
buyingShowHandle(e){
let id = e.currentTarget.dataset.id
console.log(id)
app.trackCpn(e, this.data.datas.componentName, e.currentTarget.dataset)
app.$themeToLink({
type: 1,
link: '/buyerShow/showDetail?buyingShowId=' + id
})
},
viewMore(){
viewMore(e){
app.trackCpn(e, this.data.datas.componentName, 'ViewMore')
this.queryBuyingShowList(1);
}
}
......
......@@ -68,6 +68,7 @@ const componentOptions = {
this.onClose();
},
copyText(e) {
app.trackCpn(e, '首页分享', '复制链接')
let pagePath = `${processEnv.BASE_URL}?mixid=${globalData.shopInfo.shopCode}`;
let copyVal = pagePath;
app.fenxiaoModel.getSpokesmanidByShare().then(res=>{
......@@ -87,7 +88,8 @@ const componentOptions = {
});
})
},
toPosters() {
toPosters(e) {
app.trackCpn(e, '首页分享', '生成海报')
let userInfo = wx.getStorageSync("userInfo") ? JSON.parse(wx.getStorageSync("userInfo")):'';
let queryHref = `${processEnv.BASE_URL}?mixid=${globalData.shopInfo.shopCode}`;
app.fenxiaoModel.getSpokesmanidByShare().then(res=>{
......
......@@ -87,6 +87,7 @@ Component({
methods: {
onclick(e){
let item = e.currentTarget.dataset.item
app.trackCpn(e, this.data.datas.componentName, item)
app.$themeToLink({
type: 1,
link: `/goods/commodityMenu?categoryName=${item.categoryName}&categoryId=${item.id}`
......
......@@ -36,7 +36,8 @@ const componentOptions = {
: false;
this.setData({ timeData: e.detail, "datas.isStart": isStart });
},
toActivity() {
toActivity(e) {
app.trackCpn(e, this.data.datas.componentName)
$themeToLink({ type: 1, link: `/brandTopics/${this.data.datas.id}` });
}
},
......
......@@ -292,10 +292,19 @@ const componentOptions = {
"-------------------------226"
);
let {
shopName,
productId,
productName,
terminalProductId,
terminalGoodsMixId,
productId
terminalGoodsMixId
} = e.currentTarget.dataset.items;
app.trackCpn(e, this.data.datas.componentName, {
shopName,
productId,
productName,
terminalProductId,
terminalGoodsMixId
})
$themeToLink({
type: 1,
link: `/goods/${productId}?limitedLime=true&endTime=${
......@@ -309,6 +318,11 @@ const componentOptions = {
terminalGoodsId,
goodsId
} = e.currentTarget.dataset.items;
app.trackCpn(e, this.data.datas.componentName, {
terminalGoodsMixId,
terminalGoodsId,
goodsId
})
$themeToLink({
type: 1,
link: `/order/orderConfirm?productGoodsMixId=${terminalGoodsMixId}&productGoodsId=${terminalGoodsId}&goodsId=${goodsId}&qty=1&goodsString=null`
......
const app = getApp();
const componentOptions = {
// 组件选项
options: {
......@@ -23,7 +24,8 @@ const componentOptions = {
// 组件方法
methods: {
init() {},
playVideo() {
playVideo(e) {
app.trackCpn(e, this.data.datas.componentName)
// 视频播放
if (this.data.datas.componentData['nativeControl']) {
return
......
......@@ -57,7 +57,7 @@ const componentOptions = {
onChange(e) {
this.setData({ timeData: e.detail });
},
onclickProduct() {
onclickProduct(e) {
let { goodsType } = this.data.datas.componentData;
let {
productId,
......@@ -70,12 +70,13 @@ const componentOptions = {
} else if (goodsType == 1) {
linkVal = `/pointShop/goodsDetail?productId${productId}&terminalProductId=${terminalProductId}&terminalGoodsMixId=${terminalGoodsMixId}`;
}
app.trackCpn(e, this.data.datas.componentName)
$themeToLink({
type: 1,
link: linkVal
});
},
onclickBuynow() {
onclickBuynow(e) {
let { btnType } = this.data.datas.componentData;
let {
minProductGoodsMixid,
......@@ -92,10 +93,12 @@ const componentOptions = {
linkVal = `/order/orderConfirm?productGoodsMixId=${minProductGoodsMixid}&productGoodsId=${minProductGoodsId}&goodsId=${minGoodsId}&qty=1&goodsString=null&source=3`;
}
console.log(linkVal, "-------90");
app.trackCpn(e, this.data.datas.componentName)
$themeToLink({ type: 1, link: linkVal });
},
toMerchants() {
toMerchants(e) {
let { orgId } = this.data.items;
app.trackCpn(e, this.data.datas.componentName)
$themeToLink({ type: 1, link: `/merchantsDetail/${orgId}` });
},
......
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