您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
查看抖音小店订单信息
当前为
// ==UserScript== // @name 抖音小店订单管理主播版 // @namespace - // @match *://fxg.jinritemai.com/ffa/morder/order/list // @grant none // @version 1.0 // @author -大师兄 // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @description 查看抖音小店订单信息 // ==/UserScript== $( (function () { "use strict"; //创建悬浮盒子 let erjiHezi = ` <style> #dashixiong-caidan { position: fixed; top: 10px; right: 0px; text-align: left; z-index: 9998; /*z-index 属性设置元素的堆叠顺序。拥有更高堆叠顺序的元素总是会处于堆叠顺序较低的元素的前面。*/ cursor: pointer; margin-top: 4px; line-height: 34px; display: inline-block; border-radius: 15px; /*盒子圆弧角*/ background-color: rgba(255, 255, 255, 1); color: #000; font-size: 15px; padding: 15px 25px; width: 600px; overflow-x: auto; /*overflow-y: auto;*/ } #dashixiongtable { display: block; width: 100%; height: 600px; text-align: center; vertical-align: center; white-space: nowrap; /*-webkit-overflow-scrolling: touch; 移动端手指滚动更流畅*/ } #dashixiongtable_tbody { overflow-y: auto; } /* #dashixiongtable_tbody:hover{overflow-y:auto;} */ #dashixiongtable tr { /* height: 20px; */ } #dashixiongtable td,#dashixiongtable th { padding: 1px 2px; border: 1px solid #000; border-collapse: collapse;/*合并边框*/ } #dashixiongtable tr:hover { background-color: #f0f0f0; } #dashixiong-main-div { position: fixed; top: 20px; right: 50px; text-align: center; z-index: 9999; cursor: pointer; vertical-align:middle; margin-top: 4px; height: 34px; width: 34px; line-height: 34px; display: inline-block; border-radius: 50px; background-color: rgba(0, 0, 0, 0.5); } .dashixiong { color: #880000; font-size: 23px; } </style> <div id="dashixiong-main"> <div id="dashixiong-main-div"> </div> <div id="dashixiong-caidan"> <button id="btn_shuaxin">点击这里刷新表格</button> <table id="dashixiongtable"> <thead> <tr> <th class="xuhao">序号</th> <th class="kehunicheng">用户昵称</th> <th class="dingdanzhuangtai">订单金额</th> <th class="dingdanzhuangtai">订单状态</th> <th class="xiadanshijian">下单时间</th> <th class="lianjiebiaoti">链接标题</th> <th class="dingdanbianhao">订单编号</th> </tr> </thead> <tbody id="dashixiongtable_tbody"></tbody> </table> </div> </div> `; let wangzhi = "https://fxg.jinritemai.com/api/order/searchlist?tab=all&order_by=create_time&order=desc&ttl=1629335116079&page=0&pageSize=10&appid=1&__token=3624eb6b8f3818903f92ba21f8e14a31&_bid=ffa_order&aid=4272&_lid=351161259758&_signature=_02B4Z6wo00101NtZ0jQAAIDAe8wUpCVQ11TbXdaAAFfRSoeO5CK1xgmRh43pjgPswUWA.m4HmoRCREkDdOoJYHc2ErLZn55XQBvEV.W04E-6X1Pn.RklJ7i3frjEleWNM6fnH.B9eqhePFr1bd"; $.ajax({ type: "GET", url: wangzhi, data: {}, dataType: "json", success: function (data) { //console.log(data); chulishuju(data); }, }); function chulishuju(data) { // console.log(data); // $("tr").remove(".hangneirong"); let kehunicheng = ""; let xiadanshijian = ""; let da_shop_order_id = ""; for (let i = 0; i < data.data.length; i++) { da_shop_order_id = data.data[i].shop_order_id; // console.log(wangzhiyinsi.replace(/order_id=(\w+)&appid=/, "order_id=" + shop_order_id + "&appid=")); kehunicheng = data.data[i].user_nickname; xiadanshijian = formatDate(data.data[i].create_time); $("#dashixiongtable_tbody").append( biaoge_html(data.data.length - i,kehunicheng,data.data[i].pay_amount / 100,data.data[i].order_status_info.order_status_text,xiadanshijian,data.data[i].shop_order_id,data.data[i].product_item[0].product_name) ); } if($("#dashixiong-caidan").outerHeight() > $(window).height()-20){ $("#dashixiong-caidan").height($(window).height()-50); } } function biaoge_html(xuhao,kehunicheng,dingdanjine,dingdanzhuangtai,xiadanshijian,dingdanbianhao,lianjiebiaoti){ return '<tr class="hangneirong"><td class="xuhao">' + xuhao + '</td><td class="kehunicheng">' + kehunicheng + '</td><td class="dingdanjine">' + dingdanjine + '</td><td class="dingdanzhuangtai">' + dingdanzhuangtai + '</td><td class="xiadanshijian">' + xiadanshijian + '</td><td class="lianjiebiaoti">' + lianjiebiaoti + '</td><td class="dingdanbianhao">' + dingdanbianhao + "</td></tr>" } function tianjiashuju(data) { //console.log("1"); // $("tr").remove(".hangneirong"); let kehunicheng = ""; let xiadanshijian; let da_shop_order_id; var dashixiong_str = ""; let biaoge_diyige_shijiancuo = Number(Date.parse(new Date($(".hangneirong:eq(0) .xiadanshijian").text())))/1000; let biaoge_hangshu = Number(Date.parse(new Date($(".hangneirong:eq(0) .xuhao").text()))); // console.log(biaoge_diyige_shijiancuo,Object.prototype.toString.call(biaoge_diyige_shijiancuo)); // let i_i = 0; for (let i = 0; i < data.data.length; i++) { // if(data.data[i].create_time <= biaoge_diyige_shijiancuo) {Toast("数据更新完成",1000);break}; // console.log(Object.prototype.toString.call(data.data[i].create_time)); xiadanshijian = formatDate(data.data[i].create_time); // console.log(Number(xiadanshijian),biaoge_diyige_shijiancuo); da_shop_order_id = data.data[i].shop_order_id; // console.log(wangzhiyinsi.replace(/order_id=(\w+)&appid=/, "order_id=" + shop_order_id + "&appid=")); if(data.data[i].create_time > biaoge_diyige_shijiancuo) { kehunicheng = data.data[i].user_nickname; dashixiong_str += biaoge_html(i + 1,kehunicheng,data.data[i].pay_amount / 100,data.data[i].order_status_info.order_status_text,xiadanshijian,da_shop_order_id,data.data[i].product_item[0].product_name); }else{ $('#dashixiongtable_tbody tr .dingdanbianhao:contains(' + da_shop_order_id + ')').siblings('.dingdanzhuangtai').text(data.data[i].order_status_info.order_status_text); $('#dashixiongtable_tbody tr .dingdanbianhao:contains(' + da_shop_order_id + ')').siblings('.dingdanjine').text(data.data[i].pay_amount / 100); }; } // console.log(dashixiong_str); $("#dashixiongtable_tbody").prepend(dashixiong_str); //重新写序号 let len = $('#dashixiongtable_tbody tr').length; for(let i = 0;i<len;i++){ $('#dashixiongtable_tbody tr:eq('+i+') td:first').text(len - i); } if($("#dashixiong-caidan").outerHeight() > $(window).height()-20){ $("#dashixiong-caidan").height($(window).height()-50); } // console.log($("#dashixiong-caidan").outerHeight()); Toast("更新完毕",1000); } $("body").eq(0).prepend(erjiHezi); // $("#dashixiong-caidan").hide(); //响应事件 $("#dashixiong-main-div").click(function () { $.ajax({ type: "GET", url: wangzhi, data: {}, dataType: "json", success: function (data) { tianjiashuju(data); }, }); }); $("#dashixiong-main-div").mouseenter(function () { $("#dashixiong-caidan").stop(true, false).show(); }); window.setInterval(function(){$("#dashixiong-main-div").click();},120000); $("#btn_shuaxin").on("click",function () { $.ajax({ type: "GET", url: wangzhi, data: {}, dataType: "json", success: function (data) { tianjiashuju(data); }, }); }); function formatDate(data) { let timestamp = new Date(data * 1000); let year = timestamp.getFullYear(); let month = timestamp.getMonth() + 1; let date = timestamp.getDate(); let hour = timestamp.getHours(); let minute = timestamp.getMinutes(); let second = timestamp.getSeconds(); return ( year + "-" + fixZero(month, 2) + "-" + fixZero(date, 2) + " " + fixZero(hour, 2) + ":" + fixZero(minute, 2) + ":" + fixZero(second, 2) ); } function fixZero(num, length) { let str = "" + num; let len = str.length; let s = ""; for (let i = length; i-- > len; ) { s += "0"; } return s + str; } function Toast(msg,duration){ duration=isNaN(duration)?3000:duration; let m = document.createElement('div'); m.innerHTML = msg; m.style.cssText="max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;"; document.body.appendChild(m); setTimeout(function() { let d = 0.5; m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in'; m.style.opacity = '0'; setTimeout(function() { document.body.removeChild(m) }, d * 1000); }, duration); } })() );