getPrice

计算价格

当前为 2025-03-05 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/485233/1547690/getPrice.js

const defaultRate = 7.1;
const defaultShippingCost = 85;

function getPrice(cost, weight) {
  let proRate = 0.25;
  if (cost <= 250 && cost > 50) {
    proRate = 0.22;
  }
  const rate = getRate() * 0.944 * 0.99;
  const shippingCost = +getShippingCost();
  const price = ((cost + weight * shippingCost) / (1 - proRate)) / rate;
  return Math.ceil(price);
}