Quellcode durchsuchen

2025年10月15日basic更新:
1、新增windowHelper类,可以在其初始化后任意位置获取到WindowStage实例.
2、新增tk广告聚合.
3、contextHelper新增oldContext,以应对某些只能使用getContext()的过时方法.
4、新增YTObjectUtils工具类,使用ts绕过ets限制,使操作对象更加简便,当前为测试版,会不定时更新.
5、新增Singleton抽象类,其子类均为单例,简化了定义单例的步骤.

wangcy vor 3 Wochen
Ursprung
Commit
aaa9c3c388
51 geänderte Dateien mit 1323 neuen und 476 gelöschten Zeilen
  1. 37 23
      commons/basic/Index.ets
  2. 10 0
      commons/basic/build-profile.json5
  3. 9 1
      commons/basic/oh-package.json5
  4. 0 0
      commons/basic/src/main/ets/ads/jhAd/BannerAd.ets
  5. 2 2
      commons/basic/src/main/ets/ads/jhAd/RewardAd.ets
  6. 2 2
      commons/basic/src/main/ets/ads/jhAd/StartAd.ets
  7. 47 0
      commons/basic/src/main/ets/ads/tkAd/components/TkBannerAdComp.ets
  8. 20 0
      commons/basic/src/main/ets/ads/tkAd/components/TkNativeAdComp.ets
  9. 45 0
      commons/basic/src/main/ets/ads/tkAd/components/TkStartAdComp.ets
  10. 56 0
      commons/basic/src/main/ets/ads/tkAd/utils/TkAdHelper.ets
  11. 41 0
      commons/basic/src/main/ets/ads/tkAd/utils/TkBannerAd.ets
  12. 54 0
      commons/basic/src/main/ets/ads/tkAd/utils/TkInterstitialAd.ets
  13. 67 0
      commons/basic/src/main/ets/ads/tkAd/utils/TkNativeAd.ets
  14. 90 0
      commons/basic/src/main/ets/ads/tkAd/utils/TkRewardAd.ets
  15. 76 0
      commons/basic/src/main/ets/ads/tkAd/utils/TkStartAd.ets
  16. 1 1
      commons/basic/src/main/ets/apis/YTRequest.ets
  17. 3 3
      commons/basic/src/main/ets/apis/YTUserRequest.ets
  18. 1 1
      commons/basic/src/main/ets/components/adComp/ShowBannerAd.ets
  19. 1 1
      commons/basic/src/main/ets/components/adComp/ShowJHRewardAd.ets
  20. 1 1
      commons/basic/src/main/ets/components/generalComp/AgreePrivacy.ets
  21. 1 1
      commons/basic/src/main/ets/components/generalComp/ChatList.ets
  22. 4 4
      commons/basic/src/main/ets/components/generalComp/TextSelect.ets
  23. 2 2
      commons/basic/src/main/ets/components/generalComp/YTHeader.ets
  24. 181 167
      commons/basic/src/main/ets/components/generalComp/YtProgressComp.ets
  25. 50 0
      commons/basic/src/main/ets/components/toastBuilders/AgreePrivacy.ets
  26. 107 0
      commons/basic/src/main/ets/components/toastBuilders/AlertToastComp.ets
  27. 45 0
      commons/basic/src/main/ets/components/toastBuilders/LoginToUse.ets
  28. 54 0
      commons/basic/src/main/ets/components/toastBuilders/YtDoubleConfirm.ets
  29. 30 31
      commons/basic/src/main/ets/datepicker/WheelPicker.ets
  30. 155 157
      commons/basic/src/main/ets/datepicker/YTDataPickerSelector.ets
  31. 1 1
      commons/basic/src/main/ets/models/LoginCollect.ets
  32. 2 0
      commons/basic/src/main/ets/models/UserInfo.ets
  33. 1 2
      commons/basic/src/main/ets/rdb/utils/RelationalStoreUtis.ts
  34. 3 3
      commons/basic/src/main/ets/styles/AttributeModifier.ets
  35. 1 1
      commons/basic/src/main/ets/utils/arkts/wechat/WXApiWrap.ets
  36. 37 23
      features/feature/src/main/ets/view/MainView.ets
  37. 9 7
      features/feature/src/main/ets/view/ThirdView.ets
  38. 1 0
      features/user/src/main/ets/views/RegisterOrResetPassView.ets
  39. BIN
      libs/GDTUnionSDK-default-release.har
  40. BIN
      libs/KSAdSDK-3.0.5.har
  41. BIN
      libs/anythink_network_csj.har
  42. BIN
      libs/anythink_network_gdt.har
  43. BIN
      libs/anythink_network_huawei.har
  44. BIN
      libs/anythink_network_ks.har
  45. BIN
      libs/anythink_sdk.har
  46. BIN
      libs/openadsdk.har
  47. 9 1
      oh-package.json5
  48. 11 1
      products/entry/src/main/ets/entryability/EntryAbility.ets
  49. 53 40
      products/entry/src/main/ets/pages/Index.ets
  50. 3 0
      products/entry/src/main/module.json5
  51. BIN
      sign/聊天恋爱宝调试证书.p7b

+ 37 - 23
commons/basic/Index.ets

@@ -1,5 +1,19 @@
 export { YtProgressComp } from './src/main/ets/components/generalComp/YtProgressComp'
 
+
+export { TkBannerAdComp } from './src/main/ets/ads/tkAd/components/TkBannerAdComp'
+
+export { TkStartAdComp } from './src/main/ets/ads/tkAd/components/TkStartAdComp'
+
+export { ATSplashAd } from 'anythink_sdk'
+
+export { tkStartAd, TkStartAd } from './src/main/ets/ads/tkAd/utils/TkStartAd'
+
+export { BuildATSplashAdView } from 'anythink_sdk'
+
+
+export { windowHelper } from './src/main/ets/utils/arkts/utils/WindowHelper'
+
 export { Pet } from './src/main/ets/rdb/tables/Pet'
 
 export { RDBMapper } from './src/main/ets/rdb/utils/RDBMapper'
@@ -8,13 +22,13 @@ export { RelationalStoreUtils } from './src/main/ets/rdb/utils/RelationalStoreUt
 
 export { Test } from './src/main/ets/rdb/tables/Test'
 
-export { registerFontUtil } from './src/main/ets/utils/RegisterFontUtil'
+export { registerFontUtil } from './src/main/ets/utils/arkts/utils/RegisterFontUtil'
 
-export { RouterPage } from './src/main/ets/ts'
+export { RouterPage } from './src/main/ets/utils/ts/decorators'
 
-export { YTToast } from './src/main/ets/utils/YTToast'
+export { YTToast } from './src/main/ets/utils/arkts/utils/YTToast'
 
-export { ContextHelper } from './src/main/ets/utils/ContextHelper'
+export { ContextHelper } from './src/main/ets/utils/arkts/utils/ContextHelper'
 
 export { YTSwiper } from './src/main/ets/components/generalComp/YTSwiper'
 
@@ -24,23 +38,23 @@ export { TextSelect } from './src/main/ets/components/generalComp/TextSelect'
 
 export { DropDownImageInfo, DropDownInfo, TextInfo, TextInputInfo } from './src/main/ets/models/TextSelectModel'
 
-export { pushMessageUtil } from './src/main/ets/utils/NoticeUtil'
+export { pushMessageUtil } from './src/main/ets/utils/arkts/utils/NoticeUtil'
 
-export { yTPreferences } from './src/main/ets/utils/YTPreferencesUtil'
+export { yTPreferences } from './src/main/ets/utils/arkts/utils/YTPreferencesUtil'
 
-export { yTToast } from './src/main/ets/utils/YTToast'
+export { yTToast } from './src/main/ets/utils/arkts/utils/YTToast'
 
 export { PanGrid } from './src/main/ets/components/generalComp/PanGrid'
 
-export { YTPhotoHelper } from './src/main/ets/utils/YTPhotoHelper'
+export { YTPhotoHelper } from './src/main/ets/utils/arkts/utils/YTPhotoHelper'
 
 export { YTUserRequest } from './src/main/ets/apis/YTUserRequest'
 
-export { ScanCodeUtil } from './src/main/ets/utils/ScanCodeUtil'
+export { ScanCodeUtil } from './src/main/ets/utils/arkts/utils/ScanCodeUtil'
 
-export { yTBindSheet } from './src/main/ets/utils/YTBindSheet'
+export { yTBindSheet } from './src/main/ets/utils/arkts/utils/YTBindSheet'
 
-export { YTDate } from './src/main/ets/utils/YTDate'
+export { YTDate } from './src/main/ets/utils/arkts/utils/YTDate'
 
 export * from './src/main/ets/constants'
 
@@ -48,29 +62,29 @@ export * from '@ibestservices/ibest-ui'
 
 export { reviseImgHeaderBuilder } from './src/main/ets/components/generalComp/ReviseImgHeaderBuilder'
 
-export { copyText } from './src/main/ets/utils/CopyText'
+export { copyText } from './src/main/ets/utils/arkts/utils/CopyText'
 
 export { Log as YTLog } from '@abner/log'
 
-export { YtDebounce } from "./src/main/ets/utils/DebounceLoad"
+export { YtDebounce } from "./src/main/ets/utils/arkts/utils/DebounceLoad"
 
 export { ShowBannerAd } from "./src/main/ets/components/adComp/ShowBannerAd"
 
-export { BannerAd } from "./src/main/ets/ads/BannerAd"
+export { BannerAd } from "./src/main/ets/ads/jhAd/BannerAd"
 
 
 export { ShowJHRewardAd } from "./src/main/ets/components/adComp/ShowJHRewardAd"
 
-export { jHStartAd } from "./src/main/ets/ads/StartAd"
+export { jHStartAd } from "./src/main/ets/ads/jhAd/StartAd"
 
 export { AdStatus } from "./src/main/ets/constants"
 
-export { permissionController } from "./src/main/ets/utils/PermissionControl"
+export { permissionController } from "./src/main/ets/utils/arkts/utils/PermissionControl"
 
 export { YTRequest } from "./src/main/ets/apis/YTRequest"
 
 
-export { HuaweiAuthPlugin } from "./src/main/ets/utils/HuaWeiAuthPlugin"
+export { HuaweiAuthPlugin } from "./src/main/ets/utils/arkts/utils/HuaWeiAuthPlugin"
 
 export { userInfo, UserInfo } from "./src/main/ets/models/UserInfo"
 
@@ -79,26 +93,26 @@ export { YTButton } from "./src/main/ets/components/generalComp/YTButton"
 
 export { YTHeader } from "./src/main/ets/components/generalComp/YTHeader"
 
-export { YTAvoid } from "./src/main/ets/utils/YTAvoid"
+export { YTAvoid } from "./src/main/ets/utils/arkts/utils/YTAvoid"
 
-export { yTRouter } from "./src/main/ets/utils/YTRouter"
+export { yTRouter } from "./src/main/ets/utils/arkts/utils/YTRouter"
 
-export * from "./src/main/ets/utils/YTBreakPoint"
+export * from "./src/main/ets/utils/arkts/utils/YTBreakPoint"
 
 export { BasicType } from './src/main/ets/models/index'
 
 export { YTAddressSelectorDialog, DateOption } from './src/main/ets//datepicker/YTDataPickerSelector'
 
 
-export { YTDateUtil, DateFormat } from './src/main/ets/utils/YTDateUtil'
+export { YTDateUtil, DateFormat } from './src/main/ets/utils/arkts/utils/YTDateUtil'
 
-export { ytOaidUtils } from './src/main/ets/utils/YtOaidUtils'
+export { ytOaidUtils } from './src/main/ets/utils/arkts/utils/YtOaidUtils'
 
 export * from '@mumu/crop'
 
 export * from './src/main/ets/models'
 
-export { YTCalendarPicker } from './src/main/ets/components/generalComp/YTCalendarPicker.ets'
+
 
 
 

+ 10 - 0
commons/basic/build-profile.json5

