Files
tangzhuan-yu/static/assets/BuyerInteraction-BaO2JFO9.js
T
jinghui 56e13a75b4 feat: 躺赚鱼 v3.6.5 —— 新增「使用说明」图文教程页
- 左侧定位菜单(四组17功能,点击平滑滚动 + 滚动高亮跟随),右侧功能步骤 + 小提示 + 真实界面截图
- 17 张实拍截图入 static/help/(lazy 加载),窄屏自动降级横向菜单
- 侧边栏「系统」组新增入口(所有用户可见)
- require_admin 判定统一走 ADMIN_USERNAME 常量(消除与 verify_admin_token 的硬编码不一致)

浏览器实测:1440×900 桌面布局 nav/content 左右分栏、点击定位与高亮均通过、17/17 图片 200 且渲染清晰;
临时测试账号与会话已清理。
2026-11-16 09:47:09 +08:00

2 lines
7.9 KiB
JavaScript
Vendored

import{r as n,j as e,P as C,e as E,aR as P,Q as $,o as B,n as i,aW as H,bE as M}from"./index-BIvz5Jcw.js";import{P as R,a as D,N as z,S as d}from"./ui-YqULwUTN.js";import{S as O}from"./save-Bwc_QnHd.js";import{S as U}from"./shield-alert-BLVh_PbV.js";import{F as W}from"./flower-2-B8e-r4X9.js";import{M as q}from"./message-square-text-CYR04FKJ.js";const r=200,A="宝贝收到了,很满意,感谢老板,欢迎下次再来!",G="亲,感谢支持!有任何问题随时找我~",I={auto_rate_enabled:"评价买家",auto_flower_enabled:"索要小红花",auto_thanks_enabled:"收货致谢",auto_receive_flower_enabled:"自动收下小红花"},K=[{value:300,label:"5 分钟"},{value:900,label:"15 分钟"},{value:1800,label:"30 分钟"},{value:3600,label:"1 小时"},{value:7200,label:"2 小时(默认)"},{value:21600,label:"6 小时"},{value:86400,label:"24 小时"}],ee=()=>{const[l,c]=n.useState(null),[p,h]=n.useState(!1),[b,_]=n.useState(!1),[o,T]=n.useState([]),[f,x]=n.useState({}),j=()=>{h(!0),Promise.all([P(),$().catch(()=>null),B().catch(()=>[])]).then(([t,a,s])=>{c({...t,auto_rate_template:(t.auto_rate_template??"").trim()||(a==null?void 0:a.auto_rate_template)||A}),T(s),x((a==null?void 0:a.accounts)??{})}).finally(()=>h(!1))},F=async(t,a)=>{const s=f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},w={...s,[a]:!s[a]};x(u=>({...u,[t]:w}));try{await M(t,{[a]:w[a]})}catch(u){x(k=>({...k,[t]:s})),i(`保存失败:${u.message}`)}};n.useEffect(()=>{j()},[]);const L=async()=>{if(!l)return;const t=(l.auto_rate_template||"").trim();if(!t){i("默认评价内容不能为空");return}if(t.length>r){i(`默认评价内容不能超过 ${r} 字`);return}_(!0);try{await H({auto_rate_template:t,auto_thanks_template:(l.auto_thanks_template||"").trim(),buyer_interaction_interval:String(S)}),i("买家互动配置已保存")}catch(a){i(`保存失败:${a.message}`)}finally{_(!1)}};if(!l)return e.jsx(R,{label:"正在加载买家互动配置"});const m=t=>f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},g=o.some(t=>m(t.id).auto_rate_enabled),y=o.some(t=>m(t.id).auto_thanks_enabled),N=l.auto_rate_template??"",v=l.auto_thanks_template??"",S=Number(l.buyer_interaction_interval)||7200;return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(D,{title:"买家互动",description:"评价买家、索要小红花与自动收花。涉及平台实际操作,请按账号开启。",icon:C,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:j,disabled:p,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(E,{className:`h-4 w-4 ${p?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:b,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(O,{className:"h-4 w-4"}),b?"保存中":"保存设置"]})]})}),e.jsx(z,{type:"warning",message:"评价提交后无法撤销,求花会向买家发送一条消息。建议先用测试订单验证效果。"}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"按账号开启",description:"逐个账号控制。关闭的账号不会自动执行,订单页也不显示入口、后端拒绝请求。",icon:U}),o.length===0?e.jsx("p",{className:"px-4 py-6 text-sm text-gray-500",children:"还没有账号,请先在账号管理里添加。"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 text-left text-xs text-gray-500",children:[e.jsx("th",{className:"px-4 py-2 font-semibold",children:"账号"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"评价买家"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"索要小红花"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"收货致谢"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"自动收下小红花"})]})}),e.jsx("tbody",{children:o.map(t=>{const a=m(t.id);return e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("p",{className:"font-semibold text-gray-900",children:t.nickname||t.id}),e.jsx("p",{className:"mt-0.5 font-mono text-xs text-gray-400",children:t.id})]}),["auto_rate_enabled","auto_flower_enabled","auto_thanks_enabled","auto_receive_flower_enabled"].map(s=>e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{type:"button",role:"switch","aria-checked":a[s],"aria-label":`${t.nickname||t.id} ${I[s]}`,onClick:()=>void F(t.id,s),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${a[s]?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${a[s]?"translate-x-5":""}`})})},s))]},t.id)})})]})}),e.jsxs("p",{className:"border-t border-gray-100 px-4 py-3 text-xs leading-5 text-gray-500",children:["三项都在",e.jsx("strong",{className:"font-semibold text-gray-700",children:"买家确认收货"}),"后触发。 致谢文本立即发送;评价和求花要等闲鱼把订单切到「交易成功」,通常几十秒内完成, 失败则由下面的兜底轮询稍后重试。"]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"默认评价内容",description:"订单页打开评价框时自动填入,仍可逐单修改后再提交。",icon:W}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"评价文案"}),e.jsx("textarea",{value:N,onChange:t=>c({...l,auto_rate_template:t.target.value}),maxLength:r,placeholder:A,className:"ios-input mt-1 min-h-28 w-full resize-y rounded-md px-3 py-2.5 text-sm",disabled:!g}),e.jsxs("div",{className:"mt-1 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-500",children:g?"闲鱼对评价内容有长度和内容限制,过长可能被拒绝。":"为任一账号开启「评价买家」后可编辑。"}),e.jsxs("span",{className:"text-xs text-gray-400",children:[N.length,"/",r]})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"收货致谢文本",description:"买家确认收货后立即发送这条消息。留空则不发送。",icon:q}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"致谢文案"}),e.jsx("textarea",{value:v,onChange:t=>c({...l,auto_thanks_template:t.target.value}),maxLength:r,placeholder:G,className:"ios-input mt-1 min-h-28 w-full resize-y rounded-md px-3 py-2.5 text-sm",disabled:!y}),e.jsxs("div",{className:"mt-1 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-500",children:y?"同一笔交易只发一次,不会因多条系统消息重复打扰买家。":"为任一账号开启「收货致谢」后可编辑。"}),e.jsxs("span",{className:"text-xs text-gray-400",children:[v.length,"/",r]})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"兜底检查间隔",description:"确认收货已由消息事件即时触发,这里只在漏收消息或服务重启时补做。",icon:E}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"检查频率"}),e.jsx("select",{value:S,onChange:t=>c({...l,buyer_interaction_interval:t.target.value}),className:"ios-input mt-1 w-full rounded-md px-3 py-2.5 text-sm",children:K.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:"每轮都会拉取一次卖出订单列表,设得太密容易触发平台风控。 正常情况下靠即时触发就够了,这里保持较长间隔即可。"})]})]})]})]})};export{ee as default};