hejianhao
2026-04-29 f67c2084dd1f9d9237755571888b756b2f3997bb
feat: 添加营销活动弹窗关闭时的券订阅逻辑

在关闭营销活动弹窗时,触发活动券订阅以进行频控。使用活动主键(id、popupId 或 activityId)作为订阅的业务标识。
2个文件已修改
13 ■■■■■ 已修改文件
src/pages/robotaxi/home/index.tsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/begin-route/hooks/use-order-actions.ts 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/home/index.tsx
@@ -70,6 +70,7 @@
import { getServicePhone } from '../../../robotaxi/api/customer-service';
import { getOrderDistance } from '../../../robotaxi/api/select-map-site';
import { checkOtp, toH5 } from '../../../utils/tools';
import { subscribeOperationCouponGroup } from '../../../utils/subscribe';
type HomeTripStatus = TripStatus | 0;
@@ -533,6 +534,15 @@
    setShowCustomerService(false);
  };
  /**
   * 关闭营销活动弹窗并触发活动券订阅。
   */
  const handleCloseMarketing = () => {
    setShowMarketing(false);
    const subscribeBizId = marketingData?.id || marketingData?.popupId || marketingData?.activityId; // 优先使用活动主键做订阅频控
    void subscribeOperationCouponGroup(subscribeBizId);
  };
  const handleFloatActivityClick = () => {
    if (!floatActivityUrl) {
      Taro.showToast({ title: '活动页面建设中', icon: 'none' });
@@ -794,7 +804,7 @@
        onClose={handleCloseCustomerService}
      />
      {/* 营销活动弹窗 */}
      <MarketingPopup show={showMarketing} data={marketingData} onClose={() => setShowMarketing(false)} />
      <MarketingPopup show={showMarketing} data={marketingData} onClose={handleCloseMarketing} />
      {/* 悬浮窗 */}
      {showFloatActivity && (
        <View className='activity-float-window' onClick={handleFloatActivityClick}>
src/robotaxi/pages/begin-route/hooks/use-order-actions.ts
@@ -112,7 +112,6 @@
      estimatedTime,
    };
    // Add selectedRouteId if available
    if (deps.routeOptions && typeof deps.selectedRouteIndex === 'number') {
      const selectedRoute = deps.routeOptions[deps.selectedRouteIndex];
      if (selectedRoute?.route?.routeID) {