Эх сурвалжийг харах

Merge branch 'release' into dev4.5.5

luwenna 4 жил өмнө
parent
commit
d7ef13c956

+ 24 - 2
src/jfw/modules/app/src/web/templates/big-member/page_buy_commit.html

@@ -464,6 +464,7 @@
                 }else if(_this.grades == 2){
                     level = 1
                 }
+                var paramsMid = utils.getParam('mid') //引流语文案id
                 $.ajax({
                     type:'POST',
                     url:'/jypay/bigmember/createOrder',
@@ -474,8 +475,29 @@
                     },
                     success:function(res){
                         if( res.error_code >= 0 ){
-                            history.replaceState({}, '', '/jyapp/big/page/orderdetail_member?order_code=' + res.data.order_code);
-                            location.href = '/jyapp/pay/checkout_member?orderCode='+res.data.order_code+'&from=buy';
+                          // 判断url里是否有引导语文案id,如果有就需要埋点
+                            if (paramsMid) {
+                              try {
+                                $.ajax({
+                                  type: "POST",
+                                  url: "/publicapply/drainage/bmt/" + paramsMid,
+                                  data: {
+                                    p: 'OBT',
+                                    price: Number(_this.afterall.replace(',', ''))*100,
+                                    orderCode: res.data.order_code
+                                  },
+                                  success: function(r) {
+                                    console.log(r)
+                                  }
+                                })
+                              } catch (error) {
+                                console.log(error)
+                              }
+                            }
+                            setTimeout(function() {
+                              history.replaceState({}, '', '/jyapp/big/page/orderdetail_member?order_code=' + res.data.order_code);
+                            location.href = '/jyapp/pay/checkout_member?orderCode='+res.data.order_code+'&from=buy&mid=' + paramsMid;
+                            }, 300)
                         }else {
                             alert(res.error_msg)
                         }

+ 4 - 4
src/jfw/modules/app/src/web/templates/big-member/page_landingPage.html

@@ -567,15 +567,15 @@
                             success: function(r) {
                                 console.log(r,'rrrr')
                                 if (r.data) {
-                                    location.href = './buy_commit?meal='+ res
+                                    location.href = './buy_commit?meal='+ res + '&mid=' + utils.getParam('mid')
                                 }
                             }
                         })
                     } catch (error) {
-                        location.href = './buy_commit?meal='+ res
+                        location.href = './buy_commit?meal='+ res + '&mid=' + utils.getParam('mid')
                     }
                     } else {
-                        location.href = './buy_commit?meal='+ res
+                        location.href = './buy_commit?meal='+ res + '&mid=' + utils.getParam('mid')
                 }
             },
             linkBuy:function (res,types) {
@@ -597,7 +597,7 @@
                 this.census('免费体验')
                 // 跳转到用户收集页面
                 // location.href = '/demo-member/demo_action.html'
-                location.href = '/jyapp/frontPage/bigmember/free/perfect_info?origin=member_freeuse'
+                location.href = '/jyapp/frontPage/bigmember/free/perfect_info?origin=member_freeuse&mid=' + utils.getParam('mid')
             },
             // 咨询客服
             consult:function(){

+ 20 - 1
src/jfw/modules/app/src/web/templates/commonPay/checkout.html

@@ -309,6 +309,23 @@
                                     iconHide: true,
                                     duration: 1500,
                                     callback: function () {
+                                      // 支付成功 判断有没有引流语id,有 需要埋点
+                                      if (checkout.getUrlParam('mid')) {
+                                        try {
+                                          $.ajax({
+                                            type: "POST",
+                                            url: "/publicapply/drainage/bmt/" + checkout.getUrlParam('mid'),
+                                            data: {
+                                              p: 'Paid'
+                                            },
+                                            success: function(r) {
+                                              console.log(r)
+                                            }
+                                          })
+                                        } catch (error) {
+                                          console.log(error)
+                                        }
+                                      }
                                        var  bigmemberBid=checkout.getUrlParam("b");
                                         var href="/jyapp/{{.T.doType}}/paySuccess?orderCode=" + res.orderCode + "&email=" + res.email + "&payTime=" + res.payTime + "&pay_way=" + res.pay_way + "&price=" + res.price + "&t={{.T.t}}"
                                         if (bigmemberBid==="1"){
@@ -318,7 +335,9 @@
                                         if (docsId!=null){
                                           href +="&docsId="+docsId
                                         }
-                                        location.replace(href);
+                                        setTimeout(function() {
+                                          location.replace(href);
+                                        }, 300)
                                     }
                                 })
                             }

