全部年线月线";
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(chk==1){ //自动提交订单
var t1 = setInterval(function() {
var 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)){
if (frmId == 1){
ifLj = getTargetByTAV('div','class','tb-btn-wait');
}else if(frmId == 2){
ifLj = getTargetByTAV('div','class','tb-tqg');
}
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;
}
}
function getStyle(element, attr){
if(element.currentStyle){
return element.currentStyle[attr];
}else{
return window.getComputedStyle(element,null)[attr];
}
}
function dateFormat(fmt, date) {
let ret;
let opt = {
"Y+": date.getFullYear().toString(), // 年
"m+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"H+": date.getHours().toString(), // 时
"M+": date.getMinutes().toString(), // 分
"S+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt;
}
function getTargetById(t_id){
var target = document.getElementById(t_id);
return target;
}
function getTargetByTAV(t_tag,t_attr,t_value){
var target = document.getElementsByTagName(t_tag);
for(var i=0;i
{
strJosn = d;
};
const mqN =0 ;
function mqMode()
{
if (mqN>=60) return; //避免影响用户正常使用
var divSel = getTargetByTAV('div','class','select-all J_SelectAll');
console.log("aaaaa" + allck);
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);
}
}else if (ttx > 60 * 1000 * 1)//1分钟才同步
{
console.log("距离抢购还有一段时间");
setTimeout(() =>
{
//location.replace(location.href);
syncTime();
}, 10 * 1000);
}else if (ttx > 0) {
console.log('cccc'+mqBfTim);
if (ttx <= mqBfTim * 1000 * 1 && mqMd ==1 ){
if(ifRef==0){
GM_setValue("ref",1);
location.replace(location.href);
}
}
$('#AiceStart').prop('lastChild').nodeValue="正在倒计时("+ttx/1000+"S)";
if (initsdtime_int == 0) {
initsdtime_int = parseInt(result.time);
}
if ((d8 - sd) <= 1000) {
console.log("等待抢购");
$('#AiceStart').prop('lastChild').nodeValue="等待抢购";
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);
}
}
}
}
});
}
})();