This commit is contained in:
liushiwei
2024-08-07 14:46:26 +08:00
parent 0808f42ce7
commit 25ba3eb387
14 changed files with 1066 additions and 48 deletions

View File

@@ -42,8 +42,49 @@ function init() {
flag = true
}
}
const regex = /price-adjust-confirm[^\n]+content/
let modelsAll = document.querySelectorAll('div[class*="price-adjust-confirm"]')
const results = Array.from(modelsAll).filter(item => regex.test(item.getAttribute('class')))
for (let i = 0; i < results.length; i++) {
let tipsObj = results[i].querySelector('div[class*="_tips"]')
let spanObj = tipsObj.querySelector('div span:last-child')
if (spanObj) {
const popup = document.createElement("div")
popup.innerText = "拒绝调价"
const styles = {
padding: "8px",
background: "#fb7701",
color: "#fff",
display: 'inline',
borderRadius: "8px",
cursor: "pointer"
}
for (const e in styles) {
popup.style[e] = styles[e]
}
spanObj.appendChild(popup)
popup.addEventListener('click', async () => {
let tbodyObj = results[i].querySelector('tbody')
let trList = tbodyObj.querySelectorAll('tr')
for (let i = 0; i < trList.length; i++) {
let tdObj = trList[i].querySelector('td:last-child')
let firstLabelObj = tdObj.querySelector('div label:first-child')
if (firstLabelObj.getAttribute("data-checked")) {
let labelObj = tdObj.querySelector('div label:nth-child(2)')
let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]')
// await sleepSync(50)
radioObj.click()
}
}
})
flag = true
}
}
let models2 = document.querySelectorAll('div[class^="price-adjust-confirm-system_contentWrp"]')
/*let models2 = document.querySelectorAll('div[class^="price-adjust-confirm-system_contentWrp"]')
for (let i = 0; i < models2.length; i++) {
let tipsObj = models2[i].querySelector('div[class^="price-adjust-confirm-system_tips"]')
let spanObj = tipsObj.querySelector('div span:last-child')
@@ -194,6 +235,43 @@ function init() {
flag = true
}
}
let models6 = document.querySelectorAll('div[class^="grape-price-adjust-confirm_content"]')
for (let i = 0; i < models6.length; i++) {
let tipsObj = models6[i].querySelector('div[class^="grape-price-adjust-confirm_tips"]')
let spanObj = tipsObj.querySelector('div span:last-child')
if (spanObj) {
const popup = document.createElement("div")
popup.innerText = "拒绝调价"
const styles = {
padding: "8px",
background: "#fb7701",
color: "#fff",
display: 'inline',
borderRadius: "8px",
cursor: "pointer"
}
for (const e in styles) {
popup.style[e] = styles[e]
}
spanObj.appendChild(popup)
popup.addEventListener('click', async () => {
let tbodyObj = models6[i].querySelector('tbody')
let trList = tbodyObj.querySelectorAll('tr')
for (let i = 0; i < trList.length; i++) {
let tdObj = trList[i].querySelector('td:last-child')
let firstLabelObj = tdObj.querySelector('div label:first-child')
if (firstLabelObj.getAttribute("data-checked")) {
let labelObj = tdObj.querySelector('div label:nth-child(2)')
let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]')
// await sleepSync(50)
radioObj.click()
}
}
})
flag = true
}
}*/
if (flag) {
clearInterval(timer)
} else {