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: `
- {{range.minMB}}MB - {{range.maxMB}}MB   价格:{{range.pricePerMB}}元/MB + {{range.minMB}}MB - {{range.maxMB}}MB   价格:{{range.totalPrice}}元{{range.pricePerMB}}元/MB  
@@ -99,7 +108,7 @@ Vue.component("plan-bandwidth-ranges", {
- + - + + + + +
带宽下限带宽下限 *
@@ -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 带宽"。

diff --git a/web/public/js/components/plans/plan-price-view.js b/web/public/js/components/plans/plan-price-view.js index fbc2c2b1..fc3b2fe9 100644 --- a/web/public/js/components/plans/plan-price-view.js +++ b/web/public/js/components/plans/plan-price-view.js @@ -26,7 +26,7 @@ Vue.component("plan-price-view", { 按{{plan.bandwidthPrice.percentile}}th带宽计费
- {{range.minMB}} - {{range.maxMB}}MB: {{range.pricePerMB}}元/MB + {{range.minMB}} - {{range.maxMB}}MB{{range.totalPrice}}元{{range.pricePerMB}}元/MB