Update App.jsx via upload script - 2026-11-16 22:27:58
This commit is contained in:
parent
2fb6494c23
commit
c51439b5ee
10
App.jsx
10
App.jsx
|
|
@ -258,7 +258,7 @@ const STORAGE_KEYS = { customers: 'crm:customers', products: 'crm:products', quo
|
||||||
|
|
||||||
const blankCustomer = () => ({
|
const blankCustomer = () => ({
|
||||||
id: 'c_' + Date.now() + '_' + Math.random().toString(36).slice(2, 7),
|
id: 'c_' + Date.now() + '_' + Math.random().toString(36).slice(2, 7),
|
||||||
company: '', contact: '', country: '', region: 'middle_east', email: '', phone: '',
|
company: '', contact: '', country: '', region: 'middle_east', email: '', phone: '', wechat: '',
|
||||||
isVip: false,
|
isVip: false,
|
||||||
hasOrdered: false,
|
hasOrdered: false,
|
||||||
preferredContacts: [],
|
preferredContacts: [],
|
||||||
|
|
@ -1523,6 +1523,7 @@ function contactDisplayFlags(c) {
|
||||||
return {
|
return {
|
||||||
showEmail: (none || preferred.includes('email')) && !!c.email,
|
showEmail: (none || preferred.includes('email')) && !!c.email,
|
||||||
showPhone: (none || preferred.includes('phone')) && !!c.phone,
|
showPhone: (none || preferred.includes('phone')) && !!c.phone,
|
||||||
|
showWechat: (none || preferred.includes('wechat')) && !!c.wechat,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// 标题统一规则:意向型号(+数量)优先,没有就退回公司名,再没有就显示未命名
|
// 标题统一规则:意向型号(+数量)优先,没有就退回公司名,再没有就显示未命名
|
||||||
|
|
@ -2461,7 +2462,7 @@ function CustomerMonitorGrid({ list, vipFlag, dragCustomerIdx, dragCustomerVip,
|
||||||
const modelQty = [c.intendedModel, c.intendedQty ? `× ${c.intendedQty}` : ''].filter(Boolean).join(' ');
|
const modelQty = [c.intendedModel, c.intendedQty ? `× ${c.intendedQty}` : ''].filter(Boolean).join(' ');
|
||||||
const cardTitle = customerTitle(c);
|
const cardTitle = customerTitle(c);
|
||||||
const showCompanyLine = !!(modelQty && c.company);
|
const showCompanyLine = !!(modelQty && c.company);
|
||||||
const { showEmail, showPhone } = contactDisplayFlags(c);
|
const { showEmail, showPhone, showWechat } = contactDisplayFlags(c);
|
||||||
const isDragging = dragCustomerIdx === idx && dragCustomerVip === vipFlag;
|
const isDragging = dragCustomerIdx === idx && dragCustomerVip === vipFlag;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
@ -2484,6 +2485,7 @@ function CustomerMonitorGrid({ list, vipFlag, dragCustomerIdx, dragCustomerVip,
|
||||||
{c.contact && <div className="row-sub">{c.contact}</div>}
|
{c.contact && <div className="row-sub">{c.contact}</div>}
|
||||||
{showEmail && <div className="row-sub" style={{ display: 'flex', alignItems: 'center', gap: 4 }}><Mail size={11} />{c.email}</div>}
|
{showEmail && <div className="row-sub" style={{ display: 'flex', alignItems: 'center', gap: 4 }}><Mail size={11} />{c.email}</div>}
|
||||||
{showPhone && <div className="row-sub" style={{ display: 'flex', alignItems: 'center', gap: 4 }}><Phone size={11} />{c.phone}</div>}
|
{showPhone && <div className="row-sub" style={{ display: 'flex', alignItems: 'center', gap: 4 }}><Phone size={11} />{c.phone}</div>}
|
||||||
|
{showWechat && <div className="row-sub" style={{ display: 'flex', alignItems: 'center', gap: 4 }}><MessageCircle size={11} />微信 {c.wechat}</div>}
|
||||||
{lt && <div className="row-sub">当地时间 {lt.time}</div>}
|
{lt && <div className="row-sub">当地时间 {lt.time}</div>}
|
||||||
<div style={{ display: 'flex', gap: 6, marginTop: 4 }}>
|
<div style={{ display: 'flex', gap: 6, marginTop: 4 }}>
|
||||||
<button className="btn btn-sm" style={{ flex: 1, justifyContent: 'center' }} onClick={() => onView(c.id)}>查看</button>
|
<button className="btn btn-sm" style={{ flex: 1, justifyContent: 'center' }} onClick={() => onView(c.id)}>查看</button>
|
||||||
|
|
@ -2922,6 +2924,8 @@ function MainApp({ username, onLogout }) {
|
||||||
(c.company || '').toLowerCase().includes(q) ||
|
(c.company || '').toLowerCase().includes(q) ||
|
||||||
(c.contact || '').toLowerCase().includes(q) ||
|
(c.contact || '').toLowerCase().includes(q) ||
|
||||||
(c.email || '').toLowerCase().includes(q) ||
|
(c.email || '').toLowerCase().includes(q) ||
|
||||||
|
(c.phone || '').toLowerCase().includes(q) ||
|
||||||
|
(c.wechat || '').toLowerCase().includes(q) ||
|
||||||
(c.country || '').toLowerCase().includes(q)
|
(c.country || '').toLowerCase().includes(q)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -6137,6 +6141,7 @@ function CustomerForm({ draft, setDraft, onSave, onCancel }) {
|
||||||
<span className="field-label">电话 / WhatsApp{COUNTRY_BY_NAME[draft.country] ? `(${COUNTRY_BY_NAME[draft.country].dial})` : ''}</span>
|
<span className="field-label">电话 / WhatsApp{COUNTRY_BY_NAME[draft.country] ? `(${COUNTRY_BY_NAME[draft.country].dial})` : ''}</span>
|
||||||
<input className="input" value={draft.phone} onChange={e => set({ phone: e.target.value })} />
|
<input className="input" value={draft.phone} onChange={e => set({ phone: e.target.value })} />
|
||||||
</div>
|
</div>
|
||||||
|
<div className="field"><span className="field-label">微信 WeChat</span><input className="input" value={draft.wechat || ''} onChange={e => set({ wechat: e.target.value })} placeholder="微信号 / 手机号" /></div>
|
||||||
<div className="field"><span className="field-label">网站</span><input className="input" value={draft.website} onChange={e => set({ website: e.target.value })} /></div>
|
<div className="field"><span className="field-label">网站</span><input className="input" value={draft.website} onChange={e => set({ website: e.target.value })} /></div>
|
||||||
<div className="field">
|
<div className="field">
|
||||||
<span className="field-label">客户来源</span>
|
<span className="field-label">客户来源</span>
|
||||||
|
|
@ -6594,6 +6599,7 @@ function CustomerDetail({
|
||||||
<Info icon={<Globe size={13} />} label="地区 / 国家" value={`${regionLabel(c.region)} · ${c.country || '—'}`} />
|
<Info icon={<Globe size={13} />} label="地区 / 国家" value={`${regionLabel(c.region)} · ${c.country || '—'}`} />
|
||||||
<ContactInfo icon={<Mail size={13} />} label="邮箱" value={c.email || '—'} active={preferred.includes('email')} onToggle={() => onTogglePreferred('email')} />
|
<ContactInfo icon={<Mail size={13} />} label="邮箱" value={c.email || '—'} active={preferred.includes('email')} onToggle={() => onTogglePreferred('email')} />
|
||||||
<ContactInfo icon={<Phone size={13} />} label="电话" value={c.phone || '—'} active={preferred.includes('phone')} onToggle={() => onTogglePreferred('phone')} />
|
<ContactInfo icon={<Phone size={13} />} label="电话" value={c.phone || '—'} active={preferred.includes('phone')} onToggle={() => onTogglePreferred('phone')} />
|
||||||
|
<ContactInfo icon={<MessageCircle size={13} />} label="微信" value={c.wechat || '—'} active={preferred.includes('wechat')} onToggle={() => onTogglePreferred('wechat')} />
|
||||||
<Info icon={<Clock size={13} />} label="当地时间" value={lt ? `${lt.time}(${lt.en})` : '—'} />
|
<Info icon={<Clock size={13} />} label="当地时间" value={lt ? `${lt.time}(${lt.en})` : '—'} />
|
||||||
<Info icon={<Globe size={13} />} label="网站" value={c.website ? <a href={c.website} target="_blank" rel="noreferrer" style={{ color: 'var(--blue)' }}>{c.website}</a> : '—'} />
|
<Info icon={<Globe size={13} />} label="网站" value={c.website ? <a href={c.website} target="_blank" rel="noreferrer" style={{ color: 'var(--blue)' }}>{c.website}</a> : '—'} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue