Kaynağa Gözat

新建营销活动页面调整

lxr 3 hafta önce
ebeveyn
işleme
b46fca919e

+ 38 - 6
src/api/modules/operationManagement.ts

@@ -64,13 +64,36 @@ storeAxiosInstance.interceptors.response.use(
   }
 );
 
+/** 门店优惠券列表查询参数(与 alienStore GET 查询串一致) */
+export type GetStoreAllCouponListParams = {
+  storeId: number | string;
+  tab?: number;
+  size?: number;
+  page?: number;
+  couponName?: string;
+  couponsFromType?: number;
+  couponType?: number | string;
+};
+
 /**
- * 获取优惠券列表
- * @param params 请求参数
- * @returns 优惠券列表数据
+ * 获取门店全部优惠券列表
+ * GET {VITE_API_URL_STORE}/alienStore/life-discount-coupon/getStoreAllCouponList
+ * 示例:?storeId=381&tab=0&size=99&page=1&couponName=&couponsFromType=1&couponType=1
+ * 兼容旧入参:pageNum/pageSize、name(映射为 page/size/couponName)
  */
-export const getCouponList = params => {
-  return http.post<ResPage<any>>(PORT_NONE + `/couponPlatform/getCouponList`, params);
+export const getCouponList = (input: Record<string, any>) => {
+  const params: GetStoreAllCouponListParams = {
+    storeId: input.storeId,
+    tab: input.tab ?? 0,
+    size: Number(input.size ?? input.pageSize ?? 99),
+    page: Number(input.page ?? input.pageNum ?? 1),
+    couponName: input.couponName ?? input.name ?? "",
+    couponsFromType: Number(input.couponsFromType ?? 1),
+    couponType: input.couponType != null && input.couponType !== "" ? Number(input.couponType) : 1
+  };
+  return storeAxiosInstance.get<ResPage<any>>(`/life-discount-coupon/getStoreAllCouponList`, {
+    params
+  });
 };
 
 /**
@@ -155,7 +178,16 @@ export const getActivityRuleOptions = (params?: any) => {
 };
 
 /**
- * AI生成活动宣传图
+ * AI生成活动宣传图(与商家端 operationalActivity/generatePromotionImages 一致)
+ * @param params { activityName: string, uploadImgType: number }
+ * @returns 生成的图片数据
+ */
+export const generatePromotionImages = (params: { activityName: string; uploadImgType?: number }) => {
+  return http.post<any>(PORT_NONE + `/operationalActivity/generatePromotionImages`, params);
+};
+
+/**
+ * AI生成活动宣传图(原 http_ai 接口,保留兼容)
  * @param params 请求参数 { text: string } - 活动描述文本
  * @returns 生成的图片数据
  */

+ 4 - 6
src/views/operationManagement/couponTemplate.vue

@@ -98,13 +98,11 @@ const initParam = reactive({
   couponsFromType: 1
 });
 
-// 数据回调处理
+// 数据回调处理(兼容 getStoreAllCouponList 返回 records / 旧 discountList)
 const dataCallback = (data: any) => {
-  // 优惠券从 discountList.records 取值
-  return {
-    list: data.discountList?.records || [],
-    total: data.discountList?.total || 0
-  };
+  const list = data.records ?? data.discountList?.records ?? [];
+  const total = data.total ?? data.discountList?.total ?? list.length ?? 0;
+  return { list, total };
 };
 
 // 获取表格列表

Dosya farkı çok büyük olduğundan ihmal edildi
+ 540 - 305
src/views/operationManagement/newActivity.vue


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor