165 lines
3.7 KiB
HTML
165 lines
3.7 KiB
HTML
<div id="couponModal" class="modal-overlay">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h3>添加优惠券</h3>
|
||
<button class="modal-close" onclick="closeCouponModal()">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="form-group">
|
||
<label><span class="required">*</span> 优惠券名称</label>
|
||
<input type="text" id="couponName" placeholder="生日优惠券" class="form-input">
|
||
</div>
|
||
<div class="form-group">
|
||
<label><span class="required">*</span> 优惠券门槛金额</label>
|
||
<div class="input-with-dropdown">
|
||
<input type="number" id="couponThreshold" value="10" class="form-input">
|
||
<button class="dropdown-btn">▼</button>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label><span class="required">*</span> 优惠券减免金额</label>
|
||
<div class="input-with-dropdown">
|
||
<input type="number" id="couponDiscount" value="1" class="form-input">
|
||
<button class="dropdown-btn">▼</button>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label><span class="required">*</span> 优惠券有效时间</label>
|
||
<div class="input-with-dropdown">
|
||
<input type="number" id="couponValidity" value="1" class="form-input">
|
||
<button class="dropdown-btn">▼</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button class="btn btn-secondary" onclick="closeCouponModal()">取消</button>
|
||
<button class="btn btn-primary" onclick="confirmAddCoupon()">确认添加</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<style>
|
||
.modal-overlay {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
background-color: rgba(0, 0, 0, 0.5);
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
z-index: 1000;
|
||
}
|
||
|
||
.modal-content {
|
||
background: white;
|
||
border-radius: 8px;
|
||
width: 400px;
|
||
max-width: 90vw;
|
||
max-height: 90vh;
|
||
overflow-y: auto;
|
||
}
|
||
|
||
.modal-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 20px;
|
||
border-bottom: 1px solid #eee;
|
||
}
|
||
|
||
.modal-header h3 {
|
||
margin: 0;
|
||
font-size: 18px;
|
||
color: #333;
|
||
}
|
||
|
||
.modal-close {
|
||
background: none;
|
||
border: none;
|
||
font-size: 24px;
|
||
cursor: pointer;
|
||
color: #999;
|
||
padding: 0;
|
||
width: 30px;
|
||
height: 30px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.modal-close:hover {
|
||
color: #333;
|
||
}
|
||
|
||
.modal-body {
|
||
padding: 20px;
|
||
}
|
||
|
||
.modal-footer {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 10px;
|
||
padding: 20px;
|
||
border-top: 1px solid #eee;
|
||
}
|
||
|
||
.form-group {
|
||
margin-bottom: 16px;
|
||
}
|
||
|
||
.form-group label {
|
||
display: block;
|
||
margin-bottom: 8px;
|
||
font-weight: 500;
|
||
color: #333;
|
||
}
|
||
|
||
.required {
|
||
color: #e74c3c;
|
||
margin-right: 4px;
|
||
}
|
||
|
||
.input-with-dropdown {
|
||
position: relative;
|
||
display: flex;
|
||
}
|
||
|
||
.input-with-dropdown .form-input {
|
||
flex: 1;
|
||
padding-right: 40px;
|
||
}
|
||
|
||
.dropdown-btn {
|
||
position: absolute;
|
||
right: 8px;
|
||
top: 50%;
|
||
transform: translateY(-50%);
|
||
background: none;
|
||
border: none;
|
||
cursor: pointer;
|
||
color: #666;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.btn-secondary {
|
||
background-color: #f8f9fa;
|
||
color: #6c757d;
|
||
border: 1px solid #dee2e6;
|
||
}
|
||
|
||
.btn-secondary:hover {
|
||
background-color: #e9ecef;
|
||
}
|
||
|
||
.btn-primary {
|
||
background-color: #007bff;
|
||
color: white;
|
||
border: 1px solid #007bff;
|
||
}
|
||
|
||
.btn-primary:hover {
|
||
background-color: #0056b3;
|
||
}
|
||
</style> |