Greasy Fork is available in English.

最惠买 - 安全简洁高效的淘宝省钱利器

在您逛淘宝的时候,商品详情页会自动显示该商品可用的超值优惠券,领取后下单直接抵扣,让您购物省钱更省心。

// ==UserScript==
// @name         最惠买 - 安全简洁高效的淘宝省钱利器
// @namespace    http://vip.zuihuimai.net/
// @version      1.9
// @description  在您逛淘宝的时候,商品详情页会自动显示该商品可用的超值优惠券,领取后下单直接抵扣,让您购物省钱更省心。
// @author       最惠买
// @include      *://item.taobao.com/*
// @include      *://*detail.tmall.com/*
// @include      *://*detail.tmall.hk/*
// @include      *://s.taobao.com/*
// @include      *://ai.taobao.com/search/*
// @include      *://list.tmall.com/*
// @include      *://*.liangxinyao.com/*
// @require      http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
// ==/UserScript==
 var head = document.getElementsByTagName('head')[0],
 cssURL = 'https://zuihuimai.net/tm/style.css',
 linkTag = document.createElement('link');

 linkTag.id = 'dynamic-style';
 linkTag.href = cssURL;
 linkTag.setAttribute('rel','stylesheet');
 linkTag.setAttribute('media','all');
 linkTag.setAttribute('type','text/css');

head.appendChild(linkTag);
(function() {
    'use strict';
    var goods_id = getQueryString('id');
    var version = 1.7;
    var zhm_url = 'https://www.zuihuimai.net/vrhr/index.php';
    var zhm_vurl = 'https://www.zuihuimai.net/zhmapp/zhm/index.php';
    if(goods_id){
	var htmlV = "<div id='zhm_div'><table class='zhm_tab' id='zhm_table'><tr><th><b onclick=window.open('http://vip.zuihuimai.net/') style='cursor:pointer'>优惠券</b></th><th>券后</th><th>有 效 期</th><th>操作</th></tr>";
	htmlV +="<tr><td colspan='5'>正在查询优惠信息,请稍候...</td></tr>";
	htmlV +="</table></div>";
	$('#J_LinkBasket').parent().after(htmlV);
	$('.J_LinkAdd').parent().after(htmlV);
	if(window.location.host.search('taobao.com') != -1){
		$('#zhm_table').addClass('zhm_tab_taobao');
	}else{
		$('#zhm_table').addClass('zhm_tab_tmall');
	}
	$.getJSON(zhm_url,{goods_id:goods_id,version:version},function(data){
	var html = "<table class='zhm_tab' id='zhm_table'><tr><th><b onclick=window.open('http://vip.zuihuimai.net/') style='cursor:pointer'>优惠券</b></th><th>券后</th><th>有 效 期</th><th>操作</th></tr>";

	if(data.code_data == '100'){
		var arrData = new Array();
		arrData = data.data_info;
		for(var i = 0;i<arrData.length;i++){
			html += "<tr ><td>"+arrData[i]['Quan_condition']+"</td><td>"+arrData[i]['Price']+"</td><td>"+arrData[i]['Quan_time']+"</td><td><b onclick=window.open('"+zhm_vurl+'?op=zhmLink&url='+arrData[i]['Quan_link']+"') style='cursor:pointer'>领取</b></td></tr>";
			}
		}
		if(data.code_data == '200'){
			html +="<tr><td colspan='5'>这个商品没有超值优惠券,去<b onclick=window.open('http://vip.zuihuimai.net') style='cursor:pointer'> 这里 </b>找找,或者 <b onclick=window.open('https://www.zuihuimai.net/zhmapp/index.php?op=zhmRand') style='cursor:pointer'>试试手气</b>。</td></tr>";
		}
		if(data.code_version == '400'){
			html +="<tr><td colspan='5'>有新版本啦!点<b onclick=window.open('https://www.zuihuimai.net/download.html') style='cursor:pointer'> 这里 </b>升级!</td></tr>";
		}
		html +="</table>";
		$('#zhm_div').html(html);
		$('#zhm_div').html(html);
		if(window.location.host.search('taobao.com') != -1){
			$('#zhm_table').addClass('zhm_tab_taobao');
		}else{
			$('#zhm_table').addClass('zhm_tab_tmall');
		}
	});
    }
    // Your code here...
})();
function getQueryString(e) {
	var t = new RegExp("(^|&)" + e + "=([^&]*)(&|$)");
	var a = window.location.search.substr(1).match(t);
	if (a != null) return a[2];
	return "";
}