Pārlūkot izejas kodu

feat: 三端大会员购买、下单、支付、留资埋点引导语

yangfeng 4 gadi atpakaļ
vecāks
revīzija
852339d386

+ 21 - 1
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,27 @@
                     },
                     success:function(res){
                         if( res.error_code >= 0 ){
+                          // 判断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)
+                              }
+                            }
                             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';
+                            location.href = '/jyapp/pay/checkout_member?orderCode='+res.data.order_code+'&from=buy&mid=' + paramsMid;
                         }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(){

+ 17 - 0
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"){

+ 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

+ 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 = {

+ 22 - 2
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',
@@ -528,7 +548,7 @@
                       })
                     }
                     history.replaceState({"flag": "pay"}, '', '/front/member/memberDetail?order_code=' + res.data.order_code);
-                    location.href = '/front/member/orderPay/' + res.data.order_code;
+                    location.href = '/front/member/orderPay/' + res.data.order_code + '?mid=' + paramsMid;
                 }
             })
         })

+ 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;
             }

+ 21 - 1
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,27 @@
                     },
                     success:function(res){
                         if( res.error_code >= 0 ){
+                          // 判断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)
+                              }
+                            }
                             history.replaceState({"flag": "pay"}, '', '/front/wxMyOrder/memberDetail/' + res.data.order_code);
-                            location.href = '/weixin/pay/checkout_member?orderCode='+res.data.order_code
+                            location.href = '/weixin/pay/checkout_member?orderCode='+res.data.order_code + '&mid=' +paramsMid;
                         }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

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

@@ -249,6 +249,25 @@
                     }, 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',
+                                      price: price*100,
+                                      orderCode: orderCode
+                                    },
+                                    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)
                 }
               }
             })       

+ 17 - 0
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"){