Greasy Fork镜像 支持简体中文。

customs

try to take over the world!

  1. // ==UserScript==
  2. // @resource icon1 http://tampermonkey.net/favicon.ico
  3. // @name customs
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.0.6
  6. // @description try to take over the world!
  7. // @author yao
  8. // @match
  9.  
  10. // @include https://www.buyoyo.com/*
  11. // @grant none
  12. //@require http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. var button = $("<input class='myBtn' type='button' value='报关' />");
  18. button.css({
  19. "width":"70",
  20. "display": "inline-block",
  21. "zoom": "1",
  22. "display": "inline",
  23. "vertical-align": "baseline",
  24. "margin": "0 2px",
  25. "outline": "none",
  26. "cursor": "pointer",
  27. "height": "27px",
  28. "text-align": "center",
  29. "text-decoration": "none",
  30. "font": "14px/100% Arial, Helvetica, sans-serif",
  31. "text-shadow": "0 1px 1px rgba(0,0,0,.3)",
  32. "-webkit-border-radius": ".5em",
  33. "-moz-border-radius": ".5em",
  34. "border-radius": ".5em",
  35. "-webkit-box-shadow": "0 1px 2px rgba(0,0,0,.2)",
  36. "-moz-box-shadow": "0 1px 2px rgba(0,0,0,.2)",
  37. "box-shadow": "0 1px 2px rgba(0,0,0,.2)",
  38. "border": "solid 1px #555",
  39. "background": "#6e6e6e",
  40. "background": "-webkit-gradient(linear, left top, left bottom, from(#888), to(#575757))",
  41. "background": "-moz-linear-gradient(top, #888, #575757)",
  42. "filter": "progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#575757')"
  43.  
  44. });
  45.  
  46. button.click(function(){
  47. // 修改标题
  48. Array.prototype.slice.call( document.getElementById('cartForm').parentNode.getElementsByTagName('tr') ).flatMap(i=>Array.prototype.slice.call(i.getElementsByTagName('a'))).map(i=>i.innerHTML = i.innerHTML+ "(DVD版)")
  49. // 修改介质
  50. Array.prototype.slice.call( document.getElementById('cartForm').parentNode.getElementsByTagName('tr')).map(i=>Array.prototype.slice.call(i.getElementsByTagName('td'))[6]).filter(i=> typeof i !== 'undefined').map(i=>i.getElementsByTagName('b')[0]).filter(i=> typeof i !== 'undefined').map(i=>i.parentNode.parentNode.children[4].innerHTML="DVD")
  51. // 修改重量
  52. Array.prototype.slice.call( document.getElementById('cartForm').parentNode.getElementsByTagName('tr')).map(i=>Array.prototype.slice.call(i.getElementsByTagName('td'))[6]).filter(i=> typeof i !== 'undefined').map(i=>i.getElementsByTagName('b')[0]).filter(i=> typeof i !== 'undefined').map(i=>i.parentNode.parentNode.children[5].innerHTML="1.0(DU)")
  53. // 修改单价
  54. Array.prototype.slice.call( document.getElementById('cartForm').parentNode.getElementsByTagName('tr')).map(i=>Array.prototype.slice.call(i.getElementsByTagName('td'))[6]).filter(i=> typeof i !== 'undefined').map(i=>i.getElementsByTagName('b')[0]).filter(i=> typeof i !== 'undefined').map(i=>i.innerHTML = "HK$13.5")
  55. // 修改数量
  56. Array.prototype.slice.call( document.getElementById('cartForm').parentNode.getElementsByTagName('tr')).map(i=>Array.prototype.slice.call(i.getElementsByTagName('td'))[6]).filter(i=> typeof i !== 'undefined').map(i=>i.getElementsByTagName('b')[0]).filter(i=> typeof i !== 'undefined').map(i=>i.parentNode.parentNode.children[7].children[0].value=1)
  57. // 修改单行总价
  58. Array.prototype.slice.call( document.getElementById('cartForm').parentNode.getElementsByTagName('tr')).map(i=>Array.prototype.slice.call(i.getElementsByTagName('td'))[6]).filter(i=> typeof i !== 'undefined').map(i=>i.getElementsByTagName('b')[0]).filter(i=> typeof i !== 'undefined').map(i=>i.parentNode.parentNode.children[8].innerHTML = "HK$" + parseInt(i.parentNode.parentNode.children[7].children[0].value) * 13.5)
  59. // 修改总重量
  60. Array.prototype.slice.call(document.querySelector('#cartForm').parentNode.parentNode.nextElementSibling.nextElementSibling.nextElementSibling.getElementsByTagName('b'))[0].innerHTML = Array.prototype.slice.call( document.getElementById('cartForm').parentNode.getElementsByTagName('tr')).map(i=>Array.prototype.slice.call(i.getElementsByTagName('td'))[6]).filter(i=> typeof i !== 'undefined').map(i=>i.getElementsByTagName('b')[0]).filter(i=> typeof i !== 'undefined').map(i=>i.parentNode.parentNode.children[5]).length
  61. // 修改总价
  62. Array.prototype.slice.call(document.querySelector('#cartForm').parentNode.parentNode.nextElementSibling.nextElementSibling.nextElementSibling.getElementsByTagName('b'))[1].innerHTML = "HK$" + Array.prototype.slice.call( document.getElementById('cartForm').parentNode.getElementsByTagName('tr')).map(i=>Array.prototype.slice.call(i.getElementsByTagName('td'))[6]).filter(i=> typeof i !== 'undefined').map(i=>i.getElementsByTagName('b')[0]).filter(i=> typeof i !== 'undefined').map(i=>i.parentNode.parentNode.children[5]).length * 13.5
  63. alert("修改完成");
  64. });
  65. document.querySelector('#cartForm').parentNode.parentNode.nextElementSibling.nextElementSibling.nextElementSibling.nextElementSibling.nextElementSibling.nextElementSibling.getElementsByTagName('tr')[2].children[0].appendChild(button[0])
  66.  
  67. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址