// ==UserScript== // @name 淘宝天猫内部优惠券.现在开始帮您省钱 // @namespace https://www.ishtq.com // @version 3.36 // @description 淘宝天猫内部优惠券,一件查找优惠券,简单快速 // @author 淘宝天猫内部优惠券 // @include http*://item.taobao.com/* // @include http*://detail.tmall.com/* // @include http*://s.taobao.com/* // @include http*://list.tmall.com/* // @include http*://list.tmall.hk/* // @include http*://chaoshi.tmall.com/* // @require https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js // @grant none // @downloadURL none // ==/UserScript== //////////////////////////////////////////////////////////////////////// (function() { 'use strict'; // 淘宝天猫优惠券,一件查找优惠券,简单快速为您省钱!!! var location = window.location.host; var num = -1; if(location.indexOf("item.taobao.com")>=0){ num = 0; }else if(location.indexOf("detail.tmall") != -1){ num = 1; }else if(location.indexOf("s.taobao.com") != -1){ num = 2; }else if(location.indexOf("list.tmall.com") != -1){ num = 3; }else if(location.indexOf("ai.taobao.com") != -1){ num = 4; }else if(location.indexOf("list.tmall.hk") != -1){ num = 5; }else if(location.indexOf("chaoshi.tmall.com") != -1){ num = -1; } //alert(num) if(num != -1){ setInterval(function(){ getTaoBao(num); },500); } })(); function getTaoBao(num){ var name; var html; switch(num){ case 0: if($('.tb-main-title').hasClass("tm")){ }else{ $('.tb-main-title').addClass("tm"); name = $('.tb-main-title').text(); html = '
查优惠券
双十一超级红包
'; $('.tb-action').append(html); } break; case 1: if($('meta[name=keywords]').hasClass("ishtq")){ }else{ $('meta[name=keywords]').addClass("ishtq"); name = $('meta[name=keywords]').attr('content'); html = '
查优惠券
双十一超级红包
'; $('.tb-action').append(html); } break; case 2: for(var i=0;i<$(".price").length;i++){ if($(".price").eq(i).hasClass("jia")){ }else{ $(".price").eq(i).addClass("jia"); if($(".J_U2IStat .img").eq(i).attr("alt")){ $(".price").eq(i).append("查优惠券") }else{ $(".price").eq(i).append("查优惠券") } } } break; case 3: if($(".productPrice")){ for(var q=0;q<$(".productPrice").length;q++){ if($(".productPrice").eq(q).hasClass("jia")){ }else{ $(".productPrice").eq(q).addClass("jia"); $(".productPrice").eq(q).append("查优惠券") } } } for(var j=0;j<$(".ui-price").length;j++){ if($(".ui-price").eq(j).hasClass("jia")){ }else{ $(".ui-price").eq(j).addClass("jia"); $(".ui-price").eq(j).append("查优惠券") } } break; case 4: $(".title").each(function(){ if($(this).hasClass("jia")){ }else{ $(this).addClass("jia"); name = $(this).children("a:first").text(); $(this).after("查优惠券"); } }); break; case 5: if($(".productPrice")){ for(var e=0;e<$(".productPrice").length;e++){ if($(".productPrice").eq(e).hasClass("jia")){ }else{ $(".productPrice").eq(e).addClass("jia"); $(".productPrice").eq(e).append("查优惠券") } } } for(var w=0;w<$(".ui-price").length;w++){ if($(".ui-price").eq(w).hasClass("jia")){ }else{ $(".ui-price").eq(w).addClass("jia"); $(".ui-price").eq(w).append("查优惠券") } } break; case 6: //if($(".wrap").length == 0) break; //alert($(".wrap")); break; } }