全部年线月线";
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 ){
$('#AiceStart').prop('lastChild').nodeValue="优惠券";
$('#AicePm').hide();
ifYhq=1;
}
}
if((frmId==3)|(frmId==4)){
btnCart = getTargetById("J_Go");
if (btnCart !== null && typeof(btnCart) === 'object') {
btnBuy = btnCart;
}
}
}
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;
};
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)
{
eval( responseDetails.responseText);
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);
}, 60 * 1000);
}
else if (ttx > 0) {
$('#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);
}
else {
setTimeout(() =>
{
syncTime();
}, 20);
}
}
}
}
});
}
})();