链家自动计算公摊

2021/11/16 下午2:34:13

  1. // ==UserScript==
  2. // @name 链家自动计算公摊
  3. // @namespace Violentmonkey Scripts
  4. // @match https://*.lianjia.com/ershoufang/*.html
  5. // @grant none
  6. // @version 1.0
  7. // @author Ybond
  8. // @description 2021/11/16 下午2:34:13
  9. // @license MIT
  10. // ==/UserScript==
  11. //建筑面积
  12. let jzmj = $("#introduction .content ul>li:eq(2)").html().replace('<span class="label">建筑面积</span>','').replace("㎡","");
  13. //套内面积
  14. let tnmj = $("#introduction .content ul>li:eq(4)").html().replace('<span class="label">套内面积</span>','').replace("㎡","");
  15.  
  16. if(isNumber(tnmj)&&isNumber(jzmj)){
  17. //公摊面积
  18. let gtmj = ((jzmj-tnmj)/jzmj*100).toFixed(2)+"%";
  19. $(".content .price .text .unitPrice").append('<span style="margin-left: 50px;">'+gtmj+'</span>');
  20. }
  21.  
  22. function isNumber(val) {
  23.   if (parseFloat(val).toString() == "NaN") {
  24.     
  25.     return false;
  26.   } else {
  27.     return true;
  28.   }
  29. }

QingJ © 2025

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