记得领券!京东PLUS会员

在购物车结算页面添加一个按钮,提醒领取PLUS会员优惠券

  1. // ==UserScript==
  2. // @name 记得领券!京东PLUS会员
  3. // @namespace jd.com
  4. // @version 20180923.1
  5. // @description 在购物车结算页面添加一个按钮,提醒领取PLUS会员优惠券
  6. // @author dbw9580
  7. // @match https://cart.jd.com/cart*
  8. // @match https://cart.jd.com/
  9. // @grant GM_addStyle
  10. // ==/UserScript==
  11.  
  12.  
  13. (function() {
  14. 'use strict';
  15. const button_fix_css = `
  16. .toolbar-wrap .btn-area .submit-btn {
  17. display: inline-block !important;
  18. }
  19. `;
  20.  
  21. const button_inline_style = `
  22. display: inline-block;
  23. position: relative;
  24. width: 96px;
  25. height: 52px;
  26. line-height: 52px;
  27. color: #fff;
  28. text-align: center;
  29. font-size: 18px;
  30. font-family: 'Microsoft YaHei';
  31. background: #e54346;
  32. overflow: hidden;
  33. `;
  34.  
  35. if (document.getElementsByClassName("submit-btn").length != 0) {
  36. GM_addStyle(button_fix_css);
  37. let father_of_submit_btn = document.getElementsByClassName("submit-btn")[0].parentElement;
  38. let template = document.createElement("template");
  39. template.innerHTML = `<a href="//plus.jd.com/coupon/index" target="_blank" style="${button_inline_style}">去领券</a>`;
  40. let go_get_coupon = template.content.firstChild;
  41. father_of_submit_btn.appendChild(go_get_coupon);
  42. }
  43.  
  44. })();

QingJ © 2025

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