// ==UserScript== // @name 店小秘统计当前订单件数 // @namespace https://greasyfork.org/zh-CN/scripts/462551 // @version 0.7 // @description 发货时对一下数量,对于一个订单有多件的比较方便 // @author Huang // @match https://www.dianxiaomi.com/order/* // @icon https://www.google.com/s2/favicons?sz=64&domain=dianxiaomi.com // @grant GM_addStyle // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; const attributeName = `cur-total`; let css = ` h3.total-num { color: red; position: absolute; left: 250px; top: 7px; font-size:14px; } #orderListTable tr.goodsId { position: relative; } ` GM_addStyle(css); function main(){ let table = document.querySelector("#orderListTable"); if(!table) return; let titleRows = document.querySelectorAll('.goodsId'); const len = titleRows.length; if(len == 0)return; for (let titleRow of titleRows) { let contentRow = titleRow.nextElementSibling; let numBoxes = contentRow.querySelectorAll('[class^="circularSpan"]'); let sum = 0; for (let numBox of numBoxes) { let num = parseInt(numBox.textContent); sum += num; } titleRow.insertAdjacentHTML("beforeend", `