@@ -1,6 +1,16 @@
 {
   "apiType": "stageMode",
   "buildOption": {
+    "arkOptions": {
+      "runtimeOnly": {
+        "packages": [
+          "anythink_network_ks",
+          "anythink_network_csj",
+          "anythink_network_gdt",
+          "anythink_network_huawei"
+        ]
+      }
+    }
   },
   "buildOptionSet": [
     {

+ 9 - 1
commons/basic/oh-package.json5

@@ -12,7 +12,15 @@
     "@ibestservices/ibest-ui": "2.0.6",
     "@tencent/wechat_open_sdk": "^1.0.0",
     "lunar": "^1.0.0",
-    "@mumu/crop": "^1.0.3"
+    "@mumu/crop": "^1.0.3",
+    "ksadsdk": "file:../../libs/KSAdSDK-3.0.5.har",
+    '@csj/openadsdk': "file:../../libs/openadsdk.har",
+    '@gdt/gdt-union-sdk': "file:../../libs/GDTUnionSDK-default-release.har",
+    'anythink_sdk': "file:../../libs/anythink_sdk.har",
+    'anythink_network_ks': "file:../../libs/anythink_network_ks.har",
+    'anythink_network_csj': "file:../../libs/anythink_network_csj.har",
+    'anythink_network_gdt': "file:../../libs/anythink_network_gdt.har",
+    'anythink_network_huawei': "file:../../libs/anythink_network_huawei.har"
   },
   "devDependencies": {},
   "dynamicDependencies": {},

+ 0 - 0
commons/basic/src/main/ets/ads/BannerAd.ets → commons/basic/src/main/ets/ads/jhAd/BannerAd.ets


+ 2 - 2
commons/basic/src/main/ets/ads/RewardAd.ets → commons/basic/src/main/ets/ads/jhAd/RewardAd.ets

@@ -2,8 +2,8 @@ import { advertising } from '@kit.AdsKit';
 import { common } from '@kit.AbilityKit';
 import { hilog } from '@kit.PerformanceAnalysisKit';
 import { BusinessError, commonEventManager, emitter } from '@kit.BasicServicesKit';
-import { AdStatus } from '../constants';
-import { YTLog, yTToast } from '../../../../Index';
+import { AdStatus } from '../../constants';
+import { YTLog, yTToast } from '../../../../../Index';
 import { IBestToast } from '@ibestservices/ibest-ui';
 
 const KEY_REWARD_DATA = "reward_ad_data";

+ 2 - 2
commons/basic/src/main/ets/ads/StartAd.ets → commons/basic/src/main/ets/ads/jhAd/StartAd.ets

@@ -3,8 +3,8 @@ import { advertising } from '@kit.AdsKit';
 import { router } from '@kit.ArkUI';
 import { hilog } from '@kit.PerformanceAnalysisKit';
 import { emitter } from '@kit.BasicServicesKit';
-import { YTLog } from '../../../../Index';
-import { AppStorageKeyCollect } from '../constants';
+import { YTLog } from '../../../../../Index';
+import { AppStorageKeyCollect } from '../../constants';
 
 export enum AdType {
   // 开屏广告的类型

+ 47 - 0
commons/basic/src/main/ets/ads/tkAd/components/TkBannerAdComp.ets

@@ -0,0 +1,47 @@
+import { ATAdError, ATAdInfo, BuildATBannerAdView } from 'anythink_sdk';
+import { TkBannerAd, tkBannerAd } from '../utils/TkBannerAd';
+
+@Component
+export struct TkBannerAdComp {
+  @State private tkBannerAd: TkBannerAd = tkBannerAd
+
+  aboutToAppear(): void {
+    // this.tkBannerAd.loadBannerAd()
+    this.tkBannerAd.atBannerAd?.loadAd({
+      context: getContext(),
+      uiContext: this.getUIContext()
+    })
+    this.tkBannerAd.onAdLoaded = () => {
+      this.tkBannerAd.isLoaded = true
+      this.tkBannerAd.bannerAd = this.tkBannerAd.atBannerAd?.getBannerAd()
+    }
+
+  }
+
+
+
+  build() {
+    if (this.tkBannerAd.isLoaded && this.tkBannerAd.bannerAd) {
+      Column() {
+        BuildATBannerAdView(this.tkBannerAd.atBannerAd!.getBannerAd()!, {
+          onAdShow: (adInfo: ATAdInfo): void => {
+            // console.log('aaa', JSON.stringify(adInfo))
+          },
+          onAdClick: (adInfo: ATAdInfo): void => {
+          },
+          onAdClose: (adInfo: ATAdInfo): void => {
+            this.tkBannerAd.isLoaded = false
+          },
+          onAdAutoRefreshed: (adInfo: ATAdInfo): void => {
+          },
+          onAdAutoRefreshFailed: (adError: ATAdError): void => {
+          }
+        })
+      }
+      .width('100%')
+      .height(50)
+      .backgroundColor(Color.Yellow)
+
+    }
+  }
+}

+ 20 - 0
commons/basic/src/main/ets/ads/tkAd/components/TkNativeAdComp.ets

@@ -0,0 +1,20 @@
+import { BuildATNativeAdExpressView } from 'anythink_sdk';
+import { tkNativeAd, TkNativeAd } from '../utils/TkNativeAd';
+
+@Component
+export struct TkNativeAdComp {
+  @State private tkNativeAd: TkNativeAd = tkNativeAd
+
+  aboutToAppear() {
+    this.tkNativeAd.showNativeAd()
+    tkNativeAd.onCloseClick = () => {
+      this.tkNativeAd.isLoaded = false
+    }
+  }
+
+  build() {
+    if (this.tkNativeAd.nativeAd && this.tkNativeAd.isLoaded) {
+      BuildATNativeAdExpressView(this.tkNativeAd.nativeAd);
+    }
+  }
+}

+ 45 - 0
commons/basic/src/main/ets/ads/tkAd/components/TkStartAdComp.ets

@@ -0,0 +1,45 @@
+import { BuildATSplashAdView } from 'anythink_sdk'
+import { windowHelper } from '../../../utils/arkts/utils/WindowHelper'
+import { tkStartAd, TkStartAd } from '../utils/TkStartAd'
+
+@Component
+export struct TkStartAdComp {
+  @BuilderParam @Require placeholderComponent: () => void
+  @State private tkStartAd: TkStartAd = tkStartAd
+  @State private isLoaded: boolean = false
+
+  aboutToAppear(): void {
+    const id = setTimeout(() => {
+      this.tkStartAd.showAd = false
+    }, 5000)
+    this.tkStartAd.loadedCallBack = () => {
+      if (this.tkStartAd.splashAd.isAdReady()) {
+        this.isLoaded = true
+      }
+      clearTimeout(id)
+    }
+    this.tkStartAd.onAdClosed = () => {
+      this.tkStartAd.showAd = false
+    }
+
+  }
+
+  build() {
+    if (this.tkStartAd.showAd) {
+      Stack() {
+        Column() {
+          this.placeholderComponent()
+        }
+        .width('100%')
+        .height('100%')
+        .backgroundColor(Color.White)
+        .justifyContent(FlexAlign.Center)
+
+        if (this.isLoaded) {
+          BuildATSplashAdView(this.tkStartAd.splashAd, { windowStage: windowHelper.windowStage })
+        }
+      }
+
+    }
+  }
+}

+ 56 - 0
commons/basic/src/main/ets/ads/tkAd/utils/TkAdHelper.ets

@@ -0,0 +1,56 @@
+import { ATInitConfiguration, ATSDK } from 'anythink_sdk';
+import { ContextHelper, IBestToast } from '../../../../../../Index';
+import { Singleton } from '../../../utils/ts/utils/SingleTon';
+import { tkBannerAd } from './TkBannerAd';
+import { tkInterstitialAd } from './TkInterstitialAd';
+import { tkRewardAd } from './TkRewardAd';
+import { tkStartAd } from './TkStartAd';
+
+
+class TkAdHelper extends Singleton {
+  private readonly configuration: ATInitConfiguration = {
+    appId: "a68e72d516d235",
+    appKey: "ac0ed243c65ffeb1e16d7766bbee902dc",
+    networkLogDebug: true
+  }
+  // demo
+  // private readonly configuration: ATInitConfiguration = {
+  //   appId: "a6704d2dda04f7",
+  //   appKey: "4f7b9ac17decb9babec83aac078742c7",
+  //   networkLogDebug: true
+  // }
+  private readonly bannerPlacementId: string = 'b68e72d9373572'
+  // private readonly bannerPlacementId: string = 'b6772057a769c3' //demo
+  private readonly interstitialPlacementId: string = 'b68e72d9426e70'
+  private readonly rewardPlacementId: string = 'b68e72d92c2b91'
+  private readonly startPlacementId: string = 'b68e72d94e2001'
+  private readonly nativePlacementId: string = 'b68e72d9214faf'
+
+  init() {
+    ATSDK.init(ContextHelper.oldContext.getApplicationContext(), this.configuration)
+    ATSDK.start()
+      .then((flag) => {
+        if (flag) {
+          tkRewardAd.init(this.rewardPlacementId)
+          tkStartAd.init(this.startPlacementId)
+          tkInterstitialAd.init(this.interstitialPlacementId)
+          tkBannerAd.init(this.bannerPlacementId)
+
+        } else {
+          IBestToast.show("广告初始化失败")
+        }
+
+      })
+
+  }
+
+  showRewardAd() {
+    tkRewardAd.showRewardAd()
+  }
+
+  showInterstitialAd() {
+    tkInterstitialAd.showInterstitialAd()
+  }
+}
+
+export const tkAdHelper = TkAdHelper.getInstance()

+ 41 - 0
commons/basic/src/main/ets/ads/tkAd/utils/TkBannerAd.ets

@@ -0,0 +1,41 @@
+import { ATAdError, ATBannerAd, BannerAd } from 'anythink_sdk';
+import { YTLog } from '../../../../../../Index';
+import { ContextHelper } from '../../../utils/arkts/utils/ContextHelper';
+import { Singleton } from '../../../utils/ts/utils/SingleTon';
+
+
+export class TkBannerAd extends Singleton {
+  declare onAdLoaded: () => void
+  bannerAd?: BannerAd;
+  isLoaded: boolean = false
+  atBannerAd?: ATBannerAd;
+  private declare placementId: string;
+
+  init(placementId: string) {
+    this.placementId = placementId
+    this.atBannerAd = new ATBannerAd(this.placementId);
+
+    this.atBannerAd.setAdListener({
+      onAdLoaded: () => {
+        this.onAdLoaded?.()
+        // this.isLoaded = true
+        // this.bannerAd = this.atBannerAd?.getBannerAd()
+      },
+      onAdLoadFailed: (adError: ATAdError): void => {
+        YTLog.error(adError, 'bannerAd')
+      }
+    });
+
+  }
+
+  loadBannerAd() {
+    this.atBannerAd?.loadAd({
+      context: ContextHelper.context,
+      uiContext: ContextHelper.UIContext
+    })
+
+
+  }
+}
+
+export const tkBannerAd = TkBannerAd.getInstance();

+ 54 - 0
commons/basic/src/main/ets/ads/tkAd/utils/TkInterstitialAd.ets

@@ -0,0 +1,54 @@
+import { ATKSConfig } from 'anythink_network_ks';
+import { ATAdError, ATAdInfo, ATInterstitialAd } from 'anythink_sdk';
+import { ContextHelper } from '../../../../../../Index';
+import { windowHelper } from '../../../utils/arkts/utils/WindowHelper';
+import { Singleton } from '../../../utils/ts/utils/SingleTon';
+
+
+class TkInterstitialAd extends Singleton {
+  private declare interstitialAd: ATInterstitialAd
+  private declare placementId: string
+
+  init(placementId: string) {
+    this.placementId = placementId
+    this.interstitialAd = new ATInterstitialAd(this.placementId)
+    this.interstitialAd.setAdListener({
+      onAdLoaded: (): void => {
+
+      },
+      onAdShow: (adInfo: ATAdInfo): void => {
+        // this.interstitialAd.loadAd({ context: ContextHelper.oldContext, localExtraMap: localExtraMap });
+      },
+      onAdClick: (adInfo: ATAdInfo): void => {
+      },
+      onAdClose: (adInfo: ATAdInfo): void => {
+        this.interstitialAd.loadAd({ context: ContextHelper.oldContext, localExtraMap: localExtraMap });
+      },
+      onAdLoadFailed: (adError: ATAdError): void => {
+      },
+      onAdVideoPlayStart: (adInfo: ATAdInfo): void => {
+      },
+      onAdVideoPlayEnd: (adInfo: ATAdInfo): void => {
+        // this.interstitialAd.loadAd({ context: ContextHelper.context, localExtraMap: localExtraMap });
+      },
+      onAdVideoPlayFailed: (adError: ATAdError, adInfo?: ATAdInfo): void => {
+      }
+    })
+
+    const localExtraMap: Record<string, Object> = {};
+    // 仅针对快手平台的广告配置
+    localExtraMap[ATKSConfig.VIDEO_AUTO_PLAY_TYPE_KEY] = 3; //设置不自动播放
+
+    this.interstitialAd.loadAd({ context: ContextHelper.oldContext, localExtraMap: localExtraMap });
+  }
+
+  showInterstitialAd() {
+    if (this.interstitialAd.isAdReady()) {
+      this.interstitialAd.showAd(ContextHelper.context, {
+        windowStage: windowHelper.windowStage
+      });
+    }
+  }
+}
+
+export const tkInterstitialAd: TkInterstitialAd = TkInterstitialAd.getInstance()

+ 67 - 0
commons/basic/src/main/ets/ads/tkAd/utils/TkNativeAd.ets

@@ -0,0 +1,67 @@
+import { ATAdError, ATAdInfo, ATNativeAd, NativeAd } from 'anythink_sdk';
+import { ContextHelper, YTLog } from '../../../../../../Index';
+import { Singleton } from '../../../utils/ts/utils/SingleTon';
+
+
+export class TkNativeAd extends Singleton {
+  declare atNativeAd: ATNativeAd
+  declare nativeAd?: NativeAd
+  isLoaded: boolean = false
+  declare onCloseClick: () => void
+  private declare placementId: string;
+
+  init(placementId: string) {
+    this.placementId = placementId;
+    this.atNativeAd = new ATNativeAd(this.placementId);
+    this.atNativeAd.setAdListener({
+      onAdLoaded: (): void => {
+        this.isLoaded = true
+
+        // this.showAd();
+      },
+      onAdLoadFailed: (adError: ATAdError): void => {
+        YTLog.error(adError)
+      },
+      onAdOtherStatus: (adInfo?: ATAdInfo | undefined): void => {
+
+      }
+    });
+    this.loadAd()
+
+  }
+
+  loadAd() {
+    this.atNativeAd.loadAd({
+      context: ContextHelper.oldContext,
+      uiContext: ContextHelper.UIContext
+    });
+  }
+
+  showNativeAd() {
+    this.nativeAd = this.atNativeAd.getNativeAd();
+    if (!this.nativeAd) {
+      return;
+    }
+    this.nativeAd.setNativeAdEventListener({
+      onAdShow: (adInfo: ATAdInfo): void => {
+      },
+      onAdClose: (adInfo: ATAdInfo): void => {
+        this.onCloseClick()
+      },
+      onAdClick: (adInfo: ATAdInfo): void => {
+      },
+      onAdVideoResume: (adInfo: ATAdInfo): void => {
+      },
+      onAdVideoPause: (adInfo: ATAdInfo): void => {
+      },
+      onAdVideoPlayStart: (adInfo: ATAdInfo): void => {
+      },
+      onAdVideoPlayEnd: (adInfo: ATAdInfo): void => {
+      },
+      onAdVideoPlayFailed: (adError: ATAdError, adInfo?: ATAdInfo | undefined): void => {
+      }
+    })
+  }
+}
+
+export const tkNativeAd = TkNativeAd.getInstance()

+ 90 - 0
commons/basic/src/main/ets/ads/tkAd/utils/TkRewardAd.ets

@@ -0,0 +1,90 @@
+import { ATKSConfig } from 'anythink_network_ks';
+import { AT_LOCAL_EXTRA_KEY, ATAdError, ATAdInfo, ATRewardVideoAd } from 'anythink_sdk';
+import { YTLog } from '../../../../../../Index';
+import { ContextHelper } from '../../../utils/arkts/utils/ContextHelper';
+import { windowHelper } from '../../../utils/arkts/utils/WindowHelper';
+import { Singleton } from '../../../utils/ts/utils/SingleTon';
+
+
+export class TkRewardAd extends Singleton {
+  private declare rewardAd: ATRewardVideoAd
+  private isLoading: boolean = false
+  private declare placementId: string
+
+  init(placementId: string) {
+    this.placementId = placementId
+    this.rewardAd = new ATRewardVideoAd(this.placementId);
+    this.rewardAd.setAdListener({
+      onAdLoaded: (): void => {
+        this.isLoading = false
+
+      },
+      onAdShow: (adInfo: ATAdInfo): void => {
+        // this.rewardAd.loadAd({
+        //   context: ContextHelper.context,
+        //   localExtraMap: localExtraMap
+        // });
+      },
+      onAdClick: (adInfo: ATAdInfo): void => {
+      },
+      onAdClose: (adInfo: ATAdInfo): void => {
+        this.rewardAd.loadAd({
+          context: ContextHelper.context,
+          localExtraMap: localExtraMap
+        });
+      },
+      onAdReward: (adInfo: ATAdInfo): void => {
+        // this.rewardAd.loadAd({
+        //   context: ContextHelper.context,
+        //   localExtraMap: localExtraMap
+        // });
+      },
+      onAdLoadFailed: (adError: ATAdError): void => {
+        YTLog.error(adError)
+        // IBestToast.show("广告加载失败")
+        this.isLoading = false
+      },
+      onAdVideoPlayStart: (adInfo: ATAdInfo): void => {
+      },
+      onAdVideoPlayEnd: (adInfo: ATAdInfo): void => {
+        this.rewardAd.loadAd({
+          context: ContextHelper.context,
+          localExtraMap: localExtraMap
+        });
+      },
+      onAdVideoPlayFailed: (adError: ATAdError, adInfo?: ATAdInfo | undefined): void => {
+      },
+      onAdOtherStatus: (adInfo?: ATAdInfo): void => {
+      }
+    });
+
+    const localExtraMap: Record<string, Object> = {};
+    //支持透传以下参数给广告平台:比如userId,详见AT_LOCAL_EXTRA_KEY
+    localExtraMap[AT_LOCAL_EXTRA_KEY.USER_ID] = "your user id";
+    // 仅针对快手平台的广告配置
+    localExtraMap[ATKSConfig.VIDEO_AUTO_PLAY_TYPE_KEY] = 3; //设置不自动播放
+
+
+    this.rewardAd.loadAd({
+      context: ContextHelper.context,
+      localExtraMap: localExtraMap
+    });
+
+    this.isLoading = true
+
+    return this.rewardAd
+  }
+
+
+  showRewardAd() {
+    if (!this.isLoading) {
+      if (this.rewardAd.isAdReady()) {
+        this.rewardAd.showAd(ContextHelper.context, {
+          windowStage: windowHelper.windowStage    //在UIAbility的onWindowStageCreate(windowStage: window.WindowStage)中获取
+        });
+      }
+    }
+  }
+}
+
+export const tkRewardAd = TkRewardAd.getInstance();

+ 76 - 0
commons/basic/src/main/ets/ads/tkAd/utils/TkStartAd.ets

@@ -0,0 +1,76 @@
+import { AT_LOCAL_EXTRA_KEY, ATAdError, ATAdInfo, ATSplashAd } from 'anythink_sdk';
+import { display } from '@kit.ArkUI';
+import { ATKSConfig } from 'anythink_network_ks';
+import { ContextHelper, YTLog } from '../../../../../../Index';
+import { Singleton } from '../../../utils/ts/utils/SingleTon';
+
+
+export class TkStartAd extends Singleton {
+  isLoaded: boolean = false
+  showAd: boolean = true
+  declare splashAd: ATSplashAd
+  declare loadedCallBack: () => void
+  declare onAdClosed: () => void
+  private declare loadAd: () => void
+  private declare placementId: string
+
+  init(placementId: string) {
+    this.placementId = placementId
+    this.splashAd = new ATSplashAd(this.placementId);
+    this.splashAd.setAdListener({
+      onAdLoaded: (isTimeout: boolean): void => {
+        if (!isTimeout) {
+          this.isLoaded = true
+          this.loadedCallBack()
+        }
+      },
+
+      onAdShow: (adInfo: ATAdInfo): void => {
+      },
+      onAdClick: (adInfo: ATAdInfo): void => {
+      },
+      onAdClose: (adInfo: ATAdInfo): void => {
+        this.onAdClosed()
+      },
+      onAdOtherStatus: ((status) => {
+        YTLog.info(status, 'StartAdStatus')
+      }),
+      onAdLoadTimeout: (): void => {
+      },
+      onAdLoadFailed: (adError: ATAdError): void => {
+        YTLog.error(adError)
+      }
+    });
+
+    const localExtraMap: Record<string, Object> = {};
+    // 仅针对快手平台的广告配置
+    localExtraMap[ATKSConfig.VIDEO_AUTO_PLAY_TYPE_KEY] = 1; //设置自动播放
+    //设置宽高,单位/vp
+    localExtraMap[AT_LOCAL_EXTRA_KEY.AD_WIDTH] = ContextHelper.UIContext.px2vp(display.getDefaultDisplaySync().width);
+    localExtraMap[AT_LOCAL_EXTRA_KEY.AD_HEIGHT] = ContextHelper.UIContext.px2vp(display.getDefaultDisplaySync().height);
+
+    this.loadAd = () => {
+      if (this.isLoaded) {
+        return
+      }
+
+
+      this.splashAd.loadAd({
+        context: ContextHelper.oldContext,
+        fetchAdTimeout: 5000,
+        localExtraMap: localExtraMap,
+      })
+
+    }
+
+    this.loadAd()
+  }
+
+  // showStartAd() {
+  //   BuildATSplashAdView(this.splashAd, {
+  //     windowStage: windowHelper.windowStage //在UIAbility的onWindowStageCreate(windowStage: window.WindowStage)中获取
+  //   })
+  // }
+}
+
+export const tkStartAd = TkStartAd.getInstance();

+ 1 - 1
commons/basic/src/main/ets/apis/YTRequest.ets

@@ -10,7 +10,7 @@ import axios, {
 import { ContextHelper, IBestToast, ReqString, YTLog } from '../../../../Index';
 import { AppStorageKeyCollect } from '../constants';
 import { userInfo } from '../models/UserInfo';
-import { yTRouter } from '../utils/YTRouter';
+import { yTRouter } from '../utils/arkts/utils/YTRouter';
 
 
 export const baseURL: string = 'https://hm.ytpm.net/prod-activity'

+ 3 - 3
commons/basic/src/main/ets/apis/YTUserRequest.ets

@@ -3,12 +3,12 @@ import { AppStorageKeyCollect } from '../constants'
 import { ReqString, ResultCallBack } from '../models'
 import { LoginCollect } from '../models/LoginCollect'
 import { UserInfo, userInfo } from '../models/UserInfo'
-import { yTRouter } from '../utils/YTRouter'
+import { yTRouter } from '../utils/arkts/utils/YTRouter'
 import { YTRequest } from './YTRequest'
 import { ContextHelper, YTLog } from '../../../../Index'
 import { AxiosProgressEvent, FormData } from '@ohos/axios'
-import { YTDate } from '../utils/YTDate'
-import { HuaweiAuthPlugin } from '../utils/HuaWeiAuthPlugin'
+import { YTDate } from '../utils/arkts/utils/YTDate'
+import { HuaweiAuthPlugin } from '../utils/arkts/utils/HuaWeiAuthPlugin'
 
 //用户相关api
 export class YTUserRequest extends YTRequest {

+ 1 - 1
commons/basic/src/main/ets/components/adComp/ShowBannerAd.ets

@@ -1,5 +1,5 @@
 import { advertising, AutoAdComponent } from '@kit.AdsKit';
-import { BannerAd } from '../../ads/BannerAd';
+import { BannerAd } from '../../ads/jhAd/BannerAd';
 import { hilog } from '@kit.PerformanceAnalysisKit';
 import { AdStatus } from '../../constants';
 

+ 1 - 1
commons/basic/src/main/ets/components/adComp/ShowJHRewardAd.ets

@@ -1,5 +1,5 @@
 import { common } from '@kit.AbilityKit';
-import { RewardAd } from '../../ads/RewardAd';
+import { RewardAd } from '../../ads/jhAd/RewardAd';
 import { emitter } from '@kit.BasicServicesKit';
 
 

+ 1 - 1
commons/basic/src/main/ets/components/generalComp/AgreePrivacy.ets

@@ -1,5 +1,5 @@
 import { BasicType } from '../../models';
-import { YTToast } from '../../utils/YTToast';
+import { YTToast } from '../../utils/arkts/utils/YTToast';
 import { YTButton } from './YTButton';
 
 @Builder

+ 1 - 1
commons/basic/src/main/ets/components/generalComp/ChatList.ets

@@ -1,5 +1,5 @@
 import { BasicType, BreakPointString, MessageType, Role } from '../../models'
-import { BreakPointType, YTBreakPoint } from '../../utils/YTBreakPoint'
+import { BreakPointType, YTBreakPoint } from '../../utils/arkts/utils/YTBreakPoint'
 
 @Component
 export struct ChatList {

+ 4 - 4
commons/basic/src/main/ets/components/generalComp/TextSelect.ets

@@ -1,5 +1,5 @@
 import { DropDownImageInfo, DropDownInfo, TextInfo, TextInputInfo } from '../../models/TextSelectModel'
-import { BreakPointSize, YTBreakPoint } from '../../utils/YTBreakPoint'
+import { BreakPointSize, YTBreakPoint } from '../../utils/arkts/utils/YTBreakPoint'
 
 
 @Component
@@ -26,6 +26,9 @@ export struct TextSelect {
   @Prop showImageName: string = '' //要展示的图片字段名
   defaultOption: ESObject //默认选中项
   public moduleHeight?: Length = 40 //组件高度
+  textInputInfo: TextInputInfo | null = null //自定义输入框配置,不传则不显示
+  @StorageProp(YTBreakPoint.BreakPointVp) breakPointSize: BreakPointSize = { width: 0, height: 0 }
+  @State selectPosition: Position = { x: 0, y: 0 }
   @State private selectHeight: Length = 0
   @State private isShowSelect: boolean = false
   @State private selectText: ResourceStr = ''
@@ -34,9 +37,6 @@ export struct TextSelect {
   }
   public textInputSubmit = (text: string) => {
   }
-  textInputInfo: TextInputInfo | null = null //自定义输入框配置,不传则不显示
-  @StorageProp(YTBreakPoint.BreakPointVp) breakPointSize: BreakPointSize = { width: 0, height: 0 }
-  @State selectPosition: Position = { x: 0, y: 0 }
 
   init() {
     if (this.selectOptions[0]) {

+ 2 - 2
commons/basic/src/main/ets/components/generalComp/YTHeader.ets

@@ -1,5 +1,5 @@
-import { YTAvoid } from '../../utils/YTAvoid'
-import { yTRouter } from '../../utils/YTRouter'
+import { YTAvoid } from '../../utils/arkts/utils/YTAvoid'
+import { yTRouter } from '../../utils/arkts/utils/YTRouter'
 
 interface Font {
   fontWeight?: string | number | FontWeight,

+ 181 - 167
commons/basic/src/main/ets/components/generalComp/YtProgressComp.ets

@@ -1,12 +1,12 @@
-import { YTAvoid } from "../../utils/YTAvoid";
-import { yTRouter } from "../../utils/YTRouter";
+import { YTAvoid } from '../../utils/arkts/utils/YTAvoid';
+
 //等级参数接口
-export interface GradeParam{
+export interface GradeParam {
   point: number;
-  position: number;//1-10等份的位置
-  topImage?:ResourceStr
-  selectImage?:ResourceStr
-  unSelectImage?:ResourceStr
+  position: number; //1-10等份的位置
+  topImage?: ResourceStr
+  selectImage?: ResourceStr
+  unSelectImage?: ResourceStr
 }
 
 @Component
@@ -15,12 +15,19 @@ export struct YtProgressComp {
   @State lastClickTime: number = 0;
   @State coolDown: boolean = false;
   @State isShowToast: boolean = false;
-  v0Point: GradeParam = {point:0,position:0,topImage:$r('app.media.icon_crown_gold'),selectImage:$r('app.media.icon_grow_yes'),unSelectImage:$r('app.media.icon_grow_no')};
-  v1Point: GradeParam = {point:70,position:3};
-  v2Point: GradeParam = {point:300,position:10};
-  @State private  v1Area:Position = {x:0,y:0}
-  @State private  v2Area:Position = {x:0,y:0}
+  v0Point: GradeParam = {
+    point: 0,
+    position: 0,
+    topImage: $r('app.media.icon_crown_gold'),
+    selectImage: $r('app.media.icon_grow_yes'),
+    unSelectImage: $r('app.media.icon_grow_no')
+  };
+  v1Point: GradeParam = { point: 70, position: 3 };
+  v2Point: GradeParam = { point: 300, position: 10 };
   currentPointImage: ResourceStr = $r('app.media.icon_crown_red');
+  @State private v1Area: Position = { x: 0, y: 0 }
+  @State private v2Area: Position = { x: 0, y: 0 }
+
   getProgressWidth() {
     // 总长度定义为299
     const totalLength = 299;
@@ -28,7 +35,7 @@ export struct YtProgressComp {
     // 各关键点的位置
     const firstPointRight = 23; // 第一个点右侧位置
     const secondPointLeft = Number(this.v1Area.x); // 第二个点左侧位置
-    const secondPointRight = Number(this.v1Area.x)+23; // 第二个点右侧位置
+    const secondPointRight = Number(this.v1Area.x) + 23; // 第二个点右侧位置
     const thirdPointLeft = Number(this.v2Area.x); // 第三个点左侧位置
     let width = 0;
 
@@ -37,7 +44,8 @@ export struct YtProgressComp {
       width = totalLength;
     } else if (this.growPoint >= this.v1Point.point) {
       // 成长值在v1Point及以上,在第二点右侧至第三点左侧之间线性增长
-      const progressRatio = Math.min((this.growPoint - this.v1Point.point) / (this.v2Point.point - this.v1Point.point), 1);
+      const progressRatio =
+        Math.min((this.growPoint - this.v1Point.point) / (this.v2Point.point - this.v1Point.point), 1);
       width = secondPointRight + (thirdPointLeft - secondPointRight) * progressRatio;
     } else {
       // 成长值在(this.v1Point - 10)以下,在第一点右侧至第二点左侧之间线性增长
@@ -67,183 +75,189 @@ export struct YtProgressComp {
   }
 
   build() {
-      Column() {
+    Column() {
+      RelativeContainer() {
+        Image($r('app.media.bg_progress'))
+          .width(338)
+          .height(119)
+          .alignRules({
+            top: { anchor: '__container__', align: VerticalAlign.Top },
+            middle: { anchor: '__container__', align: HorizontalAlign.Center }
+          })
+
+
         RelativeContainer() {
-          Image($r('app.media.bg_progress'))
-            .width(338)
-            .height(119)
+          Row()
+            .width(253 + 46)
+            .height(16)
+            .borderRadius(8)
+            .border({
+              width: 1,
+              color: '#000'
+            })
+            .zIndex(2)
             .alignRules({
-              top: { anchor: '__container__', align: VerticalAlign.Top },
-              middle: { anchor: '__container__', align: HorizontalAlign.Center }
+              center: { anchor: '__container__', align: VerticalAlign.Center },
+              left: { anchor: '__container__', align: HorizontalAlign.Start }
+            })
+          Row()
+            .width(this.getProgressWidth())//根据成长值改变
+            .height(16)
+            .borderRadius(8)
+            .border({
+              width: { right: 1 },
+              color: '#000'
+            })
+            .id('progress_width')
+            .zIndex(1)
+            .backgroundColor('#5491D5')
+            .alignRules({
+              center: { anchor: '__container__', align: VerticalAlign.Center },
+              left: { anchor: '__container__', align: HorizontalAlign.Start }
             })
 
+          Image(this.growPoint > 0 ?
+            this.v0Point.selectImage ? this.v0Point.selectImage : $r('app.media.icon_grow_yes') :
+            this.v0Point.selectImage ? this.v0Point.selectImage : $r('app.media.icon_grow_no'))
+            .width(23)
+            .aspectRatio(1)
+            .id('first_progress')
+            .alignRules({
+              center: { anchor: '__container__', align: VerticalAlign.Center },
+              left: { anchor: '__container__', align: HorizontalAlign.Start },
+              right: { anchor: '__container__', align: HorizontalAlign.End },
+              bias: { horizontal: 0 / 10 }
+            })
+            .zIndex(3)
 
-          RelativeContainer() {
-            Row()
-              .width(253 + 46)
-              .height(16)
-              .borderRadius(8)
-              .border({
-                width: 1,
-                color: '#000'
-              })
-              .zIndex(2)
-              .alignRules({
-                center: { anchor: '__container__', align: VerticalAlign.Center },
-                left: { anchor: '__container__', align: HorizontalAlign.Start }
-              })
-            Row()
-              .width(this.getProgressWidth())//根据成长值改变
-              .height(16)
-              .borderRadius(8)
-              .border({
-                width: { right: 1 },
-                color: '#000'
-              })
-              .id('progress_width')
-              .zIndex(1)
-              .backgroundColor('#5491D5')
-              .alignRules({
-                center: { anchor: '__container__', align: VerticalAlign.Center },
-                left: { anchor: '__container__', align: HorizontalAlign.Start }
-              })
+          Image(this.v0Point.topImage ? this.v0Point.topImage : $r('app.media.icon_crown_gold'))
+            .width(23)
+            .alignRules({
+              bottom: { anchor: 'first_progress', align: VerticalAlign.Top },
+              middle: { anchor: 'first_progress', align: HorizontalAlign.Center },
+            })
+            .id('icon_crown_gold')
+            .margin({ bottom: 3 })
+            .zIndex(3)
 
-            Image(this.growPoint > 0 ? this.v0Point.selectImage?this.v0Point.selectImage:$r('app.media.icon_grow_yes') :this.v0Point.selectImage?this.v0Point.selectImage: $r('app.media.icon_grow_no'))
+          if (this.growPoint != this.v1Point.point && this.growPoint < this.v2Point.point) {
+            Image(this.currentPointImage)
               .width(23)
-              .aspectRatio(1)
-              .id('first_progress')
               .alignRules({
-                center: { anchor: '__container__', align: VerticalAlign.Center },
-                left: { anchor: '__container__', align: HorizontalAlign.Start },
-                right: { anchor: '__container__', align: HorizontalAlign.End },
-                bias: { horizontal: 0 / 10 }
+                bottom: { anchor: 'progress_width', align: VerticalAlign.Top },
+                middle: { anchor: 'progress_width', align: HorizontalAlign.End },
               })
+              .id('icon_crown_red')
+              .margin({ bottom: 2, right: 4 })
               .zIndex(3)
+          }
 
-            Image(this.v0Point.topImage?this.v0Point.topImage:$r('app.media.icon_crown_gold'))
-              .width(23)
-              .alignRules({
-                bottom: { anchor: 'first_progress', align: VerticalAlign.Top },
-                middle: { anchor: 'first_progress', align: HorizontalAlign.Center },
-              })
-              .id('icon_crown_gold')
-              .margin({ bottom: 3 })
-              .zIndex(3)
+          Image(this.v1Point.topImage ? this.v1Point.topImage : $r('app.media.icon_crown_blue'))
+            .width(23)
+            .alignRules({
+              bottom: { anchor: 'second_progress', align: VerticalAlign.Top },
+              middle: { anchor: 'second_progress', align: HorizontalAlign.Center },
+            })
+            .id('icon_crown_blue')
+            .margin({ bottom: 3 })
+            .zIndex(3)
 
-            if (this.growPoint != this.v1Point.point && this.growPoint < this.v2Point.point) {
-              Image(this.currentPointImage)
-                .width(23)
-                .alignRules({
-                  bottom: { anchor: 'progress_width', align: VerticalAlign.Top },
-                  middle: { anchor: 'progress_width', align: HorizontalAlign.End },
-                })
-                .id('icon_crown_red')
-                .margin({ bottom: 2, right: 4 })
-                .zIndex(3)
-            }
-
-            Image(this.v1Point.topImage?this.v1Point.topImage:$r('app.media.icon_crown_blue'))
-              .width(23)
-              .alignRules({
-                bottom: { anchor: 'second_progress', align: VerticalAlign.Top },
-                middle: { anchor: 'second_progress', align: HorizontalAlign.Center },
-              })
-              .id('icon_crown_blue')
-              .margin({ bottom: 3 })
-              .zIndex(3)
+          Image(this.v2Point.topImage ? this.v2Point.topImage : $r('app.media.icon_crown_yellow'))
+            .width(23)
+            .alignRules({
+              bottom: { anchor: 'third_progress', align: VerticalAlign.Top },
+              middle: { anchor: 'third_progress', align: HorizontalAlign.Center },
+            })
+            .id('icon_crown_yellow')
+            .margin({ bottom: 3 })
+            .zIndex(3)
 
-            Image(this.v2Point.topImage?this.v2Point.topImage:$r('app.media.icon_crown_yellow'))
-              .width(23)
-              .alignRules({
-                bottom: { anchor: 'third_progress', align: VerticalAlign.Top },
-                middle: { anchor: 'third_progress', align: HorizontalAlign.Center },
-              })
-              .id('icon_crown_yellow')
-              .margin({ bottom: 3 })
-              .zIndex(3)
+          Image(this.growPoint >= this.v1Point.point ?
+            this.v1Point.selectImage ? this.v1Point.selectImage : $r('app.media.icon_grow_yes') :
+            this.v1Point.selectImage ? this.v1Point.selectImage : $r('app.media.icon_grow_no'))
+            .width(23)
+            .aspectRatio(1)
+            .id('second_progress')
+            .alignRules({
+              center: { anchor: '__container__', align: VerticalAlign.Center },
+              left: { anchor: '__container__', align: HorizontalAlign.Start },
+              right: { anchor: '__container__', align: HorizontalAlign.End },
+              bias: { horizontal: this.v1Point.position / 10 }
+            })
+            .zIndex(3)
+            .onAreaChange((_, newArea) => {
+              console.log(`进度区域:${JSON.stringify(newArea)}`);
+              this.v1Area = newArea.position
+            })
 
-            Image(this.growPoint >= this.v1Point.point ? this.v1Point.selectImage?this.v1Point.selectImage:$r('app.media.icon_grow_yes') :  this.v1Point.selectImage?this.v1Point.selectImage:$r('app.media.icon_grow_no'))
-              .width(23)
-              .aspectRatio(1)
-              .id('second_progress')
-              .alignRules({
-                center: { anchor: '__container__', align: VerticalAlign.Center },
-                left: { anchor: '__container__', align: HorizontalAlign.Start },
-                right: { anchor: '__container__', align: HorizontalAlign.End },
-                bias: { horizontal: this.v1Point.position / 10 }
-              })
-              .zIndex(3)
-              .onAreaChange((_,newArea)=>{
-                console.log(`进度区域:${JSON.stringify(newArea)}`);
-                this.v1Area = newArea.position
-              })
+          Image(this.growPoint >= this.v2Point.point ?
+            this.v2Point.selectImage ? this.v2Point.selectImage : $r('app.media.icon_grow_yes') :
+            this.v2Point.selectImage ? this.v2Point.selectImage : $r('app.media.icon_grow_no'))
+            .width(23)
+            .aspectRatio(1)
+            .id('third_progress')
+            .alignRules({
+              center: { anchor: '__container__', align: VerticalAlign.Center },
+              left: { anchor: '__container__', align: HorizontalAlign.Start },
+              right: { anchor: '__container__', align: HorizontalAlign.End },
+              bias: { horizontal: this.v2Point.position / 10 }
+            })
+            .zIndex(3)
+            .onAreaChange((_, newArea) => {
+              console.log(`进度区域:${JSON.stringify(newArea)}`);
+              this.v2Area = newArea.position
+            })
 
-            Image(this.growPoint >= this.v2Point.point ? this.v2Point.selectImage?this.v2Point.selectImage:$r('app.media.icon_grow_yes') :  this.v2Point.selectImage?this.v2Point.selectImage:$r('app.media.icon_grow_no'))
-              .width(23)
-              .aspectRatio(1)
-              .id('third_progress')
-              .alignRules({
-                center: { anchor: '__container__', align: VerticalAlign.Center },
-                left: { anchor: '__container__', align: HorizontalAlign.Start },
-                right: { anchor: '__container__', align: HorizontalAlign.End },
-                bias: { horizontal: this.v2Point.position / 10 }
-              })
-              .zIndex(3)
-              .onAreaChange((_,newArea)=>{
-                console.log(`进度区域:${JSON.stringify(newArea)}`);
-                this.v2Area = newArea.position
-              })
 
+        }
+        .height(23)
+        .width(253 + 46)
+        .alignRules({
+          top: { anchor: '__container__', align: VerticalAlign.Top },
+          left: { anchor: '__container__', align: HorizontalAlign.Start }
+        })
+        .margin({
+          top: 23,
+          left: 19
+        })
 
+        Row({ space: 8 }) {
+          Column() {
+            Text('我的成长点')
+              .font({ size: 12, weight: FontWeight.Normal })
+              .fontColor('#000')
+            Text(this.growPoint.toString())
+              .font({ size: 24, weight: FontWeight.Bold })
+              .fontColor('#000')
+              .maxLines(1)
+              .textOverflow({ overflow: TextOverflow.MARQUEE })
           }
-          .height(23)
-          .width(253 + 46)
-          .alignRules({
-            top: { anchor: '__container__', align: VerticalAlign.Top },
-            left: { anchor: '__container__', align: HorizontalAlign.Start }
-          })
-          .margin({
-            top: 23,
-            left: 19
-          })
 
-          Row({ space: 8 }) {
-            Column() {
-              Text('我的成长点')
-                .font({ size: 12, weight: FontWeight.Normal })
-                .fontColor('#000')
-              Text(this.growPoint.toString())
-                .font({ size: 24, weight: FontWeight.Bold })
-                .fontColor('#000')
-                .maxLines(1)
-                .textOverflow({ overflow: TextOverflow.MARQUEE })
-            }
-
-            Image($r('app.media.icon_right'))
-              .width(8)
-          }
-          .alignRules({
-            bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
-            left: { anchor: '__container__', align: HorizontalAlign.Start }
-          })
-          .margin({
-            left: 7, bottom: 6
-          })
-          .onClick(() => {
-            //todo 点击成长
-          })
+          Image($r('app.media.icon_right'))
+            .width(8)
         }
-        .height(119)
-        .width(338)
+        .alignRules({
+          bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
+          left: { anchor: '__container__', align: HorizontalAlign.Start }
+        })
         .margin({
-          top: YTAvoid.getTop()
+          left: 7, bottom: 6
         })
         .onClick(() => {
-
+          //todo 点击成长
         })
-
       }
-      .width('100%')
-      .id('bg_cat')
+      .height(119)
+      .width(338)
+      .margin({
+        top: YTAvoid.getTop()
+      })
+      .onClick(() => {
+
+      })
+
+    }
+    .width('100%')
+    .id('bg_cat')
   }
 }

+ 50 - 0
commons/basic/src/main/ets/components/toastBuilders/AgreePrivacy.ets

@@ -0,0 +1,50 @@
+import { BasicType } from '../../models';
+import { yTToast } from '../../utils/arkts/utils/YTToast';
+import { YTButton } from '../generalComp/YTButton';
+
+@Builder
+export function agreePrivacy(item: BasicType<undefined>) {
+  Column() {
+    Text('温馨提示')
+      .fontSize(14)
+      .fontColor('Color.Black')
+      .margin({ top: 14, bottom: 8 })
+    Text('已阅读并同意《用户协议》和《隐私政策》')
+      .fontSize(13)
+      .fontColor($r('sys.color.mask_secondary'))
+      .margin({ bottom: 19 })
+
+
+    Column() {
+      YTButton({
+        btContent: '同意并登入',
+        btHeight: 37,
+        click: () => {
+          yTToast.hide()
+
+          item.loginType!.isAgreePrivacy = true
+
+          item.loginType?.executeLogin()
+
+
+        }
+      })
+      YTButton({
+        btContent: '不同意',
+        btHeight: 37,
+        bgc: Color.White,
+        btFontColor: '#80000000',
+        click: () => {
+          yTToast.hide()
+        }
+      })
+    }
+    .padding({ left: 16, right: 16 })
+
+  }
+  .width(280)
+  .height(160)
+  .backgroundColor(Color.White)
+  .borderRadius(8)
+  .margin({ bottom: 28 })
+}

+ 107 - 0
commons/basic/src/main/ets/components/toastBuilders/AlertToastComp.ets

@@ -0,0 +1,107 @@
+import { BasicType } from '../../models'
+import { yTToast } from '../../utils/arkts/utils/YTToast'
+
+import { YTButton } from '../generalComp/YTButton'
+
+
+@Builder
+export function AlertToastBuilder(item: BasicType<undefined>) {
+  AlertToastComp({
+    message: item.message,
+    onConfirm: item.onConfirm,
+    onCancel: item.onCancel,
+    messageAlignSelf: item.messageAlignSelf,
+    confirmMessage: item.confirmMessage,
+    cancelMessage: item.cancelMessage,
+    isShowClose: item.isShowClose
+  })
+}
+
+@Component
+struct AlertToastComp {
+  message: string = ''
+  confirmMessage: string = '保存并退出'
+  cancelMessage: string = '取消并退出'
+  isShowClose: boolean = true
+  messageAlignSelf: ItemAlign = ItemAlign.Center
+
+  onConfirm: (index: string) => void = (index: string) => {
+  }
+
+  onCancel: () => void = () => {
+  }
+
+  build() {
+
+    Column({ space: 24 }) {
+      Stack() {
+        Row() {
+          Text(this.message)
+            .fontSize(16)
+            .fontWeight(400)
+            .fontColor('#FF353C46')
+            .alignSelf(this.messageAlignSelf)
+        }
+        .width('100%')
+        .justifyContent(FlexAlign.Center)
+
+        Row() {
+          Image($r('app.media.icon_cancel_blue'))
+            .width(16)
+        }
+        .width('100%')
+        .justifyContent(FlexAlign.End)
+        .onClick(() => {
+          yTToast.hide()
+        })
+        .visibility(this.isShowClose ? Visibility.Visible : Visibility.Hidden)
+      }
+      .width('100%')
+
+      Row() {
+        YTButton({
+          btContent: this.confirmMessage,
+          btWidth: 104,
+          btHeight: 42,
+          btFontSize: 16,
+          bgc: '#FF6E645E',
+          btPadding: 0,
+          btFontColor: '#FFF',
+          click: () => {
+            // yTToast.hide()
+            // yTRouter.routerBack()
+
+            this.onConfirm?.('0')
+          }
+        })
+        YTButton({
+          btContent: this.cancelMessage,
+          btWidth: 104,
+          btHeight: 42,
+          btFontSize: 16,
+          bgc: '#FFF5F5F7',
+          btPadding: 0,
+          btFontColor: '#FF353C46',
+          click: () => {
+            // console.log('你好')
+            this.onCancel?.()
+          }
+        })
+      }
+      .width('100%')
+      .justifyContent(FlexAlign.SpaceBetween)
+    }
+    .width(343)
+    // .height(138)
+    .padding({
+      left: 48,
+      right: 48,
+      top: 28,
+      bottom: 20
+    })
+    .backgroundColor('#FFF')
+    .borderRadius(16)
+
+    // .margin({ left: 16, right: 16 })
+  }
+}

+ 45 - 0
commons/basic/src/main/ets/components/toastBuilders/LoginToUse.ets

@@ -0,0 +1,45 @@
+import { BasicType } from '../../models';
+import { yTRouter } from '../../utils/arkts/utils/YTRouter';
+
+import { YTButton } from '../generalComp/YTButton';
+
+@Builder
+export function loginToUse(_: BasicType) {
+  Column() {
+    Row() {
+      Text('登录使用所有功能')
+        .fontSize(16)
+        .fontWeight(400)
+        .fontColor('#B31C1C1C')
+
+      YTButton({
+        btHeight: 30,
+        btWidth: 80,
+        btContent: '马上登录',
+        btBorderRadius: 32,
+        btFontSize: 12,
+        click: () => {
+          yTRouter.router2LoginPage()
+        }
+      })
+    }
+    .justifyContent(FlexAlign.SpaceBetween)
+    .padding({
+      top: 13,
+      left: 20,
+      bottom: 13,
+      right: 20
+    })
+    .borderRadius(8)
+    .backgroundColor(Color.White)
+    .width('100%')
+    .height(56)
+    .shadow({
+      color: '#14000000',
+      radius: 32,
+      offsetX: 0,
+      offsetY: 4
+    })
+  }
+  .padding({ left: 20, right: 20 })
+}

+ 54 - 0
commons/basic/src/main/ets/components/toastBuilders/YtDoubleConfirm.ets

@@ -0,0 +1,54 @@
+import { YTButton, yTToast, } from '../../../../../Index';
+import { BasicType } from '../../models';
+
+@Builder
+export function yTDoubleConfirm(item: BasicType<undefined>) {
+  Column() {
+    Text(item.text)
+      .fontSize(14)
+      .fontColor(Color.Black)
+      .margin({ bottom: 18 })
+    Text(item.message)
+      .fontColor($r('sys.color.mask_secondary'))
+      .lineHeight(18)
+      .fontSize(13)
+      .margin({ bottom: 18 })
+    Row() {
+      YTButton(
+        {
+          btContent: '确定',
+          btWidth: 108,
+          btHeight: 37,
+          btFontSize: 12,
+          click: item.click,
+          btLinearGradient: { angle: 92, colors: [['#FF4597F7', 0.023], ['#FF6B6DF7', 1.081]] },
+        }
+      )
+      YTButton(
+        {
+          btContent: '取消',
+          btWidth: 108,
+          btHeight: 37,
+          btFontColor: '#80000000',
+          btBorder: { width: 1, color: '#33000000' },
+          btFontSize: 12,
+          bgc: Color.White,
+          click: () => {
+            yTToast.hide()
+          }
+        }
+      )
+    }
+    .justifyContent(FlexAlign.SpaceBetween)
+    .width('100%')
+  }
+  .width(280)
+  .padding({
+    top: 14,
+    left: 24,
+    right: 24,
+    bottom: 24
+  })
+  .backgroundColor(Color.White)
+  .borderRadius(8)
+}

+ 30 - 31
commons/basic/src/main/ets/datepicker/WheelPicker.ets

@@ -2,14 +2,13 @@
  * 滚轮式日期选择器组件
  */
 
-import { YTDateUtil } from '../utils/YTDateUtil';
+import { YTDateUtil } from '../utils/arkts/utils/YTDateUtil';
 import { UnitType } from './DatePickerEnums';
 
 @Component
 export struct WheelPicker {
   @Prop @Require date: Date;
   @State dateLocal: Date = new Date();
-  upDate: (date: Date) => void = (date: Date) => {};
   @Prop @Require minDate: Date;
   @Prop @Require maxDate: Date;
   @Prop @Require unitType: UnitType;
@@ -27,14 +26,12 @@ export struct WheelPicker {
   @State selectedDayString: string = '';
   @State debounceYear: number = -1;
   @State debounceMonth: number = -1;
-
-  @Prop highlightBackgroundColor:ResourceColor
-  @Prop highlightBorderColor:ResourceColor
-  @Prop selectedTextStyle:PickerTextStyle
-  @Prop textStyle:PickerTextStyle
-
-
-
+  @Prop highlightBackgroundColor: ResourceColor
+  @Prop highlightBorderColor: ResourceColor
+  @Prop selectedTextStyle: PickerTextStyle
+  @Prop textStyle: PickerTextStyle
+  upDate: (date: Date) => void = (date: Date) => {
+  };
 
   aboutToAppear() {
     // 设置初始选中值
@@ -94,18 +91,18 @@ export struct WheelPicker {
 
     for (let month = minMonth; month <= maxMonth; month++) {
       //补零
-      this.monthsString.push(YTDateUtil.padNumber(month)+'月')
+      this.monthsString.push(YTDateUtil.padNumber(month) + '月')
       this.months.push(month);
     }
 
     // 确保选中的月份在可选范围内
-    console.log('选择的月份是',this.selectedMonth)
+    console.log('选择的月份是', this.selectedMonth)
     if (this.selectedMonth < minMonth) {
       this.selectedMonth = minMonth;
-      this.selectedMonthString = YTDateUtil.padNumber(minMonth)+'月';
+      this.selectedMonthString = YTDateUtil.padNumber(minMonth) + '月';
     } else if (this.selectedMonth > maxMonth) {
       this.selectedMonth = maxMonth;
-      this.selectedMonthString = YTDateUtil.padNumber(minMonth)+'月';
+      this.selectedMonthString = YTDateUtil.padNumber(minMonth) + '月';
     }
   }
 
@@ -128,16 +125,16 @@ export struct WheelPicker {
 
     for (let day = minDay; day <= maxDay; day++) {
       this.days.push(day);
-      this.daysString.push(day.toString()+'日');
+      this.daysString.push(day.toString() + '日');
     }
 
     // 确保选中的日期在可选范围内
     if (this.selectedDay < minDay) {
       this.selectedDay = minDay;
-      this.selectedDayString = this.selectedDay+'日';
+      this.selectedDayString = this.selectedDay + '日';
     } else if (this.selectedDay > maxDay) {
       this.selectedDay = maxDay;
-      this.selectedDayString = this.selectedDay+'日';
+      this.selectedDayString = this.selectedDay + '日';
     }
   }
 
@@ -158,7 +155,8 @@ export struct WheelPicker {
       .height(44)
       .backgroundColor(this.highlightBackgroundColor)
       .borderRadius(44)
-      .border({width: 1, color: this.highlightBorderColor})
+      .border({ width: 1, color: this.highlightBorderColor })
+
       Row() {
         // 根据单位类型显示不同的选择器
         if (this.unitType === UnitType.YEAR || this.unitType === UnitType.YEAR_MONTH ||
@@ -180,7 +178,7 @@ export struct WheelPicker {
 
               this.debounceYear = setTimeout(() => {
 
-                this.selectedYear = Number((val as string).replace('年',''));
+                this.selectedYear = Number((val as string).replace('年', ''));
                 this.selectedYearString = val as string;
                 this.initMonths();
                 this.initDays();
@@ -188,10 +186,10 @@ export struct WheelPicker {
                 this.debounceYear = -1;
               }, 300); // 300ms 的防抖延迟
             })
- /*         Text('年')
-            .fontSize(16)
-            .fontColor(Color.Black)
-            .margin({ left: 10, right: 16 })*/
+          /*         Text('年')
+                     .fontSize(16)
+                     .fontColor(Color.Black)
+                     .margin({ left: 10, right: 16 })*/
         }
 
         if (this.unitType === UnitType.MONTH || this.unitType === UnitType.YEAR_MONTH ||
@@ -222,10 +220,10 @@ export struct WheelPicker {
 
             })
 
-   /*       Text('月')
-            .fontSize(16)
-            .margin({ left: 3, right: 16 })
-            .fontColor(Color.Black)*/
+          /*       Text('月')
+                   .fontSize(16)
+                   .margin({ left: 3, right: 16 })
+                   .fontColor(Color.Black)*/
         }
 
         if (this.unitType === UnitType.DAY || this.unitType === UnitType.MONTH_DAY ||
@@ -249,12 +247,13 @@ export struct WheelPicker {
               this.updateDate();
             })
 
-/*          Text('日')
-            .fontSize(16)
-            .fontColor(Color.Black)*/
+          /*          Text('日')
+                      .fontSize(16)
+                      .fontColor(Color.Black)*/
         }
       }
-      .justifyContent((this.unitType==UnitType.YEAR||this.unitType==UnitType.MONTH||this.unitType==UnitType.DAY)?FlexAlign.Center:FlexAlign.SpaceBetween)
+      .justifyContent((this.unitType == UnitType.YEAR || this.unitType == UnitType.MONTH ||
+        this.unitType == UnitType.DAY) ? FlexAlign.Center : FlexAlign.SpaceBetween)
       .width('100%')
       .padding({ left: 25, right: 25 })
 

+ 155 - 157
commons/basic/src/main/ets/datepicker/YTDataPickerSelector.ets

@@ -1,5 +1,5 @@
 import { YTHeader } from "../components/generalComp/YTHeader";
-import { YTDateUtil } from "../utils/YTDateUtil";
+import { YTDateUtil } from "../utils/arkts/utils/YTDateUtil";
 import { ResultType, UnitType } from "./DatePickerEnums";
 import { QNUIFloatingContainer } from "./YTUIFloatingContainer"
 import { WheelPicker } from "./WheelPicker";
@@ -14,113 +14,115 @@ export struct YTUIDatePickerComponent {
   @Prop @Require maxDate: Date; // 最大可选日期,默认10年后
   @Prop @Require unitType: UnitType; // 单位类型,默认为年月日
   @State isVisible: string = '100%'; // 是否显示选择器
+  title: string = '选择日期'
+  @Prop headerBuilder: DatePickerHeaderGlobalBuilder
+  @Prop highlightBackgroundColor: ResourceColor
+  @Prop highlightBorderColor: ResourceColor
+  @Prop selectedTextStyle: PickerTextStyle
+  @Prop textStyle: PickerTextStyle
   // 回调函数
   confirm: (date: Date) => void = () => {
   };
   close: () => void = () => {
   };
-  title:string = '选择日期'
-  @Prop headerBuilder:DatePickerHeaderGlobalBuilder
-  @Prop highlightBackgroundColor:ResourceColor
-  @Prop highlightBorderColor:ResourceColor
-  @Prop selectedTextStyle:PickerTextStyle
-  @Prop textStyle:PickerTextStyle
 
   aboutToAppear(): void {
     this.dateLocal = this.date;
-    console.log('aboutToAppear',YTDateUtil.formatDate(this.dateLocal))
-  }
-
-  // 确认选择
-  private onConfirm(): void {
-    this.confirm?.( this.dateLocal);
-    this.isVisible = '100%'
-    this.close?.()
-
-  }
-
-  // 取消选择
-  private onCancel(): void {
-    // this.confirm(ResultType.CANCEL, this.dateLocal);
-    this.isVisible = '100%'
-    this.close?.()
+    console.log('aboutToAppear', YTDateUtil.formatDate(this.dateLocal))
   }
 
   build() {
     Column() {
-        Column() {
-          //标题
-          Column({space:12}){
-            YTHeader({
-              defaultStyle:{
-                backArrow:true,
-                title:this.title,
-              },
-              headerHeight: 44,
-              headerPadding:0,
-              rightComp:()=>{
-                this.headerRightBuilder()
-              },
-              leftComp:()=>{
-                this.headerLeftBuilder()
-              }
-            })
-            Divider()
-              .strokeWidth(1)
-              .color('#DFDFDF')
-          }
-          .width('100%')
-          .padding({top:10,bottom:10})
-
-          WheelPicker({
-            date: this.date,
-            minDate: this.minDate,
-            maxDate: this.maxDate,
-            unitType: this.unitType,
-            highlightBackgroundColor:this.highlightBackgroundColor,
-            highlightBorderColor:this.highlightBorderColor,
-            textStyle:this.textStyle,
-            selectedTextStyle:this.selectedTextStyle,
-            upDate: (date: Date) => {
-              this.dateLocal = date
+      Column() {
+        //标题
+        Column({ space: 12 }) {
+          YTHeader({
+            defaultStyle: {
+              backArrow: true,
+              title: this.title,
+            },
+            headerHeight: 44,
+            headerPadding: 0,
+            rightComp: () => {
+              this.headerRightBuilder()
+            },
+            leftComp: () => {
+              this.headerLeftBuilder()
             }
           })
+          Divider()
+            .strokeWidth(1)
+            .color('#DFDFDF')
         }
-        .backgroundColor(Color.White)
         .width('100%')
-        .borderRadius({ topLeft: 14, topRight: 14 })
-        .constraintSize({minHeight:300,maxHeight:320})
-        .padding({left:20,right:20})
+        .padding({ top: 10, bottom: 10 })
+
+        WheelPicker({
+          date: this.date,
+          minDate: this.minDate,
+          maxDate: this.maxDate,
+          unitType: this.unitType,
+          highlightBackgroundColor: this.highlightBackgroundColor,
+          highlightBorderColor: this.highlightBorderColor,
+          textStyle: this.textStyle,
+          selectedTextStyle: this.selectedTextStyle,
+          upDate: (date: Date) => {
+            this.dateLocal = date
+          }
+        })
+      }
+      .backgroundColor(Color.White)
+      .width('100%')
+      .borderRadius({ topLeft: 14, topRight: 14 })
+      .constraintSize({ minHeight: 300, maxHeight: 320 })
+      .padding({ left: 20, right: 20 })
     }
     .width('100%')
     .backgroundColor(Color.White)
     // .onAppear(() => {
     //   this.isVisible = '0'
     // })
-    .borderRadius({topLeft:24,topRight:24})
+    .borderRadius({ topLeft: 24, topRight: 24 })
+
     // .translate({ y: this.isVisible })
     // .animation({ duration: 200 })
 
   }
+
   @Builder
-  headerRightBuilder(){
-    Column(){
+  headerRightBuilder() {
+    Column() {
       this.headerBuilder.headerRightBuilder.builder()
     }
-    .onClick(()=>{
+    .onClick(() => {
       this.onConfirm()
     })
   }
 
   @Builder
-  headerLeftBuilder(){
-    Column(){
+  headerLeftBuilder() {
+    Column() {
       this.headerBuilder.headerLeftBuilder.builder()
     }
-    .onClick(()=>{
+    .onClick(() => {
       this.onCancel()
     })
   }
+
+  // 确认选择
+  private onConfirm(): void {
+    this.confirm?.( this.dateLocal);
+    this.isVisible = '100%'
+    this.close?.()
+
+  }
+
+  // 取消选择
+  private onCancel(): void {
+    // this.confirm(ResultType.CANCEL, this.dateLocal);
+    this.isVisible = '100%'
+    this.close?.()
+  }
 }
 
 export class DateOption {
@@ -148,50 +150,45 @@ export class DateOption {
    * 确认选择回调
    */
   confirm?: (date: Date) => void;
-
   /**
    * 头部左侧按钮
    */
-  headerLeftBuilder?:WrappedBuilder<[]>
+  headerLeftBuilder?: WrappedBuilder<[]>
   /**
    * 头部右侧按钮
    */
-  headerRightBuilder?:WrappedBuilder<[]>
+  headerRightBuilder?: WrappedBuilder<[]>
   /**
    * 标题
    */
-  title?:string
+  title?: string
   /**
    * 高亮背景色
    */
-  highlightBackgroundColor?:ResourceColor
-
+  highlightBackgroundColor?: ResourceColor
   /**
    * 高亮边框颜色
    */
-  highlightBorderColor?:ResourceColor
-
+  highlightBorderColor?: ResourceColor
   /**
    * 选中的字体样式
    */
-  selectedTextStyle?:PickerTextStyle
-
-
+  selectedTextStyle?: PickerTextStyle
   /**
    * 非选中的字体样式
    */
-  textStyle?:PickerTextStyle
+  textStyle?: PickerTextStyle
 }
 
 @Builder
-function headerLeftBuilder(){
+function headerLeftBuilder() {
   Image($r('app.media.ic_back'))
     .width(24)
     .margin({ left: 16 })
 }
 
 @Builder
-function headerRightBuilder(){
+function headerRightBuilder() {
   Image($r("app.media.slice_sure"))
     .width(24)
 }
@@ -201,28 +198,28 @@ function headerRightBuilder(){
 export class YTDatePickerOptions extends DateOption {
   @Trace
   isEnd?: boolean = false
+  headerBuilder?: DatePickerHeaderGlobalBuilder
   cancel?: () => void = () => {
   }
-  headerBuilder?:DatePickerHeaderGlobalBuilder
 }
 
 // 组件包装器
 @Builder
 export function YTDatePickerViewBuilder(param: YTDatePickerOptions) {
-  Column(){
+  Column() {
     YTUIDatePickerComponent({
-      date: param.date|| new Date(),
-      minDate: param.minDate|| YTDateUtil.getYearToday(-10),
-      maxDate: param.maxDate||YTDateUtil.getYearToday(10),
-      unitType: param.unitType||UnitType.YEAR_MONTH_DAY,
+      date: param.date || new Date(),
+      minDate: param.minDate || YTDateUtil.getYearToday(-10),
+      maxDate: param.maxDate || YTDateUtil.getYearToday(10),
+      unitType: param.unitType || UnitType.YEAR_MONTH_DAY,
       confirm: param.confirm,
       close: param.cancel,
-      title:param.title,
-      headerBuilder:param.headerBuilder,
-      highlightBackgroundColor:param.highlightBackgroundColor,
-      highlightBorderColor:param.highlightBorderColor,
-      selectedTextStyle:param.selectedTextStyle,
-      textStyle:param.textStyle,
+      title: param.title,
+      headerBuilder: param.headerBuilder,
+      highlightBackgroundColor: param.highlightBackgroundColor,
+      highlightBorderColor: param.highlightBorderColor,
+      selectedTextStyle: param.selectedTextStyle,
+      textStyle: param.textStyle,
     });
   }
   .width('100%')
@@ -246,72 +243,13 @@ export class YTAddressSelectorDialog {
     this.uiContext = uiContext;
 
   }
-  // 拷贝传入的配置到携带picker的配置中(Builder仅支持传递一个参数)
-  private optionToPickerOption(option: DateOption): YTDatePickerOptions {
-    const dateOptionAndPicker = new YTDatePickerOptions();
-
-    // 显式复制每个属性(仅复制用户传入的值,保留未传参数的默认值)
-    if (option.date !== undefined) {
-      dateOptionAndPicker.date = option.date
-    }
-    if (option.minDate !== undefined) {
-      dateOptionAndPicker.minDate = option.minDate;
-    }
-    if (option.maxDate !== undefined) {
-      dateOptionAndPicker.maxDate = option.maxDate;
-    }
-    if (option.unitType !== undefined) {
-      dateOptionAndPicker.unitType = option.unitType;
-    }
-    if (option.headerLeftBuilder !== undefined) {
-      dateOptionAndPicker.headerLeftBuilder = option.headerLeftBuilder
-    }
-    if (option.title !== undefined) {
-      dateOptionAndPicker.title = option.title
-    }else {
-      dateOptionAndPicker.title = '选择日期'
-    }
-
-    dateOptionAndPicker.headerBuilder = new DatePickerHeaderGlobalBuilder()
-    if (option.headerLeftBuilder !== undefined) {
-      dateOptionAndPicker.headerBuilder.headerLeftBuilder = option.headerLeftBuilder
-    }else {
-      dateOptionAndPicker.headerBuilder.headerLeftBuilder = wrapBuilder(headerLeftBuilder)
-    }
-    if (option.headerRightBuilder !== undefined) {
-      dateOptionAndPicker.headerBuilder.headerRightBuilder = option.headerRightBuilder
-    }else {
-      dateOptionAndPicker.headerBuilder.headerRightBuilder = wrapBuilder(headerRightBuilder)
-    }
-    if (option.highlightBackgroundColor!==undefined) {
-      dateOptionAndPicker.highlightBackgroundColor = option.highlightBackgroundColor
-    }else {
-      dateOptionAndPicker.highlightBackgroundColor ='#FFFFF6D1'
-    }
-    if (option.highlightBorderColor!==undefined) {
-      dateOptionAndPicker.highlightBorderColor = option.highlightBorderColor
-    }else {
-      dateOptionAndPicker.highlightBorderColor =Color.Transparent
-    }
-    if (option.selectedTextStyle!==undefined) {
-      dateOptionAndPicker.selectedTextStyle = option.selectedTextStyle
-    }else {
-      dateOptionAndPicker.selectedTextStyle = { font: { size: 16,weight:500 }, color: '#CC353C46' }
-    }
-    if (option.textStyle!==undefined) {
-      dateOptionAndPicker.textStyle = option.textStyle
-    }else {
-      dateOptionAndPicker.textStyle = { font: { size: 16,weight:500 }, color: '#CC353C46' }
-    }
-    return dateOptionAndPicker;
-  }
 
   // 显示地址选择器对话框
-  public show(dateOption?:DateOption) {
-    let option:DateOption = {}
+  public show(dateOption?: DateOption) {
+    let option: DateOption = {}
     if (dateOption) {
       option = dateOption
-    }else {
+    } else {
       option = new DateOption()
     }
     const pickerOption = this.optionToPickerOption(option)
@@ -366,6 +304,66 @@ export class YTAddressSelectorDialog {
   public hide() {
     this.dialog?.dismissDialog();
   }
+
+  // 拷贝传入的配置到携带picker的配置中(Builder仅支持传递一个参数)
+  private optionToPickerOption(option: DateOption): YTDatePickerOptions {
+    const dateOptionAndPicker = new YTDatePickerOptions();
+
+    // 显式复制每个属性(仅复制用户传入的值,保留未传参数的默认值)
+    if (option.date !== undefined) {
+      dateOptionAndPicker.date = option.date
+    }
+    if (option.minDate !== undefined) {
+      dateOptionAndPicker.minDate = option.minDate;
+    }
+    if (option.maxDate !== undefined) {
+      dateOptionAndPicker.maxDate = option.maxDate;
+    }
+    if (option.unitType !== undefined) {
+      dateOptionAndPicker.unitType = option.unitType;
+    }
+    if (option.headerLeftBuilder !== undefined) {
+      dateOptionAndPicker.headerLeftBuilder = option.headerLeftBuilder
+    }
+    if (option.title !== undefined) {
+      dateOptionAndPicker.title = option.title
+    } else {
+      dateOptionAndPicker.title = '选择日期'
+    }
+
+    dateOptionAndPicker.headerBuilder = new DatePickerHeaderGlobalBuilder()
+    if (option.headerLeftBuilder !== undefined) {
+      dateOptionAndPicker.headerBuilder.headerLeftBuilder = option.headerLeftBuilder
+    } else {
+      dateOptionAndPicker.headerBuilder.headerLeftBuilder = wrapBuilder(headerLeftBuilder)
+    }
+    if (option.headerRightBuilder !== undefined) {
+      dateOptionAndPicker.headerBuilder.headerRightBuilder = option.headerRightBuilder
+    } else {
+      dateOptionAndPicker.headerBuilder.headerRightBuilder = wrapBuilder(headerRightBuilder)
+    }
+    if (option.highlightBackgroundColor !== undefined) {
+      dateOptionAndPicker.highlightBackgroundColor = option.highlightBackgroundColor
+    } else {
+      dateOptionAndPicker.highlightBackgroundColor = '#FFFFF6D1'
+    }
+    if (option.highlightBorderColor !== undefined) {
+      dateOptionAndPicker.highlightBorderColor = option.highlightBorderColor
+    } else {
+      dateOptionAndPicker.highlightBorderColor = Color.Transparent
+    }
+    if (option.selectedTextStyle !== undefined) {
+      dateOptionAndPicker.selectedTextStyle = option.selectedTextStyle
+    } else {
+      dateOptionAndPicker.selectedTextStyle = { font: { size: 16, weight: 500 }, color: '#CC353C46' }
+    }
+    if (option.textStyle !== undefined) {
+      dateOptionAndPicker.textStyle = option.textStyle
+    } else {
+      dateOptionAndPicker.textStyle = { font: { size: 16, weight: 500 }, color: '#CC353C46' }
+    }
+    return dateOptionAndPicker;
+  }
 }
 
 

+ 1 - 1
commons/basic/src/main/ets/models/LoginCollect.ets

@@ -1,6 +1,6 @@
 import { YTLog } from '../../../../Index';
 import { IBestToast } from '@ibestservices/ibest-ui';
-import { YTToast } from '../utils/YTToast';
+import { YTToast } from '../utils/arkts/utils/YTToast';
 import { AppStorageKeyCollect } from '../constants';
 import { YTUserRequest } from '../apis/YTUserRequest';
 

+ 2 - 0
commons/basic/src/main/ets/models/UserInfo.ets

@@ -206,3 +206,5 @@ export const userInfo = UserInfo.getInstance()
 
 
 
+
+

+ 1 - 2
commons/basic/src/main/ets/rdb/utils/RelationalStoreUtis.ts

@@ -118,7 +118,7 @@ export class RelationalStoreUtils {
     }
 
     if (RelationalStoreUtils.cloudLoadStore !== undefined) {
-    id =   (RelationalStoreUtils.cloudLoadStore as relationalStore.RdbStore).insertSync(table.name, insertParam)
+      id = (RelationalStoreUtils.cloudLoadStore as relationalStore.RdbStore).insertSync(table.name, insertParam)
     }
     return id
   }
@@ -203,7 +203,6 @@ export class RelationalStoreUtils {
         );
       }
       const resultSet = (RelationalStoreUtils.cloudLoadStore as relationalStore.RdbStore).querySync(predicates)
-
       // 获取列名信息
       const columnNames = resultSet.columnNames
 

+ 3 - 3
commons/basic/src/main/ets/styles/AttributeModifier.ets

@@ -1,5 +1,5 @@
 import StyleConstants from '../constants/StyleConstants'
-import { YTAvoid } from '../utils/YTAvoid'
+import { YTAvoid } from '../utils/arkts/utils/YTAvoid'
 
 export class BackgroundPageModifier implements AttributeModifier<CommonAttribute> {
   isNeedImage: boolean
@@ -23,7 +23,7 @@ export class BackgroundPageModifier implements AttributeModifier<CommonAttribute
         .backgroundImagePosition(Alignment.Center)
         .padding({
           top: this.isNeedPaddingTop ? YTAvoid.getTop() : 0,
-          bottom: this.isNeedPaddingBottom ? YTAvoid.getBottom(): 0,
+          bottom: this.isNeedPaddingBottom ? YTAvoid.getBottom() : 0,
           left: 10,
           right: 10
         })
@@ -34,7 +34,7 @@ export class BackgroundPageModifier implements AttributeModifier<CommonAttribute
         .backgroundColor($r("app.color.theme_bg_color"))
         .padding({
           top: this.isNeedPaddingTop ? YTAvoid.getTop() : 0,
-          bottom: this.isNeedPaddingBottom ? YTAvoid.getBottom(): 0,
+          bottom: this.isNeedPaddingBottom ? YTAvoid.getBottom() : 0,
           left: 10,
           right: 10
         })

+ 1 - 1
commons/basic/src/main/ets/utils/wechat/WXApiWrap.ets → commons/basic/src/main/ets/utils/arkts/wechat/WXApiWrap.ets

@@ -1,5 +1,5 @@
 import * as wxopensdk from '@tencent/wechat_open_sdk';
-import { APP_ID } from '../../constants';
+import { APP_ID } from '../../../constants';
 
 
 export type OnWXReq = (req: wxopensdk.BaseReq) => void

+ 37 - 23
features/feature/src/main/ets/view/MainView.ets

@@ -1,14 +1,12 @@
-import { BackgroundPageModifier, DateOption, YTAddressSelectorDialog,
-  YTCalendarPicker,
-  YTDateUtil,
-  YtProgressComp,
-  yTRouter } from 'basic'
 import { UnitType } from 'basic/src/main/ets/datepicker/DatePickerEnums'
 import { promptAction } from '@kit.ArkUI'
+import { tkAdHelper } from 'basic/src/main/ets/ads/tkAd/utils/TkAdHelper'
+import { DateOption, TkBannerAdComp, YTAddressSelectorDialog, YTDateUtil, YtProgressComp, yTRouter } from 'basic'
 
 @Component
 export struct MainView {
-  @State point:number = 40
+  @State point: number = 40
+
   build() {
     Column() {
       Text('打开日历')
@@ -41,41 +39,57 @@ export struct MainView {
           }
           yTDateDialog.show(dateOption) //设置好配置之后打开日历的函数
         })
-
       Button('跳转页面测试')
-        .onClick(()=>{
-          yTRouter.pushPathByName('TestRouterPage',null)
+        .onClick(() => {
+          yTRouter.pushPathByName('TestRouterPage', null)
+        })
+
+      Button('播放激励广告')
+        .onClick(() => {
+          tkAdHelper.showRewardAd()
         })
 
-      YTCalendarPicker()
+
+      Button('播放插屏广告')
+        .onClick(() => {
+          tkAdHelper.showInterstitialAd()
+        })
+
+      TkBannerAdComp()
+
+      CalendarPicker()
 
       YtProgressComp({
-        growPoint:this.point,
-        v1Point:{
-          point:100,
-          position:4
+        growPoint: this.point,
+        v1Point: {
+          point: 100,
+          position: 4
         },
-        v2Point:{
-          point:200,
-          position:10,
-          topImage:$r('app.media.app_icon'),
+        v2Point: {
+          point: 200,
+          position: 10,
+          topImage: $r('app.media.app_icon'),
         }
       })
-      Row(){
+      Row() {
         Button('+10')
-          .onClick(()=>{
+          .onClick(() => {
             this.point += 10
           })
         Button('-10')
-          .onClick(()=>{
+          .onClick(() => {
             this.point -= 10
           })
       }
     }
-    .attributeModifier(new BackgroundPageModifier(true))
-
+    .width('100%')
+    .height('100%')
 
   }
+
+  // .attributeModifier(new BackgroundPageModifier(true))
+
+
 }
 
 @Builder

+ 9 - 7
features/feature/src/main/ets/view/ThirdView.ets

@@ -1,12 +1,14 @@
-import { Pet, RDBMapper, RelationalStoreUtils, Test } from "basic";
+import { Pet, RDBMapper, RelationalStoreUtils, Test } from 'basic';
 
 @Component
 export struct ThirdView {
   @State list: Test[] = []
   @State list2: Pet[] = []
-  id1:number = 0
-  id2:number = 0
-  petMapper:RDBMapper<Pet> = new RDBMapper(Pet)
+  id1: number = 0
+  id2: number = 0
+  petMapper: RDBMapper<Pet> = new RDBMapper(Pet)
+  petMapper2: RDBMapper<Test> = new RDBMapper(Test)
+
   build() {
     Column() {
       Row() {
@@ -50,7 +52,7 @@ export struct ThirdView {
       Row() {
         Button('测试新增2')
           .onClick(() => {
-            this.petMapper.insert( { name: 'test1', tag: '标签' }, (id:number) => {
+            this.petMapper.insert({ name: 'test1', tag: '标签' }, (id: number) => {
               console.log('insert success');
               this.id2 = id
               let list = this.petMapper.getListSync()
@@ -61,10 +63,10 @@ export struct ThirdView {
 
         Button('测试修改2')
           .onClick(() => {
-            this.petMapper.updateItemById({ id: this.id2, name: '测试1修改',tag: '标签2' }, () => {
+            this.petMapper.updateItemById({ id: this.id2, name: '测试1修改', tag: '标签2' }, () => {
               console.log('insert success');
               let list = this.petMapper.getListSync()
-              this.list2= list
+              this.list2 = list
               console.log('list:', JSON.stringify(list))
             })
           })

+ 1 - 0
features/user/src/main/ets/views/RegisterOrResetPassView.ets

@@ -70,6 +70,7 @@ export struct RegisterOrResetPassComp {
         .fontColor('#FFEA4A18')
 
 
+
       YTButton({
         //: '立即重置'
         btContent: this.calcButtonContent(),

BIN
libs/GDTUnionSDK-default-release.har


BIN
libs/KSAdSDK-3.0.5.har


BIN
libs/anythink_network_csj.har


BIN
libs/anythink_network_gdt.har


BIN
libs/anythink_network_huawei.har


BIN
libs/anythink_network_ks.har


BIN
libs/anythink_sdk.har


BIN
libs/openadsdk.har


+ 9 - 1
oh-package.json5

@@ -1,11 +1,19 @@
 {
   "modelVersion": "5.0.2",
   "description": "Please describe the basic information.",
+  "buildOption": {
+  },
   "dependencies": {
     "@hadss/debug-db": "^1.0.0-rc.10"
   },
   "devDependencies": {
     "@ohos/hypium": "1.0.21",
-    "@ohos/hamock": "1.0.0"
+    "@ohos/hamock": "1.0.0",
+  },
+  "overrides": {
+    'ksadsdk': "file:./libs/KSAdSDK-3.0.5.har",
+    '@csj/openadsdk': "file:./libs/openadsdk.har",
+    '@gdt/gdt-union-sdk': "file:./libs/GDTUnionSDK-default-release.har",
+    'anythink_sdk': "file:./libs/anythink_sdk.har"
   }
 }

+ 11 - 1
products/entry/src/main/ets/entryability/EntryAbility.ets

@@ -2,7 +2,13 @@ import { AbilityConstant, bundleManager, ConfigurationConstant, UIAbility, Want
 import { hilog } from '@kit.PerformanceAnalysisKit';
 import { window } from '@kit.ArkUI';
 import {
-  AppStorageKeyCollect, IBestInit, RelationalStoreUtils, YTAvoid, YTBreakPoint, YTLog
+  AppStorageKeyCollect,
+  IBestInit,
+  RelationalStoreUtils,
+  windowHelper,
+  YTAvoid,
+  YTBreakPoint,
+  YTLog
 } from 'basic';
 import BuildProfile from 'BuildProfile';
 
@@ -23,6 +29,8 @@ export default class EntryAbility extends UIAbility {
         hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err));
         return;
       }
+      windowHelper.init(windowStage)
+
 
       // 动态引入: 仅在 DEBUG 模式下引入该模块
       if (BuildProfile.DEBUG) {
@@ -51,6 +59,8 @@ export default class EntryAbility extends UIAbility {
         .catch((err: Error) => {
           YTLog.error(err)
         })
+
+      RelationalStoreUtils.initReplayCloudStore(this.context)
       const windowClass = windowStage.getMainWindowSync()
       windowClass.setWindowLayoutFullScreen(true)
       const top = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height

+ 53 - 40
products/entry/src/main/ets/pages/Index.ets

@@ -1,4 +1,6 @@
-import { BasicType, ContextHelper, YTAvoid, yTRouter } from 'basic';
+import {
+  BasicType, ContextHelper, TkBannerAdComp, TkStartAdComp, YTAvoid, yTRouter
+} from 'basic';
 import { Mine } from 'user/src/main/ets/views/Mine';
 import { MainView, SecondView, ThirdView } from 'feature';
 
@@ -33,56 +35,67 @@ struct Index {
   tabsController: TabsController = new TabsController()
 
   aboutToAppear(): void {
-    // 设置为 false 表示为单机 app
-    ContextHelper.init(this.getUIContext(), false)
+    ContextHelper.init(this.getUIContext(), getContext())
+
+
   }
 
   build() {
-    Navigation(yTRouter) {
-      Column() {
-        Tabs({ controller: this.tabsController }) {
-          ForEach(this.contentList, (_: BasicType<undefined>, index) => {
-            TabContent() {
-              if (index == 0) {
-                //放对应组件
-                MainView()
-              } else if (index == 1) {
-                SecondView()
-              } else if (index == 2) {
-                ThirdView()
-              } else {
-                Mine()
+
+    Stack() {
+      Navigation(yTRouter) {
+        Column() {
+          Tabs({ controller: this.tabsController }) {
+            ForEach(this.contentList, (_: BasicType<undefined>, index) => {
+              TabContent() {
+                if (index == 0) {
+                  //放对应组件
+                  MainView()
+                } else if (index == 1) {
+                  SecondView()
+                } else if (index == 2) {
+                  ThirdView()
+                } else {
+                  Mine()
+                }
               }
-            }
+            })
+          }
+          .onChange((index) => {
+            this.currentIndex = index
           })
-        }
-        .onChange((index) => {
-          this.currentIndex = index
-        })
-        .barHeight(0)
-        .layoutWeight(1)
-        .scrollable(false)
+          .barHeight(0)
+          .layoutWeight(1)
+          .scrollable(false)
 
-        Row() {
-          ForEach(this.contentList, (item: BasicType<undefined>, index) => {
-            this.barBuilder((() => {
-              item.index = index
-              return item
-            })())
-          })
+          Row() {
+            ForEach(this.contentList, (item: BasicType<undefined>, index) => {
+              this.barBuilder((() => {
+                item.index = index
+                return item
+              })())
+            })
+          }
+          .justifyContent(FlexAlign.SpaceAround)
+          .width('100%')
+          .padding({ bottom: this.bottom })
+          .shadow({ offsetY: -13, radius: 16, color: '#0A000000' })
         }
-        .justifyContent(FlexAlign.SpaceAround)
         .width('100%')
-        .padding({ bottom: this.bottom })
-        .shadow({ offsetY: -13, radius: 16, color: '#0A000000' })
+        .height('100%')
+        .backgroundColor(Color.White)
+
+      }
+      .mode(NavigationMode.Stack)
+      .hideToolBar(true)
+
+      TkStartAdComp() {
+        Text('占位组件')
       }
-      .width('100%')
-      .height('100%')
-      .backgroundColor(Color.White)
+
 
     }
-    .mode(NavigationMode.Stack)
-    .hideToolBar(true)
+
   }
 
   @Builder

+ 3 - 0
products/entry/src/main/module.json5

@@ -15,6 +15,9 @@
       {
         "name": "ohos.permission.INTERNET"
       },
+      {
+        "name": "ohos.permission.GET_NETWORK_INFO"   //访问⽹络信息  可选,影响转化
+      },
       {
         "name": "ohos.permission.APP_TRACKING_CONSENT",
         "reason": "$string:reason",

BIN
sign/聊天恋爱宝调试证书.p7b