|
@@ -69,9 +69,9 @@
|
|
|
<?php if (!in_array($value, ['空号', '实号', '风险号']) && !in_array($key, [0, 1, 5])) { ?>
|
|
|
<label>
|
|
|
<input type="checkbox" name="card_states[]" value="<?php echo $key; ?>"
|
|
|
- <?php if (!empty($output['intercept']['card_states']) && in_array($key, $output['intercept']['card_states'])) {
|
|
|
- echo 'checked';
|
|
|
- } ?>
|
|
|
+ <?php if (!empty($output['intercept']['card_states']) && in_array($key, $output['intercept']['card_states'])) {
|
|
|
+ echo 'checked';
|
|
|
+ } ?>
|
|
|
>
|
|
|
</label><?php echo $value; ?>
|
|
|
<?php } ?>
|
|
@@ -172,15 +172,15 @@
|
|
|
for="name"><?php echo $value; ?>:</label>
|
|
|
<label>
|
|
|
<input class="day_secs" type="text" name="<?php echo "$key-day_secs"; ?>"
|
|
|
- value="<?php echo $output['retry_times']['qualities'][$key]['day_secs'] ?? 0; ?>">
|
|
|
+ value="<?php echo $output['retry_times']['qualities'][$key]['day_secs'] ?? 0; ?>">
|
|
|
</label>
|
|
|
<label>
|
|
|
<input class="night_secs" style="margin: 0 30px;" type="text" name="<?php echo "$key-night_secs"; ?>"
|
|
|
- value="<?php echo $output['retry_times']['qualities'][$key]['night_secs'] ?? 0; ?>">
|
|
|
+ value="<?php echo $output['retry_times']['qualities'][$key]['night_secs'] ?? 0; ?>">
|
|
|
</label>
|
|
|
<label>
|
|
|
<input class="times" type="text" name="<?php echo "$key-times"; ?>"
|
|
|
- value="<?php echo $output['retry_times']['qualities'][$key]['times'] ?? 0; ?>">
|
|
|
+ value="<?php echo $output['retry_times']['qualities'][$key]['times'] ?? 0; ?>">
|
|
|
</label>
|
|
|
</td>
|
|
|
</tr>
|
|
@@ -352,91 +352,113 @@
|
|
|
<script type="text/javascript">
|
|
|
$(function () {
|
|
|
//按钮先执行验证再提交表单
|
|
|
- let day
|
|
|
- let nights
|
|
|
- let times
|
|
|
- $("#submitBtn").click(function () {
|
|
|
- if (day == 0 || nights == 0 || times == 0) {
|
|
|
- layer.msg('白天秒数,黑天秒数,重试次数(三者都需设置)');
|
|
|
- } else {
|
|
|
- $("#user_form").submit();
|
|
|
- }
|
|
|
- })
|
|
|
+ let day
|
|
|
+ let nights
|
|
|
+ let times
|
|
|
+ $("#submitBtn").click(function () {
|
|
|
+ if (day == 0 || nights == 0 || times == 0) {
|
|
|
+ layer.msg('白天秒数,黑天秒数,重试次数(三者都需设置)');
|
|
|
+ } else {
|
|
|
+ $("#user_form").submit();
|
|
|
+ }
|
|
|
+ })
|
|
|
$('.required .day_secs').each(function(index, item) {
|
|
|
$(item).change(function() {
|
|
|
const day_secs = $(this).val()
|
|
|
const zero = day_secs.replace(/^[0]+/,'')
|
|
|
- $(item).val(zero);
|
|
|
+ const zero_day = day_secs.substr(0, 1)
|
|
|
+ const zero_length = day_secs.substr(day_secs.length -1)
|
|
|
+ if (zero_day == 0) {
|
|
|
+ $(this).val(zero_day);
|
|
|
+ }
|
|
|
+ if (zero_length != 0){
|
|
|
+ console.log(zero, 123);
|
|
|
+ $(item).val(zero);
|
|
|
+ }
|
|
|
if ((!/^\d+$/.test(day_secs)) || isNaN(day_secs)) {
|
|
|
- layer.msg('白天秒数只能设置大于0的整数');
|
|
|
- $(item).val("0");
|
|
|
- }
|
|
|
+ layer.msg('白天秒数只能设置大于0的整数');
|
|
|
+ $(item).val("0");
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
$('.required .night_secs').each(function(index, item) {
|
|
|
$(item).change(function() {
|
|
|
const night_secs = $(this).val()
|
|
|
const zero = night_secs.replace(/^[0]+/,'')
|
|
|
- $(item).val(zero);
|
|
|
+ const zero_day = night_secs.substr(0, 1)
|
|
|
+ const zero_length = night_secs.substr(night_secs.length -1)
|
|
|
+ if (zero_day == 0) {
|
|
|
+ $(this).val(zero_day);
|
|
|
+ }
|
|
|
+ if (zero_length != 0){
|
|
|
+ $(item).val(zero);
|
|
|
+ }
|
|
|
if ((!/^\d+$/.test(night_secs)) || isNaN(night_secs)) {
|
|
|
- layer.msg('黑天秒数只能设置大于0的整数');
|
|
|
- $(item).val("0");
|
|
|
- }
|
|
|
+ layer.msg('黑天秒数只能设置大于0的整数');
|
|
|
+ $(item).val("0");
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
$('.required .times').each(function(index, item) {
|
|
|
$(item).change(function() {
|
|
|
const times = $(this).val()
|
|
|
const zero = times.replace(/^[0]+/,'')
|
|
|
- $(item).val(zero);
|
|
|
+ const zero_day = times.substr(0, 1)
|
|
|
+ const zero_length = times.substr(times.length -1)
|
|
|
+ if (zero_day == 0) {
|
|
|
+ $(this).val(zero_day);
|
|
|
+ }
|
|
|
+ if (zero_length != 0){
|
|
|
+ $(item).val(zero);
|
|
|
+ }
|
|
|
if ((!/^\d+$/.test(times)) || isNaN(times)) {
|
|
|
- layer.msg('重试次数只能设置大于0的整数');
|
|
|
- $(item).val("0");
|
|
|
- }
|
|
|
+ layer.msg('重试次数只能设置大于0的整数');
|
|
|
+ $(item).val("0");
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
$('#success').change(function(index, item) {
|
|
|
- const success = $(this).val()
|
|
|
- const intercept = success.substring(success.length, success.length-1)
|
|
|
- if(intercept == '.') {
|
|
|
- layer.msg('成功率只能设置浮点数');
|
|
|
- $(this).val("0.00");
|
|
|
- return
|
|
|
- }
|
|
|
- const zero = success.replace(/^0+\./g, '0.')
|
|
|
- $(this).val(zero);
|
|
|
- if ((/^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(success)) || isNaN(success)){
|
|
|
- layer.msg('成功率只能设置浮点数');
|
|
|
- $(this).val("0.00");
|
|
|
- }
|
|
|
+ const success = $(this).val()
|
|
|
+ const intercept = success.substring(success.length, success.length-1)
|
|
|
+ if(intercept == '.') {
|
|
|
+ layer.msg('成功率只能设置浮点数');
|
|
|
+ $(this).val("0.00");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const zero = success.replace(/^0+\./g, '0.')
|
|
|
+ $(this).val(zero);
|
|
|
+ if ((/^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(success)) || isNaN(success)){
|
|
|
+ layer.msg('成功率只能设置浮点数');
|
|
|
+ $(this).val("0.00");
|
|
|
+ }
|
|
|
})
|
|
|
$('#profit_ratio').change(function(index, item) {
|
|
|
- const profit_ratio = $(this).val()
|
|
|
- const intercept = profit_ratio.substring(profit_ratio.length, profit_ratio.length-1)
|
|
|
- if(intercept == '.') {
|
|
|
- layer.msg('利润率只能设置浮点数');
|
|
|
- $(this).val("0.00");
|
|
|
- return
|
|
|
- }
|
|
|
- const zero = profit_ratio.replace(/^0+\./g,'0.')
|
|
|
- $(this).val(zero);
|
|
|
- if ((/^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(profit_ratio)) || isNaN(profit_ratio)){
|
|
|
- layer.msg('利润率只能设置浮点数');
|
|
|
- $(this).val("0.00");
|
|
|
- }
|
|
|
+ const profit_ratio = $(this).val()
|
|
|
+ const intercept = profit_ratio.substring(profit_ratio.length, profit_ratio.length-1)
|
|
|
+ if(intercept == '.') {
|
|
|
+ layer.msg('利润率只能设置浮点数');
|
|
|
+ $(this).val("0.00");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const zero = profit_ratio.replace(/^0+\./g,'0.')
|
|
|
+ $(this).val(zero);
|
|
|
+ if ((/^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(profit_ratio)) || isNaN(profit_ratio)){
|
|
|
+ layer.msg('利润率只能设置浮点数');
|
|
|
+ $(this).val("0.00");
|
|
|
+ }
|
|
|
})
|
|
|
$('.judge').each(function(index, item) {
|
|
|
let day_secs = $(item).find('.day_secs').val()
|
|
|
let night_secs = $(item).find('.night_secs').val()
|
|
|
let times_secs = $(item).find('.times').val()
|
|
|
$(item).change(function() {
|
|
|
- let day_secs = $(item).find('.day_secs').val()
|
|
|
- let night_secs = $(item).find('.night_secs').val()
|
|
|
- let times_secs = $(item).find('.times').val()
|
|
|
- day = day_secs
|
|
|
- nights = night_secs
|
|
|
- times = times_secs
|
|
|
- if (day_secs == 0 || night_secs == 0 || times_secs == 0) {
|
|
|
+ let day_secs = $(item).find('.day_secs').val()
|
|
|
+ let night_secs = $(item).find('.night_secs').val()
|
|
|
+ let times_secs = $(item).find('.times').val()
|
|
|
+ day = day_secs
|
|
|
+ nights = night_secs
|
|
|
+ times = times_secs
|
|
|
+ if (day_secs == 0 || night_secs == 0 || times_secs == 0) {
|
|
|
layer.msg('白天秒数,黑天秒数,重试次数(三者都需设置 只能设置大于0的整数)');
|
|
|
}
|
|
|
})
|