加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
try.js 3.34 KB
一键复制 编辑 原始数据 按行查看 历史
King 提交于 2018-08-13 16:37 . last update
var importJs=document.createElement('script');
importJs.setAttribute("type","text/javascript");
importJs.setAttribute("src", 'https://greasyfork.org/scripts/14098-bililiterange-js/code/bililiteRangejs.js?version=88786');
document.getElementsByTagName("head")[0].appendChild(importJs);
var el = document.querySelectorAll('input[name="coupon"]')[0];
bililiteRange(el).sendkeys('foo');
var event = document.createEvent('HTMLEvents');
event.initEvent("change", true, true);
event.eventType = 'message';
el.dispatchEvent(event);
WebFlags:
var webcheck=false;
function getwebcheck(){
var webcheck1=jQuery('.couponcontent.toggle-content').length;
var wevcheck2=jQuery('.order-value.value').length;
var wevcheck3=true;
if(webcheck1 && wevcheck2 && wevcheck3){
webcheck=true;
}
}
getwebcheck();
if (jQuery(".bdc-cart-totals-remove-promo").length>0) {
execJs('jQuery(".bdc-cart-totals-remove-promo").click()');
var ch0=setInterval(check0,1000);
var timesRun = 0;
function check0(){
timesRun += 1;
if(jQuery(".bdc-cart-totals-remove-promo").length==0 || timesRun==3){
clearInterval(ch0);
setTimeout(function(){
autotest_remove_init();
},1000);
}else{
execJs('jQuery(".bdc-cart-totals-remove-promo").click()');
}
}
}else{
autotest_remove_init();
}
function autotest_remove_init(){
data['org_price']=jQuery(".bdc-cart-totals-subtotal").last().next().text().replace(/[^0-9\.\$\£\€\,]+/g,"");
jQuery(".bdc-cart-promo-codes .ft-input").val('');
jQuery(".bdc-cart-promo-codes .ft-input").sendkeys(code);
execJs('jQuery(".bdc-cart-promo-codes .ft-input").change();');
setTimeout(function(){
execJs('jQuery(".bdc-cart-promo-codes .ft-btn").click()');
setTimeout(function(){
var ch=setInterval(check,1000);
function check(){
if(jQuery(".bdc-cart-totals-remove-promo").length>0 || jQuery.trim(jQuery(".field-validation-error").text())!=""){
clearInterval(ch);
data['now_price']=jQuery(".bdc-cart-totals-subtotal").last().next().text().replace(/[^0-9\.\$\£\€\,]+/g,"");
data['result_tips']=jQuery.trim(jQuery(".field-validation-error").text());
resolve(data);
}
}
},1000);
},1000);
}
if (jQuery(".bdc-cart-totals-remove-promo").length>0) {
execJs('jQuery(".bdc-cart-totals-remove-promo").click()');
var ch0=setInterval(check0,1000);
var timesRun = 0;
function check0(){
timesRun += 1;
if(jQuery(".bdc-cart-totals-remove-promo").length==0 || timesRun==3){
clearInterval(ch0);
setTimeout(function(){
autotest_apply_best_code();
},1000);
}else{
execJs('jQuery(".bdc-cart-totals-remove-promo").click()');
}
}
}else{
autotest_apply_best_code();
}
function autotest_apply_best_code(){
jQuery(".bdc-cart-promo-codes .ft-input").val('');
jQuery(".bdc-cart-promo-codes .ft-input").sendkeys(code);
execJs('jQuery(".bdc-cart-promo-codes .ft-input").change();');
setTimeout(function(){
execJs('jQuery(".bdc-cart-promo-codes .ft-btn").click()');
},1000);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化