[自动查券助手💸]可查淘宝、天猫、天猫国际、阿里大药房、京东、京东国际、京东大药房等隐藏优惠券。简洁无广告,不花冤枉钱

浏览商品时,自动查询商品是否有隐藏优惠券,支持:京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、天猫超市(chaoshi.tmall.com)、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东大药房(yiyaojd.com)、阿里大药房(maiyao.liangxinyao.com)等,低侵入提示,低调使用,长期维护更新~

当前为 2023-10-22 提交的版本,查看 最新版本

在您安装前,Greasy Fork 希望您知道此脚本声明其包含了一些负面功能。这些功能也许会使脚本作者获利,而不能给您带来任何直接的金钱收益。

作者可从这份脚本获得佣金,例如通过修改链接地址或提供优惠券代码以包含推荐或附属代码。 脚本作者的说明: 【此提示为GreasyFork代码规范要求含有查券功能的脚本必须添加,实际使用无任何强制跳转,代码可查,请知悉】

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name              [自动查券助手💸]可查淘宝、天猫、天猫国际、阿里大药房、京东、京东国际、京东大药房等隐藏优惠券。简洁无广告,不花冤枉钱
// @name:zh           [自动查券助手💸]可查淘宝、天猫、天猫国际、阿里大药房、京东、京东国际、京东大药房等隐藏优惠券。简洁无广告,不花冤枉钱
// @name:zh-TW        [自動查券助手💸]可查淘寶、天貓、天貓國際、阿里大藥房、京東、京東國際、京東大藥房等隱藏優惠券。簡潔無廣告,不花冤枉錢
// @description       浏览商品时,自动查询商品是否有隐藏优惠券,支持:京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、天猫超市(chaoshi.tmall.com)、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东大药房(yiyaojd.com)、阿里大药房(maiyao.liangxinyao.com)等,低侵入提示,低调使用,长期维护更新~
// @description:zh    浏览商品时,自动查询商品是否有隐藏优惠券,支持:京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、天猫超市(chaoshi.tmall.com)、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东大药房(yiyaojd.com)、阿里大药房(maiyao.liangxinyao.com)等,低侵入提示,低调使用,长期维护更新~
// @description:zh-TW 瀏覽商品時,自動查詢商品是否有隱藏優惠券,支援:京東(jd.com)、淘寶(taobao.com)、天貓(tmall.com)、天貓超市(chaoshi.tmall.com)、天貓國際(tmall.hk)、京東國際(jd.hk)、京東圖書、京東大藥房(yiyaojd.com)、阿里大藥房(maiyao.liangxinyao.com)等,低侵入提示,低調使用,長期維護更新~
// @icon		      data:image/png;base64,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
// @namespace         coupon_honghaoer
// @version           2.1.1
// @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://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.2.1/jquery.min.js
// @require           https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery.qrcode/1.0/jquery.qrcode.min.js
// @connect			  tt.shuqiandiqiu.com
// @connect           j.jiayoushichang.com
// @grant             GM_openInTab
// @grant             GM.openInTab
// @grant             GM_getValue
// @grant             GM.getValue
// @grant             GM_setValue
// @grant             GM.setValue
// @grant             GM_xmlhttpRequest
// @grant             GM.xmlHttpRequest
// @license           AGPL License
// @antifeature  	  referral-link 【此提示为GreasyFork代码规范要求含有查券功能的脚本必须添加,实际使用无任何强制跳转,代码可查,请知悉】
// @charset		      UTF-8
// @run-at            document-idle
// @original-script   https://greasyfork.org/zh-CN/scripts/469417
// @original-author   huahuacat
// @original-license  AGPL License
// ==/UserScript==

