Greasy Fork is available in English.

! 超简洁的网购省钱小助手,自动显示京东、淘宝、聚划算、天猫隐藏优惠券与历史价格。简洁无广告,一目了然,让您告别虚假降价。持续维护中...

或许是最简洁好用的购物小助手啦~ 自动显示京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、聚划算、天猫超市、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东大药房(yiyaojd.com)隐藏优惠券与历史价格。不止让您省钱开心购物,更可以告别虚假降价,以最优惠的价格,把宝贝抱回家。

目前为 2021-06-22 提交的版本。查看 最新版本

// ==UserScript==
// @name              ! 超简洁的网购省钱小助手,自动显示京东、淘宝、聚划算、天猫隐藏优惠券与历史价格。简洁无广告,一目了然,让您告别虚假降价。持续维护中...
// @name:zh           ! 超简洁的网购省钱小助手,自动显示京东、淘宝、聚划算、天猫隐藏优惠券与历史价格。简洁无广告,一目了然,让您告别虚假降价。持续维护中...
// @name:zh-TW        ! 超簡潔的網購省錢小助手,自動顯示京東、淘寶、聚劃算、天貓隱藏優惠券與歷史價格。簡潔無廣告,一目了然,讓您告別虛假降價。持續維護中...
// @namespace         http://shop.xuelg.com
// @version           2.0.2
// @description       或许是最简洁好用的购物小助手啦~ 自动显示京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、聚划算、天猫超市、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东大药房(yiyaojd.com)隐藏优惠券与历史价格。不止让您省钱开心购物,更可以告别虚假降价,以最优惠的价格,把宝贝抱回家。
// @description:zh    或許是最簡潔好用的購物小助手啦~ 自動顯示京東(jd.com)、淘寶(taobao.com)、天貓(tmall.com)、聚劃算、天貓超市、天貓國際(tmall.hk)、京東國際(jd.hk)、京東圖書、京東大藥房(yiyaojd.com)隱藏優惠券與歷史價格。不止讓您省錢開心購物,更可以告別虛假降價,以最優惠的價格,把寶貝抱回家。
// @description:zh-TW 或許是最簡潔好用的購物小助手啦~ 自動顯示京東(jd.com)、淘寶(taobao.com)、天貓(tmall.com)、聚劃算、天貓超市、天貓國際(tmall.hk)、京東國際(jd.hk)、京東圖書、京東大藥房(yiyaojd.com)隱藏優惠券與歷史價格。不止讓您省錢開心購物,更可以告別虛假降價,以最優惠的價格,把寶貝抱回家。
// @author            血莲
// @match             *://*.taobao.com/*
// @match             *://*.tmall.com/*
// @match             *://chaoshi.detail.tmall.com/*
// @match             *://*.tmall.hk/*
// @match             *://*.liangxinyao.com/*
// @match             *://*.jd.com/*
// @match             *://*.jd.hk/*
// @match             *://*.yiyaojd.com/*
// @exclude           *://login.taobao.com/*
// @exclude           *://uland.taobao.com/*
// @exclude           *://pages.tmall.com/*
// @require           https://cdn.bootcdn.net/ajax/libs/jquery/1.8.3/jquery.min.js
// @require           https://cdn.bootcdn.net/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js
// @antifeature       referral-link 【应GreasyFork代码规范要求:含有优惠券查询功能的脚本必须添加此提示!在此感谢大家的理解...】
// @grant             unsafeWindow
// ==/UserScript==

