您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
计算价格
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/485233/1363057/getPrice.js
const defaultRate = 7.14; const defaultShippingCost = 70; function getPrice(cost, weight) { if (cost > 300) { alert('价格太高,请自行计算!'); return 0; } let proRate = 0; if (cost <= 50) { proRate = 0.45; } if (cost <= 100 && cost > 50) { proRate = 0.375; } if (cost <= 200 && cost > 100) { proRate = 0.275; } if (cost <= 300 && cost > 200) { proRate = 0.325; } const rate = defaultRate * 0.93; const shippingCost = defaultShippingCost + 12; if (weight !== 0) { const price = (cost + cost * proRate + weight * shippingCost) / rate; return Math.ceil(price); } return 0; }