(function() {
	'use strict';
	
	/**
	 * 公共的方法
	 */
	class CommonTools{
		request(mothed, url, param){
			return new Promise(function(resolve, reject){
				GM_xmlhttpRequest({
					url: url,
					method: mothed,
					data:param,
					onload: function(response) {
						var status = response.status;
						var playurl = "";
						if(status==200||status=='200'){
							var responseText = response.responseText;
							resolve({"code":"success", "result":responseText});
						}else{
							reject({"code":"error", "result":null});
						}
					}
				});
			})
		}
		randomNumber(){
			return Math.ceil(Math.random()*100000000);
		}
		getPlatform(url = window.location.href){
			let platform = "";
			if(url.indexOf("detail.tmall")!=-1 || url.indexOf("tmall.hk")!=-1){
				platform = "tmall";
			}else if(url.indexOf("taobao.com")!=-1 || url.indexOf("maiyao.liangxinyao.com")!=-1){
				platform = "taobao";
			}else if(url.indexOf("jd.com")!=-1 || url.indexOf("npcitem.jd.hk")!=-1 || url.indexOf("yiyaojd.com")!=-1){
				platform = "jd";
			}
			return platform;
		}
		getParamterQueryUrl(text, tag) { //查询GET请求url中的参数
			if(text.indexOf("?")!=-1){ //选取?后面的字符串,兼容window.location.search,前面的?不能去掉
				var textArray = text.split("?");
				text = "?"+textArray[textArray.length-1];
			}
			var t = new RegExp("(^|&)" + tag + "=([^&]*)(&|$)");
			var a = text.substr(1).match(t);
			if (a != null){
				return a[2];
			}
			return "";
		}
		getEndHtmlIdByUrl(url){
			if(url.indexOf("?")!=-1){
				url = url.split("?")[0]
			}
			if(url.indexOf("#")!=-1){
				url = url.split("#")[0]
			}
			var splitText = url.split("/");
			var idText = splitText[splitText.length-1];
			idText = idText.replace(".html","");
			return idText;
		}
		getElementAsync(selector, allowEmpty = true, delay=200){
			return new Promise((resolve,reject) =>{
				let totalDelay = 0;
				let elementInterval = setInterval(()=>{
					if(totalDelay >= 3000){ //总共检查3s,如果还是没找到,则返回
						reject(false);
						clearInterval(elementInterval);
					}
					let element = document.querySelector(selector);
					let result = allowEmpty ? !!element : (!!element && !!element.innerHTML);
					if(result){
						clearInterval(elementInterval);
						resolve(element);
					}else{
						totalDelay += delay;
					}
				}, delay);
			});
		}
	}
	
	/**
	 * 优惠券相关功能
	 */
	class Coupon{
		platforms = ["detail.tmall.com", "item.taobao.com", "item.jd.com", "item.yiyaojd.com", "npcitem.jd.hk", "detail.tmall.hk"];
		constructor(){
			this.commonTools = new CommonTools();
		}
		isRun(){
			for(var i=0; i<this.platforms.length;i++){
				if(window.location.host.indexOf(this.platforms[i])!=-1){
					return true;
				}
			}
			return false;
		}
		filterName(str){
			if(!str) return "";
			str = str.replace(/\t/g,"");
			str = str.replace(/\r/g,"");
			return encodeURIComponent(str)
		}
		async getGoodsData(platform){
			var goodsId = "";
			var goodsName = "";
			const href = window.location.href;
			if(platform=="taobao"){
				goodsId = this.commonTools.getParamterQueryUrl(window.location.search, "id");
				try{
					const titleObj = await this.commonTools.getElementAsync("[class='tb-main-title']", false);
					goodsName = titleObj.getAttribute("data-title");
					if(!goodsName){
						goodsName = titleObj.textContent;
					}
				}catch(e){}
				
			}else if(platform=="tmall"){
				goodsId = this.commonTools.getParamterQueryUrl(window.location.search, "id");
				try{
					const titleObj = await this.commonTools.getElementAsync("[class^='ItemHeader--mainTitle--']", false);
					goodsName = titleObj.textContent;
				}catch(e){}
				
			}else if(platform=="jd"){
				goodsId = this.commonTools.getEndHtmlIdByUrl(href);
				try{
					const titleObj = await this.commonTools.getElementAsync("[class='sku-name']", false);
					goodsName = titleObj.textContent;
				}catch(e){}
			}
			const data = {"goodsId":goodsId, "goodsName":this.filterName(goodsName)};
			return data;
		}
		randomSpmValue(){
			$("meta[name='data-spm']").each(function(){
				var max = 5000;
				var min = 1000;
				var randomValue = Math.floor(Math.random() * (max - min + 1) ) + min;
				var randomLetter = String.fromCharCode(Math.floor( Math.random() * 26) + "a".charCodeAt(0));
				$(this).attr("content", randomValue+randomLetter);
			});
			$("meta[name='spm-id']").each(function(){
				var max = 5000;
				var min = 1000;
				var randomValue = Math.floor(Math.random() * (max - min + 1) ) + min;
				var randomLetter = String.fromCharCode(Math.floor( Math.random() * 26) + "a".charCodeAt(0));
				$(this).attr("content", randomValue+randomLetter);
			});
			$("body").find("*").each(function(){
				$(this).removeAttr("data-spm-anchor-id");
				$(this).removeAttr("data-spm");
			});
		}
		runAliDeceptionSpm(){
			const host = window.location.host;
			if(host.indexOf("aliyun.com")!=-1 || host.indexOf("taobao.com")!=-1 || host.indexOf("tmall.com")!=-1){
				this.randomSpmValue();
				setInterval(()=>{
					this.randomSpmValue();
				}, 2000);
			}
		}
		async createCouponHtml(platform, goodsId, goodsName){
			if(!platform || !goodsId) return;
			const goodsCouponUrl = "http://tt.shuqiandiqiu.com/api/coupon/discover?no=5&v=1.0.2&pl="+platform+"&id="+goodsId+"&qu="+goodsName;
			const goodsPrivateUrl = "http://tt.shuqiandiqiu.com/api/private/change/coupon?no=5&v=1.0.2&platform="+platform+"&id=";
			try{
				const data = await this.commonTools.request("GET", goodsCouponUrl, null);
				if(data.code=="success" && !!data.result){
					const result = JSON.parse(data.result).data;
					if(!result || result==="null" || !result.css || !result.html || !result.handler){
						return;
					}
					const  cssText = result.css, htmlText = result.html, handler = result.handler, templateId = result.templateId;
					if(!cssText || !htmlText || !handler){
						return;
					}
					$("body").prepend("<style>"+cssText+"</style>");
					
					// 添加HTML
					const handlers = handler.split("@");
					for(var i=0; i<handlers.length; i++){
						var $handler = $(""+handlers[i]+"");
						if(platform=="taobao"){
							$handler.parent().after(htmlText);
						}else if(platform=="tmall"){
							$handler.parent().after(htmlText);
						}else if(platform=="jd"){
							$handler.after(htmlText);
						}
					}
					
					const $template = $("#"+templateId);
					if($template.length == 0){
						return;
					}
					
					const couponElementA = $template.find("a[name='cpShUrl']");
					couponElementA.unbind("click").bind("click", ()=>{
						event.stopPropagation();
						event.preventDefault();
						let couponId = $template.data("id");
						if(!!couponId){
							this.commonTools.request("GET", goodsPrivateUrl+couponId, null).then((resutData2)=>{
								if(resutData2.code==="success" && !!resutData2.result){
									let url = JSON.parse(resutData2.result).url;
									if(!!url) GM_openInTab(url, {active:true});
								}
							});
						}
					});
					
					setInterval(()=>{
						$template.find("*").each(function(){
							$(this).removeAttr("data-spm-anchor-id");
						});
					},400);
					
					//canvas画二维码
					var $canvasElement = $("#ca"+templateId);
					if($canvasElement.length == 0){
						return;
					}
					let couponId = $template.data("id");
					this.commonTools.request("GET", goodsPrivateUrl+couponId, null).then((resutData2)=>{
						if(resutData2.code==="success" && !!resutData2.result){
							let img = JSON.parse(resutData2.result).img;
							if(!!img){
								var canvasElement = document.getElementById("ca"+templateId);
								var cxt = canvasElement.getContext("2d");
								var imgData = new Image();
								imgData.src = img;
								imgData.onload=function(){
									cxt.drawImage(imgData, 0, 0, imgData.width, imgData.height);
								}
							}
						}
					});
				}
			}catch(e){}
		}
		showGoodsQRcode(platform){
			if(platform==="jd"){ //京东不需要这个方法
				return;
			}
			const elementId = Math.ceil(Math.random()*100000000)+"qrcode";
			const width = 130;
			const title = platform=="jd" ? "京东APP扫码查看此商品":"淘宝APP扫码查看此商品";
			const text = platform=="jd" ? window.location.href : window.location.href.split("?")[0] + "?id="+this.commonTools.getParamterQueryUrl(window.location.search, "id");
			var html = `
				<div style="position:fixed;right:40px;bottom:10px;z-index:99999999;padding:5px;background-color:#F2F2F2;border-radius:3px;">
					<div style='font-size:12px;color:#ff5000;font-weight:bold;'>`+title+`</div>
					<div style='width:`+width+`px;height:`+width+`px;margin:0px auto;' id='`+elementId+`'></div>
				</div>
			`;
			$("body").append(html);
			jQuery('#'+elementId).qrcode({
				render: "canvas",
				width: width,
				height: width,
				foreground: "#000",
				background: "#FFF",
				text: text
			});
			console.log("text", text);
		};
		async start(){
			if(this.isRun()){
				this.runAliDeceptionSpm();
				const platform = this.commonTools.getPlatform();
				if(!!platform){
					this.showGoodsQRcode(platform);
					const goodsData = await this.getGoodsData(platform);
					this.createCouponHtml(platform, goodsData.goodsId, goodsData.goodsName);
				}
				
				if(platform=="tmall"){ //tmall如果sku太多就折叠
					const skuItemWrapper = await this.commonTools.getElementAsync("[class='skuItemWrapper']", false);
					if(skuItemWrapper != null){
						const { style } = skuItemWrapper;
						style.maxHeight = "400px";
						style.overflow = "auto";
					}
				}
			}
		}
	}
	
	class SearchPageObject{
		intervalIsRunComplete = true;  //定时任务一个循环是否完成
		constructor(){
			this.commonTools = new CommonTools();
		}
		pickupSearchElements(){ //收集列表的元素
			const selectorElementList = new Array();
			const url = window.location.href;
			if(url.indexOf("://s.taobao.com/search")!=-1 || url.indexOf("://s.taobao.com/list")!=-1) { //淘宝搜索页面
				selectorElementList.push({"element":".items >.item", "page":"taobao"});
		
		        selectorElementList.push({"element":".Content--content--sgSCZ12 .Card--doubleCardWrapper--L2XFE73", "page":"taobao_new"});
				selectorElementList.push({"element":".Content--content--sgSCZ12 .Card--listCardWrapper--ax09OfT", "page":"taobao_new"});
				selectorElementList.push({"element":".Content--content--sgSCZ12 .Card--doubleCardWrapperMall--uPmo5Bz", "page":"taobao_new"});
				selectorElementList.push({"element":".Content--content--sgSCZ12 .Card--listCardWrapperMall--E3jI8L4", "page":"taobao_new"});
		
			}else if(url.indexOf("taobao.com/category")!=-1){ //淘宝店铺分类
				selectorElementList.push({"element":"dl.item", "page":"taobao_category"});
			}else if(url.indexOf("taobao.com/search.htm")!=-1){ //淘宝店铺搜索
				selectorElementList.push({"element":"dl.item", "page":"taobao_shop_search"});
			}
			else if (url.indexOf("://list.tmall.com/search_product.htm")!=-1 || url.indexOf("://list.tmall.com//search_product.htm")!=-1
				|| url.indexOf("://list.tmall.com/coudan/search_product.htm")!=-1) { //天猫超市
		
				selectorElementList.push({"element":".product", "page":"tmall_chaoshi_search"});
				selectorElementList.push({"element":".chaoshi-recommend-list .chaoshi-recommend-item", "page":"tmall_chaoshi_search_new"}); //新天猫超市
		
			}else if (url.indexOf("//list.tmall.hk/search_product")!=-1) { //天猫国际
				selectorElementList.push({"element":"#J_ItemList .product", "page":"tmall_hk"});
			}else if(url.indexOf("tmall.com/category-")!=-1){ //天猫分类
				selectorElementList.push({"element":"#J_ShopSearchResult dl.item", "page":"tmall_category"});
			}else if(url.indexOf("tmall.com/category-")!=-1){ //天猫旗舰店分类
				selectorElementList.push({"element":"#J_ShopSearchResult dl.item", "page":"tmall_category"});
			}else if(url.indexOf(".tmall.com/shop/view_shop.htm")!=-1){ //天猫旗舰全部展示
				selectorElementList.push({"element":"dl.item", "page":"tmall_shop_01"});
			}else if(url.indexOf(".tmall.com/search.htm")!=-1){
				selectorElementList.push({"element":"dl.item", "page":"tmall_shop_search"});
			}
			else if(url.indexOf("//maiyao.liangxinyao.com/shop/view_shop.htm")!=-1 
				|| url.indexOf("//maiyao.liangxinyao.com/search.htm")!=-1
				|| url.indexOf("//maiyao.liangxinyao.com/category")!=-1){ //阿里大药房
				selectorElementList.push({"element":"#J_ShopSearchResult dl.item", "page":"ali_yao"});
			}
			else if (url.indexOf("//search.jd.com/Search")!=-1) { //京东搜索
				selectorElementList.push({"element":"#J_goodsList li.gl-item", "page":"jd"});
			}else if(url.indexOf("//search.jd.hk/Search")!=-1){ //京东国际
				selectorElementList.push({"element":"#plist li.gl-item", "page":"jd_hk"});
			}else if(url.indexOf("//mall.jd.com/view_search")!=-1){ //京东大药房
				selectorElementList.push({"element":"li.jSubObject", "page":"jd_yao"});
			}
			return selectorElementList;
		}
		createAllElementHtml(elementData){ //为所有的商品创建提示
			const self = this;
			$(elementData.element).each(function(){  //遍历所有的商品框
				self.createOneElementHtml($(this), elementData);
			});
			self.intervalIsRunComplete = true;
		}
		/**
		 * 为商品box添加有券提醒
		 * @param {Object} $element  每一个商品box
		 * @param {Object} elementData id and page
		 */
		async createOneElementHtml($element, elementData){  //查询到每个商品list
			if($element.attr("completebox")){  //当存在时,说明已经处理过了
				return;
			}
			
			$element.css("position","relative");
			var page = elementData.page;
			var goodsDetailUrl = null;
			
			if(page==="taobao"){
				goodsDetailUrl = $element.find("a[id^='J_Itemlist_TLink_']").attr("href");
			}else if(page==="taobao_new"){
				let href = $element.attr("href");
				goodsDetailUrl = href.indexOf("http") == -1 ? (location.protocol + href) : href;
			}else if(page==="taobao_category"){
				goodsDetailUrl = $element.find(".J_TGoldData").attr("href");
			}else if(page==="taobao_shop_search"){
				goodsDetailUrl = $element.find(".J_TGoldData").attr("href");
			}else if(page==="ali_yao"){
				goodsDetailUrl = $element.find(".J_TGoldData").attr("href");
			}else if(page==="tmall_chaoshi_search"){
				let href = $element.find("div.product-img").find("a").attr("href");
				goodsDetailUrl = href.indexOf("http") ==-1 ? (location.protocol + href) : href;
			}else if(page==="tmall_chaoshi_search_new"){
				let href = !!$element.attr("href")?$element.attr("href"):$element.find("a").attr("href");
				goodsDetailUrl = href.indexOf("http") ==-1 ? (location.protocol + href) : href;
			}else if(page==="tmall_hk"){
				goodsDetailUrl = $element.find("a.productImg").attr("href");
			}else if(page==="tmall_category"){
				goodsDetailUrl = $element.find(".J_TGoldData").attr("href");
			}else if(page==="tmall_shop_01"){
				goodsDetailUrl = $element.find("dt.photo").find("a").attr("href");
			}else if(page==="tmall_shop_search"){
				goodsDetailUrl = $element.find(".J_TGoldData").attr("href");
			}
			else if(page==="jd"){
				goodsDetailUrl = $element.find("div.p-img").find("a").attr("href");
			}else if(page==="jd_hk"){
				goodsDetailUrl = $element.find("div.p-img").find("a").attr("href");
			}else if(page==="jd_yao"){
				goodsDetailUrl = $element.find("div.jPic").find("a").attr("href");
			}
			
			if(!goodsDetailUrl){
				return;
			}
			// console.log(goodsDetailUrl);
			
			var analysisData = null;
			if(page==="jd" || page==="jd_hk"){
				var jdId = this.commonTools.getEndHtmlIdByUrl(goodsDetailUrl);
				if(!!jdId) analysisData = {"id":jdId, "platform":"jd"};
			}else{
				var platform = this.commonTools.getPlatform(goodsDetailUrl);
				var id = this.commonTools.getParamterQueryUrl(goodsDetailUrl, "id");
				if(platform && id){
					analysisData = {"id":id, "platform":platform};
				}
			}
			if(!analysisData){
				return;
			}
			
			try{
				const searchUrl = "http://j.jiayoushichang.com/api/ebusiness/coupon/exist/"+analysisData.platform+"?id="+analysisData.id;
				const data = await this.commonTools.request("GET", searchUrl, null);
				if(data.code=="success" && !!data.result){
					const tip = JSON.parse(data.result).tip;
					if(tip){
						$element.append(tip);
					}
				}
			}catch(e){}
			$element.attr("completebox","true");
		}
		searchPage(selectorElementList){
			if(!this.intervalIsRunComplete){
				return;
			}
			selectorElementList.forEach((elementData)=>{
				if(!!elementData){
					this.createAllElementHtml(elementData);
				}
			});
		}
		start(){
			const selectorElementList = this.pickupSearchElements();
			setInterval(()=>{
				this.searchPage(selectorElementList);
			}, 500);
		};
	}
	
	(new Coupon()).start();
	(new SearchPageObject()).start();
})();