淘宝天猫优惠券一键领取,实实在在省钱。增加618超级红包领取

淘宝天猫内部优惠券一键领取,在商品页可以直接领取相关商品优惠券,还可以搜索全网相关宝贝。

As of 2020-06-12. See the latest version.

// ==UserScript==
// @name         淘宝天猫优惠券一键领取,实实在在省钱。增加618超级红包领取
// @namespace    https://tk.xunhuo.vip
// @version      1.13
// @description  淘宝天猫内部优惠券一键领取,在商品页可以直接领取相关商品优惠券,还可以搜索全网相关宝贝。
// @icon         https://tk.xunhuo.vip/favicon.ico
// @author       优惠券
// @connect      xunhuo.vip
// @include      *item.taobao.com/*
// @include      *detail.tmall.com/*
// @include      *s.taobao.com/*
// @include      *list.tmall.com/*
// @include      *list.tmall.hk/*
// @include      *chaoshi.tmall.com/*
// @include      *detail.tmall.hk/*
// @include      *chaoshi.detail.tmall.com/*
// @require      https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js
// @grant        none
// @homepageURL       https://tk.xunhuo.vip/?id=24557
// ==/UserScript==
///////////////////////////////////////////////////////////////////////
(function() {
    'use strict';
    $(document).ready(function() {
		var url = window.location.host;
        var name = '';//$(document).attr('title');
        var id = '';
		if (url == 'item.taobao.com') {
            id = $("link[rel=canonical]").attr("href");
            id = id.split("id=")[1];
            name = $('.tb-main-title').attr('data-title');
            var taobao = '<div class="tb-btn-buy" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/api_gaoyong_url_m.aspx?id=24557&sid=&relationId=&code='+ encodeURI(id) +'&type=0&type2=0" title="部分商品可能没有优惠券,可直接点击链接购买或尝试用搜券搜索其他的商品" target="_blank">领取优惠券</a></div><div class="tb-btn-add" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/m/item/list_s_super.aspx?id=24557&sid=&relationId=&keyword='+ encodeURI(name) +' target="_blank">全网搜券</a></div>';
            var taobao2 = '<div class="tb-btn-buy" style="padding-top:10px;"><a href="https://m.tb.cn/h.VN0ZC0J"target="_blank">618超级红包领取</a></div>';
            $('.tb-action').append(taobao,taobao2);

		}else if(url == 'detail.tmall.com'){
            id = $("link[rel=canonical]").attr("href");
            id = id.split("id=")[1];
            name = $('meta[name=keywords]').attr('content');

            var tmall =   '<div class="tb-btn-buy tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/api_gaoyong_url_m.aspx?id=24557&sid=&relationId=&code='+ encodeURI(id) +'&type=0&type2=0" title="部分商品可能没有优惠券或失效,可以点击链接直接购买或可尝试用搜券搜索其他相同的产品" target="_blank">获得优惠券</a></div><div class="tb-btn-basket tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/m/item/list_s_super.aspx?id=24557&sid=&relationId=&keyword='+ encodeURI(name) +'" title="搜索其他店铺商品" target="_blank">全网搜券</a></div>';
			var tmall2 =   '<div class="tb-btn-buy tb-btn-sku" style="padding-top:10px;"><a href="https://m.tb.cn/h.VN0ZC0J"target="_blank">618超级红包领取</a></div>';
			$('.tb-action').append(tmall,tmall2);

        }else if(url == 'chaoshi.detail.tmall.com'){
            id = $('a[id=J_AddFavorite]').attr('data-aldurl')
            id = id.split("id=")[1]
            name = $('input[name=title]').attr('value');
            var chaoshi = '<div class="tb-btn-buy tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/api_gaoyong_url_m.aspx?id=24557&sid=&relationId=&code='+ encodeURI(id) +'&type=0&type2=0" title="部分商品可能没有优惠券,可直接点击链接购买或尝试用搜券搜索其他的商品" target="_blank">获得优惠券</a></div><div class="tb-btn-basket tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/m/item/list_s_super.aspx?id=24557&sid=&relationId=&keyword='+ encodeURI(name) +'" title="搜索其他店铺商品" target="_blank">全网搜券</a></div><br />';
            $('.tb-sku').append(chaoshi);

        }else if(url == 'detail.tmall.hk'){
            id = $("link[rel=canonical]").attr("href");
            id = id.split("id=")[1];
            name = $('meta[name=keywords]').attr('content');
            var tmall_hk =   '<div class="tb-btn-buy tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/api_gaoyong_url_m.aspx?id=24557&sid=&relationId=&code='+ encodeURI(id) +'&type=0&type2=0" title="部分商品可能没有优惠券,可直接点击链接购买或尝试用搜券搜索其他的商品" target="_blank">获得优惠券</a></div><div class="tb-btn-basket tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/m/item/list_s_super.aspx?id=24557&sid=&relationId=&keyword='+ encodeURI(name) +'" title="搜索其他店铺商品" target="_blank">全网搜券</a></div><br />';
			$('.tb-sku').append(tmall_hk);
        }
    });
})();