| 123456789101112131415161718192021222324 |
- import { common } from '@kit.AbilityKit';
- import { RewardAd } from '../../ads/jhAd/RewardAd';
- import { emitter } from '@kit.BasicServicesKit';
- @Component
- export struct ShowJHRewardAd {
- @BuilderParam showAdStruct: () => void
- private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext;
- aboutToAppear(): void {
- emitter.on('showJHAd', () => {
- new RewardAd(this.context)
- })
- }
- aboutToDisappear(): void {
- emitter.off('showJHAd')
- }
- build() {
- this.showAdStruct()
- }
- }
|