Initial commit (code only without large binaries)
This commit is contained in:
42
EdgeAdmin/web/views/@default/ns/userPlans/createPopup.html
Normal file
42
EdgeAdmin/web/views/@default/ns/userPlans/createPopup.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{$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>
|
||||
<user-selector></user-selector>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>套餐 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="planId">
|
||||
<option value="0">[选择套餐]</option>
|
||||
<option v-for="plan in plans" :value="plan.id">{{plan.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>周期 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="periodUnit">
|
||||
<option value="monthly">按月</option>
|
||||
<option value="yearly">按年</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>到期日期 *</td>
|
||||
<td>
|
||||
<datepicker :v-name="'dayTo'"></datepicker>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
73
EdgeAdmin/web/views/@default/ns/userPlans/index.html
Normal file
73
EdgeAdmin/web/views/@default/ns/userPlans/index.html
Normal file
@@ -0,0 +1,73 @@
|
||||
{$layout}
|
||||
|
||||
<first-menu>
|
||||
<menu-item href=".?type=available" :active="type == 'available'">有效套餐({{countAvailable}})</menu-item>
|
||||
<menu-item href=".?type=expiring7" :active="type == 'expiring7'">7天内过期(<span v-if="countExpiring7 > 0" class="red">{{countExpiring7}}</span><span v-else>0</span>)</menu-item>
|
||||
<menu-item href=".?type=expiring30" :active="type == 'expiring30'">30天内过期(<span v-if="countExpiring30 > 0" class="red">{{countExpiring30}}</span><span v-else>0</span>)</menu-item>
|
||||
<menu-item href=".?type=expired" :active="type == 'expired'">过期套餐({{countExpired}})</menu-item>
|
||||
<span class="item disabled">|</span>
|
||||
<menu-item @click.prevent="createUserPlan">[新购套餐]</menu-item>
|
||||
</first-menu>
|
||||
|
||||
<div class="margin"></div>
|
||||
<form class="ui form" method="get" action="/ns/userPlans">
|
||||
<input type="hidden" name="type" :value="type"/>
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown auto-width" name="planId" v-model="planId">
|
||||
<option value="0">[套餐]</option>
|
||||
<option v-for="plan in plans" :value="plan.id">{{plan.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown auto-width" name="periodUnit" v-model="periodUnit">
|
||||
<option value="">[付费周期]</option>
|
||||
<option value="monthly">按月</option>
|
||||
<option value="yearly">按年</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<button class="ui button" type="submit">检索</button>
|
||||
|
||||
<a href="/ns/userPlans" v-if="planId > 0 || periodUnit.length > 0">[清除条件]</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<not-found-box v-if="userPlans.length == 0">暂时还没有用户套餐。</not-found-box>
|
||||
|
||||
<table class="ui table selectable celled" v-if="userPlans.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户</th>
|
||||
<th class="four wide">套餐</th>
|
||||
<th class="two wide">有效期</th>
|
||||
<th class="width6">付费周期</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="userPlan in userPlans">
|
||||
<td>
|
||||
<span v-if="userPlan.user != null">
|
||||
<user-link :v-user="userPlan.user"></user-link>
|
||||
</span>
|
||||
<span v-else class="disabled">已删除</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="userPlan.plan != null">{{userPlan.plan.name}}</span>
|
||||
<span v-else class="disabled">已删除</span>
|
||||
</td>
|
||||
<td>{{userPlan.dayTo}}</td>
|
||||
<td>
|
||||
<span v-if="userPlan.periodUnit == 'monthly'">按月</span>
|
||||
<span v-if="userPlan.periodUnit == 'yearly'">按年</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" @click.prevent="updateUserPlan(userPlan.id)">修改</a>
|
||||
<a href="" @click.prevent="deleteUserPlan(userPlan.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<page-box></page-box>
|
||||
30
EdgeAdmin/web/views/@default/ns/userPlans/index.js
Normal file
30
EdgeAdmin/web/views/@default/ns/userPlans/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
Tea.context(function () {
|
||||
this.createUserPlan = function () {
|
||||
teaweb.popup("/ns/userPlans/createPopup", {
|
||||
callback: function () {
|
||||
teaweb.successRefresh("保存成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.updateUserPlan = function (userPlanId) {
|
||||
teaweb.popup("/ns/userPlans/userPlan/updatePopup?userPlanId=" + userPlanId, {
|
||||
callback: function () {
|
||||
teaweb.successRefresh("保存成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteUserPlan = function (userPlanId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除此套餐吗?", function () {
|
||||
that.$post("/ns/userPlans/userPlan/delete")
|
||||
.params({
|
||||
userPlanId: userPlanId
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.successRefresh("删除成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,44 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改用户套餐</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="userPlanId" :value="userPlan.id"/>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">用户 *</td>
|
||||
<td>
|
||||
<span v-if="userPlan.user != null"><user-link :v-user="userPlan.user"></user-link></span>
|
||||
<span v-else class="disabled">已被删除</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>套餐 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="planId" v-model="userPlan.planId">
|
||||
<option value="0">[选择套餐]</option>
|
||||
<option v-for="plan in plans" :value="plan.id">{{plan.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>周期 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="periodUnit" v-model="userPlan.periodUnit">
|
||||
<option value="monthly">按月</option>
|
||||
<option value="yearly">按年</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>到期日期 *</td>
|
||||
<td>
|
||||
<datepicker :v-name="'dayTo'" :v-value="userPlan.dayTo"></datepicker>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
Reference in New Issue
Block a user