feat: 动态控制试用期管理中“是否试用”字段的显示,并移除冗余的只读试用期详情。

This commit is contained in:
zulifeng 2026-01-29 19:48:03 +08:00
parent ecaf0aa786
commit f9c03cab8f
2 changed files with 9 additions and 19 deletions

View File

@ -812,21 +812,6 @@
</div>
</div>
<!-- Trial period details (Read-only reference) -->
<div class="trial-details-section" style="margin-top: 15px; padding-top: 15px; border-top: 1px dashed #eee;">
<h4><i class="fas fa-clock"></i> 试用时间参考</h4>
<div class="form-row">
<div class="form-group">
<label for="editTrialStart">开始时间</label>
<input type="datetime-local" id="editTrialStart" readonly />
</div>
<div class="form-group">
<label for="editTrialEnd">结束时间</label>
<input type="datetime-local" id="editTrialEnd" readonly />
</div>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn-primary">
<i class="fas fa-save"></i>
@ -1032,7 +1017,7 @@
<input type="text" id="trialIntendedProductOther" name="intendedProductOther"
placeholder="请输入其他意向产品" style="display: none; margin-top: 8px" />
</div>
<div class="form-group">
<div class="form-group" id="trialIsTrialGroup">
<label>是否试用</label>
<div style="display: flex; gap: 20px; align-items: center">
<label style="
@ -1121,7 +1106,7 @@
<label for="editTrialEndTime">结束时间</label>
<input type="datetime-local" id="editTrialEndTime" name="endTime" />
</div>
<div class="form-group">
<div class="form-group" id="editTrialIsTrialGroup">
<label>是否试用</label>
<div style="display: flex; gap: 20px; align-items: center">
<label style="

View File

@ -204,8 +204,9 @@ function setupTrialTimeVisibility() {
const checkboxes = checkboxGroup.querySelectorAll('input[type="checkbox"]');
const startTimeGroup = document.getElementById('trialStartTimeGroup');
const endTimeGroup = document.getElementById('trialEndTimeGroup');
const isTrialGroup = document.getElementById('trialIsTrialGroup');
if (!startTimeGroup || !endTimeGroup) return;
if (!startTimeGroup || !endTimeGroup || !isTrialGroup) return;
function updateTimeVisibility() {
const checkedBoxes = checkboxGroup.querySelectorAll('input[type="checkbox"]:checked');
@ -216,6 +217,7 @@ function setupTrialTimeVisibility() {
startTimeGroup.style.display = showTimeFields ? 'block' : 'none';
endTimeGroup.style.display = showTimeFields ? 'block' : 'none';
isTrialGroup.style.display = showTimeFields ? 'block' : 'none';
}
// Add change listener to all checkboxes
@ -660,14 +662,17 @@ function updateEditTrialTimeFieldsVisibility() {
const startTimeGroup = document.getElementById('editTrialStartTimeGroup');
const endTimeGroup = document.getElementById('editTrialEndTimeGroup');
const isTrialGroup = document.getElementById('editTrialIsTrialGroup');
if (startTimeGroup && endTimeGroup) {
if (startTimeGroup && endTimeGroup && isTrialGroup) {
if (hasDataLoop) {
startTimeGroup.style.display = 'block';
endTimeGroup.style.display = 'block';
isTrialGroup.style.display = 'block';
} else {
startTimeGroup.style.display = 'none';
endTimeGroup.style.display = 'none';
isTrialGroup.style.display = 'none';
}
}
}