// ==UserScript== // @icon https://www.thfou.com/img/favicon.png // @name 阿里巴巴电脑访问无线端详情 // @namespace https://www.thfou.com/ // @version 2.0.0 // @description 添加阿里巴巴电脑详情页直接访问无线端详情按钮 // @author 头号否 // @match *://detail.1688.com/offer/* // @supportURL https://www.thfou.com/liuyan // @compatible Chrome // @compatible Firefox // @compatible Edge // @compatible Safari // @compatible Opera // @compatible UC // @license GPL-3.0-only // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; var alicmz = '
'; var getbody = document.getElementById('doc'); getbody.insertAdjacentHTML('afterbegin', alicmz); var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML="#thfou_alicmz, .aliwx{position:fixed;top:45%;right:50px;padding:10px;min-width:130px;text-align:center;z-index:99999999;background-color:#fff;border:1px dotted #D9D9D9;}.alicmzbtn{background-color: #FFE4D0; color: #E5511D; border: 1px solid #F0CAB6;right:20em;top:40em;z-index:88;cursor:pointer;padding:5px 20px;border-radius:50px;margin-bottom:10px;transition:.3s;}.alicmzbtn:hover{color:#fff;background-color:#E5511D;}.close{color: #828282; background-color: #e6e6e6; width: 80px; text-align: center; padding: 0.5em; border-radius: 2px; padding-left: 1em; padding-right: 1em; text-decoration: none;transition: .3s;}.close:hover{color:#5d5d5d;background-color:#dcdcdc;text-decoration: none;}.alicmzbtn a{color:#E5511D;text-decoration: none;}.dmcss a{color:#d3d3d3;text-decoration: none;}.xflogo{width: 110px; padding: 15px 10px 15px 10px;}#gbxf{color:#a9a9a9;position:absolute;right:8px;top:6px;font-size:12px;cursor:pointer;transition:.3s;border:1px #a9a9a9 solid;line-height:9px;border-radius:3px;padding:1px;}#gbxf:hover{color:#fff;border:1px #fa630a solid;background-color:#fa630a;opacity:0.8;}#smallxf{position:fixed;bottom:0px;right:36px;background:linear-gradient(to right,#f78004,#fe4514);border:1px #fe4514 solid;color:#fff;padding:8px;font-weight:bold;font-size:14px;transition:.6s;cursor:pointer;z-index:99999;}#smallxf:hover{color:#fe4514;border:1px #fe4514 solid;background:transparent;}"; document.getElementsByTagName('HEAD').item(0).appendChild(style); //定义一个全局弹出层 window.layerstart = ''; //让层居中显示 window.layerCenter = function(){ var bwidth = window.screen.availWidth; var bheight = window.screen.availHeight; var layertop = (bheight - 720) / 2; var layerleft = (bwidth - 1280) / 2; if(layertop <= 70){ layertop = "1em"; } else{ layertop = (layertop - 125) + "px"; } //改变css //$("#layer").css({"top":layertop,"left":layerleft}); //原生js改变css //alert(layertop); document.getElementById("layer").style.top = "5%"; document.getElementById("layer").style.left = "30%"; } //创建一个遮罩层 window.keepout = function(){ var fade = '
'; //$("body").append(fade); var div = document.createElement("div"); div.innerHTML = fade; document.body.appendChild(div); } //关闭层 window.closelayer = function(){ //$("#layer").hide(); document.getElementById("layer").style.display = "none"; //showSidebar(); //$("#layer").remove(); var layer = document.getElementById("layer"); layer.parentNode.removeChild(layer); //$("#fade").remove(); var fade = document.getElementById("fade"); fade.parentNode.removeChild(fade); } //创建一个显示按钮 function aliwxframe(){ //$("body").append('
'); //使用原生js添加按钮 var getkj = document.getElementById("thfou_alicmz"); getkj.innerHTML = '
查看无线端详情
'; document.body.appendChild(getkj); } //显示按钮 var num = document.getElementsByName('b2c_auction')[0].content; window.showaliwx = function(){ var up = layerstart; up += ''; up += layerend; //$("body").append(up); var div = document.createElement("div"); div.innerHTML = up; document.body.appendChild(div); //$("#layer").show(); document.getElementById("layer").style.display = "block"; //显示遮罩 keepout(); //居中显示层 layerCenter(); } aliwxframe(); var hkjsc = '
1688营销黑科技
'; var hkj = document.getElementById('thfou_alicmz'); hkj.insertAdjacentHTML('beforeend',hkjsc); var alixf = '
阿里悬浮生成
'; var txf = document.getElementById('thfou_alicmz'); txf.insertAdjacentHTML('beforeend',alixf); var alicode = '
阿里代码生成
'; var tcode = document.getElementById('thfou_alicmz'); tcode.insertAdjacentHTML('beforeend',alicode); var alilive = '
阿里直播间
'; var tlive = document.getElementById('thfou_alicmz'); tlive.insertAdjacentHTML('beforeend',alilive); var morejb = '
获取更多插件
'; var more = document.getElementById('thfou_alicmz'); more.insertAdjacentHTML('beforeend',morejb); var thfougw = '
www.thfou.com
'; var thfou = document.getElementById('thfou_alicmz'); thfou.insertAdjacentHTML('beforeend',thfougw); var thflogo = ''; var thf = document.getElementById('thfou_alicmz'); thf.insertAdjacentHTML('afterbegin',thflogo); var gbxf = '
'; var xfkj = document.getElementById('thfou_alicmz'); xfkj.insertAdjacentHTML('afterbegin',gbxf); var hdxf = document.getElementById('gbxf'); hdxf.addEventListener('click', hidexf, false); var smallxf = ''; var getcmz = document.getElementById('thfou_alicmz'); getcmz.insertAdjacentHTML('afterend',smallxf); var showxf = document.getElementById('smallxf'); showxf.addEventListener('click', showcmz, false); function hidexf() { document.getElementById('thfou_alicmz').style.display = 'none'; document.getElementById('smallxf').style.display = 'block'; } function showcmz() { document.getElementById('thfou_alicmz').style.display = 'block'; document.getElementById('smallxf').style.display = 'none'; } })();