[dev]update

This commit is contained in:
susie-laptop 2025-05-29 21:56:54 -04:00
parent ad661e5a77
commit 40afeb4e5d
3 changed files with 122 additions and 103 deletions

View File

@ -1,52 +1,52 @@
export const BRAND_SOURCES = [ export const BRAND_SOURCES = [
{ {
value: 'TKS Official', value: 'tks_official',
name: 'TKS Official', name: 'TKS Official',
}, },
{ {
value: 'Third-party Agency', value: 'third_party_agency',
name: 'Third-party Agency', name: 'Third-party Agency',
}, },
{ {
value: 'Offline Event', value: 'offline_event',
name: 'Offline Event', name: 'Offline Event',
}, },
{ {
value: 'Social Media', value: 'social_media',
name: 'Social Media', name: 'Social Media',
}, },
]; ];
export const CAMPAIGN_SERVICES = [ export const CAMPAIGN_SERVICES = [
{ {
value: 'paid_promotion', value: 'short_video_paid',
name: '达人短视频(付费)', name: '达人短视频(付费)',
}, },
{ {
value: 'affiliate', value: 'short_video_affiliate',
name: '达人短视频(纯佣)', name: '达人短视频(纯佣)',
}, },
{ {
value: 'sponsored_content', value: 'live_stream_brand_hosted',
name: '直播(代播)', name: '直播(代播)',
}, },
{ {
value: 'brand_ambassador', value: 'live_stream_influencer_hosted',
name: '直播(达播)', name: '直播(达播)',
}, },
{ {
value: 'other', value: 'short_video_material_only',
name: '纯素材短视频', name: '纯素材短视频',
}, },
]; ];
export const CREATOR_TYPES = [ export const CREATOR_TYPES = [
{ {
value: 'dai', value: 'product_promotion',
name: '带货类达人', name: '带货类达人',
}, },
{ {
value: 'exposure', value: 'exposure_focused',
name: '曝光类达人', name: '曝光类达人',
}, },
]; ];
@ -114,32 +114,40 @@ export const CREATOR_LEVELS = [
]; ];
export const CREATOR_CATEGORIES = [ export const CREATOR_CATEGORIES = [
{ value: 'Phones & Electronics', name: 'Phones & Electronics' }, { value: 'phones_electronics', name: 'Phones & Electronics' },
{ value: 'Homes Supplies', name: 'Homes Supplies' }, { value: 'home_supplies', name: 'Homes Supplies' },
{ value: 'Health', name: 'Health' }, { value: 'health', name: 'Health' },
{ value: 'Textiles & Soft Furnishings', name: 'Textiles & Soft Furnishings' }, { value: 'textiles_soft_furnishings', name: 'Textiles & Soft Furnishings' },
{ value: 'Household Appliances', name: 'Household Appliances' }, { value: 'household_appliances', name: 'Household Appliances' },
{ value: 'Womenswear & Underwear', name: 'Womenswear & Underwear' }, { value: 'womenswear_underwear', name: 'Womenswear & Underwear' },
{ value: 'Muslim Fashion', name: 'Muslim Fashion' }, { value: 'muslim_fashion', name: 'Muslim Fashion' },
{ value: 'Shoes', name: 'Shoes' }, { value: 'shoes', name: 'Shoes' },
{ value: 'Beauty & Personal Care', name: 'Beauty & Personal Care' }, { value: 'beauty_personal_care', name: 'Beauty & Personal Care' },
{ value: 'Pet Supplies', name: 'Pet Supplies' }, { value: 'pet_supplies', name: 'Pet Supplies' },
{ value: 'Computers & Office Equipment', name: 'Computers & Office Equipment' }, { value: 'computers_office_equipment', name: 'Computers & Office Equipment' },
{ value: 'Baby & Maternity', name: 'Baby & Maternity' }, { value: 'baby_maternity', name: 'Baby & Maternity' },
{ value: 'Sports & Outdoor', name: 'Sports & Outdoor' }, { value: 'sports_outdoor', name: 'Sports & Outdoor' },
{ value: 'Toys', name: 'Toys' }, { value: 'toys', name: 'Toys' },
{ value: 'Furniture', name: 'Furniture' }, { value: 'furniture', name: 'Furniture' },
{ value: 'Kitchenware', name: 'Kitchenware' }, { value: 'kitchenware', name: 'Kitchenware' },
{ value: 'Home Improvement', name: 'Home Improvement' }, { value: 'home_improvement', name: 'Home Improvement' },
{ value: 'Tools & Hardware', name: 'Tools & Hardware' }, { value: 'tools_hardware', name: 'Tools & Hardware' },
{ value: "Kids' Fashion", name: "Kids' Fashion" }, { value: 'kids_fashion', name: "Kids' Fashion" },
{ value: 'Automotive & Motorcycle', name: 'Automotive & Motorcycle' }, { value: 'automotive_motorcycle', name: 'Automotive & Motorcycle' },
{ value: 'Fashion Accessories', name: 'Fashion Accessories' }, { value: 'fashion_accessories', name: 'Fashion Accessories' },
{ value: 'Food & Beverages', name: 'Food & Beverages' }, { value: 'food_beverages', name: 'Food & Beverages' },
{ value: 'Books, Magazines & Audio', name: 'Books, Magazines & Audio' }, { value: 'books_magazines_audio', name: 'Books, Magazines & Audio' },
{ value: 'Menswear & Underwear', name: 'Menswear & Underwear' }, { value: 'menswear_underwear', name: 'Menswear & Underwear' },
{ value: 'Pre-Owned Collections', name: 'Pre-Owned Collections' }, { value: 'pre_owned_collections', name: 'Pre-Owned Collections' },
{ value: 'Luggage & Bags', name: 'Luggage & Bags' }, { value: 'luggage_bags', name: 'Luggage & Bags' },
{ value: 'Jewellery Accessories & Derivatives', name: 'Jewellery Accessories & Derivatives' }, { value: 'jewellery_accessories_derivatives', name: 'Jewellery Accessories & Derivatives' },
{ value: 'Other', name: 'Other' }, { 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: '合作追踪' },
]; ];

