Feat(商品详情&店铺):来源模块数据埋点
This commit is contained in:
@@ -339,14 +339,41 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesInn/inn/innHome?id=' + id
|
url: '/pagesInn/inn/innHome?id=' + id + '&from=' + this.getOptionsParams()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goToGoods(productId) {
|
goToGoods(productId) {
|
||||||
if (!productId) {
|
if (!productId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$global.navToGoods(productId)
|
uni.navigateTo({
|
||||||
|
url: `/pages/shop/GoodsCon/index?id=${productId}&from=${this.getOptionsParams()}`
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getOptionsParams() {
|
||||||
|
// 0、特产;1、文玩;2、七彩云上;3、特色礼品;4、康养食材;5、千县名品;6、景点门票
|
||||||
|
let from = ''
|
||||||
|
switch(this.type) {
|
||||||
|
case 0:
|
||||||
|
from = 'techan'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
from = 'wenwan'
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
from = 'gift'
|
||||||
|
break
|
||||||
|
case 4:
|
||||||
|
from = 'wellness'
|
||||||
|
break
|
||||||
|
case 5:
|
||||||
|
from = 'famous'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
from = ''
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return from
|
||||||
},
|
},
|
||||||
bannerItemTapHandle(banner) {
|
bannerItemTapHandle(banner) {
|
||||||
if (!banner) {
|
if (!banner) {
|
||||||
|
|||||||
@@ -422,6 +422,7 @@ import cookie from "@/utils/store/cookie";
|
|||||||
import {famousGoodsShareImage, secKillGoodsShareImage} from "@/api/share";
|
import {famousGoodsShareImage, secKillGoodsShareImage} from "@/api/share";
|
||||||
import CouponsPopup from "@/components/CouponsPopup.vue"
|
import CouponsPopup from "@/components/CouponsPopup.vue"
|
||||||
import {addProduct, checkProduct, removeProduct} from "@/api/favorite";
|
import {addProduct, checkProduct, removeProduct} from "@/api/favorite";
|
||||||
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "GoodsCon",
|
name: "GoodsCon",
|
||||||
@@ -434,6 +435,7 @@ export default {
|
|||||||
ShareInfo,
|
ShareInfo,
|
||||||
CouponsPopup
|
CouponsPopup
|
||||||
},
|
},
|
||||||
|
mixins: [pageListenMixins],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
isProductInfoExpand: true, //商品信息是否展开
|
isProductInfoExpand: true, //商品信息是否展开
|
||||||
@@ -504,7 +506,8 @@ export default {
|
|||||||
// v9-2
|
// v9-2
|
||||||
show: false,
|
show: false,
|
||||||
uniqueId: null,
|
uniqueId: null,
|
||||||
isFavorite: false
|
isFavorite: false,
|
||||||
|
pageKeyId: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(["isLogin", "location", "userInfo"]),
|
computed: mapGetters(["isLogin", "location", "userInfo"]),
|
||||||
@@ -541,6 +544,49 @@ export default {
|
|||||||
console.log("getEnterOptionsSync", uni.getEnterOptionsSync());
|
console.log("getEnterOptionsSync", uni.getEnterOptionsSync());
|
||||||
uni.removeStorageSync('couponId')
|
uni.removeStorageSync('couponId')
|
||||||
|
|
||||||
|
const from = options.from
|
||||||
|
const id = options.id
|
||||||
|
switch (from) {
|
||||||
|
// 特产
|
||||||
|
case 'techan':
|
||||||
|
this.pageKeyId = `product_from_goods_productId_${id}`
|
||||||
|
break
|
||||||
|
// 地标好物
|
||||||
|
case 'landmark':
|
||||||
|
this.pageKeyId = `product_from_landmarkGoods_productId_${id}`
|
||||||
|
break
|
||||||
|
// 节日
|
||||||
|
case 'gift':
|
||||||
|
this.pageKeyId = `product_from_appContentFestival_productId_${id}`
|
||||||
|
break
|
||||||
|
// 时令尝鲜
|
||||||
|
case 'season':
|
||||||
|
this.pageKeyId = `product_from_seasonalFood_productId_${id}`
|
||||||
|
break
|
||||||
|
// 秒杀
|
||||||
|
case 'kill':
|
||||||
|
this.pageKeyId = `seckillProduct_seckillId_${options.activityId}`
|
||||||
|
break
|
||||||
|
// 文玩
|
||||||
|
case 'wenwan':
|
||||||
|
this.pageKeyId = `product_from_wenwan_productId_${id}`
|
||||||
|
break
|
||||||
|
// 非遗文化
|
||||||
|
case 'ich':
|
||||||
|
this.pageKeyId = `product_from_ich_productId_${id}`
|
||||||
|
break
|
||||||
|
// 康养食材
|
||||||
|
case 'wellness':
|
||||||
|
this.pageKeyId = `product_from_wellnessFood_productId_${id}`
|
||||||
|
break
|
||||||
|
// 千县
|
||||||
|
case 'famous':
|
||||||
|
this.pageKeyId = `product_from_countyFamous_productId_${id}`
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
let url = handleQrCode();
|
let url = handleQrCode();
|
||||||
if (url && url.productId) {
|
if (url && url.productId) {
|
||||||
this.id = url.productId;
|
this.id = url.productId;
|
||||||
|
|||||||
@@ -428,11 +428,13 @@ import {getUrlParam} from "@/utils/common.js"
|
|||||||
import imgBox from '@/components/imageTypeSet/imagebox.vue'
|
import imgBox from '@/components/imageTypeSet/imagebox.vue'
|
||||||
import cookie from "@/utils/store/cookie"
|
import cookie from "@/utils/store/cookie"
|
||||||
import {addStore, removeStore} from "@/api/favorite"
|
import {addStore, removeStore} from "@/api/favorite"
|
||||||
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
imgBox
|
imgBox
|
||||||
},
|
},
|
||||||
|
mixins: [pageListenMixins],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
@@ -469,7 +471,8 @@ export default {
|
|||||||
{ text: '商家资质', value: 3, isShow: true }
|
{ text: '商家资质', value: 3, isShow: true }
|
||||||
],
|
],
|
||||||
isLoadGoodListoSuccess: false,
|
isLoadGoodListoSuccess: false,
|
||||||
isLoadInfoListSuccess: false
|
isLoadInfoListSuccess: false,
|
||||||
|
pageKeyId: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
||||||
@@ -477,8 +480,42 @@ export default {
|
|||||||
this.scrollData = e
|
this.scrollData = e
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if (options.id) {
|
const id = options.id || ''
|
||||||
this.id = options.id || null
|
const from = options.from
|
||||||
|
switch (from) {
|
||||||
|
// 特产
|
||||||
|
case 'techan':
|
||||||
|
this.pageKeyId = `hotel_from_techan_hotelId_${id}`
|
||||||
|
break
|
||||||
|
// 千县
|
||||||
|
case 'famous':
|
||||||
|
this.pageKeyId = `hotel_from_famous_hotelId_${id}`
|
||||||
|
break
|
||||||
|
// 特色礼品
|
||||||
|
case 'gift':
|
||||||
|
this.pageKeyId = `hotel_from_gift_hotelId_${id}`
|
||||||
|
break
|
||||||
|
// 文玩
|
||||||
|
case 'wenwan':
|
||||||
|
this.pageKeyId = `hotel_from_wenwan_hotelId_${id}`
|
||||||
|
break
|
||||||
|
// 寻趣味
|
||||||
|
case 'fun':
|
||||||
|
this.pageKeyId = `hotel_from_findFun_hotelId_${id}`
|
||||||
|
break
|
||||||
|
// 养生圣地
|
||||||
|
case 'wellness':
|
||||||
|
this.pageKeyId = `hotel_from_wellnessPlace_hotelId_${id}`
|
||||||
|
break
|
||||||
|
// 民宿
|
||||||
|
case 'homestay':
|
||||||
|
this.pageKeyId = `product_from_countyFamous_productId_${id}`
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if (id) {
|
||||||
|
this.id = id || null
|
||||||
this.partnerId = options.partnerId || null
|
this.partnerId = options.partnerId || null
|
||||||
} else {
|
} else {
|
||||||
let obj = uni.getEnterOptionsSync()
|
let obj = uni.getEnterOptionsSync()
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
v-for="(item, index) in dataList"
|
v-for="(item, index) in dataList"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="item"
|
class="item"
|
||||||
@click="$global.navToGoods(item.id)"
|
@click="goodItemClick(item.id)"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
:src="item.image"
|
:src="item.image"
|
||||||
@@ -135,6 +135,14 @@ export default {
|
|||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
goodItemClick(productId) {
|
||||||
|
if (!productId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/shop/GoodsCon/index?id=${productId}&from=techan`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -36,7 +36,9 @@ export function formatContent(html) {
|
|||||||
* @returns {null}
|
* @returns {null}
|
||||||
*/
|
*/
|
||||||
export function pageToWatchShowCount(key, cb = '') {
|
export function pageToWatchShowCount(key, cb = '') {
|
||||||
console.log(Vue.prototype.$pageToWatchData)
|
if (!key) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!Vue.prototype.$pageToWatchData[key]) {
|
if (!Vue.prototype.$pageToWatchData[key]) {
|
||||||
Vue.prototype.$pageToWatchData[key] = []
|
Vue.prototype.$pageToWatchData[key] = []
|
||||||
}
|
}
|
||||||
@@ -52,6 +54,9 @@ export function pageToWatchShowCount(key, cb = '') {
|
|||||||
* @returns {null}
|
* @returns {null}
|
||||||
*/
|
*/
|
||||||
export function pageToWatchShowTimer(key, data) {
|
export function pageToWatchShowTimer(key, data) {
|
||||||
|
if (!key) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (Vue.prototype.$pageToWatchData[key]) {
|
if (Vue.prototype.$pageToWatchData[key]) {
|
||||||
Vue.prototype.$pageToWatchData[key].push(data)
|
Vue.prototype.$pageToWatchData[key].push(data)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user