Greasy Fork

Greasy Fork is available in English.

淘宝.天猫.京东.拼多多.大额优惠券/ 一键免费领取

一键免费领取。直接领取优惠券购买。优惠30%以上!

当前为 2020-03-05 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name       淘宝.天猫.京东.拼多多.大额优惠券/ 一键免费领取 
// @namespace    http://www.tzbridge.cn/
// @version      1.5.6
// @description 一键免费领取。直接领取优惠券购买。优惠30%以上!
// @author       淘宝优惠劵
// @match        *://item.taobao.com/*
// @match        *://detail.tmall.com/*
// @match        *://detail.tmall.hk/*
// @match        *://chaoshi.detail.tmall.com/*
// @match        *://item.jd.com/*
// @require      https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js
// @grant        none
// @run-at       document-end
// ==/UserScript==
(function () {
  'use strict';
  $(document).ready(function () {
    var host = window.location.host;
    var productNm = '';
    var url = "http://www.r10263.cn/mall/topic?type=4&isc=0&goodSource=1&sign=KY58&title=9.9%E5%8C%85%E9%82%AE";
    var urll = "http://www.r10263.cn/mall/findResult?spm=a220o.1000855.0.0.315b4fa5NNOyl8&sign=KY58&goodSource=1&keyword=";
    var label = "精选9.9包邮";
    var labell = "一键领取优惠劵";
    var cssSelector = '';
    if (host.indexOf('taobao.com') > 0) {
      productNm = $.trim($('.tb-main-title').text());
      cssSelector = '.tb-action';
    }
    else if (host.indexOf('tmall.com') > 0) {
      productNm = $.trim($('.tb-detail-hd h1').text());
      cssSelector = '.tb-action';
    }
    else if (host.indexOf('jd.com') > 0) {
      productNm = $.trim($('.sku-name').text());
      cssSelector = '#choose-btns';
      url = "http://www.r10263.cn/mall/findResult?spm=a220o.1000855.0.0.315b4fa5NNOyl8&sign=KY58&goodSource=1&keyword=";
    }
    $(cssSelector).append(obtainAppendHtml(host, url, productNm, label, urll, labell));
  });

  function obtainAppendHtml(host, url, productNm, label, urll, labell) {
    if (host.indexOf('taobao.com') > 0) {
      return '<div class="div-inline"><div class="tb-btn-buy" style="padding-top:11px;"><a href="' + url + encodeURI(productNm) + '" target="_blank">' + label + '</a></div></div> <div class="div-inline"><div class="tb-btn-add" style="padding-top:11px;"><a href="' + urll + '" target="_blank">' + labell + '</a></div></div>';
    }
    else if (host.indexOf('tmall.com') > 0) {
      return '<div class="div-inline"><div class="tb-btn-buy tb-btn-sku"  style="padding-top:11px;"><a href="' + url + encodeURI(productNm) + '" target="_blank">' + label + '</a></div></div> <div class="div-inline"><div class="tb-btn-basket tb-btn-sku " style="padding-top:11px;"><a href="' + urll + '" target="_blank">' + labell + '</a></div></div>';
    }
    else if (host.indexOf('jd.com') > 0) {
      return '<a class="btn-special1 btn-lg" href="' + url + encodeURI(productNm) + '" target="_blank">' + label + '</a>';
    }
  }
})();