最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

主播流水記錄導(dǎo)出表格

2022-08-04 23:07 作者:Yazawaにこ  | 我要投稿

①??打開(kāi)主播流水詳情頁(yè)面 流水頁(yè)面

② 按 F12 打開(kāi)控制臺(tái)

在紅色框框粘貼以下代碼

③ 在紅色區(qū)域內(nèi)復(fù)制粘貼以下代碼,然后回車。



class GiftTableExport {

? ? static async run(date) {

? ? ? ? let objects = await GiftTableExport.getGiftList(date);

? ? ? ? const table = GiftTableExport.buildTable(Object.keys(objects[0]), objects.map(v => Object.values(v)));

? ? ? ? GiftTableExport.tableToExcel(table, date);

? ? }

? ? static buildTable(titleColumns, valueColumns) {

? ? ? ? const table = document.createElement('table');
? ? ? ? const titleTr = document.createElement('tr');
? ? ? ? table.append(titleTr);
? ? ? ? titleColumns.map(v => {
? ? ? ? ? ? const th = document.createElement('th');
? ? ? ? ? ? th.innerText = v;
? ? ? ? ? ? titleTr.appendChild(th);
? ? ? ? });
? ? ? ? valueColumns.map(v => {
? ? ? ? ? ? const valueTr = document.createElement('tr');
? ? ? ? ? ? v.map(vv => {
? ? ? ? ? ? ? ? const th = document.createElement('th');
? ? ? ? ? ? ? ? th.innerText = vv;
? ? ? ? ? ? ? ? valueTr.appendChild(th);
? ? ? ? ? ? });
? ? ? ? ? ? table.append(valueTr);
? ? ? ? });
? ? ? ? return table;
? ? }
? ? static tableToExcel(table, fileName) {
? ? ? ? function base64(content) {
? ? ? ? ? ? return window.btoa(unescape(encodeURIComponent(content)));
? ? ? ? }
? ? ? ? let excelContent = table.innerHTML;? ? ? ? let excelFile = `<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='htt${'p://w'}ww.${'w3.o'}rg/TR${'/REC-ht'}ml40'>`;
? ? ? ? excelFile += "<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head>";
? ? ? ? excelFile += "<body><table>";
? ? ? ? excelFile += excelContent;
? ? ? ? excelFile += "</table></body>";
? ? ? ? excelFile += "</html>";
? ? ? ? let link = "data:application/vnd.ms-excel;base64," + base64(excelFile);
? ? ? ? const a = document.createElement("a");
? ? ? ? a.download = fileName + ".xlsx";
? ? ? ? a.href = link;
? ? ? ? a.click();
? ? }
? ? static async getGiftList(date, last_id = 0) {

? ? ? ? const res = await fetch(`http${'s:/'}/ap${'i.l'}ive.bilibil${'i.co'}m/xlive/revenue/v1/giftSt${'ream/get'}ReceivedGiftStreamNextList?limit=50&coin_type=0&begin_time=${date}&last_id=${last_id}`, {

? ? ? ? ? ? "headers": { "accept": "application/json, text/plain, */*", "accept-language": "zh-CN,zh;q=0.9", "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Google Chrome\";v=\"99\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site" },

? ? ? ? ? ? "referrer": `http${'s://l'}in${'k.b'}ilibil${'i.co'}m/p/center/ind${'ex?'}spm_id_fr${'om=333.10'}07.0.0`,

? ? ? ? ? ? "referrerPolicy": "no-referrer-when-downgrade",

? ? ? ? ? ? "body": null,

? ? ? ? ? ? "method": "GET",

? ? ? ? ? ? "mode": "cors",

? ? ? ? ? ? "credentials": "include"

? ? ? ? });

? ? ? ? const result = await res.json();

? ? ? ? let { has_more, list } = result.data;

? ? ? ? if (has_more) {

? ? ? ? ? ? const nextList = await GiftTableExport.getGiftList(date, [...list].pop().id);

? ? ? ? ? ? list = list.concat(nextList);

? ? ? ? }

? ? ? ? list = list.map(item => {

? ? ? ? ? ? return {

? ? ? ? ? ? ? ? "UID": item.uid,

? ? ? ? ? ? ? ? "昵稱": item.uname,

? ? ? ? ? ? ? ? "時(shí)間": item.time,

? ? ? ? ? ? ? ? "禮物": item.gift_name,

? ? ? ? ? ? ? ? "數(shù)量": item.gift_num,

? ? ? ? ? ? ? ? "金瓜子": item.gold,

? ? ? ? ? ? ? ? "銀瓜子": item.silver,

? ? ? ? ? ? ? ? "IOS金瓜子": item.ios_gold,

? ? ? ? ? ? }

? ? ? ? });

? ? ? ? return list;

? ? }

}

const exportButton = document.createElement('button');

exportButton.innerText = "導(dǎo)出";

exportButton.onclick = () => {

? ? const date = document.body.querySelector('.el-date-editor.selector.date-selector.el-input.el-date-editor--date input').value;

? ? GiftTableExport.run(date)

}

document.body.querySelector('.item.nickName').appendChild(exportButton);

//?

④ 然后在搜索按鈕后面會(huì)出現(xiàn)一個(gè)導(dǎo)出按鈕,在左邊選好時(shí)間后,點(diǎn)擊導(dǎo)出就可以導(dǎo)出當(dāng)天的禮物流水啦w。


主播流水記錄導(dǎo)出表格的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
滦南县| 鲁山县| 东莞市| 桐乡市| 忻州市| 商河县| 双桥区| 剑川县| 津南区| 巢湖市| 古丈县| 乌兰县| 宣武区| 葫芦岛市| 洛扎县| 珲春市| 珠海市| 吴旗县| 靖州| 南投市| 互助| 专栏| 民丰县| 陵水| 青铜峡市| 荥经县| 榕江县| 钟山县| 西峡县| 上饶市| 安溪县| 南安市| 广水市| 崇明县| 维西| 大化| 库尔勒市| 阿坝县| 鹿邑县| 石楼县| 长顺县|