- TikTok/Shopee/速卖通/Walmart 各 46-47 条已在待发布 - Ozon 47 条已建、改价 40/47 - SHEIN 配方跑通第一条;Temu 差「预览图」一步 - 核心产出:MYJ.message.error 钩子诊断法(解开了三个平台的保存静默拦截) - 含下一轮提示词 NEXT-ROUND-PROMPT.md
43 lines
3.5 KiB
JavaScript
43 lines
3.5 KiB
JavaScript
import { attach } from '/tmp/cdp3.mjs';
|
|
const wait = ms => new Promise(z => setTimeout(z, ms));
|
|
const c = await attach('/web/sheinProduct/add') || await attach('dianxiaomi.com');
|
|
const reqs=[];
|
|
c.on(m=>{ if(m.method==='Network.requestWillBeSent'){const r=m.params.request;
|
|
if(/shein/i.test(r.url)&&/\.json/.test(r.url)&&r.method==='POST') reqs.push(r.url.replace('https://www.dianxiaomi.com','')); }});
|
|
await c.send('Network.enable').catch(()=>{});
|
|
const IMGS=['https://cbu01.alicdn.com/img/ibank/O1CN01IHtNAHKMzNC1chua_!!2222444614399-0-cib.jpg',
|
|
'https://cbu01.alicdn.com/img/ibank/O1CN01UGEWafTzqTH1chua_!!2222444614399-0-cib.jpg',
|
|
'https://cbu01.alicdn.com/img/ibank/O1CN01d0hA4N72jzD1chua_!!2222444614399-0-cib.jpg',
|
|
'https://cbu01.alicdn.com/img/ibank/O1CN01edgGxIlmdtJ1chua_!!2222444614399-0-cib.jpg'];
|
|
const r = await c.evalJS(`(()=>{const p=document.querySelector('#app').__vue_app__.config.globalProperties.$pinia;
|
|
const d=p._s.get('sheinSkuDataStore').$state.formState;
|
|
const rows=d.skuDataList||[]; let n=0;
|
|
rows.forEach((x,i)=>{ x.skcSupplierCode='SHEIN-TEST-'+(i+1); x.skcRetailPrice='12.90'; x.supplyPrice='8.50';
|
|
x.stockVariety='999'; x.weight='100'; x.length='200'; x.width='150'; x.height='30'; n++; });
|
|
const im=p._s.get('sheinImgStore').$state.formState;
|
|
im.mainImgData.multipleSpuImgs=${JSON.stringify(IMGS.map((u,i)=>({url:u,imgUrl:u,name:'img'+(i+1)+'.jpg',width:800,height:800})))};
|
|
return JSON.stringify({rows:n, imgs:im.mainImgData.multipleSpuImgs.length, imgType:Array.isArray(im.mainImgData.multipleSpuImgs)?'array':typeof im.mainImgData.multipleSpuImgs});})()`);
|
|
console.log('填充:', r);
|
|
await wait(3500);
|
|
const chk = await c.evalJS(`(()=>{const it=[...document.querySelectorAll('*')].filter(e=>e.offsetParent!==null&&/图片/.test(e.innerText||'')&&e.querySelectorAll('img').length>0);
|
|
return JSON.stringify({domImgs:it.length?it[0].querySelectorAll('img').length:0});})()`);
|
|
console.log('UI 图片:', String(chk));
|
|
await c.evalJS(`window.scrollTo(0,0)`); await wait(600);
|
|
const sv = await c.evalJS(`(()=>{const xs=[...document.querySelectorAll('button')].filter(e=>e.offsetParent!==null);
|
|
let x=xs.find(e=>/^\\s*保存\\s*$/.test((e.innerText||'').trim()))||xs.find(e=>/保存/.test(e.innerText||''));
|
|
if(!x)return'nf'; for(const ev of ['mousedown','mouseup','click']) x.dispatchEvent(new MouseEvent(ev,{bubbles:true,cancelable:true,view:window})); return (x.innerText||'').trim();})()`);
|
|
console.log('保存按钮:', sv);
|
|
await wait(13000);
|
|
await c.evalJS(`(()=>{const ms=[...document.querySelectorAll('.ant-modal')].filter(e=>e.offsetParent!==null);
|
|
for(const m of ms){const b=[...m.querySelectorAll('button')].find(x=>/确定|确认/.test(x.innerText||'')); if(b)b.click();} return 1;})()`);
|
|
await wait(4000);
|
|
console.log('POST 请求:', JSON.stringify([...new Set(reqs)].slice(0,5)));
|
|
const red = await c.evalJS(`(()=>{const red=[]; document.querySelectorAll('*').forEach(el=>{ if(el.offsetParent===null||el.children.length)return;
|
|
const t=(el.innerText||'').trim(); if(!t||t.length>60)return;
|
|
const s=getComputedStyle(el); const m=(s.color||'').match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/); if(!m)return;
|
|
if(+m[1]>160&&+m[2]<140&&+m[3]<140) red.push(t); });
|
|
const toasts=[...document.querySelectorAll('.ant-message-notice,.ant-notification-notice')].map(e=>(e.innerText||'').replace(/\\s+/g,' ').trim());
|
|
return JSON.stringify({red:[...new Set(red)].slice(0,10), toasts:[...new Set(toasts)].slice(0,3)});})()`);
|
|
console.log('红字/提示:', String(red).slice(0,600));
|
|
process.exit(0);
|