diff --git a/web/public/js/components/plans/plan-bandwidth-ranges.js b/web/public/js/components/plans/plan-bandwidth-ranges.js index 7d373136..9d939027 100644 --- a/web/public/js/components/plans/plan-bandwidth-ranges.js +++ b/web/public/js/components/plans/plan-bandwidth-ranges.js @@ -12,6 +12,7 @@ Vue.component("plan-bandwidth-ranges", { minMB: "", maxMB: "", pricePerMB: "", + totalPrice: "", addingRange: { minMB: 0, maxMB: 0, @@ -36,6 +37,7 @@ Vue.component("plan-bandwidth-ranges", { this.minMB = "" this.maxMB = "" this.pricePerMB = "" + this.totalPrice = "" this.ranges.push(this.addingRange) this.ranges.$sort(function (v1, v2) { if (v1.minMB < v2.minMB) { @@ -83,13 +85,20 @@ Vue.component("plan-bandwidth-ranges", { pricePerMB = 0 } this.addingRange.pricePerMB = pricePerMB + }, + totalPrice: function (v) { + let totalPrice = parseFloat(v.toString()) + if (isNaN(totalPrice) || totalPrice < 0) { + totalPrice = 0 + } + this.addingRange.totalPrice = totalPrice } }, template: `
| 带宽下限 | +带宽下限 * |
@@ -108,7 +117,7 @@ Vue.component("plan-bandwidth-ranges", {
|
| 带宽上限 | +带宽上限 * |
@@ -117,6 +126,16 @@ Vue.component("plan-bandwidth-ranges", {
如果填0,表示上不封顶。 |
| 总价格 | +
+
+
+ 元/MB
+
+ 和单位价格二选一。 + |
+ |
| 单位价格 |
@@ -124,6 +143,7 @@ Vue.component("plan-bandwidth-ranges", {
元/MB
+ 和总价格二选一。如果设置了单位价格,那么"总价格 = 单位价格 x 带宽"。 |