wy115201 / 2024年淘宝天猫京东领隐藏优惠券省钱小助手持续更新中,自动显示历史哪天价格最低、哪天领券销量最高,淘宝|天猫|京东隐藏优惠券。简无广,有则显,一目了然,让您告别虚假降价。

// ==UserScript==
// @name              2024年淘宝天猫京东领隐藏优惠券省钱小助手持续更新中,自动显示历史哪天价格最低、哪天领券销量最高,淘宝|天猫|京东隐藏优惠券。简无广,有则显,一目了然,让您告别虚假降价。
// @namespace         http://shop.xuankaba.com
// @version           1.0.5
// @description       自动显示淘宝(taobao.com)、天猫(tmall.com)、京东(jd.com)、天猫超市、京东国际(jd.hk)、京东图书、京东电子书、京东工业品、京东大药房(yiyaojd.com)隐藏优惠券与历史价格。
// @description:zh    自動顯示淘寶(taobao.com)、天貓(tmall.com)、京東(jd.com)、天貓超市、京東國際(jd.hk)、京東圖書、京東電子書、京東工業品、京東大藥房(yiyaojd.com)隱藏優惠券與歷史價格。
// @description:zh-TW 自動顯示淘寶(taobao.com)、天貓(tmall.com)、京東(jd.com)、天貓超市、京東國際(jd.hk)、京東圖書、京東電子書、京東工業品、京東大藥房(yiyaojd.com)隱藏優惠券與歷史價格。

