Greasy Fork is available in English.

淘宝天猫优惠券一键领取,实实在在省钱。

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

Verzia zo dňa 2020-06-11 07:45:10 UTC. Pozri najnovšiu verziu.

// ==UserScript==
// @name         淘宝天猫优惠券一键领取,实实在在省钱。
// @namespace    https://tk.xunhuo.vip
// @version      1.1
// @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/*
// @include      http*://detail.tmall.hk/*
// @include      http*://chaoshi.detail.tmall.com/*
// @require      https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js
// @grant        none
// ==/UserScript==
///////////////////////////////////////////////////////////////////////
(function() {
    'use strict';
    $(document).ready(function() {
		var url = window.location.host;
        var itemName = '';//$(document).attr('title');
        var itemId = '';
		if (url == 'item.taobao.com') {
            itemId = $("link[rel=canonical]").attr("href");
            itemId = itemId.split("id=")[1];
            itemName = $('.tb-main-title').attr('data-title');
            var btn_quan_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(itemId) +'&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(itemName) +' target="_blank">全网搜券</a></div>';
            $('.tb-action').append(btn_quan_taobao);

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

            var btn_quan_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(itemId) +'&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(itemName) +'" title="搜索其他店铺商品" target="_blank">全网搜券</a></div>';
			var btn_quan_tmall2 =   '<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(itemName) +'" title="搜索其他店铺商品" target="_blank">搜券</a></div>';
			$('.tb-action').append(btn_quan_tmall);

        }else if(url == 'chaoshi.detail.tmall.com'){
            itemId = $('a[id=J_AddFavorite]').attr('data-aldurl')
            itemId = itemId.split("itemId=")[1]
            itemName = $('input[name=title]').attr('value');
            var btn_chaoshi_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(itemId) +'&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(itemName) +'" title="搜索其他店铺商品" target="_blank">全网搜券</a></div><br />';
            $('.tb-sku').append(btn_chaoshi_tmall);

        }else if(url == 'detail.tmall.hk'){
            itemId = $("link[rel=canonical]").attr("href");
            itemId = itemId.split("id=")[1];
            itemName = $('meta[name=keywords]').attr('content');
            var btn_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(itemId) +'&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(itemName) +'" title="搜索其他店铺商品" target="_blank">全网搜券</a></div><br />';
			$('.tb-sku').append(btn_tmall_hk);
        }
    });
})();