This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
{$layout "layout_popup"}
<h3>添加有效期选项</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<table class="ui table definition selectable">
<tr>
<td class="title">有效期选项 *</td>
<td>
<div class="ui fields inline">
<div class="ui field">
<input type="text" name="count" size="4" maxlength="4" ref="focus" placeholder="数量"/>
</div>
<div class="ui field">
<select class="ui dropdown" name="unit">
<option value="month"></option>
<option value="year"></option>
</select>
</div>
</div>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,35 @@
{$layout}
{$template "../menu"}
<second-menu>
<menu-item @click.prevent="createPeriod">[添加有效期选项]</menu-item>
</second-menu>
<div v-if="!enableTrafficPackages">
<div class="margin"></div>
<div class="ui message warning">尚未在 <a href="/finance/fee">[计费设置]</a> 里开启"启用流量包"选项,用户将无法使用设置的流量包。</div>
</div>
<p class="comment" v-if="periods.length == 0">暂时还没有有效期选项设置。</p>
<table class="ui table celled selectable" v-if="periods.length > 0">
<thead>
<tr>
<th>有效期选项</th>
<th class="width6">状态</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="period in periods">
<td>
<a href="" @click.prevent="updatePeriod(period.id)">{{period.count}}{{period.unitName}} <i class="icon expand small"></i></a>
</td>
<td>
<label-on :v-is-on="period.isOn"></label-on>
</td>
<td>
<a href="" @click.prevent="updatePeriod(period.id)">修改</a> &nbsp;
<a href="" @click.prevent="deletePeriod(period.id)">删除</a>
</td>
</tr>
</table>

View File

@@ -0,0 +1,32 @@
Tea.context(function () {
this.createPeriod = function () {
teaweb.popup("/finance/packages/periods/createPopup", {
callback: function () {
teaweb.successRefresh("保存成功")
}
})
}
this.updatePeriod = function (periodId) {
teaweb.popup("/finance/packages/periods/period/updatePopup?periodId=" + periodId, {
callback: function () {
teaweb.successRefresh("保存成功")
}
})
}
this.deletePeriod = function (periodId) {
let that = this
teaweb.confirm("确定要删除此有效期选项吗?", function () {
that.$post("/finance/packages/periods/period/delete")
.params({
periodId: periodId
})
.success(function () {
teaweb.success("删除成功", function () {
teaweb.reload()
})
})
})
}
})

View File

@@ -0,0 +1,23 @@
{$layout "layout_popup"}
<h3>修改有效期选项</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="periodId" :value="period.id"/>
<table class="ui table definition selectable">
<tr>
<td class="title">有效期选项</td>
<td>{{period.count}}{{period.unitName}}</td>
</tr>
<tr>
<td>启用</td>
<td>
<checkbox name="isOn" v-model="period.isOn"></checkbox>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>