全部年线月线";
hml= hml + "
";
opWind('','0','历史价格',hisPriceShow(hml));
}else{
//console.log(json.action.to);
opWind(json.action.to,'1','请验证后刷新页面!','');
}
}
});
});
}
}
function hisPriceShow(sBody){
var priceHtml=
`
历史价格
${sBody}
`
return priceHtml;
};
if(frmId==9 && GM_getValue("goodsId")!=0){ //京东手机页面处理 避免用户正常访问手机页面执行脚本
var t2 = setInterval(function() {
if ($("#id-pcprompt-mask")) {
$("#id-pcprompt-mask").remove();
}
if ($(".mod_alert_v2_mas")) {
$(".mod_alert_v2_mas").remove();
}
if ($(".mod_alert_mask")) {
$(".mod_alert_mask").remove();
}
if ($("#lineVoiceMobile").length == 1) {
var mobile = $("#lineVoiceMobile").val();
if (mobile == "") {
$("#lineVoiceMobile").val("13912345678");
}
}
var phoneNum = getTargetByTAV('input','class','num');
var gNum = GM_getValue("goodsNum");
if (phoneNum !== null && typeof(phoneNum) == 'object' && phoneNum.value!=gNum) {
phoneNum.value= gNum;
}
var zfk = null;
var zfk1= 0 ;
if (getTargetById("payPass") !== null && typeof(getTargetById("payPass")) == 'object'){
zfk = getTargetById("payPass").style.display;
if (zfk!="none"){
var zfkSd = getTargetById("shotDot").lastChild;
if($("#shotDot").children().length==6 && zfkSd!== null && typeof(zfkSd) == 'object' && zfkSd.className!="on") {
zfk1=0;
}else{
zfk1=1;
}
}else{
zfk1=0;
}
}
var olZf =getTargetById("btnPayOnLine");
if (olZf !== null && typeof(olZf) === 'object' && zfk1!=1) {
olZf.click();
}
var zxZf = null;
zxZf = getTargetByTAV("a","class","mod_btn bg_2");
if (zxZf !== null && typeof(zxZf) === 'object'&& zfk1!=1) {
zxZf.click();
//clearInterval(t2);
}else{}
// 取消提示
if (getTargetByTAV("a","class","mod_alert_v2 show fixed") !== null && typeof(getTargetByTAV("a","class","mod_alert_v2 show fixed")) === 'object') {
var altv2 = getTargetByTAV("a","class","mod_alert_v2 show fixed").getElementsByTagName('a')[0];
if (altv2 !== null && typeof(altv2) === 'object'){
altv2.click();
}
}
var gWd = null;
gWd = getTargetByTAV("a","class","btn confirm btn_1");
if (gWd !== null && typeof(gWd) === 'object') {
gWd.click();
//clearInterval(t2);
}else{}
//
var qr1 = getTargetByTAV("a","class","mod_btn confirm bg_g_jd");
if (qr1 !== null && typeof(qr1) === 'object') {
qr1.click();
//clearInterval(t2);
}
},cyce)
}
if(chk==1){ //自动提交订单
var t1 = setInterval(function() {
var gXd = null;
if (window.location.href.indexOf("jd.com")!=-1){
gXd = getTargetById("order-submit");
if(gXd !== null && typeof(gXd) === 'object'){
}else{
gXd = getTargetByTAV("button","class","checkout-submit");
}
}else if (window.location.href.indexOf("suning.com/order.do")!=-1 | window.location.href.indexOf("shopping.hksuning.com/cart")!=-1){
if(getTargetByTAV('div','class',"choose-list")!== null && typeof(getTargetByTAV('div','class',"choose-list")) === 'object'
&& getTargetByTAV('div','class',"choose-list").children[0].children[0].className!="choose-item checked"){
getTargetByTAV('div','class',"choose-list").children[0].children[0].click();
}//--- 苏宁香港
gXd = getTargetByTAV("a","class","checkout-submit-btn cart-btn l");
}else{
gXd = getTargetByTAV("a","class","go-btn");
}
if (gXd !== null && typeof(gXd) === 'object') {
gXd.click();
clearInterval(t1);
}else{}
},cyce)
}
window.onload=function (){
if((frmId == 1)|(frmId == 2)|(frmId == 7)){
if (frmId == 1){
ifLj = getTargetByTAV('div','class','tb-btn-wait');
}else if(frmId == 2){
ifLj = getTargetByTAV('div','class','tb-tqg');
}else if(frmId == 7){
ifLj = null;
}
if(ifLj == null ){
//var nuLj = getTargetByTAV('div','class','tb-btn-buy tb-btn-sku tb-hidden');
//if (nuLj!=null){}else{
$('#AiceStart').prop('lastChild').nodeValue="优惠券";
$('#AicePm').hide();
ifYhq=1;
//}
}
}
if((frmId==3)|(frmId==4)){
allck = getTargetById('J_SelectAll1');
btnCart = getTargetById("J_Go");
if (btnCart !== null && typeof(btnCart) === 'object') {
btnBuy = btnCart;
}
if(ifRef==1&&mqMd==1){
mqMode();
}
}
if(frmId==5){
$('#AiceStart').prop('lastChild').nodeValue="优惠券";
$('#AicePm').hide();
ifYhq=1;
}
if(frmId==6){
allck = getTargetByTAV('input','class',"jdcheckbox");
if (allck == null || typeof(allck) == 'undefined') {
//location.replace(location.href);
location.reload();
}
btnCart = getTargetByTAV('a','class',"submit-btn");
if (btnCart !== null && typeof(btnCart) === 'object') {
btnBuy = btnCart;
}
if(GM_getValue("goodsId")!=0){
var cGoodsId = GM_getValue("goodsId");
GM_setValue("goodsId",0);
GM_setValue("AutoSubOdr",1)
// var chks = document.getElementById('cart-list').getElementsByTagName('input');
// for(var ii=0; ii
{
strJosn = d;
};
const mqN =0 ;
function mqMode()
{
console.log("开始盲抢");
if (mqN>=60) return; //避免影响用户正常使用
var divSel = null;
if (window.location.href.indexOf("jd.com")!=-1|window.location.href.indexOf("suning.com")!=-1){
if(allck !== null && typeof(allck) === 'object'){
if (allck.checked==0){
allck.click();
}
}else{
mqN++;
mqMode();
return;
}
}else{
divSel = getTargetByTAV('div','class','select-all J_SelectAll');
if (allck !== null && typeof(allck) === 'object') {
if(divSel !== null && typeof(divSel) === 'object'){
allck.click();
}else{
mqN++;
mqMode();
return;
}
}else{
mqN++;
mqMode();
return;
}
}
$('#AiceStart').prop('lastChild').nodeValue="等待抢购";
window.setTimeout(function ()
{
if (btnBuy !== null && typeof(btnBuy) === 'object') {
btnBuy.click();
}else{}
}, 500);
}
function syncTime()
{
if (gostart==0) return;
var timestamp = getCookie("ft_qgd");
d8 = new Date();
d8.setTime(timestamp);//读取抢拍时间
starttime = new Date().getTime();
GM_xmlhttpRequest({
url: "https://t.alicdn.com/t/gettime?callback=fff",
method: 'GET',
timeout: 10000,
headers: {
'Content-Type': 'application/jsonp',
'Accept': 'application/jsonp',
'Cache-Control': 'public'
},
onload: function(responseDetails)
{
if (responseDetails.status == 200)
{
//console.log(responseDetails.responseText);
//eval( responseDetails.responseText);
var strJosn = JSON.parse(responseDetails.responseText.replace('fff(','').replace(')',''));
//console.log(strJosn);
var result = strJosn;
endtime = new Date().getTime();
//服务器时间
var sd = new Date();
sd.setTime(result.time * 1000);
var ttx = d8 - sd;
if (ttx < 0)//已过1
{
alert("时间已过");
if (ttx> -2000) //避免重复刷页面
{
//location.replace(location.href);
location.reload();
}
}else if (ttx > 60 * 1000 * 2)//2分钟才同步
{
console.log("距离抢购还有一段时间");
setTimeout(() =>
{
//location.replace(location.href);
syncTime();
}, 10 * 1000);
}else if (ttx > 0) {
if (ttx <= mqBfTim * 1000 * 1 && mqMd ==1 ){
if(ifRef==0){
GM_setValue("ref",1);
//location.replace(location.href);
location.reload();
}
}
$('#AiceStart').prop('lastChild').nodeValue="正在倒计时("+ttx/1000+"S)";
if (initsdtime_int == 0) {
initsdtime_int = parseInt(result.time);
}
if ((d8 - sd) <= 2000) {
console.log("等待抢购");
$('#AiceStart').prop('lastChild').nodeValue="等待抢购";
window.setTimeout(function ()
{
var buyCyce =0 //避免多次提交
var buyTop = 1 //不同页面提交次数不同
if(frmId==1 || frmId==2 || frmId==5 || frmId==7){
buyTop=5;
}else{
buyTop=1;
}
var t3 = setInterval(() => {
if (buyCyce>= buyTop){
$('#AiceStart').prop('lastChild').nodeValue="开始倒计时";
clearInterval(t3);
return;
}
if (btnBuy !== null && typeof(btnBuy) === 'object') {
if (btnBuy.style.display!=null && typeof(btnBuy.style.display)=== 'object' &&btnBuy.style.display=="none"){
}else{
btnBuy.click();
buyCyce++;
}
}else{}
},400);
}, d8 - sd - bwtime);
/*
window.setTimeout(function ()
{
if (btnBuy !== null && typeof(btnBuy) === 'object') {
btnBuy.click();
}else{}
}, d8 - sd - bwtime);
window.setTimeout(function ()
{
if (btnBuy !== null && typeof(btnBuy) === 'object') {
btnBuy.click();
}else{}
}, d8 - sd - bwtime + 100); //重复提交一次确保提交到
*/
}
else {
setTimeout(() =>
{
syncTime();
}, 20);
}
}
}
}
});
}
})();