// ==UserScript== // @name 省神优惠券,简单易用的淘宝天猫阿里大药房商品优惠券,并且提供同类商品大额优惠券推荐! // @namespace https://tsr.itwashot.com/ // @version 0.1.4 // @description 简单易用的淘宝天猫阿里大药房优惠券。并提供同类商品大额优惠券推荐。脚本将持续更新,后面陆续支持拼多多,京东等平台。 // @author Kevin Lelf // @match *://*.taobao.com/* // @match *://*.tmall.com/* // @match *://*.liangxinyao.com/* // @match *://chaoshi.detail.tmall.com/* // @match *://*.tmall.hk/* // @connect tsr.itwashot.com // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @require https://cdn.bootcss.com/materialize/1.0.0-rc.2/js/materialize.min.js // @resource lelf-materialcss https://cdn.jsdelivr.net/gh/lelf2005/cdn@master/material.css?v=20200630 // @run-at document-end // @grant GM_addStyle // @grant GM_getResourceText // @downloadURL none // ==/UserScript== (function() { 'use strict'; var $ = $ || window.$; var materialcss = GM_getResourceText('lelf-materialcss'); GM_addStyle(materialcss); var apiTBQueryById = 'https://honey-jewelry.com/taobao/getCoupon/'; //var apiTBQueryById = 'http://localhost:8080/getCoupon/'; var tbDetailUrls = ["//item.taobao.com/item.htm","//detail.tmall.com/item.htm", "//chaoshi.detail.tmall.com/item.htm", "//detail.tmall.hk/hk/item.htm","//detail.tmall.hk/item.htm" ]; initCss(); var productId; if (isTBDetailPage(location.href)) { productId = window.location.href.split("id=")[1].split('&')[0]; $.get(apiTBQueryById + productId, function(data) { var htmlCoupon = ''; var htmlSimilarItems = ''; if(data.otherRecommends.length > 0){ for(let i in data.otherRecommends) { htmlSimilarItems += '
'+data.otherRecommends[i].coupon_info+'
'; } } if (data.coupon_amount) { htmlCoupon = '' + data.coupon_info + '
剩余:' + data.coupon_remain_count + '
'+topItems[i].title+'
'+ '