View File

@ -153,14 +153,22 @@ export default function BrandsDetail() {
</SlidePanel> </SlidePanel>
</> </>
)} )}
<AddCampaignModal show={showAddCampaignModal} onHide={() => setShowAddCampaignModal(false)} /> <AddCampaignModal
<AddProductModal show={showAddProductModal} onHide={() => setShowAddProductModal(false)} /> show={showAddCampaignModal}
onHide={() => setShowAddCampaignModal(false)}
brandId={id}
/>
<AddProductModal
show={showAddProductModal}
onHide={() => setShowAddProductModal(false)}
brandId={id}
/>
</React.Fragment> </React.Fragment>
) )
); );
} }
export function AddCampaignModal({ show, onHide }) { export function AddCampaignModal({ show, onHide, brandId }) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const [formData, setFormData] = useState({ const [formData, setFormData] = useState({
name: '', name: '',
@ -218,6 +226,7 @@ export function AddCampaignModal({ show, onHide }) {
followers: [0, 100], followers: [0, 100],
gmv: '', gmv: '',
views: [0, 100000], views: [0, 100000],
brand_id: brandId,
}); });
setValidated(false); setValidated(false);
onHide(); 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 dispatch = useDispatch();
const [productIds, setProductIds] = useState({ const [productIds, setProductIds] = useState({
0: '', 0: '',

View File

@ -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 SearchBar from '../components/SearchBar';
import { Footprints, Plus } from 'lucide-react'; import { Footprints, Plus } from 'lucide-react';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { addTemplateThunk, editTemplateThunk, fetchTemplates } from '../store/slices/inboxSlice'; import { addTemplateThunk, editTemplateThunk, fetchTemplates } from '../store/slices/inboxSlice';
import TemplateList from '../components/TemplateList'; import TemplateList from '../components/TemplateList';
import { CAMPAIGN_SERVICES } from '../lib/constant'; import { CAMPAIGN_SERVICES, TEMPLATE_MISSIONS } from '../lib/constant';
export default function InboxTemplate() { export default function InboxTemplate() {
const [activeTab, setActiveTab] = useState('all'); const [activeTab, setActiveTab] = useState('all');
@ -14,7 +14,6 @@ export default function InboxTemplate() {
const [formData, setFormData] = useState({ const [formData, setFormData] = useState({
title: 'TikTok合作邀请', title: 'TikTok合作邀请',
content: `Hi {tiktok id},\n\n我是{sender name}来自OOIN Media。我们对您的TikTok内容印象深刻希望能就付费推广活动进行合作。\n\n请问您对单个TikTok视频的报价是多少如果我们计划多个视频合作是否有批量折扣\n\n期待您的回复`, content: `Hi {tiktok id},\n\n我是{sender name}来自OOIN Media。我们对您的TikTok内容印象深刻希望能就付费推广活动进行合作。\n\n请问您对单个TikTok视频的报价是多少如果我们计划多个视频合作是否有批量折扣\n\n期待您的回复`,
category: 1,
mission: 'initial_contact', mission: 'initial_contact',
platform: 'tiktok', platform: 'tiktok',
service: 'text', service: 'text',
@ -116,7 +115,7 @@ function AddTemplateModal({ show, formData, setFormData, handleClose, type = 'ad
useEffect(() => {}, [formData]); useEffect(() => {}, [formData]);
return ( return (
<Modal show={show} onHide={handleClose}> <Modal show={show} onHide={handleClose} size='lg'>
<Modal.Header closeButton> <Modal.Header closeButton>
<Modal.Title>{type === 'add' ? 'Add Template' : 'Edit Template'}</Modal.Title> <Modal.Title>{type === 'add' ? 'Add Template' : 'Edit Template'}</Modal.Title>
</Modal.Header> </Modal.Header>
@ -133,7 +132,8 @@ function AddTemplateModal({ show, formData, setFormData, handleClose, type = 'ad
onChange={handleChange} onChange={handleChange}
/> />
</Form.Group> </Form.Group>
<Form.Group className='mb-3' controlId='formBasicEmail'> <Row className='mb-3'>
<Form.Group className='col' controlId='formBasicEmail'>
<Form.Label>Mission</Form.Label> <Form.Label>Mission</Form.Label>
<Form.Select <Form.Select
required required
@ -146,14 +146,14 @@ function AddTemplateModal({ show, formData, setFormData, handleClose, type = 'ad
<option value='' disabled> <option value='' disabled>
Select mission Select mission
</option> </option>
<option value='initial_contact'>初步建联</option> {
<option value='negotiation'>砍价邮件</option> TEMPLATE_MISSIONS.map((mission) => (
<option value='script'>脚本邮件</option> <option value={mission.value}>{mission.name}</option>
<option value='follow_up'>合作追踪</option> ))
<option value='other'>其他</option> }
</Form.Select> </Form.Select>
</Form.Group> </Form.Group>
<Form.Group className='mb-3' controlId='formBasicEmail'> <Form.Group className='col' controlId='formBasicEmail'>
<Form.Label>Platform</Form.Label> <Form.Label>Platform</Form.Label>
<Form.Select <Form.Select
required required
@ -172,7 +172,7 @@ function AddTemplateModal({ show, formData, setFormData, handleClose, type = 'ad
<option value='youtube'>Youtube</option> <option value='youtube'>Youtube</option>
</Form.Select> </Form.Select>
</Form.Group> </Form.Group>
<Form.Group className='mb-3' controlId='formBasicEmail'> <Form.Group className='col' controlId='formBasicEmail'>
<Form.Label>合作模式</Form.Label> <Form.Label>合作模式</Form.Label>
<Form.Select <Form.Select
required required
@ -189,6 +189,8 @@ function AddTemplateModal({ show, formData, setFormData, handleClose, type = 'ad
))} ))}
</Form.Select> </Form.Select>
</Form.Group> </Form.Group>
</Row>
<Form.Group className='mb-3' controlId='formBasicEmail'> <Form.Group className='mb-3' controlId='formBasicEmail'>
<Form.Label>Template</Form.Label> <Form.Label>Template</Form.Label>
<Form.Control <Form.Control