+ 21 - 0
src/jfw/modules/app/src/web/templates/frontRouter/bigmember/free/perfect_info.html

@@ -520,6 +520,7 @@
     },
     mounted() {
       this.ajaxGetEchoInfo()
+      this.bigDocAjax('ICRP') // 进入留资页面埋点
     },
     computed: {
       getTipStr () {
@@ -606,6 +607,25 @@
       }
     },
     methods: {
+      // 从引导语文案点击免费体验进来埋点
+      bigDocAjax: function(type) {
+        if (utils.getParam('mid')) {
+          try {
+            $.ajax({
+              type: "POST",
+              url: "/publicapply/drainage/bmt/" + utils.getParam('mid'),
+              data: {
+                p: type
+              },
+              success: function(r) {
+                console.log(r)
+              }
+            })
+          } catch (error) {
+            console.log(error)
+          }
+        }
+      },
       ajaxFn: function (url, data, callback, type) {
         return $.ajax({
           type: 'post',
@@ -867,6 +887,7 @@
         history.back()
       },
       submitForm () {
+        this.bigDocAjax('ICRW') // 提交留资埋点引导语
         this.ajaxParams.name = this.infoMap.name
         this.ajaxParams.phone = this.infoMap.phone
         this.ajaxParams.mail = this.infoMap.email

+ 14 - 1
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -976,6 +976,18 @@
             powerInt.push(3)
         }
         console.log(powerInt)
+        let u = navigator.userAgent
+        let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
+        let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+        let platform = ''
+        if (isAndroid) {
+            //这个是安卓操作系统
+            platform = 'AA'
+        }
+        if (isIOS) {
+          //这个是ios操作系统
+            platform = 'AI'
+        }
         $.ajax({
             type: 'POST',
             url: '/publicapply/drainage/behaviorLog',
@@ -984,7 +996,8 @@
             data: JSON.stringify({
                 drainageId: drainInfo.id + '',
                 bigServiceId: drainInfo.s_serviceid + '',
-                userType: powerInt.toString()
+                userType: powerInt.toString(),
+                platform: platform
             }),
             success: function(res) {
                 console.log(res)

+ 27 - 4
src/jfw/modules/publicapply/src/drainage/entity/entity.go

@@ -57,6 +57,7 @@ type DrainageUserInfo struct {
 	UserType     string `json:"userType"`     //用户类型0:普通;1:超级订阅;2:大会员;3:商机管理;(可以存在1,2)
 	BigServiceId string `json:"bigServiceId"` //大会员服务id
 	DrainageId   string `json:"drainageId"`   //引流文案id
+	Platform     string `json:"platform"`     //平台类型 P:PC;W:微信;AA:APPAndroid;AI:APPIOS
 }
 
 //
@@ -68,6 +69,10 @@ func DrainageUserLog(DUI DrainageUserInfo) string {
 		"drainage":     DUI.DrainageId,
 		"userType":     DUI.UserType,
 		"isClickBuyBT": 0, //是否点击去购买按钮
+		"isOBT":        0, //是否点击下单按钮
+		"isPaid":       0, //是否已支付
+		"isICRP":       0, //是否触发留资
+		"isICRW":       0, //是否留资
 	}
 	if id := db.Mgo_Log.Save(BidType.Cwlogcoll, cwInfo); id != "" {
 		return util.SE2.EncodeString(id)
@@ -76,10 +81,28 @@ func DrainageUserLog(DUI DrainageUserInfo) string {
 }
 
 //
-func UpdateDrainageUserLogById(id string) bool {
+func UpdateDrainageUserLogById(id, P, orderCode string, price int) bool {
+	//是否点击购买按钮
+	var set = map[string]interface{}{
+		"isClickBuyBT": 1,
+	}
+	if P != "" {
+		switch P {
+		case "OBT":
+			//是否点击下单按钮
+			set = map[string]interface{}{"isOBT": 1, "price": price, "orderCode": orderCode}
+		case "Paid":
+			//是否已支付
+			set = map[string]interface{}{"isPaid": 1}
+		case "ICRP":
+			//是否触发留资
+			set = map[string]interface{}{"isICRP": 1}
+		case "ICRW":
+			//是否留资
+			set = map[string]interface{}{"isICRW": 1}
+		}
+	}
 	return db.Mgo_Log.UpdateById(BidType.Cwlogcoll, id, map[string]interface{}{
-		"$set": map[string]interface{}{
-			"isClickBuyBT": 1,
-		},
+		"$set": set,
 	})
 }

+ 5 - 1
src/jfw/modules/publicapply/src/drainage/service/service.go

@@ -23,7 +23,11 @@ func (this *DrainageStruct) Bmbutinfo(id string) {
 		if id == "" {
 			return Result{Data: nil, Error_msg: Error_msg_1002}
 		}
-		m := UpdateDrainageUserLogById(id)
+		p := this.GetString("p")                 //买点类型
+		price, _ := this.GetInteger("price")     //下单价格
+		orderCode := this.GetString("orderCode") //订单编号
+		// log.Println(id, "---", p, "---", price, "---", orderCode, "----000")
+		m := UpdateDrainageUserLogById(id, p, orderCode, price)
 		return Result{Data: m}
 	}()
 	this.ServeJson(r)

+ 20 - 0
src/web/staticres/js/pc-collect-user-info.js

@@ -407,12 +407,32 @@ var vm = new Vue({
       this.$refs[formName].validate(function (valid) {
         if (valid) {
           _this.formAjax(_this.source)
+          _this.bigDocAjax()
         } else {
           console.log('error submit!!');
           return false;
         }
       });
     },
+    // 快照页引流的文案埋点 留资提交时埋点
+    bigDocAjax: function() {
+      if (getParam('id')) {
+        try {
+          $.ajax({
+            type: "POST",
+            url: "/publicapply/drainage/bmt/" + getParam('id'),
+            data: {
+              p: 'ICRW'
+            },
+            success: function(r) {
+              console.log(r)
+            }
+          })
+        } catch (error) {
+          console.log(error)
+        }
+      }
+    },
     // 表单提交请求
     formAjax: function(source) {
       var params = {

+ 25 - 3
src/web/templates/big-member/pc/page_buy_commit.html

@@ -506,6 +506,7 @@
             if (!loginflag) {
                 return openLoginDig()
             }
+            var paramsMid = getParam('mid')
             $.ajax({
                 type: 'POST',
                 url: '/jypay/bigmember/createOrder',
@@ -515,7 +516,26 @@
                     order_phone: OrderPhoneCheck.phone
                 },
                 success: function (res) {
-                   if (source!=null){
+                  // 判断url里是否有引导语文案id,如果有就需要埋点
+                  if (paramsMid && res.data && res.data.order_code) {
+                      try {
+                        $.ajax({
+                          type: "POST",
+                          url: "/publicapply/drainage/bmt/" + paramsMid,
+                          data: {
+                            p: 'OBT',
+                            price: getDisPrice(getParams.level, getParams.cycle)*100,
+                            orderCode: res.data.order_code
+                          },
+                          success: function(r) {
+                            console.log(r)
+                          }
+                        })
+                      } catch (error) {
+                        console.log(error)
+                      }
+                  }
+                  if (source!=null){
                       $.ajax({
                         type:'GET',
                         url:'/front/order/source',
@@ -527,8 +547,10 @@
                         }
                       })
                     }
-                    history.replaceState({"flag": "pay"}, '', '/front/member/memberDetail?order_code=' + res.data.order_code);
-                    location.href = '/front/member/orderPay/' + res.data.order_code;
+                    setTimeout(function() {
+                      history.replaceState({"flag": "pay"}, '', '/front/member/memberDetail?order_code=' + res.data.order_code);
+                      location.href = '/front/member/orderPay/' + res.data.order_code + '?mid=' + paramsMid;
+                    }, 300)
                 }
             })
         })

+ 19 - 2
src/web/templates/big-member/pc/page_index.html

@@ -1095,6 +1095,23 @@
             } catch (e) {
               console.log('未初始化百度统计')
             }
+            console.log(getParam('id'))
+            if (getParam('id')) {
+              try {
+                $.ajax({
+                  type: "POST",
+                  url: "/publicapply/drainage/bmt/" + getParam('id'),
+                  data: {
+                    p: 'ICRP' // 留资页面埋点大会员引导文案
+                  },
+                  success: function(r) {
+                    console.log(r)
+                  }
+                })
+              } catch (error) {
+                console.log(error)
+              }
+            }
             vm.dialogTitle = '请完善个人信息,立刻获得全部功能的产品试用'
             vm.isNeedSubmit('member_freeuse',function(){
               vm.showSuccess = true
@@ -1251,9 +1268,9 @@
                 // 购买过
                 location.href = '/swordfish/page_big_pc'
             } else {
-                var buy_commit_href ='/big/pc/page/buy_commit';
+                var buy_commit_href ='/big/pc/page/buy_commit?mid=' + getParam('id');
                 if(source!=null&&source!=undefined){
-                  buy_commit_href+="?source="+source;//baidusem
+                  buy_commit_href+="&source="+source;//baidusem
                 }
                 location.href = buy_commit_href;
             }

+ 24 - 2
src/web/templates/big-member/wx/page_buy_commit.html

@@ -449,6 +449,7 @@
                 }else if(_this.grades == 2){
                     level = 1
                 }
+                var paramsMid = utils.getParam('mid') //引流语文案id
                 $.ajax({
                     type:'POST',
                     url:'/jypay/bigmember/createOrder',
@@ -459,8 +460,29 @@
                     },
                     success:function(res){
                         if( res.error_code >= 0 ){
-                            history.replaceState({"flag": "pay"}, '', '/front/wxMyOrder/memberDetail/' + res.data.order_code);
-                            location.href = '/weixin/pay/checkout_member?orderCode='+res.data.order_code
+                          // 判断url里是否有引导语文案id,如果有就需要埋点
+                          if (paramsMid) {
+                              try {
+                                $.ajax({
+                                  type: "POST",
+                                  url: "/publicapply/drainage/bmt/" + paramsMid,
+                                  data: {
+                                    p: 'OBT',
+                                    price: Number(_this.afterall.replace(',', ''))*100,
+                                    orderCode: res.data.order_code
+                                  },
+                                  success: function(r) {
+                                    console.log(r)
+                                  }
+                                })
+                              } catch (error) {
+                                console.log(error)
+                              }
+                            }
+                            setTimeout(function(){
+                              history.replaceState({"flag": "pay"}, '', '/front/wxMyOrder/memberDetail/' + res.data.order_code);
+                              location.href = '/weixin/pay/checkout_member?orderCode='+res.data.order_code + '&mid=' +paramsMid;
+                            },300)
                         }else {
                             alert(res.error_msg)
                         }

+ 4 - 4
src/web/templates/big-member/wx/page_landingPage.html

@@ -547,15 +547,15 @@
                             success: function(r) {
                                 console.log(r,'rrrr')
                                 if (r.data) {
-                                    location.href = './buy_commit?meal='+ res
+                                    location.href = './buy_commit?meal='+ res + '&mid=' + utils.getParam('mid')
                                 }
                             }
                         })
                     } catch (error) {
-                        location.href = './buy_commit?meal='+ res
+                        location.href = './buy_commit?meal='+ res + '&mid=' + utils.getParam('mid')
                     }
                     } else {
-                        location.href = './buy_commit?meal='+ res
+                        location.href = './buy_commit?meal='+ res + '&mid=' + utils.getParam('mid')
                 }
             },
             linkBuy:function (res, i) {
@@ -577,7 +577,7 @@
             exper_fun:function () {
                 this.setStatistics('免费体验')
                 // location.href = '/demo-member/demo_action.html'
-                location.href = '/weixin/frontPage/bigmember/free/perfect_info?origin=member_freeuse'
+                location.href = '/weixin/frontPage/bigmember/free/perfect_info?origin=member_freeuse&mid=' + utils.getParam('mid')
             },
             // 咨询客服
             consult:function(){

+ 21 - 0
src/web/templates/frontRouter/wx/bigmember/free/perfect_info.html

@@ -530,6 +530,7 @@
     },
     mounted() {
       this.ajaxGetEchoInfo()
+      this.bigDocAjax('ICRP') // 进入留资页面埋点
     },
     computed: {
       getTipStr () {
@@ -616,6 +617,25 @@
       }
     },
     methods: {
+      // 从引导语文案点击免费体验进来埋点
+      bigDocAjax: function(type) {
+        if (utils.getParam('mid')) {
+          try {
+            $.ajax({
+              type: "POST",
+              url: "/publicapply/drainage/bmt/" + utils.getParam('mid'),
+              data: {
+                p: type
+              },
+              success: function(r) {
+                console.log(r)
+              }
+            })
+          } catch (error) {
+            console.log(error)
+          }
+        }
+      },
       ajaxFn: function (url, data, callback, type) {
         return $.ajax({
           type: 'post',
@@ -877,6 +897,7 @@
         history.back()
       },
       submitForm () {
+        this.bigDocAjax('ICRW') // 提交留资埋点引导语
         this.ajaxParams.name = this.infoMap.name
         this.ajaxParams.phone = this.infoMap.phone
         this.ajaxParams.mail = this.infoMap.email

+ 17 - 0
src/web/templates/order/pc/orderPay.html

@@ -249,6 +249,23 @@
                     }, function (r) {
                         if (r.success) {
                             var from = '' // 从那个页面过来orderList(订单列表)
+                            // 判断url里是否有引导语文案id,如果有就需要埋点
+                            if (getParam('mid')) {
+                                try {
+                                  $.ajax({
+                                    type: "POST",
+                                    url: "/publicapply/drainage/bmt/" + getParam('mid'),
+                                    data: {
+                                      p: 'Paid',
+                                    },
+                                    success: function(r) {
+                                      console.log(r)
+                                    }
+                                  })
+                                } catch (error) {
+                                  console.log(error)
+                                }
+                            }
                             try {
                                 var referer = document.referrer
                                 if (referer && referer.indexOf('/swordfish/toMyOrder') !== -1) {

+ 4 - 2
src/web/templates/pc/biddetail_rec.html

@@ -1515,7 +1515,8 @@ if (subtype != '拟建' && !isMember) {
             var params = {
               drainageId: (r.data.id).toString(),
               bigServiceId: r.data.s_serviceid,
-              userType: userType
+              userType: userType,
+              platform: 'P'
             }
             $.ajax({
               type: "POST",
@@ -1534,8 +1535,9 @@ if (subtype != '拟建' && !isMember) {
                   } else if (r.data.s_serviceid == 4) {
                     // 企业画像
                     window.open('/big/page/index?id=' + s.data +  '#fx')
+                  } else {
+                    window.open('/big/page/index?id=' + s.data +  '#' + powerMap[r.data.s_serviceid].anchor)
                   }
-                  window.open('/big/page/index?id=' + s.data +  '#' + powerMap[r.data.s_serviceid].anchor)
                 }
               }
             })       

+ 20 - 1
src/web/templates/weixin/commonPay/checkout.html

@@ -306,6 +306,23 @@
                                     iconHide: true,
                                     duration: 1500,
                                     callback: function () {
+                                      // 支付成功 判断有没有引流语id,有 需要埋点
+                                      if (checkout.getUrlParam('mid')) {
+                                        try {
+                                          $.ajax({
+                                            type: "POST",
+                                            url: "/publicapply/drainage/bmt/" + checkout.getUrlParam('mid'),
+                                            data: {
+                                              p: 'Paid'
+                                            },
+                                            success: function(r) {
+                                              console.log(r)
+                                            }
+                                          })
+                                        } catch (error) {
+                                          console.log(error)
+                                        }
+                                      }
                                         var  bigmemberBid=checkout.getUrlParam("b");
                                         var href ="/weixin/{{.T.doType}}/paySuccess?orderCode=" + res.orderCode + "&email=" + res.email + "&payTime=" + res.payTime + "&price=" + res.price + "&t={{.T.t}}"
                                         if(bigmemberBid==="1"){
@@ -315,7 +332,9 @@
                                         if (docsId!=null){
                                           href +="&docsId="+docsId
                                         }
-                                        location.replace(href);
+                                        setTimeout(function() {
+                                          location.replace(href);
+                                        }, 300)
                                     }
                                 })
                             }

+ 2 - 1
src/web/templates/weixin/wxinfocontent_rec.html

@@ -1505,7 +1505,8 @@ $('.bigvip_drain').on('click', function() {
 			data: JSON.stringify({
 					drainageId: drainInfo.id + '',
 					bigServiceId: drainInfo.s_serviceid + '',
-					userType: powerInt.toString()
+					userType: powerInt.toString(),
+					platform: 'W'
 			}),
 			success: function(res) {
 					console.log(res)