Ver código fonte

2024061113525202添加ownertable和ownerid

xiaohaizhao 1 ano atrás
pai
commit
d47d9c211e

+ 4 - 1
cloud/businessCard/index.vue

@@ -304,7 +304,10 @@ export default {
         this.userid = params.userid;
       }
       this.getuserInfo(this.userid);
-      this.shareUserid = winTheCustomer(options.shareUserid || 0, "个人名片");
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "个人名片", {
+        ownertable: "sys_users",
+        ownerid: this.userid,
+      });
     }
   },
 };

+ 4 - 1
packageA/advertising/shareable.vue

@@ -23,7 +23,10 @@ export default {
       this.$refs.list.getDetail(this.id).then((detail) => {
         this.detail = detail;
       });
-      this.shareUserid = winTheCustomer(options.shareUserid || 0, "长图文");
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "长图文", {
+        ownertable: "sat_sharematerial",
+        ownerid: this.id,
+      });
     }
   },
   methods: {

+ 4 - 1
packageA/advertising/unshareable.vue

@@ -19,7 +19,10 @@ export default {
       this.$refs.list.getDetail(this.id).then((detail) => {
         this.detail = detail;
       });
-      this.shareUserid = winTheCustomer(options.shareUserid || 0, "长图文");
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "长图文", {
+        ownertable: "sat_sharematerial",
+        ownerid: this.id,
+      });
     }
   },
 };

+ 4 - 1
packageCase/imgs/detail.vue

@@ -152,7 +152,10 @@ export default {
     function render() {
       this.getDetail(true);
       this.scrolltolower();
-      this.shareUserid = winTheCustomer(options.shareUserid || 0, "效果图");
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "效果图", {
+        ownertable: "sat_sharematerial",
+        ownerid: this.sat_sharematerialid,
+      });
     }
   },
   methods: {

+ 4 - 1
packageCase/product/detail.vue

@@ -112,7 +112,10 @@ export default {
     this.isInitializeLogin(render.bind(this));
     function render() {
       this.getDetail(true);
-      this.shareUserid = winTheCustomer(options.shareUserid || 0, "单品");
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "单品", {
+        ownertable: "sa_fad",
+        ownerid: this.sa_fadid,
+      });
     }
   },
   methods: {

+ 4 - 1
store/budget/result.vue

@@ -50,7 +50,10 @@ export default {
       this.calculate(
         options.sa_storeid || uni.getStorageSync("shop").sa_storeid
       );
-      this.shareUserid = winTheCustomer(options.shareUserid || 0, "装修预算");
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "装修预算", {
+        ownertable: "sa_store",
+        ownerid: this.sa_storeid,
+      });
     }
   },
   methods: {

+ 4 - 1
store/lottery/shareable.vue

@@ -28,7 +28,10 @@ export default {
     this.isInitializeLogin(render.bind(this));
     function render() {
       this.getDetail();
-      this.shareUserid = winTheCustomer(options.shareUserid || 0, "活动抽奖");
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "活动抽奖", {
+        ownertable: "sa_award",
+        ownerid: this.sa_awardid,
+      });
     }
 
     uni.setNavigationBarTitle({

+ 4 - 1
store/lottery/unshareable.vue

@@ -28,7 +28,10 @@ export default {
     this.isInitializeLogin(render.bind(this));
     function render() {
       this.getDetail();
-      this.shareUserid = winTheCustomer(options.shareUserid || 0, "活动抽奖");
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "活动抽奖", {
+        ownertable: "sa_award",
+        ownerid: this.sa_awardid,
+      });
     }
 
     uni.setNavigationBarTitle({

+ 0 - 2
team/team/InviteUser.vue

@@ -80,7 +80,6 @@ import lPainterText from "../../uni_modules/lime-painter/components/l-painter-te
 import lPainterImage from "../../uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue";
 import lPainterQrcode from "../../uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue";
 import contact from "../../components/contact";
-import { winTheCustomer } from "../../utils/share";
 export default {
   components: {
     lPainter,
@@ -103,7 +102,6 @@ export default {
     this.isInitializeLogin(render.bind(this));
     function render() {
       this.getUserMsg();
-      // this.shareUserid = winTheCustomer(options.shareUserid || 0, "团队邀请");
     }
   },
   methods: {

+ 7 - 5
utils/share.js

@@ -1,4 +1,5 @@
 import Vue from 'vue'
+
 //判断进入的场景值 
 function sceneInfo(scene) {
     const sceneList = {
@@ -149,24 +150,25 @@ function sceneInfo(scene) {
         '1252': '搜一搜小程序搜索页「小功能」模块进入小程序'
     }
     let channel = sceneList[scene ? scene + '' : uni.getLaunchOptionsSync().scene + ''] || '未知';
-    console.log("channel", channel)
     return channel;
 }
 
-function winTheCustomer(shareUserid = 0, appname, scene = '') {
+function winTheCustomer(shareUserid = 0, appname, replenish = {}, scene = '') {
     if (!shareUserid) return uni.getStorageSync('userMsg').userid;
     Vue.prototype.$Http.basic({
         "id": "2024061113525202",
         "content": {
             shareuserid: shareUserid,
-            "channel": sceneInfo(scene), //渠道
-            appname //应用名称
+            channel: sceneInfo(scene), //渠道
+            appname, //应用名称
+            ...replenish
         }
     }).then(res => {
-        console.log("记录获客", res)
+        console.log(`${appname}记录获客`, res)
     })
     return shareUserid;
 }
+
 module.exports = {
     winTheCustomer
 }