li.shaoyi 5 meses atrás
pai
commit
71926207b8

+ 2 - 2
oem/tss-vi/config/appconfig.json

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.tssvi",
   "appName": "Tce Vietnam",
-  "version": "1.0.57",
-  "versionCode": "100057",
+  "version": "1.0.58",
+  "versionCode": "100058",
   "apiUrl": "http://192.168.31.210:8080/cfg?key=test_210",
   "tradeChannel": "ws",
   "showLoginAlert": true,

+ 2 - 2
oem/tss/config/appconfig.json

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.tss",
   "appName": "TCE",
-  "version": "1.0.56",
-  "versionCode": "100056",
+  "version": "1.0.57",
+  "versionCode": "100057",
   "apiUrl": "http://192.168.31.210:8080/cfg?key=test_210",
   "tradeChannel": "ws",
   "showLoginAlert": true,

+ 61 - 0
src/hooks/meta-pixel/index.ts

@@ -0,0 +1,61 @@
+import { onMounted } from 'vue'
+
+// https://developers.facebook.com/docs/meta-pixel/reference
+declare global {
+    interface Window {
+        fbq: any;
+        _fbq: any;
+    }
+}
+
+export function useMetaPixel(pixelId = '1427950378223149') {
+    // 初始化 MetaPixel
+    const initPixel = () => {
+        if (window.fbq) return
+
+        const fbq = <T>(...args: T[]) => {
+            fbq.callMethod
+                ? fbq.callMethod(...args)
+                : fbq.queue.push(args)
+        }
+
+        if (!window._fbq) {
+            window._fbq = fbq
+        }
+
+        fbq.push = fbq
+        fbq.loaded = true
+        fbq.version = '2.0'
+        fbq.queue = [] as any[]
+
+        const el = document.createElement('script')
+        el.async = true
+        el.src = 'https://connect.facebook.net/en_US/fbevents.js'
+
+        const tag = document.getElementsByTagName('script')[0]
+        tag.parentNode?.insertBefore(el, tag)
+
+        window.fbq = fbq
+        window.fbq('init', pixelId)
+    }
+
+    // 跟踪页面视图
+    const trackPageView = () => {
+        window.fbq('track', 'PageView')
+    }
+
+    // 跟踪自定义事件
+    const trackEvent = (eventName: 'Lead' | 'Purchase', parameters?: Record<string, any>) => {
+        window.fbq('track', eventName, parameters)
+    }
+
+    // 在组件挂载时初始化
+    onMounted(() => {
+        initPixel()
+        trackPageView()
+    })
+
+    return {
+        trackEvent
+    }
+}

+ 3 - 1
src/packages/mobile/views/user/register/Index.vue

@@ -78,7 +78,7 @@
 </template>
 
 <script lang="ts" setup>
-import { reactive, shallowRef, ref, computed, onMounted, useAttrs } from 'vue'
+import { reactive, shallowRef, ref, computed, onMounted, useAttrs, toRaw } from 'vue'
 import { CellGroup, Cell, Button, Field, Form, FormInstance, Checkbox, showFailToast, showToast, FieldRule, Popup, Picker, PickerConfirmEventParams, showSuccessToast } from 'vant'
 import { useCountDown } from '@vant/use'
 import { fullloading, dialog } from '@/utils/vant'
