This commit is contained in:
linbin 2025-08-13 02:11:53 +08:00
parent eb9673b40c
commit ae6fb3410e
3 changed files with 54 additions and 10 deletions

View File

@ -225,6 +225,34 @@
flex: 0 0 100px; flex: 0 0 100px;
} }
.radio-group {
display: flex;
gap: 20px;
margin-top: 8px;
}
.radio-option {
display: flex;
align-items: center;
cursor: pointer;
position: relative;
}
.radio-option input[type="radio"] {
margin: 0;
margin-right: 8px;
width: 16px;
height: 16px;
cursor: pointer;
}
.radio-option label {
font-size: 14px;
color: #333;
cursor: pointer;
margin: 0;
}
.modal-footer { .modal-footer {
padding: 16px 24px; padding: 16px 24px;
border-top: 1px solid #f0f0f0; border-top: 1px solid #f0f0f0;
@ -318,6 +346,20 @@
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-label">积分类型 <span class="required">*</span></label>
<div class="radio-group">
<div class="radio-option">
<input type="radio" id="pointsDiscount" name="pointsType" value="discount" checked>
<label for="pointsDiscount">积分优惠购</label>
</div>
<div class="radio-option">
<input type="radio" id="pointsExchange" name="pointsType" value="exchange">
<label for="pointsExchange">积分换购</label>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="form-label">兑换所需积分设置 <span class="required">*</span></label> <label class="form-label">兑换所需积分设置 <span class="required">*</span></label>
<div class="number-input-group"> <div class="number-input-group">
@ -421,13 +463,14 @@
// 确认选择 // 确认选择
function confirmSelection() { function confirmSelection() {
const pointsType = document.querySelector('input[name="pointsType"]:checked').value;
const points = document.getElementById('pointsInput').value; const points = document.getElementById('pointsInput').value;
const stock = document.getElementById('stockInput').value; const stock = document.getElementById('stockInput').value;
const limit = document.getElementById('limitInput').value; const limit = document.getElementById('limitInput').value;
const limitType = document.getElementById('limitType').value; const limitType = document.getElementById('limitType').value;
// 验证必填项 // 验证必填项
if (!points || !stock || limit === '') { if (!pointsType || !points || !stock || limit === '') {
alert('请填写所有必填项'); alert('请填写所有必填项');
return; return;
} }
@ -438,6 +481,7 @@
productName: '黑木耳100g', productName: '黑木耳100g',
shopName: '牛生蔬菜店', shopName: '牛生蔬菜店',
skuId: '194105142774503836', skuId: '194105142774503836',
pointsType: pointsType,
points: points, points: points,
stock: stock, stock: stock,
limit: limit, limit: limit,

View File

@ -241,9 +241,9 @@
<th width="150">商品名称</th> <th width="150">商品名称</th>
<th width="150">规格名称</th> <th width="150">规格名称</th>
<th width="150">归属店铺</th> <th width="150">归属店铺</th>
<th width="100">兑换积分</th> <th width="100">商品原价</th>
<th width="120">剩余兑换库存</th> <th width="120">积分使用模式</th>
<th width="120">已兑换数量</th> <th width="120">剩余库存</th>
<th width="120">操作</th> <th width="120">操作</th>
</tr> </tr>
</thead> </thead>
@ -256,9 +256,9 @@
<td>黑木耳</td> <td>黑木耳</td>
<td>小份</td> <td>小份</td>
<td>生生蔬菜店</td> <td>生生蔬菜店</td>
<td>1</td> <td>¥5.00</td>
<td>积分换购</td>
<td>10</td> <td>10</td>
<td>0</td>
<td> <td>
<div class="action-buttons"> <div class="action-buttons">
<button class="btn-edit">编辑</button> <button class="btn-edit">编辑</button>
@ -274,9 +274,9 @@
<td>黑木耳</td> <td>黑木耳</td>
<td>大份</td> <td>大份</td>
<td>生生蔬菜店</td> <td>生生蔬菜店</td>
<td>1</td> <td>¥8.00</td>
<td>积分优惠购</td>
<td>10</td> <td>10</td>
<td>0</td>
<td> <td>
<div class="action-buttons"> <div class="action-buttons">
<button class="btn-edit">编辑</button> <button class="btn-edit">编辑</button>
@ -292,9 +292,9 @@
<td>番茄</td> <td>番茄</td>
<td></td> <td></td>
<td>生生蔬菜店</td> <td>生生蔬菜店</td>
<td>¥3.50</td>
<td>积分换购</td>
<td>2</td> <td>2</td>
<td>2</td>
<td>0</td>
<td> <td>
<div class="action-buttons"> <div class="action-buttons">
<button class="btn-edit">编辑</button> <button class="btn-edit">编辑</button>