67 lines
4.3 KiB
HTML
67 lines
4.3 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}{% if activity %}编辑优惠活动{% else %}新增优惠活动{% endif %}{% endblock %}
|
||
{% block content %}
|
||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||
<h4><i class="bi bi-gift"></i> {% if activity %}编辑优惠活动{% else %}新增优惠活动{% endif %}</h4>
|
||
<a href="{{ url_for('recharge_activity_list') }}" class="btn btn-outline-secondary"><i class="bi bi-arrow-left"></i> 返回</a>
|
||
</div>
|
||
<div class="alert alert-light border">
|
||
<small><strong>规则说明(需求文档 §一):</strong>单次充值达标即触发;不支持累计充值与倍数叠加;新老学员均可参与;无团报优惠;可与其它优惠叠加;老带新请使用「老带新奖励」手动发放。</small>
|
||
</div>
|
||
<div class="card shadow-sm">
|
||
<div class="card-body">
|
||
<form method="POST">
|
||
<div class="row g-3">
|
||
<div class="col-md-6">
|
||
<label class="form-label">活动名称 <span class="text-danger">*</span></label>
|
||
<input type="text" class="form-control" name="name" value="{{ activity.name if activity else '' }}" required placeholder="例:1000送200">
|
||
</div>
|
||
<div class="col-md-3">
|
||
<label class="form-label">优惠触发金额(元) <span class="text-danger">*</span></label>
|
||
<input type="number" step="0.01" class="form-control" name="trigger_amount" value="{{ activity.trigger_amount if activity else '1000' }}" required>
|
||
</div>
|
||
<div class="col-md-3">
|
||
<label class="form-label">赠送课时(整课时) <span class="text-danger">*</span></label>
|
||
<input type="number" step="1" min="0" class="form-control" name="gifted_hours" value="{{ activity.gifted_hours|int if activity else '0' }}" required>
|
||
</div>
|
||
<div class="col-md-3">
|
||
<label class="form-label">可与其它活动叠加</label>
|
||
<select class="form-select" name="can_stack">
|
||
<option value="1" {% if not activity or activity.can_stack %}selected{% endif %}>是</option>
|
||
<option value="0" {% if activity and not activity.can_stack %}selected{% endif %}>否</option>
|
||
</select>
|
||
</div>
|
||
<div class="col-md-3">
|
||
<label class="form-label">限制活动有效期</label>
|
||
<select class="form-select" name="is_time_limited" id="is_time_limited">
|
||
<option value="0" {% if activity and not activity.is_time_limited %}selected{% endif %}>不限制(长期有效)</option>
|
||
<option value="1" {% if activity and activity.is_time_limited %}selected{% endif %}>限制日期</option>
|
||
</select>
|
||
</div>
|
||
<div class="col-md-3 date-range">
|
||
<label class="form-label">开始日期</label>
|
||
<input type="date" class="form-control" name="start_date" value="{{ activity.start_date if activity and activity.start_date else '' }}">
|
||
</div>
|
||
<div class="col-md-3 date-range">
|
||
<label class="form-label">结束日期</label>
|
||
<input type="date" class="form-control" name="end_date" value="{{ activity.end_date if activity and activity.end_date else '' }}">
|
||
</div>
|
||
{% if activity %}
|
||
<div class="col-md-3">
|
||
<label class="form-label">状态</label>
|
||
<select class="form-select" name="status">
|
||
<option value="1" {% if activity.status == 1 %}selected{% endif %}>启用</option>
|
||
<option value="0" {% if activity.status != 1 %}selected{% endif %}>停用</option>
|
||
</select>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
<div class="mt-3">
|
||
<button type="submit" class="btn btn-primary"><i class="bi bi-check-lg"></i> 保存</button>
|
||
<a href="{{ url_for('recharge_activity_list') }}" class="btn btn-outline-secondary">取消</a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
{% endblock %}
|