li.shaoyi пре 4 месеци
родитељ
комит
79cea67632

+ 28 - 16
src/hooks/appsflyer/index.ts

@@ -21,24 +21,36 @@ export const useAppsFlyer = (() => {
                 reject(err)
             }
 
-            if (plus.hasPlus()) {
-                const initSuccess = () => {
-                    window.plus.bridge.exec('AppsFlyerExpand', 'startSDK', [startCallbackID])
-                }
+            switch (plus.getSystemInfo('os')) {
+                case 'Android': {
+                    const initSuccess = () => {
+                        window.plus.bridge.exec('AppsFlyerExpand', 'startSDK', [startCallbackID])
+                    }
 
-                const initCallbackID = window.plus.bridge.callbackId(initSuccess, fail)
-                const startCallbackID = window.plus.bridge.callbackId(startSuccess, fail)
+                    const initCallbackID = window.plus.bridge.callbackId(initSuccess, fail)
+                    const startCallbackID = window.plus.bridge.callbackId(startSuccess, fail)
 
-                window.plus.bridge.exec('AppsFlyerExpand', 'initSDK', [initCallbackID, appsFlyerKey, false])
-            } else {
-                // appsFlyer.initSdk({
-                //     devKey: appsFlyerKey,
-                //     //appId: appsFlyerId
-                // }).then((res) => {
-                //     startSuccess(res)
-                // }).catch((err) => {
-                //     fail(err)
-                // })
+                    window.plus.bridge.exec('AppsFlyerExpand', 'initSDK', [initCallbackID, appsFlyerKey, false])
+                    break
+                }
+                case 'iOS': {
+                    resolve({
+                        status: 'success',
+                        action: 'initialized',
+                        message: 'SDK initialized successfully'
+                    })
+                    break
+                }
+                default: {
+                    // appsFlyer.initSdk({
+                    //     devKey: appsFlyerKey,
+                    //     //appId: appsFlyerId
+                    // }).then((res) => {
+                    //     startSuccess(res)
+                    // }).catch((err) => {
+                    //     fail(err)
+                    // })
+                }
             }
         } else {
             reject()

+ 7 - 3
src/packages/mobile/components/base/waterfall/flex/index.vue

@@ -4,7 +4,7 @@
         <template v-for="(data, i) in state.columns" :key="i">
             <div class="app-waterfall__column" :style="i > 0 ? columnStyles : {}">
                 <template v-for="(item, n) in data" :key="n">
-                    <div class="app-waterfall__column-item">
+                    <div class="app-waterfall__column-item" :style="n > 0 ? itemStyles : {}">
                         <slot :item="item">{{ item }}</slot>
                     </div>
                 </template>
@@ -14,7 +14,7 @@
 </template>
 
 <script lang="ts" setup>
-import { reactive, shallowRef, computed, watch, onMounted, onActivated, onDeactivated } from 'vue'
+import { reactive, shallowRef, computed, watch, onMounted, onActivated, onDeactivated, CSSProperties } from 'vue'
 
 const props = defineProps({
     //数据列表
@@ -43,10 +43,14 @@ const state = reactive({
     isDeactivated: false
 })
 
-const columnStyles = computed(() => ({
+const columnStyles = computed<CSSProperties>(() => ({
     marginLeft: `${props.gap}px`
 }))
 
+const itemStyles = computed<CSSProperties>(() => ({
+    marginTop: `${props.gap}px`
+}))
+
 const render = async () => {
     // 增量按需更新
     if (props.dataList.length > state.renderedItemCount) {

+ 1 - 1
src/packages/tss/views/product/list/components/waterfall-list/index.vue

@@ -25,7 +25,7 @@ import { useNavigation } from '@mobile/router/navigation'
 import { BuyOrSell, BuildType } from '@/constants/order'
 import { queryTouristGoods, queryTouristQuoteDay } from '@/services/api/goods'
 import { useLoginStore, useFuturesStore } from '@/stores'
-import Waterfall from '@mobile/components/base/waterfall/index.vue'
+import Waterfall from '@mobile/components/base/waterfall/flex/index.vue'
 import _ from 'lodash'
 
 defineProps({