merchant.ctl.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <style>
  2. .mleft {
  3. margin-left: 45px;
  4. }
  5. hr {
  6. border: none;
  7. border-top: 1px solid #cbe9f3;
  8. margin-bottom: 10px;
  9. margin-top: 10px;
  10. }
  11. .page .fixed-bar .item-title h3 {
  12. margin-top: 18px !important;
  13. margin-bottom: 10px !important;
  14. font-weight: 700 !important;
  15. }
  16. .tab-base li span {
  17. font-size: 12px !important;
  18. }
  19. </style>
  20. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  21. <div class="page">
  22. <div class="fixed-bar">
  23. <div class="item-title">
  24. <h3><?php echo $lang['nc_merchant'] ?></h3>
  25. <ul class="tab-base">
  26. <li><a href="index.php?act=merchant&op=merchant"><span><?php echo $lang['nc_manage'] ?></span></a></li>
  27. <li><a href="JavaScript:void(0);" class="current"><span>充值设置</span></a></li>
  28. </ul>
  29. </div>
  30. </div>
  31. <div class="fixed-empty"></div>
  32. <form id="user_form" enctype="multipart/form-data" method="post">
  33. <input type="hidden" name="form_submit" value="ok" />
  34. <input type="hidden" name="mchid" value="<?php echo $output['merchant']['mchid']; ?>" />
  35. <table class="table tb-type2">
  36. <tbody>
  37. <tr class="noborder">
  38. <td colspan="2" class="required"><label class="validation">机构名称:</label></td>
  39. </tr>
  40. <tr class="noborder">
  41. <td class="mleft" style="display: block"><?php echo "{$output['merchant']['mchid']} :{$output['merchant']['company_name']}"; ?></td>
  42. </tr>
  43. <tr class="noborder">
  44. <td colspan="2" class="required"><label class="validation">拦截设置:</label></td>
  45. </tr>
  46. <tr class="noborder">
  47. <td colspan="2" class="required mleft"><label style="display: inline-block;width: 46px;" class="mleft" for="name">转网:</label>
  48. <label>
  49. <input type="radio" name="is_transfer" value="1" <?php if ($output['intercept']['is_transfer'] === true) {
  50. echo 'checked';
  51. } ?>>
  52. </label>是
  53. <label>
  54. <input type="radio" name="is_transfer" value="0" <?php if ($output['intercept']['is_transfer'] === false) {
  55. echo 'checked';
  56. } ?>>
  57. </label>否
  58. </td>
  59. </tr>
  60. <tr class="noborder">
  61. <td colspan="2" class="required"><label class="mleft" for="name">状态码:</label>
  62. <?php foreach ($output['card_state'] as $key => $value) { ?>
  63. <?php if (!in_array($value, ['空号', '实号', '风险号']) && !in_array($key, [0, 1, 5])) { ?>
  64. <label>
  65. <input type="checkbox" name="card_states[]" value="<?php echo $key; ?>" <?php if (!empty($output['intercept']['card_states']) && in_array($key, $output['intercept']['card_states'])) {
  66. echo 'checked';
  67. } ?>>
  68. </label><?php echo $value; ?>
  69. <?php } ?>
  70. <?php } ?>
  71. </td>
  72. </tr>
  73. <tr class="noborder">
  74. <td colspan="2" class="required"><label class="mleft" style="margin-right: 12px;" for="name">三网:</label>
  75. <label>
  76. <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaMobileCard; ?>" <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaMobileCard, $output['intercept']['card_types'])) {
  77. echo 'checked';
  78. } ?>>
  79. </label>移动
  80. <label>
  81. <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaUnicomCard; ?>" <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaUnicomCard, $output['intercept']['card_types'])) {
  82. echo 'checked';
  83. } ?>>
  84. </label>联通
  85. <label>
  86. <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaTelecomCard; ?>" <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaTelecomCard, $output['intercept']['card_types'])) {
  87. echo 'checked';
  88. } ?>>
  89. </label>电信
  90. </td>
  91. </tr>
  92. <tr class="noborder">
  93. <td>
  94. <hr>
  95. </td>
  96. </tr>
  97. <tr class="noborder">
  98. <td colspan="2" class="required"><label class="validation">高价补充条件:</label></td>
  99. </tr>
  100. <tr class="noborder">
  101. <td colspan="2" class="required"><label style="margin-left: 45px; " for="name">成功率不低于:</label>
  102. <label for="success"></label><input type="text" name="ratio" value="<?php echo $output['retry_times']['lower_ratio']['ratio'] ?? 0; ?>" id="success">
  103. <label style="margin-left: 15px;" for="name">检测时间:</label>
  104. <label>
  105. <select name="period">
  106. <option value="3600" <?php if ($output['retry_times']['lower_ratio']['period'] == 3600) {
  107. echo 'selected';
  108. } ?>>3600
  109. <option value="86400" <?php if ($output['retry_times']['lower_ratio']['period'] == 86400) {
  110. echo 'selected';
  111. } ?>>当天
  112. </option>
  113. <option value="7200" <?php if ($output['retry_times']['lower_ratio']['period'] == 7200) {
  114. echo 'selected';
  115. } ?>>7200
  116. </option>
  117. <option value="1800" <?php if ($output['retry_times']['lower_ratio']['period'] == 1800) {
  118. echo 'selected';
  119. } ?>>1800
  120. </option>
  121. <option value="900" <?php if ($output['retry_times']['lower_ratio']['period'] == 900) {
  122. echo 'selected';
  123. } ?>>900
  124. </option>
  125. </select>
  126. </label>
  127. <label for="name">( 秒 )</label>
  128. </td>
  129. </tr>
  130. <tr class="noborder">
  131. <td colspan="2" class="required"><label style="margin-left: 45px;display: inline-block;width: 84px" for="name">利润率低于:</label>
  132. <label>
  133. <input id="profit_ratio" type="text" name="profit_ratio" value="<?php echo $output['retry_times']['profit_ratio'] ?? 0; ?>">
  134. </label>
  135. <label style="margin-left: 15px;" for="name">时自动不补充</label>
  136. <label style="color: red" for="">注:如1%则填0.01,0.1%则填0.001</label>
  137. </td>
  138. </tr>
  139. <tr class="noborder">
  140. <td colspan="2" class="required">
  141. <label style="margin-left: 45px;" for="name">利润计算方式:</label>
  142. <label>
  143. <select name="profit_formula">
  144. <option value="qts" <?php if ($output['retry_times']['profit_formula'] == 'qts') {
  145. echo 'selected';
  146. } ?>>卡类型+面值
  147. <option value="qt" <?php if ($output['retry_times']['profit_formula'] == 'qt') {
  148. echo 'selected';
  149. } ?>>卡类型
  150. </option>
  151. <option value="all" <?php if ($output['retry_times']['profit_formula'] == 'all') {
  152. echo 'selected';
  153. } ?>>全部
  154. </option>
  155. </select>
  156. </label>
  157. </td>
  158. </tr>
  159. <tr class="noborder">
  160. <td>
  161. <hr>
  162. </td>
  163. </tr>
  164. <tr class="noborder">
  165. <td colspan="2" class="required"><label class="validation">预回调设置:</label></td>
  166. </tr>
  167. <tr class="noborder">
  168. <td colspan="4" class="required mleft"><label style="display: inline-block;width: 60px;" class="mleft" for="name">是否开启:</label>
  169. <label>
  170. <input type="radio" name="transfer_opened" value="1" <?php if ($output['transfer_cfg']['transfer_opened'] === 1) {
  171. echo 'checked';
  172. } ?>>
  173. </label>是
  174. <label>
  175. <input type="radio" name="transfer_opened" value="0" <?php if ($output['transfer_cfg']['transfer_opened'] === 0) {
  176. echo 'checked';
  177. } ?>>
  178. </label>否
  179. </td>
  180. </tr>
  181. <tr class="noborder">
  182. <td colspan="2" class="required mleft"><label style="display: inline-block;width: 60px;" class="mleft" for="name">转发通道:</label>
  183. <input type="text" name="transfer_mchid" value="<?php echo $output['transfer_cfg']['transfer_mchid']; ?>" /><span style="color:red;">注:该通道需要单独创建,帐号不能给下游。</span>
  184. </td>
  185. </tr>
  186. <tr class="noborder">
  187. <td colspan="2" class="required mleft"><label style="display: inline-block;" class="mleft" for="name">超过多长时间开始转发:</label>
  188. <input type="text" name="transfer_lowertime" value="<?php echo $output['transfer_cfg']['transfer_lowertime']; ?>" /> <span>(秒)</span>
  189. </td>
  190. </tr>
  191. <tr class="noborder">
  192. <td colspan="2" class="required mleft"><label style="display: inline-block;" class="mleft" for="name">超过多长时间停止转发:</label>
  193. <input type="text" name="transfer_uppertime" value="<?php echo $output['transfer_cfg']['transfer_uppertime']; ?>" /> <span>(秒)</span>
  194. </td>
  195. </tr>
  196. <tr class="noborder">
  197. <td>
  198. <hr>
  199. </td>
  200. </tr>
  201. <tr class="noborder">
  202. <td colspan="2" class="required"><label class="validation">充值时间和次数设置:</label>
  203. <div style="margin-left:149px;">
  204. <label style="display: inline-block;">白天秒数</label>
  205. <label style="display: inline-block; margin: 0 145px 0 148px;">夜晚秒数</label>
  206. <label style="display: inline-block;">重试次数</label>
  207. </div>
  208. </td>
  209. </tr>
  210. <?php foreach ($output['quality'] as $key => $value) { ?>
  211. <tr class="noborder">
  212. <td colspan="2" class="required judge">
  213. <label class="seconds" style="margin-left: 48px;display:inline-block; margin-right: 16px; min-width: 38px" for="name"><?php echo $value; ?>:</label>
  214. <label>
  215. <input class="day_secs" type="text" name="<?php echo "$key-day_secs"; ?>" value="<?php echo $output['retry_times']['qualities'][$key]['day_secs'] ?? 0; ?>">
  216. </label>
  217. <label>
  218. <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; ?>">
  219. </label>
  220. <label>
  221. <input class="times" type="text" name="<?php echo "$key-times"; ?>" value="<?php echo $output['retry_times']['qualities'][$key]['times'] ?? 0; ?>">
  222. </label>
  223. </td>
  224. </tr>
  225. <?php } ?>
  226. <tr>
  227. <td colspan="2" class="required"><label class="validation" for="oil_quality">油卡通道质量:</label></td>
  228. </tr>
  229. <tr class="noborder">
  230. <td class="vatop" style="display: block; margin-left: 43px;">
  231. <label>
  232. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::Normal) {
  233. echo 'checked';
  234. } ?> value="<?php echo refill\Quality::Normal; ?>" type="radio">
  235. </label>无流水
  236. <label>
  237. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::SlowTwentyFour) {
  238. echo 'checked';
  239. } ?> value="<?php echo refill\Quality::SlowTwentyFour; ?>" type="radio">
  240. </label>有流水
  241. <label>
  242. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::CardKey) {
  243. echo 'checked';
  244. } ?> value="<?php echo refill\Quality::CardKey; ?>" type="radio">
  245. </label>卡密
  246. <label>
  247. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::Quick) {
  248. echo 'checked';
  249. } ?> value="<?php echo refill\Quality::Quick; ?>" type="radio">
  250. </label>快充
  251. <label>
  252. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OilSN_NONE_HAS) {
  253. echo 'checked';
  254. } ?> value="<?php echo refill\Quality::OilSN_NONE_HAS; ?>" type="radio">
  255. </label>无流水+有流水
  256. <label>
  257. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OilSN_HAS_NONE) {
  258. echo 'checked';
  259. } ?> value="<?php echo refill\Quality::OilSN_HAS_NONE; ?>" type="radio">
  260. </label>有流水+无流水
  261. <label>
  262. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SN_CARDKEY) {
  263. echo 'checked';
  264. } ?> value="<?php echo refill\Quality::OIL_SN_CARDKEY; ?>" type="radio">
  265. </label>有流水+卡密
  266. <label>
  267. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_CARDKEY) {
  268. echo 'checked';
  269. } ?> value="<?php echo refill\Quality::OIL_SNNONE_CARDKEY; ?>" type="radio">
  270. </label>无流水+卡密
  271. <label>
  272. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SN_SNNONE_CARDKEY) {
  273. echo 'checked';
  274. } ?> value="<?php echo refill\Quality::OIL_SN_SNNONE_CARDKEY; ?>" type="radio">
  275. </label>有流水+无流水+卡密
  276. <label>
  277. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_SN_CARDKEY) {
  278. echo 'checked';
  279. } ?> value="<?php echo refill\Quality::OIL_SNNONE_SN_CARDKEY; ?>" type="radio">
  280. </label>无流水+有流水+卡密
  281. <label>
  282. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_SN_CARDKEY_QUICK) {
  283. echo 'checked';
  284. } ?> value="<?php echo refill\Quality::OIL_SNNONE_SN_CARDKEY_QUICK; ?>" type="radio">
  285. </label>无流水+有流水+卡密+快充
  286. </td>
  287. </tr>
  288. <tr>
  289. <td colspan="2" class="required"><label class="validation" for="quality">话费通道质量:</label></td>
  290. </tr>
  291. <tr class="noborder">
  292. <td class="vatop" style="display: block; margin-left: 43px;">
  293. <label>
  294. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Normal) {
  295. echo 'checked';
  296. } ?> value="<?php echo refill\Quality::Normal; ?>" type="radio">
  297. </label>普通
  298. <label>
  299. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Quick) {
  300. echo 'checked';
  301. } ?> value="<?php echo refill\Quality::Quick; ?>" type="radio">
  302. </label>快速
  303. <label>
  304. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::CardKey) {
  305. echo 'checked';
  306. } ?> value="<?php echo refill\Quality::CardKey; ?>" type="radio">
  307. </label>卡密
  308. <label>
  309. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::ThirdShop) {
  310. echo 'checked';
  311. } ?> value="<?php echo refill\Quality::ThirdShop; ?>" type="radio">
  312. </label>三方
  313. <label>
  314. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowTwentyFour) {
  315. echo 'checked';
  316. } ?> value="<?php echo refill\Quality::SlowTwentyFour; ?>" type="radio">
  317. </label>慢24
  318. <label>
  319. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSix) {
  320. echo 'checked';
  321. } ?> value="<?php echo refill\Quality::SlowSix; ?>" type="radio">
  322. </label>慢6
  323. <label>
  324. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowTwo) {
  325. echo 'checked';
  326. } ?> value="<?php echo refill\Quality::SlowTwo; ?>" type="radio">
  327. </label>慢2
  328. <label>
  329. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowFortyEight) {
  330. echo 'checked';
  331. } ?> value="<?php echo refill\Quality::SlowFortyEight; ?>" type="radio">
  332. </label>慢48
  333. <label>
  334. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSeventyTwo) {
  335. echo 'checked';
  336. } ?> value="<?php echo refill\Quality::SlowSeventyTwo; ?>" type="radio">
  337. </label>慢72
  338. <label>
  339. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Fastest) {
  340. echo 'checked';
  341. } ?> value="<?php echo refill\Quality::Fastest; ?>" type="radio">
  342. </label>速充
  343. <label>
  344. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowNormal) {
  345. echo 'checked';
  346. } ?> value="<?php echo refill\Quality::SlowNormal; ?>" type="radio">
  347. </label>慢充一次+普充
  348. <label>
  349. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::ThirdNormal) {
  350. echo 'checked';
  351. } ?> value="<?php echo refill\Quality::ThirdNormal; ?>" type="radio">
  352. </label>三方一次+普充
  353. <label>
  354. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::DefSuccess) {
  355. echo 'checked';
  356. } ?> value="<?php echo refill\Quality::DefSuccess; ?>" type="radio">
  357. </label>普充+卡密+快充
  358. <label>
  359. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::NormalQuick) {
  360. echo 'checked';
  361. } ?> value="<?php echo refill\Quality::NormalQuick; ?>" type="radio">
  362. </label>普充+快充
  363. <label>
  364. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSixNormal) {
  365. echo 'checked';
  366. } ?> value="<?php echo refill\Quality::SlowSixNormal; ?>" type="radio">
  367. </label>慢充6+普充
  368. </td>
  369. </tr>
  370. </tbody>
  371. <tfoot>
  372. <tr class="tfoot">
  373. <td colspan="15"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
  374. </tr>
  375. </tfoot>
  376. </table>
  377. </form>
  378. </div>
  379. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
  380. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  381. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
  382. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
  383. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/layui.js"></script>
  384. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css" />
  385. <link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css" id="cssfile2" />
  386. <script type="text/javascript">
  387. $(function() {
  388. //按钮先执行验证再提交表单
  389. let day
  390. let nights
  391. let times
  392. $("#submitBtn").click(function() {
  393. if (day == 0 || nights == 0 || times == 0) {
  394. layer.msg('白天秒数,夜晚秒数,重试次数(三者都需设置)');
  395. } else {
  396. $("#user_form").submit();
  397. }
  398. })
  399. $('.required .day_secs').each(function(index, item) {
  400. $(item).change(function() {
  401. const day_secs = $(this).val()
  402. const zero = day_secs.replace(/^[0]+/, '')
  403. const zero_day = day_secs.substr(0, 1)
  404. const zero_length = day_secs.substr(day_secs.length - 1)
  405. if (zero_day == 0) {
  406. $(this).val(zero_day);
  407. }
  408. if (zero_length != 0) {
  409. console.log(zero, 123);
  410. $(item).val(zero);
  411. }
  412. if ((!/^\d+$/.test(day_secs)) || isNaN(day_secs)) {
  413. layer.msg('白天秒数只能设置大于0的整数');
  414. $(item).val("0");
  415. }
  416. })
  417. })
  418. $('.required .night_secs').each(function(index, item) {
  419. $(item).change(function() {
  420. const night_secs = $(this).val()
  421. const zero = night_secs.replace(/^[0]+/, '')
  422. const zero_day = night_secs.substr(0, 1)
  423. const zero_length = night_secs.substr(night_secs.length - 1)
  424. if (zero_day == 0) {
  425. $(this).val(zero_day);
  426. }
  427. if (zero_length != 0) {
  428. $(item).val(zero);
  429. }
  430. if ((!/^\d+$/.test(night_secs)) || isNaN(night_secs)) {
  431. layer.msg('夜晚秒数只能设置大于0的整数');
  432. $(item).val("0");
  433. }
  434. })
  435. })
  436. $('.required .times').each(function(index, item) {
  437. $(item).change(function() {
  438. const times = $(this).val()
  439. const zero = times.replace(/^[0]+/, '')
  440. const zero_day = times.substr(0, 1)
  441. const zero_length = times.substr(times.length - 1)
  442. if (zero_day == 0) {
  443. $(this).val(zero_day);
  444. }
  445. if (zero_length != 0) {
  446. $(item).val(zero);
  447. }
  448. if ((!/^\d+$/.test(times)) || isNaN(times)) {
  449. layer.msg('重试次数只能设置大于0的整数');
  450. $(item).val("0");
  451. }
  452. })
  453. })
  454. $('#success').change(function(index, item) {
  455. const success = $(this).val()
  456. const intercept = success.substring(success.length, success.length - 1)
  457. if (intercept == '.') {
  458. layer.msg('成功率只能设置浮点数');
  459. $(this).val("0.00");
  460. return
  461. }
  462. const zero = success.replace(/^0+\./g, '0.')
  463. $(this).val(zero);
  464. 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)) {
  465. layer.msg('成功率只能设置浮点数');
  466. $(this).val("0.00");
  467. }
  468. })
  469. $('#profit_ratio').change(function(index, item) {
  470. const profit_ratio = $(this).val()
  471. const intercept = profit_ratio.substring(profit_ratio.length, profit_ratio.length - 1)
  472. if (intercept == '.') {
  473. layer.msg('利润率只能设置浮点数');
  474. $(this).val("0.00");
  475. return
  476. }
  477. const zero = profit_ratio.replace(/^0+\./g, '0.')
  478. $(this).val(zero);
  479. 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)) {
  480. layer.msg('利润率只能设置浮点数');
  481. $(this).val("0.00");
  482. }
  483. })
  484. $('.judge').each(function(index, item) {
  485. let day_secs = $(item).find('.day_secs').val()
  486. let night_secs = $(item).find('.night_secs').val()
  487. let times_secs = $(item).find('.times').val()
  488. $(item).change(function() {
  489. let day_secs = $(item).find('.day_secs').val()
  490. let night_secs = $(item).find('.night_secs').val()
  491. let times_secs = $(item).find('.times').val()
  492. day = day_secs
  493. nights = night_secs
  494. times = times_secs
  495. if (day_secs == 0 || night_secs == 0 || times_secs == 0) {
  496. layer.msg('白天秒数,夜晚秒数,重试次数(三者都需设置 只能设置大于0的整数)');
  497. }
  498. })
  499. })
  500. });
  501. </script>