@@ -241,6 +241,8 @@ const formRules: { [key: string]: FieldRule[] } = {
 
 // 路由跳转
 const routerAction = () => {
+  emit('trackLead', toRaw(formData))
+
   if (attrs.onRouterAction) {
     emit('routerAction')
   } else {

+ 1 - 5
src/packages/tss/router/index.ts

@@ -113,13 +113,9 @@ const routes: Array<RouteRecordRaw> = [
       {
         path: 'register',
         name: 'user-register',
-        component: () => import('@mobile/views/user/register/Index.vue'),
+        component: () => import('../views/user/register/index.vue'),
         meta: {
           ignoreAuth: true,
-        },
-        props: {
-          showYhkhfxgzs: false,
-          insetStyle: false
         }
       },
       {

+ 16 - 7
src/packages/tss/views/bank/wallet/components/deposit/Index.vue

@@ -27,7 +27,7 @@
                 </template>
             </CellGroup>
             <CellGroup>
-                <Field v-if="sign.ismix === 1" :label="$t('banksign.bankchannel')" name="channel_code" is-link >
+                <Field v-if="sign.ismix === 1" :label="$t('banksign.bankchannel')" name="channel_code" is-link>
                     <template #input>
                         <app-select v-model="channel_code" :options="hybrids"
                             :optionProps="{ label: 'channel_name', value: 'channel_code' }" @confirm="onHibirdChange" />
@@ -41,14 +41,15 @@
                     :value="handleNoneValue(sign.bankname)" />
                 <Cell v-if="sign.ismix === 0" :title="$t('banksign.wallet.withdraw.bankaccountno')"
                     :value="handleNoneValue(sign.bankaccountno)" />
-                <Field v-if="sign.ismix === 1 && isShow" type="number" name="phone_number" :label="$t('banksign.mobilephone')" maxlength="30" v-model.trim="phone_number" :placeholder="$t('banksign.Pleaseenteryourmobilephonenumber')"
-                    :rules="formRules.phone_number" />
-                <Field v-if="sign.ismix === 1 && isShow" :label="$t('banksign.banktype')" name="method_type" is-link >
+                <Field v-if="sign.ismix === 1 && isShow" type="number" name="phone_number"
+                    :label="$t('banksign.mobilephone')" maxlength="30" v-model.trim="phone_number"
+                    :placeholder="$t('banksign.Pleaseenteryourmobilephonenumber')" :rules="formRules.phone_number" />
+                <Field v-if="sign.ismix === 1 && isShow" :label="$t('banksign.banktype')" name="method_type" is-link>
                     <template #input>
                         <app-select v-model="method_type" :options="methodTypes" @confirm="onMethodTypeChange" />
                     </template>
                 </Field>
-                <Field v-if="sign.ismix === 1 && isShow && channel_banks.length != 0" :label="$t('banksign.bankname1')" 
+                <Field v-if="sign.ismix === 1 && isShow && channel_banks.length != 0" :label="$t('banksign.bankname1')"
                     :placeholder="$t('banksign.Pleaseselectyourbank')" name="bank_code" v-model="hyBankName"
                     @click-input="showSelect = true" :rules="formRules.hyBankName" is-link />
             </CellGroup>
@@ -100,16 +101,18 @@
 import { shallowRef, ref, defineAsyncComponent, onMounted, computed } from 'vue'
 import { Form, Field, Cell, CellGroup, Button, FieldRule, FormInstance, RadioGroup, Radio, showToast, showFailToast } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
-import { currencyFormat } from '@/filters'
+import { currencyFormat, handleNoneValue } from '@/filters'
 import { useDoDeposit, useDoCusBankExtendConfigs, getMethodTypeKeys, useHybridConfigs } from '@/business/bank'
 import { getServerTime } from '@/services/api/common'
 import { useUserStore, useAccountStore, i18n } from '@/stores'
 import { useComponent } from '@/hooks/component'
-import { handleNoneValue } from '@/filters'
+import { useMetaPixel } from '@/hooks/meta-pixel'
 import Stepper from '@mobile/components/base/stepper/index.vue'
 import AppSelect from '@mobile/components/base/select/index.vue'
 import moment from 'moment'
 
+const { trackEvent } = useMetaPixel()
+
 const formRef = shallowRef<FormInstance>()
 const { formData, onSubmit, sign } = useDoDeposit()
 const { hybrids, channel_code, bank_code, method_type, method_types, channel_banks } = useHybridConfigs(0)
@@ -291,6 +294,12 @@ const formSubmit = () => {
         formData.extendInfo = JSON.stringify(obj)
 
         onSubmit().then(() => {
+            // 追踪入金结果
+            trackEvent('Purchase', {
+                currency: formData.Currency,
+                value: formData.Amount,
+            })
+
             if (!isComplete) {
                 complete()
             }

+ 6 - 6
src/packages/tss/views/bank/wallet/components/inoutapply/Index.vue

@@ -45,12 +45,12 @@
             <div style="display: flex;flex-direction: column;align-items: center;padding-bottom: 100px;"
                 v-if="selectedItem">
                 <app-qrcode :text="selectedItem.url" :width="240" :margin="3" />
-                <span style="color: #999;" v-if="selectedItem.bankcode === 'wechat'">{{
-                    t('banksign.wallet.inoutapply.wechat')
-                }}</span>
-                <span style="color: #999;" v-if="selectedItem.bankcode === 'alipay'">{{
-                    t('banksign.wallet.inoutapply.alipay')
-                }}</span>
+                <span style="color: #999;" v-if="selectedItem.bankcode === 'wechat'">
+                    {{ t('banksign.wallet.inoutapply.wechat') }}
+                </span>
+                <span style="color: #999;" v-if="selectedItem.bankcode === 'alipay'">
+                    {{ t('banksign.wallet.inoutapply.alipay') }}
+                </span>
             </div>
         </ActionSheet>
     </app-modal>

+ 17 - 0
src/packages/tss/views/user/register/index.vue

@@ -0,0 +1,17 @@
+<template>
+    <register-view :show-yhkhfxgzs="false" :inset-style="false" @track-lead="trackLead" />
+</template>
+
+<script lang="ts" setup>
+import { useMetaPixel } from '@/hooks/meta-pixel'
+import RegisterView from '@mobile/views/user/register/Index.vue'
+
+const { trackEvent } = useMetaPixel()
+
+// 追踪注册结果
+const trackLead = (formData: Model.RegisterReq) => {
+    trackEvent('Lead', {
+        content_name: formData.mobilephone
+    })
+}
+</script>