广告点击添加

This commit is contained in:
谢宇宁
2026-09-15 22:40:36 +07:00
parent d2a6c648e1
commit c5e5ec17df
9 changed files with 28 additions and 13 deletions
@@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:hgdj/hj_model/video_model.dart';
import 'package:hgdj/hj_utils/api_service/common_service.dart';
import 'package:hgdj/routers/jump_router.dart';
import '../../../hj_model/splash/ads_model.dart';
@@ -14,7 +15,10 @@ class FeedAdView extends StatelessWidget {
Widget build(BuildContext context) {
final AdsInfoModel? adv = mediaInfo?.randomAdsInfo;
return GestureDetector(
onTap: () => pushToPageByLink(adv?.href),
onTap: () {
pushToPageByLink(adv?.href);
CommonService.adsClick(adv?.id);
},
// 强制全屏铺满(与视频页一致),避免 iOS 上未撑满导致显示不全
child: SizedBox.expand(
child: NetworkImageLoader(
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hgdj/hj_model/splash/ads_model.dart';
import 'package:hgdj/hj_utils/api_service/common_service.dart';
import 'package:hgdj/routers/jump_router.dart';
import 'package:hgdj/tools_base/ad_manager.dart';
import 'package:hgdj/tools_base/widget/net_image_widget.dart';
@@ -35,7 +36,10 @@ class _FloatAdViewState extends State<FloatAdView> {
clipBehavior: Clip.none,
children: [
GestureDetector(
onTap: () => pushToPageByLink(ad.href),
onTap: () {
pushToPageByLink(ad.href);
CommonService.adsClick(ad.id);
},
child: NetworkImageLoader(
imageUrl: cover,
width: 70,