From 40afeb4e5da673ebb7ba414dd24c125befeb419a Mon Sep 17 00:00:00 2001 From: susie-laptop Date: Thu, 29 May 2025 21:56:54 -0400 Subject: [PATCH] [dev]update --- src/lib/constant.js | 86 +++++++++++++------------ src/pages/BrandsDetail.jsx | 17 +++-- src/pages/InboxTemplate.jsx | 122 ++++++++++++++++++------------------ 3 files changed, 122 insertions(+), 103 deletions(-) diff --git a/src/lib/constant.js b/src/lib/constant.js index 1d93da5..5e32e4c 100644 --- a/src/lib/constant.js +++ b/src/lib/constant.js @@ -1,52 +1,52 @@ export const BRAND_SOURCES = [ { - value: 'TKS Official', + value: 'tks_official', name: 'TKS Official', }, { - value: 'Third-party Agency', + value: 'third_party_agency', name: 'Third-party Agency', }, { - value: 'Offline Event', + value: 'offline_event', name: 'Offline Event', }, { - value: 'Social Media', + value: 'social_media', name: 'Social Media', }, ]; export const CAMPAIGN_SERVICES = [ { - value: 'paid_promotion', + value: 'short_video_paid', name: '达人短视频(付费)', }, { - value: 'affiliate', + value: 'short_video_affiliate', name: '达人短视频(纯佣)', }, { - value: 'sponsored_content', + value: 'live_stream_brand_hosted', name: '直播(代播)', }, { - value: 'brand_ambassador', + value: 'live_stream_influencer_hosted', name: '直播(达播)', }, { - value: 'other', + value: 'short_video_material_only', name: '纯素材短视频', }, ]; export const CREATOR_TYPES = [ { - value: 'dai', + value: 'product_promotion', name: '带货类达人', }, { - value: 'exposure', + value: 'exposure_focused', name: '曝光类达人', }, ]; @@ -114,32 +114,40 @@ export const CREATOR_LEVELS = [ ]; export const CREATOR_CATEGORIES = [ - { value: 'Phones & Electronics', name: 'Phones & Electronics' }, - { value: 'Homes Supplies', name: 'Homes Supplies' }, - { value: 'Health', name: 'Health' }, - { value: 'Textiles & Soft Furnishings', name: 'Textiles & Soft Furnishings' }, - { value: 'Household Appliances', name: 'Household Appliances' }, - { value: 'Womenswear & Underwear', name: 'Womenswear & Underwear' }, - { value: 'Muslim Fashion', name: 'Muslim Fashion' }, - { value: 'Shoes', name: 'Shoes' }, - { value: 'Beauty & Personal Care', name: 'Beauty & Personal Care' }, - { value: 'Pet Supplies', name: 'Pet Supplies' }, - { value: 'Computers & Office Equipment', name: 'Computers & Office Equipment' }, - { value: 'Baby & Maternity', name: 'Baby & Maternity' }, - { value: 'Sports & Outdoor', name: 'Sports & Outdoor' }, - { value: 'Toys', name: 'Toys' }, - { value: 'Furniture', name: 'Furniture' }, - { value: 'Kitchenware', name: 'Kitchenware' }, - { value: 'Home Improvement', name: 'Home Improvement' }, - { value: 'Tools & Hardware', name: 'Tools & Hardware' }, - { value: "Kids' Fashion", name: "Kids' Fashion" }, - { value: 'Automotive & Motorcycle', name: 'Automotive & Motorcycle' }, - { value: 'Fashion Accessories', name: 'Fashion Accessories' }, - { value: 'Food & Beverages', name: 'Food & Beverages' }, - { value: 'Books, Magazines & Audio', name: 'Books, Magazines & Audio' }, - { value: 'Menswear & Underwear', name: 'Menswear & Underwear' }, - { value: 'Pre-Owned Collections', name: 'Pre-Owned Collections' }, - { value: 'Luggage & Bags', name: 'Luggage & Bags' }, - { value: 'Jewellery Accessories & Derivatives', name: 'Jewellery Accessories & Derivatives' }, - { value: 'Other', name: 'Other' }, + { value: 'phones_electronics', name: 'Phones & Electronics' }, + { value: 'home_supplies', name: 'Homes Supplies' }, + { value: 'health', name: 'Health' }, + { value: 'textiles_soft_furnishings', name: 'Textiles & Soft Furnishings' }, + { value: 'household_appliances', name: 'Household Appliances' }, + { value: 'womenswear_underwear', name: 'Womenswear & Underwear' }, + { value: 'muslim_fashion', name: 'Muslim Fashion' }, + { value: 'shoes', name: 'Shoes' }, + { value: 'beauty_personal_care', name: 'Beauty & Personal Care' }, + { value: 'pet_supplies', name: 'Pet Supplies' }, + { value: 'computers_office_equipment', name: 'Computers & Office Equipment' }, + { value: 'baby_maternity', name: 'Baby & Maternity' }, + { value: 'sports_outdoor', name: 'Sports & Outdoor' }, + { value: 'toys', name: 'Toys' }, + { value: 'furniture', name: 'Furniture' }, + { value: 'kitchenware', name: 'Kitchenware' }, + { value: 'home_improvement', name: 'Home Improvement' }, + { value: 'tools_hardware', name: 'Tools & Hardware' }, + { value: 'kids_fashion', name: "Kids' Fashion" }, + { value: 'automotive_motorcycle', name: 'Automotive & Motorcycle' }, + { value: 'fashion_accessories', name: 'Fashion Accessories' }, + { value: 'food_beverages', name: 'Food & Beverages' }, + { value: 'books_magazines_audio', name: 'Books, Magazines & Audio' }, + { value: 'menswear_underwear', name: 'Menswear & Underwear' }, + { value: 'pre_owned_collections', name: 'Pre-Owned Collections' }, + { value: 'luggage_bags', name: 'Luggage & Bags' }, + { value: 'jewellery_accessories_derivatives', name: 'Jewellery Accessories & Derivatives' }, + { value: 'other', name: 'Other' }, +]; + +export const TEMPLATE_MISSIONS = [ + { value: 'all', name: '全部' }, + { value: 'initial_contact', name: '初步建联' }, + { value: 'negotiation', name: '砍价邮件' }, + { value: 'script', name: '脚本邮件' }, + { value: 'follow_up', name: '合作追踪' }, ]; diff --git a/src/pages/BrandsDetail.jsx b/src/pages/BrandsDetail.jsx index 3788e9d..50c7f81 100644 --- a/src/pages/BrandsDetail.jsx +++ b/src/pages/BrandsDetail.jsx @@ -153,14 +153,22 @@ export default function BrandsDetail() { )} - setShowAddCampaignModal(false)} /> - setShowAddProductModal(false)} /> + setShowAddCampaignModal(false)} + brandId={id} + /> + setShowAddProductModal(false)} + brandId={id} + /> ) ); } -export function AddCampaignModal({ show, onHide }) { +export function AddCampaignModal({ show, onHide, brandId }) { const dispatch = useDispatch(); const [formData, setFormData] = useState({ name: '', @@ -218,6 +226,7 @@ export function AddCampaignModal({ show, onHide }) { followers: [0, 100], gmv: '', views: [0, 100000], + brand_id: brandId, }); setValidated(false); onHide(); @@ -375,7 +384,7 @@ export function AddCampaignModal({ show, onHide }) { ); } -export function AddProductModal({ show, onHide }) { +export function AddProductModal({ show, onHide, brandId }) { const dispatch = useDispatch(); const [productIds, setProductIds] = useState({ 0: '', diff --git a/src/pages/InboxTemplate.jsx b/src/pages/InboxTemplate.jsx index ee86592..1c08011 100644 --- a/src/pages/InboxTemplate.jsx +++ b/src/pages/InboxTemplate.jsx @@ -1,11 +1,11 @@ -import { Button, Form, Modal } from 'react-bootstrap'; +import { Button, Col, Form, Modal, Row } from 'react-bootstrap'; import SearchBar from '../components/SearchBar'; import { Footprints, Plus } from 'lucide-react'; import React, { useEffect, useState } from 'react'; import { useDispatch } from 'react-redux'; import { addTemplateThunk, editTemplateThunk, fetchTemplates } from '../store/slices/inboxSlice'; import TemplateList from '../components/TemplateList'; -import { CAMPAIGN_SERVICES } from '../lib/constant'; +import { CAMPAIGN_SERVICES, TEMPLATE_MISSIONS } from '../lib/constant'; export default function InboxTemplate() { const [activeTab, setActiveTab] = useState('all'); @@ -14,7 +14,6 @@ export default function InboxTemplate() { const [formData, setFormData] = useState({ title: 'TikTok合作邀请', content: `Hi {tiktok id},\n\n我是{sender name},来自OOIN Media。我们对您的TikTok内容印象深刻,希望能就付费推广活动进行合作。\n\n请问您对单个TikTok视频的报价是多少?如果我们计划多个视频合作,是否有批量折扣?\n\n期待您的回复!`, - category: 1, mission: 'initial_contact', platform: 'tiktok', service: 'text', @@ -116,7 +115,7 @@ function AddTemplateModal({ show, formData, setFormData, handleClose, type = 'ad useEffect(() => {}, [formData]); return ( - + {type === 'add' ? 'Add Template' : 'Edit Template'} @@ -133,62 +132,65 @@ function AddTemplateModal({ show, formData, setFormData, handleClose, type = 'ad onChange={handleChange} /> - - Mission - - - - - - - - - - - Platform - - - - - - - - - - 合作模式 - - - {CAMPAIGN_SERVICES.map((service) => ( - - ))} - - + + + Mission + + + { + TEMPLATE_MISSIONS.map((mission) => ( + + )) + } + + + + Platform + + + + + + + + + + 合作模式 + + + {CAMPAIGN_SERVICES.map((service) => ( + + ))} + + + + Template