li.shaoyi 5 months ago
parent
commit
c291845c95

+ 1 - 1
src/hooks/meta-pixel/index.ts

@@ -54,7 +54,7 @@ export function useMetaPixel() {
     }
     }
 
 
     // 跟踪自定义事件
     // 跟踪自定义事件
-    const trackEvent = (eventName: 'Lead' | 'Purchase', parameters: Record<string, any> = {}) => {
+    const trackEvent = (eventName: 'CompleteRegistration' | 'Purchase', parameters: Record<string, any> = {}) => {
         if (pixelId) {
         if (pixelId) {
             if (plus.hasPlus()) {
             if (plus.hasPlus()) {
                 window.plus.bridge.exec('FacebookExpand', 'metaPixelFunction', [eventName, JSON.stringify(parameters)])
                 window.plus.bridge.exec('FacebookExpand', 'metaPixelFunction', [eventName, JSON.stringify(parameters)])

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

@@ -244,7 +244,7 @@ const formRules: { [key: string]: FieldRule[] } = {
 // 路由跳转
 // 路由跳转
 const routerAction = () => {
 const routerAction = () => {
   // 追踪注册结果
   // 追踪注册结果
-  trackEvent('Lead')
+  trackEvent('CompleteRegistration')
 
 
   if (attrs.onRouterAction) {
   if (attrs.onRouterAction) {
     emit('routerAction')
     emit('routerAction')

+ 56 - 58
src/packages/tss/views/bank/wallet/components/deposit/Index.vue

@@ -229,7 +229,7 @@ const doDepositWarning = () => {
             const e = moment(endTime.value, 'HH:mm')
             const e = moment(endTime.value, 'HH:mm')
             if (n.isSameOrAfter(s) && n.isBefore(e)) {
             if (n.isSameOrAfter(s) && n.isBefore(e)) {
                 /// 提交
                 /// 提交
-                formSubmit()
+                formSubmit(hideLoading)
             } else {
             } else {
                 dialog({
                 dialog({
                     title: t('common.tips'),
                     title: t('common.tips'),
@@ -239,8 +239,6 @@ const doDepositWarning = () => {
             }
             }
         }).catch(() => {
         }).catch(() => {
             hideLoading(t('banksign.wallet.deposit.failedtogetservertime'), 'fail')
             hideLoading(t('banksign.wallet.deposit.failedtogetservertime'), 'fail')
-        }).finally(() => {
-            hideLoading()
         })
         })
     })
     })
 }
 }
@@ -253,67 +251,67 @@ const onCopy = (status: boolean) => {
     }
     }
 }
 }
 
 
-const formSubmit = () => {
-    fullloading((hideLoading) => {
-        const obj: { [key: string]: unknown } = Object.create({})
-        configs.value.forEach((e) => {
-            if (e.value) {
-                obj[e.fieldcode] = e.value
-            }
-        })
-
-        if (channel_code.value != 'autobank') {
-            const hybrid: { [key: string]: unknown } = Object.create({})
-            // 拓展信息
-            hybrid['channel_code'] = channel_code.value
-            if (channel_code.value != 'scb') {
-                hybrid['bank_code'] = bank_code.value
-            }
-            if (channel_code.value === 'chillpay') {
-                const personinfo: { [key: string]: unknown } = Object.create({})
-                personinfo['phone_number'] = phone_number.value
-                hybrid['person_info'] = personinfo
-            }
-            obj['hybrid'] = hybrid
+const formSubmit = (hideLoading: () => void) => {
+    const obj: { [key: string]: unknown } = Object.create({})
+    configs.value.forEach((e) => {
+        if (e.value) {
+            obj[e.fieldcode] = e.value
         }
         }
-        obj['certificate_photo_url'] = certificate_photo_url.value
-
-        // 请求是否结束
-        let isComplete = false
-        const complete = () => {
-            isComplete = true
-            
-            // 追踪入金结果
-            trackEvent('Purchase', {
-                currency: formData.Currency,
-                value: formData.Amount,
-            })
+    })
 
 
-            dialog({
-                message: i18n.global.t('banksign.wallet.deposit.submitsuccess')
-            }).then(() => {
-                openComponent('inoutapply')
-            })
+    if (channel_code.value != 'autobank') {
+        const hybrid: { [key: string]: unknown } = Object.create({})
+        // 拓展信息
+        hybrid['channel_code'] = channel_code.value
+        if (channel_code.value != 'scb') {
+            hybrid['bank_code'] = bank_code.value
+        }
+        if (channel_code.value === 'chillpay') {
+            const personinfo: { [key: string]: unknown } = Object.create({})
+            personinfo['phone_number'] = phone_number.value
+            hybrid['person_info'] = personinfo
         }
         }
+        obj['hybrid'] = hybrid
+    }
+    obj['certificate_photo_url'] = certificate_photo_url.value
 
 
-        // 请求等待可能会超过30秒导致请求超时,所以2秒内没回应直接提示成功
-        const t = setTimeout(() => complete(), 2000)
-        formData.extendInfo = JSON.stringify(obj)
+    // 请求是否结束
+    let isComplete = false
+    const complete = () => {
+        isComplete = true
+        hideLoading()
 
 
-        onSubmit().then(() => {
-            if (!isComplete) {
-                complete()
-            }
-        }).catch((err) => {
-            if (!isComplete) {
-                dialog(i18n.global.t('common.submitfailure') + err).then(() => {
-                    formData.Amount = undefined
-                })
-            }
-        }).finally(() => {
-            window.clearTimeout(t)
-            hideLoading()
+        // 追踪入金结果
+        trackEvent('Purchase', {
+            currency: formData.Currency,
+            value: formData.Amount,
         })
         })
+
+        dialog({
+            message: i18n.global.t('banksign.wallet.deposit.submitsuccess')
+        }).then(() => {
+            openComponent('inoutapply')
+        })
+    }
+
+    // 请求等待可能会超过30秒导致请求超时,所以2秒内没回应直接提示成功
+    const t = setTimeout(() => complete(), 2000)
+    formData.extendInfo = JSON.stringify(obj)
+
+    onSubmit().then(() => {
+        if (!isComplete) {
+            complete()
+        }
+    }).catch((err) => {
+        hideLoading()
+
+        if (!isComplete) {
+            dialog(i18n.global.t('common.submitfailure') + err).then(() => {
+                formData.Amount = undefined
+            })
+        }
+    }).finally(() => {
+        window.clearTimeout(t)
     })
     })
 }
 }