(function() {
    'use strict';
    var style = document.createElement('link');
    style.href = 'https://cdn.xuelg.com/shop/style.css';
    style.rel = 'stylesheet';
    style.type = 'text/css';
    document.getElementsByTagName('head').item(0).appendChild(style);
    var apijiekou = 'https://api.shop.xuelg.com/';
    var url = location.href;
    if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0 || url.indexOf("//detail.tmall.hk/item.htm") > 0) {
        function QueryString(item){
            var sValue=location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)","i"))
            return sValue?sValue[1]:sValue
        }
        $.get(apijiekou+'?id='+QueryString("id"),function(data) {
            console.log(data);
            var yhq = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">优惠券 ' + data.coupon_amount + '元</div><div class="coupon-info2">' + data.coupon_info + '</div></div>'+
                    '<a class="coupon-get" href="' + data.coupon_click_url + '">立即领取</a></div><div class="coupon-time">优惠券截止时间:' + data.coupon_end_time + ' <b>剩余:'+ data.coupon_remain_count +'张</b></div>';
            var wyh = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">未查询到优惠券</div><div class="coupon-info2">' + data.qun + '</div></div>'+
                    '<a class="coupon-get" target="blank" href="' + data.search + '">搜索类似商品</a></div>';
            var lsj = '<div class="coupon-time"><b>历史最低价:' + data.zuidijia + '元</b>  历史高最价:'+ data.zuigaojia +'元(仅供参考)</div>';
            var ewm = '<div id="qrcode" style="position: fixed;bottom: 10px;right:35px;z-index: 9999;"><p class="coupon-time"><b>使用淘宝APP扫码领取优惠券</b></p></div>';
            if (url.indexOf('//detail.tmall.') != -1 || url.indexOf('//chaoshi.detail.tmall.') != -1) {
                if (data.coupon_amount && data.zuidijia) {
                    $('.tm-fcs-panel').after(yhq + lsj + ewm);
                } else if (data.coupon_amount) {
                    $('.tm-fcs-panel').after(yhq + ewm);
                } else if (data.zuidijia) {
                    if (url.indexOf(data.sign) != -1 || data.urltz == null) {
                        $('.tm-fcs-panel').after(wyh + lsj);
                    } else {
                        window.location.replace(data.urltz);
                    }
                } else {
                    if (url.indexOf(data.sign) != -1 || data.urltz == null) {
                        $('.tm-fcs-panel').after(wyh);
                    } else {
                        window.location.replace(data.urltz);
                    }
                }
            } else {
                if (data.coupon_amount && data.zuidijia) {
                    $('ul.tb-meta').after(yhq + lsj + ewm);
                } else if (data.coupon_amount) {
                    $('ul.tb-meta').after(yhq + ewm);
                } else if (data.zuidijia) {
                    if (url.indexOf(data.sign) != -1 || data.urltz == null) {
                        $('ul.tb-meta').after(wyh + lsj);
                    } else {
                        window.location.replace(data.urltz);
                    }
                } else {
                    if (url.indexOf(data.sign) != -1 || data.urltz == null) {
                        $('ul.tb-meta').after(wyh);
                    } else {
                        window.location.replace(data.urltz);
                    }
                }
            }
            $("#qrcode").qrcode({
                width:156,
                height:156,
                text:data.shorturl
            })
        })
    } else if (url.indexOf("//item.jd.com/") > 0 || url.indexOf("//npcitem.jd.hk/") > 0 || url.indexOf("//item.yiyaojd.com/") > 0 || url.indexOf("//pcitem.jd.hk/") > 0 || url.indexOf("//pro.jd.com/") > 0 || url.indexOf("//pro.m.jd.com/") > 0 || url.indexOf("//story.m.jd.com/") > 0 || url.indexOf("//prodev.m.jd.com/") > 0 || url.indexOf("//prodev.jd.com/") > 0) {
        $.get(apijiekou+'jd/?url='+url,function(data) {
            console.log(data);
            var yhq = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">优惠券 ' + data.coupon_money + '元</div><div class="coupon-info2">' + data.coupon_info + '</div></div>'+
                    '<a class="coupon-get" href="' + data.clickURL + '">立即领取</a></div><div class="coupon-time">优惠券截止时间:' + data.coupon_final + '</div>';
            var wyh = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">未查询到优惠券</div><div class="coupon-info2">' + data.qun + '</div></div>'+
                    '<a class="coupon-get" target="blank" href="' + data.search + '">搜索相关优惠</a></div>';
            var ewm = '<div id="qrcode" style="position: fixed;bottom: 3px;right:39px;z-index: 9999;"><p class="coupon-time"><b>使用京东APP扫码领取优惠券</b></p></div>';
            if (data.coupon_money) {
                $('.summary-top').after(yhq + ewm);
            } else {
                if (url.indexOf(data.sign) != -1) {
                    $('.summary-top').after(wyh);
                }else {
                    window.location.replace(data.urltz);
                }
            }
            $("#qrcode").qrcode({
                width:156,
                height:156,
                text:data.shortURL
            })
        })
    }  else {
        var objs = {};
        objs.initSearchItem = function (selector) {
            var $tmthis = $(selector);
            if ($tmthis.hasClass("tb-cool-box-already")) {
                return;
            } else {
                $tmthis.addClass("tb-cool-box-already")
            }
            var nid = $tmthis.attr("data-id");
            if (!nid || parseInt(nid) != nid || nid <= 10000) {
                nid = $tmthis.attr("data-itemid");
            }
            if (!nid || parseInt(nid) != nid || nid <= 10000) {
                if ($tmthis.attr("href")) {
                    nid = location.protocol + $tmthis.attr("href");
                } else {
                    var $tma = $tmthis.find("a");
                    if (!$tma.length) {
                        return;
                    }
                    nid = $tma.attr("data-nid");
                    if (!nid || parseInt(nid) != nid || nid <= 10000) {
                        if ($tma.hasClass("j_ReceiveCoupon") && $tma.length > 1) {
                            nid = location.protocol + $($tma[1]).attr("href");
                        } else {
                            nid = location.protocol + $tma.attr("href");
                        }
                    }
                }
            }
            var ssqun = '<div class="tb-cool-box-area tb-cool-box-wait" data-nid="' + nid + '"><a class="tb-cool-box-info tb-cool-box-info-default" title="点击查询">待查询</a></div>'
            if (nid.indexOf('http') >= 0) {
                if (nid.indexOf("//detail.ju.taobao.com/home.htm") > 0 || nid.indexOf("//item.taobao.com/item.htm") > 0 || nid.indexOf("//detail.tmall.com/item.htm") > 0 || nid.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || nid.indexOf("//detail.tmall.hk/hk/item.htm") > 0 || nid.indexOf("//detail.tmall.hk/item.htm") > 0) {
                    $tmthis.append(ssqun);
                }
            } else if (nid) {
                $tmthis.append(ssqun);
            }
        };
        objs.basicQueryItem = function (selector) {
            var $tmthis = $(selector);
            $tmthis.removeClass("tb-cool-box-wait");
            var nid = $tmthis.attr("data-nid");
            $.get(apijiekou+'?id='+nid,function(data) {
                if (data.coupon_amount) {
                    $tmthis.html('<a target="_blank" class="tb-cool-box-info tb-cool-box-info-find" title="切换透明度">有券(减' + data.coupon_amount + '元)</a>');
                } else {
                    $tmthis.addClass("tb-cool-box-info-translucent");
                    $tmthis.html('<a href="javascript:void(0);" class="tb-cool-box-info tb-cool-box-info-empty" title="切换透明度">暂无优惠</a>');
                }
            })
        };
        var tmselectorList = [];
        if (url.indexOf("//s.taobao.com/search") > 0 || url.indexOf("//s.taobao.com/list") > 0) {
            tmselectorList.push(".items .item");
        } else if (url.indexOf("//list.tmall.com/search_product.htm") > 0 || url.indexOf("//list.tmall.com//search_product.htm") > 0 || url.indexOf("//list.tmall.com/coudan/search_product.htm") > 0) {
            tmselectorList.push(".product");
            tmselectorList.push(".chaoshi-recommend-list .chaoshi-recommend-item");
        } else if (url.indexOf("//list.tmall.hk/search_product.htm") > 0) {
            tmselectorList.push("#J_ItemList .product");
        } else if (document.getElementById('J_ShopSearchResult')) {
            tmselectorList.push("#J_ShopSearchResult .item");
        }
        if (tmselectorList && tmselectorList.length > 0) {
            setInterval(function () {
                tmselectorList.forEach(function (selector) {
                    $(selector).each(function () {
                        objs.initSearchItem(this);
                    });
                });
            }, 1500);
            $(document).on("click", ".tb-cool-box-area", function () {
                var $tmthis = $(this);
                if ($tmthis.hasClass("tb-cool-box-wait")) {
                    objs.basicQueryItem(this);
                } else if ($tmthis.hasClass("tb-cool-box-info-translucent")) {
                    $tmthis.removeClass("tb-cool-box-info-translucent");
                } else {
                    $tmthis.addClass("tb-cool-box-info-translucent");
                }
            });
            setInterval(function () {
                $(".tb-cool-box-wait").each(function () {
                    objs.basicQueryItem(this);
                });
            }, 1500);
        }
    }
})();