li.shaoyi 4 hónapja
szülő
commit
9849655aa3
1 módosított fájl, 62 hozzáadás és 2 törlés
  1. 62 2
      src/packages/tss/views/home/main/index.vue

+ 62 - 2
src/packages/tss/views/home/main/index.vue

@@ -14,7 +14,13 @@
 
 
       <button type="button" style="border: 1px solid #000; padding: 20px; background-color: #fff;"
-        @click="trackEvent">AppsFlyer Test</button>
+        @click="trackEvent">initSDK Test</button>
+
+      <button type="button" style="border: 1px solid #000; padding: 20px; background-color: #fff;"
+        @click="registrationEvent">registration Test</button>
+
+      <button type="button" style="border: 1px solid #000; padding: 20px; background-color: #fff;"
+        @click="purchaseEvent">purchase Test</button>
 
 
       <app-block class="home-main__notice">
@@ -67,22 +73,76 @@ import Banner from '@mobile/components/base/banner/index.vue'
 import plus from '@/utils/h5plus'
 import ProductList from '../../product/list/components/waterfall-list/index.vue'
 
+
+
 const trackEvent = () => {
   plus.onPlusReady(() => {
-    const success = (args: unknown) => {
+
+    const startSDKsuccess = (args: unknown) => {
       window.alert('成功:' + JSON.stringify(args))
     }
 
+
+    const success = (args: unknown) => {
+
+      window.plus.bridge.exec('AppsFlyerExpand', 'startSDK', [startSDKcallbackID])
+
+    }
+
     const fail = (code: unknown) => {
       window.alert('失败:' + JSON.stringify(code))
     }
 
     const callbackID = window.plus.bridge.callbackId(success, fail)
 
+
+    const startSDKcallbackID = window.plus.bridge.callbackId(startSDKsuccess, fail)
+
     window.plus.bridge.exec('AppsFlyerExpand', 'initSDK', [callbackID, '123', false])
   })
 }
 
+
+
+const registrationEvent = () => {
+  plus.onPlusReady(() => {
+
+    const success = (args: unknown) => {
+      window.alert('成功:' + JSON.stringify(args))
+    }
+
+    const fail = (code: unknown) => {
+      window.alert('失败:' + JSON.stringify(code))
+    }
+
+    const callbackID = window.plus.bridge.callbackId(success, fail)
+
+    window.plus.bridge.exec('AppsFlyerExpand', 'logEvent', [callbackID, 'af_complete_registration', JSON.stringify({ af_registration_method: "Mobile" })])
+  })
+}
+
+
+
+const purchaseEvent = () => {
+  plus.onPlusReady(() => {
+
+    const success = (args: unknown) => {
+      window.alert('成功:' + JSON.stringify(args))
+    }
+
+    const fail = (code: unknown) => {
+      window.alert('失败:' + JSON.stringify(code))
+    }
+
+    const callbackID = window.plus.bridge.callbackId(success, fail)
+
+    window.plus.bridge.exec('AppsFlyerExpand', 'logEvent', [callbackID, 'af_purchase', JSON.stringify({ af_revenue: 9.99, af_currency: "USD" })])
+  })
+}
+
+
+
+
 const noticeStore = useNoticeStore()
 const goodsCollectionStore = useGoodsCollectionStore()