getPrice

计算价格

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/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);
}