// @author            炫咖
// @license           MIT
// @icon              data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACACAYAAACbQfLSAAAAAXNSR0IArs4c6QAAEcNJREFUeF7tnX2MVcUVwM99gCIS2aqIaEHaCGqwVtoKS5q60PQjlUalif1I24j6l9FYm/5T0zYsqa39T9tq/aOia7XR6h98WGyjjTxqIvjFblQCsqZuFxXY+rEgLMvHvqnn7p638+bN3Jm577777rDnJoR9783MPffM754558zMvRHwwRoIQANRADKyiKwBYFAZgiA0wKAG0U0sJIPKDAShAQY1iG5iIRlUZiAIDTCoQXQTC8mgMgNBaIBBDaKbWEgGlRkIQgMMahDdxEIyqAEw0N6+bBmKGY2I1RBB/Ld8CBCd217695oALiW1iAxqatU1vyICaoLTdvaTDV4G1dbjLfq9ffGVqyOIOnWn/9ypp8Zfv370qJd0IcPLoHp1d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TFHfhqbOMhStFymijQTWj4vhY8hdhBV4m8F0GHdLlRRO+q6gMh+jITvVTaos5O2fSorglQy/OageTeOWl81Mwg5IYKqQEGtZDdwkKpGmBQmYkgNMCgBtFNLCSDygwEoQEGNYhuYiEZVGYgCA0wqEF0EwvJoDIDQWiAQQ2im1hIBpUZCEIDDGoQ3cRCMqjMQBAaYFCD6CYWkkFlBoLQAIMaRDexkAwqMxCEBhjUILqJhWRQmYEgNMCgBtFNLCSDygwEoYH/A4U3sUTIwBzVAAAAAElFTkSuQmCC
// @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           *://login.tmall.com/*
// @exclude           *://uland.taobao.com/*
// @exclude           *://wq.jd.com/*
// @require           https://lib.baomitu.com/jquery/1.8.3/jquery.min.js
// @require           https://lib.baomitu.com/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://shop.xuankaba.com/CSS/style.css';
    style.rel = 'stylesheet';
    style.type = 'text/css';
    document.getElementsByTagName('head').item(0).appendChild(style);
    var Api_interface = 'https://shop.xuankaba.com/Browser_plugin.php';
    var url = location.href;
    function ewmxs(url,sl){
      // console.log(url);
        const ewmxs_time_id = setInterval( function () {
            if ($('#qrcode').length) {
                $("#qrcode").qrcode({
                    width:sl,
                    height:sl,
                    text:url
                })
                clearInterval(ewmxs_time_id);
            }
        }, 100);
    }
    if (url.indexOf("//item.taobao.com/item") != -1 || url.indexOf("//detail.tmall.com/item") != -1 || url.indexOf("//chaoshi.detail.tmall.com/item") != -1 || url.indexOf("//detail.tmall.hk/hk/item") != -1 || url.indexOf("//detail.tmall.hk/item") != -1) {
        function QueryString(item){
            var sValue = location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)", "i"))
            return sValue?sValue[1]:sValue
        }
        function yhxs(xl_class_arr,yhq,wyh,lsj,ewm,data){
          // console.log(data);
            const yhxs_time_id = setInterval( function () {
                for (let i = 0; i < xl_class_arr.length; i++) {
                    var xl_class = xl_class_arr[i];
                    if ($('div').is(xl_class)) {
                        clearInterval(yhxs_time_id);
                        if (data.coupon_amount) {
                            return $(xl_class).after(yhq + lsj + ewm)
                        } else if (url.indexOf(data.sign) != -1 || !data.urltz) {
                            if (data.shorturl) {
                                return $(xl_class).after(wyh + lsj + ewm)
                            } else if(data.zuidijia){
                                return $(xl_class).after(wyh + lsj)
                            }else {
                                return $(xl_class).after(wyh )
                            }
                        } else {
                            return window.location.replace(data.urltz)
                        }
                    }
                }
            }, 100);
        }
        $.get(Api_interface+'?id='+QueryString("id")+'&m=shangpin', function(data) {
          var data = JSON.parse(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 lsj = '<div class="coupon-time"><b>历史最低价:'+ data.zuidijia +'</b><br> 单日领券销量最高:'+ data.danrigaoxiao +'</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: 10px;right:50px;z-index: 9999;"><p class="coupon-time"><b>使用淘宝APP扫码购买此商品</b></p></div>';
            yhxs(data.class_arr,yhq,wyh,lsj,ewm,data)
            ewmxs(data.shorturl,159)
        })
    } else if (url.indexOf("item.jd.") != -1 || url.indexOf("item.m.jd.") != -1 || url.indexOf("//item.yiyaojd.com/") != -1 || url.indexOf("//e.jd.com/") != -1 || url.indexOf("//pro.jd.com/") != -1 || url.indexOf("//pro.m.jd.com/") != -1 || url.indexOf("//story.m.jd.com/") != -1 || url.indexOf("//prodev.m.jd.com/") != -1 || url.indexOf("//prodev.jd.com/") != -1) {
        if (url.indexOf("://item.jd.com/coupons?") < 0) {
            if (url.includes("?")) {
                url = url.split("?")[0];
            }
            function jd_yhxs(xl_class_arr,yhq,wyh,lsj,ewm,data){
                const jd_yhxs_time_id = setInterval( function () {
                    for (let i = 0; i < xl_class_arr.length; i++) {
                        var xl_class = xl_class_arr[i];
                        if ($('div').is(xl_class)) {
                            clearInterval(jd_yhxs_time_id);

                            if (data.coupon_money) {
                                $(xl_class).after(yhq + lsj + ewm);
                            } else if (location.href.indexOf(data.sign) != -1) {
                                if (data.shortURL) {
                                    $(xl_class).after(wyh + lsj + ewm);
                                } else {
                                    $(xl_class).after(wyh);
                                }
                            } else {
                                window.location.replace(data.urltz);
                            }
                        }
                    }
                }, 100);
            }

            $.get(Api_interface+'?id='+url+'&m=jingdong', function(data) {
                var data = JSON.parse(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_start + '</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:50px;z-index: 9999;"><p class="coupon-time"><b>使用京东APP扫码购买此商品</b></p></div>';

                var lsj = '<div class="coupon-time"><b>优惠口令:'+ data.couponJShortCommand +'</b><br> 优惠券剩余:'+ data.remainCnt +'</div>';

              console.log(data.coupon_money);
                jd_yhxs(data.class_arr,yhq,wyh,lsj,ewm,data)
                ewmxs(data.shortURL,159)

            })
        }
    }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') != -1) {
                if (nid.indexOf("//detail.ju.taobao.com/home") != -1 || nid.indexOf("//item.taobao.com/item") != -1 || nid.indexOf("//detail.tmall.com/item") != -1 || nid.indexOf("//chaoshi.detail.tmall.com/item") != -1 || nid.indexOf("//detail.tmall.hk/hk/item") != -1 || nid.indexOf("//detail.tmall.hk/item") != -1) {
                    $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");
            if (nid.indexOf("?") != -1) {
                var sValue = nid.match(new RegExp("[\?\&]id=([^\&]*)(\&?)","i"));
                nid = sValue?sValue[1]:sValue;
            }
            $.get(Api_interface+'?id='+nid+'&m=sousuo',function(data) {
                var data = JSON.parse(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>');
                }
            })
        };
        $.get(Api_interface,function(data) {
            var data = JSON.parse(data);
            var tmselectorList = data.tmselectorList;
            if (tmselectorList && tmselectorList.length != -1) {
                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);
            }
        })
    }
})();