zhengjinyi 3 лет назад
Родитель
Сommit
c899f32192

+ 30 - 7
components/cm-module/cart-components/index.vue

@@ -1425,11 +1425,26 @@ export default {
 					console.log('获取优惠券列表失败')
 				})
 		},
-		toPayCoupon(coupon){// 点击购买优惠券
+		toPayCoupon(coupon){
+			// 点击购买优惠券,友盟埋点收集购买优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_cartCouponBuy', {
+					Um_Key_PageName: '机构购物车',
+					Um_Key_EvenName: '购买优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			this.MiniWxPayFor(coupon)
 		},
 		receiveCoupon(coupon) {
-			// 点击优惠券领取按钮
+			// 点击优惠券领取按钮,友盟埋点收集领取优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_cartCouponReceive', {
+					Um_Key_PageName: '机构购物车',
+					Um_Key_EvenName: '领取优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			this.ProductService.ReceiveCoupon({
 				userId: this.couponParam.userId,
 				couponId: coupon.couponId,
@@ -1460,11 +1475,11 @@ export default {
 			.then(response => {
 				// 友盟埋点收集微信支付
 				if (process.env.NODE_ENV != 'development') {
-					this.$uma.trackEvent('Um_Event_ConfirmWechatPay', {
-						Um_Key_PageName: '微信支付',
-						Um_Key_SourcePage: '线上支付',
-						Um_Key_PayName: `${this.buttonText}`,
-						Um_Key_PayOrderID: `${this.orderId}`
+					this.$uma.trackEvent('Um_Event_cartCouponPay', {
+						Um_Key_PageName: '机构购物车',
+						Um_Key_SourcePage: '线上支付优惠券',
+						Um_Key_CouponId: `${coupon.couponId}`,
+						Um_Key_userId: `${this.userId}`
 					})
 				}
 				let PayInfo = JSON.parse(response.data.data.payInfo)
@@ -1497,6 +1512,14 @@ export default {
 			// 显示popup弹窗
 			switch (index) {
 				case 0:
+					// 友盟埋点收集领券按钮
+					if (process.env.NODE_ENV != 'development') {
+						this.$uma.trackEvent('Um_Event_cartCouponButton', {
+							Um_Key_PageName: '机构购物车',
+							Um_Key_EvenName: '点击领券按钮',
+							Um_Key_userId: `${this.userId}`,
+						})
+					}
 					this.currentTab = 0
 					this.couponParam.status = 1
 					this.couponParam.shopId = shop.shopId

+ 8 - 1
components/cm-module/homeIndex/coupon.vue

@@ -9,7 +9,7 @@
 <script>
 	import { mapState,mapMutations } from 'vuex'
 	export default{
-		name:"navbars",
+		name:'navbars',
 		data() {
 			return{
 				
@@ -23,6 +23,13 @@
 		},
 		methods:{
 			navigator(url){
+				// 友盟埋点收集首页优惠券宣传图点击
+				if (process.env.NODE_ENV != 'development') {
+					this.$uma.trackEvent('Um_Event_homeCouponBannerClick', {
+						Um_Key_PageName: '采美商城首页',
+						Um_Key_SourcePage: '首页优惠券宣传图',
+					})
+				}
 				this.$api.navigateTo(url)
 			},
 		}

+ 21 - 7
pages/goods/product.vue

@@ -970,11 +970,25 @@ export default {
 				})
 		},
 		toPayCoupon(coupon) {
-			// 点击购买优惠券
+			// 点击购买优惠券,友盟埋点收集购买优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_productCouponBuy', {
+					Um_Key_PageName: '商品详情',
+					Um_Key_EvenName: '购买优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			this.MiniWxPayFor(coupon)
 		},
 		receiveCoupon(coupon) {
-			// 点击优惠券领取按钮
+			// 点击优惠券领取按钮,友盟埋点收集领取优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_productCouponReceive', {
+					Um_Key_PageName: '商品详情',
+					Um_Key_EvenName: '领取优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			this.ProductService.ReceiveCoupon({
 				userId: this.couponParam.userId,
 				couponId: coupon.couponId,
@@ -1005,11 +1019,11 @@ export default {
 			.then(response => {
 				// 友盟埋点收集微信支付
 				if (process.env.NODE_ENV != 'development') {
-					this.$uma.trackEvent('Um_Event_ConfirmWechatPay', {
-						Um_Key_PageName: '微信支付',
-						Um_Key_SourcePage: '线上支付',
-						Um_Key_PayName: `${this.buttonText}`,
-						Um_Key_PayOrderID: `${this.orderId}`
+					this.$uma.trackEvent('Um_Event_productCouponPay', {
+						Um_Key_PageName: '商品详情',
+						Um_Key_SourcePage: '线上支付优惠券',
+						Um_Key_CouponId: `${coupon.couponId}`,
+						Um_Key_userId: `${this.userId}`
 					})
 				}
 				let PayInfo = JSON.parse(response.data.data.payInfo)

+ 29 - 9
pages/user/coupon/coupon-activity.vue

@@ -218,7 +218,14 @@ export default {
 				})
 		},
 		toPayCoupon(coupon) {
-			// 点击购买优惠券
+			// 点击购买优惠券,友盟埋点收集购买优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_meibohuiCouponBuy', {
+					Um_Key_PageName: '美博会优惠券活动页',
+					Um_Key_EvenName: '购买优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			if (this.hasLogin) {
 				if (this.userIdentity === 1 || this.userIdentity === 3) {
 					this.$util.msg('您的身份暂不支持领取优惠券', 2000)
@@ -230,7 +237,14 @@ export default {
 			}
 		},
 		receiveCoupon(coupon) {
-			// 点击优惠券领取按钮
+			// 点击优惠券领取按钮,友盟埋点收集领取优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_meibohuiCouponReceive', {
+					Um_Key_PageName: '美博会优惠券活动页',
+					Um_Key_EvenName: '领取优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			if (this.hasLogin) {
 				if (this.userIdentity === 1 || this.userIdentity === 3) {
 					this.$util.msg('您的身份暂不支持领取优惠券', 2000)
@@ -261,8 +275,14 @@ export default {
 			}
 		},
 		toUseCoupon(coupon) {
-			// 去使用跳转路径
-			console.log('coupon', coupon)
+			// 去使用跳转路径,友盟埋点收集去使用优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_meibohuiCouponToUseCoupon', {
+					Um_Key_PageName: '美博会优惠券活动页',
+					Um_Key_EvenName: '使用优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			switch (coupon.couponType) {
 				case 0: // 活动券:跳转到商城首页 / 或者活动页(看是否指定了商品)
 					if (coupon.productType == 1) {
@@ -297,11 +317,11 @@ export default {
 				.then(response => {
 					// 友盟埋点收集微信支付
 					if (process.env.NODE_ENV != 'development') {
-						this.$uma.trackEvent('Um_Event_ConfirmWechatPay', {
-							Um_Key_PageName: '微信支付',
-							Um_Key_SourcePage: '线上支付',
-							Um_Key_PayName: `${this.buttonText}`,
-							Um_Key_PayOrderID: `${this.orderId}`
+						this.$uma.trackEvent('Um_Event_meibohuiCouponPay', {
+							Um_Key_PageName: '美博会优惠券活动页',
+							Um_Key_SourcePage: '线上支付优惠券',
+							Um_Key_CouponId: `${coupon.couponId}`,
+							Um_Key_userId: `${this.userId}`
 						})
 					}
 					let PayInfo = JSON.parse(response.data.data.payInfo)

+ 29 - 9
pages/user/coupon/coupon-collection.vue

@@ -205,7 +205,14 @@ export default {
 				})
 		},
 		toPayCoupon(coupon) {
-			// 点击购买优惠券
+			// 点击购买优惠券,友盟埋点收集购买优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_userCouponCollectionBuy', {
+					Um_Key_PageName: '领券中心',
+					Um_Key_EvenName: '购买优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			if (this.hasLogin) {
 				if (this.userIdentity === 1 || this.userIdentity === 3) {
 					this.$util.msg('您的身份暂不支持领取优惠券', 2000)
@@ -217,7 +224,14 @@ export default {
 			}
 		},
 		receiveCoupon(coupon) {
-			// 点击优惠券领取按钮
+			// 点击优惠券领取按钮,友盟埋点收集领取优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_userCouponCollectionReceive', {
+					Um_Key_PageName: '领券中心',
+					Um_Key_EvenName: '领取优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			if (this.hasLogin) {
 				if (this.isReceiveLoading) {
 					return
@@ -244,8 +258,14 @@ export default {
 			}
 		},
 		toUseCoupon(coupon) {
-			// 去使用跳转路径
-			console.log('coupon', coupon)
+			// 去使用跳转路径,友盟埋点收集去使用优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_userCouponCollectionToUseCoupon', {
+					Um_Key_PageName: '领券中心',
+					Um_Key_EvenName: '使用优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			switch (coupon.couponType) {
 				case 0: // 活动券:跳转到商城首页 / 或者活动页(看是否指定了商品)
 					if (coupon.productType == 1) {
@@ -280,11 +300,11 @@ export default {
 				.then(response => {
 					// 友盟埋点收集微信支付
 					if (process.env.NODE_ENV != 'development') {
-						this.$uma.trackEvent('Um_Event_ConfirmWechatPay', {
-							Um_Key_PageName: '微信支付',
-							Um_Key_SourcePage: '线上支付',
-							Um_Key_PayName: `${this.buttonText}`,
-							Um_Key_PayOrderID: `${this.orderId}`
+						this.$uma.trackEvent('Um_Event_userCouponCollectionPay', {
+							Um_Key_PageName: '领券中心',
+							Um_Key_SourcePage: '线上支付优惠券',
+							Um_Key_CouponId: `${coupon.couponId}`,
+							Um_Key_userId: `${this.userId}`
 						})
 					}
 					let PayInfo = JSON.parse(response.data.data.payInfo)

+ 8 - 2
pages/user/coupon/coupon.vue

@@ -249,8 +249,14 @@ export default {
 				})
 		},
 		toUseCoupon(coupon) {
-			// 去使用跳转路径
-			console.log('coupon', coupon)
+			// 去使用跳转路径,友盟埋点收集去使用优惠券
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_userCouponToUseCoupon', {
+					Um_Key_PageName: '机构优惠券列表',
+					Um_Key_EvenName: '使用优惠券',
+					Um_Key_CouponId: `${coupon.couponId}`,
+				})
+			}
 			switch (coupon.couponType) {
 				case 0: // 活动券:跳转到商城首页 / 或者活动页(看是否指定了商品)
 					if (coupon.productType == 1) {