merchant.ctl.php 32 KB

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