// ==UserScript==
// @name walmart 绩效快速统计
// @namespace http://tampermonkey.net/
// @version 1.2
// @description 用在沃尔玛运营时候简化一部分操作用 私人脚本
// @author w1w
// @match *://seller.walmart.com/partner-analytics/performance/financials*
// @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// @icon https://www.google.com/s2/favicons?domain=walmart.com
// @grant none
// @license MIT
// @downloadURL none
// ==/UserScript==
//缝缝补补用三年 简化下沃尔玛后台的运营操作。
window.copy=()=> {
let transfer = document.createElement('textarea');
document.body.appendChild(transfer);
transfer.value = copyData; // 这里表示想要复制的内容
transfer.focus();
transfer.select();
alert("复制完成");
if (document.execCommand('copy')) {
document.execCommand('copy');
}
transfer.blur();
console.log('复制成功');
document.body.removeChild(transfer);
}
window.todayValue = function() {
var d = new Date();
var todayValue = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
return todayValue;
}
window.addZero = function(data) {
if (data.length < 2) {
return '0' + data
} else {
return data
}
}
window.id = 'tab' + Date.now();
window.timeIsRight = 1;
var tem =
`
" + timeList[i] +
" | " + tempDate['catlgItemId'] +
" | " + tempDate['department'] +
" | " + tempDate['brandName'] +
" | " + tempDate['TotalGMV'] +
" | " + tempDate['TotalCommissions'] +
" | " + (tempDate['TotalGMV'] - tempDate['TotalCommissions']) +
" | " + tempDate['AuthAUR'] +
" | " + tempDate['TotalUnits'] +
" | " + tempDate['TotalCancelUnits'] +
" | " + tempDate['TotalCancelAmt'] +
" | " + (tempDate['TotalCancelAmt'] / tempDate['TotalAuthAmt']) +
" | " + (tempDate['TotalCancelUnits'] / tempDate['TotalAuthUnits']) +
" | " + tempDate['Conversion'] +
" | " + tempDate['baseItemId'] +
" | " + tempDate['skuId'] +
" | " + tempDate['TotalProductVisits'] +
" |
";
}
}
}
};
$().ready(function() {
let date =new Date();
date = date.getTime()
let div_section = document.createElement('section')
let tempDate;
div_section.innerHTML = tem
setTimeout(()=>{document.querySelector("#subapp-main-0 > div > div:nth-child(1) > div > div:nth-child(3) > div").before(div_section)
tempDate = date-86400000*5;
tempDate = new Date(tempDate);
$("#ent").val(todayValue());
$("#stt").val(tempDate.getFullYear() + '-' + addZero('' + (tempDate.getMonth() + 1)) + '-' + addZero('' + tempDate.getDate()));
$("#sameDay").bind('click', function() {
$("#ent").val($("#stt").val());
});
$("#TDay").bind('click', function() {
$("#ent").val(todayValue());
tempDate = date-86400000*3;
tempDate = new Date(tempDate);
$("#stt").val(tempDate.getFullYear() + '-' + addZero('' + (tempDate.getMonth() + 1)) + '-' + addZero('' + tempDate.getDate()));
});
$("#SDay").bind('click', function() {
$("#ent").val(todayValue());
tempDate = date-86400000*7;
tempDate = new Date(tempDate);
$("#stt").val(tempDate.getFullYear() + '-' + addZero('' + (tempDate.getMonth() + 1)) + '-' + addZero('' + tempDate.getDate()));
});
$("#go").bind('click', function() {
mainLunch()
});
$("#today").bind('click', function() {
$("#ent").val(todayValue())
});
var nowTime = () => {
let d = new Date()
$('#nowTime').val('' + d.getHours() + ':' + addZero('' + d.getMinutes()) + ':' + addZero('' + d.getSeconds()))
}
setInterval(nowTime, 500)},1500)
})