provider.amount.control.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  2. <!--<link rel="stylesheet" type="text/css" href="--><?php //echo RESOURCE_SITE_URL;?><!--/js/jquery-ui/themes/ui-lightness/jquery.ui.css" />-->
  3. <!--<link href="--><?php //echo SHOP_SITE_URL;?><!--/templates/default/css/seller_center.css" rel="stylesheet" type="text/css"/>-->
  4. <style>
  5. .spec_table .batch {
  6. vertical-align: middle;
  7. display: inline-block;
  8. *display: inline /*IE7*/;
  9. margin-left: 4px;
  10. /* position: relative; */
  11. z-index: 1;
  12. *zoom: 1 /*IE7*/;
  13. }
  14. .spec_table .batch i {
  15. cursor: pointer;
  16. }
  17. .spec_table .batch-td {
  18. position: relative;
  19. }
  20. .spec_table .batch-input {
  21. background-color: #FFF;
  22. white-space: nowrap;
  23. padding: 4px 9px;
  24. border: solid 1px #BCE8F1;
  25. position: absolute;
  26. z-index: 9999;
  27. top: -50px;
  28. left: 30px;
  29. box-shadow: 3px 3px 0 rgba(153, 153, 153, 0.25);
  30. display:none;
  31. }
  32. .spec_table .batch-input h6 {
  33. font-size: 12px;
  34. color: #555;
  35. }
  36. .spec_table .batch-input .text {
  37. vertical-align: middle;
  38. clear: both;
  39. padding: 0 4px;
  40. vertical-align: middle;
  41. margin-right: 4px;
  42. }
  43. .spec_table .batch-input .arrow {
  44. background: url(<?php echo SHOP_SITE_URL;?>/templates/default/images/seller/ncsc_bg_img.png) no-repeat -240px -20px;
  45. display: block;
  46. width: 10px;
  47. height: 5px;
  48. margin-left: -5px;
  49. bottom: -5px;
  50. left: 50%;
  51. position: absolute;
  52. z-index: 2;
  53. }
  54. .spec_table .batch-input a.close {
  55. font-size: 11px;
  56. line-height: 12px;
  57. color: #BCE8F1;
  58. text-decoration: none;
  59. background-color: #FFF;
  60. text-align: center;
  61. display: block;
  62. width: 12px;
  63. height: 12px;
  64. border-radius: 7px;
  65. border: solid 1px #BCE8F1;
  66. top: -7px;
  67. right: -7px;
  68. position: absolute;
  69. z-index: 2;
  70. }
  71. .spec_table .text.price {
  72. width: 40px;
  73. }
  74. .tableFixed {
  75. position: fixed;
  76. top: 54px;
  77. background-color: #fff;
  78. z-index:998;
  79. left:0px;
  80. display:block;
  81. padding-left:20px;
  82. }
  83. .styleOne {
  84. width: 35px;
  85. display:inline-block
  86. }
  87. .styleTow {
  88. width: 30px;
  89. display:inline-block
  90. }
  91. .tb-type2 th.td {
  92. padding-right: 0;
  93. border-bottom: 1px dotted #CBE9F3;
  94. }
  95. .fixed-bar {
  96. margin-left:0px;
  97. padding-left:20px;
  98. }
  99. /* .trFlex {
  100. display: block;
  101. padding-left:120px;
  102. }
  103. .tbFlex {
  104. position: fixed;
  105. left: 20px;
  106. top: auto;
  107. background-color: #fff;
  108. z-index: 1;
  109. height: 25px;
  110. line-height: 25px;
  111. } */
  112. </style>
  113. <div class="page">
  114. <div class="fixed-bar">
  115. <div class="item-title">
  116. <h3>通道管理</h3>
  117. <ul class="tab-base">
  118. <li><a href="index.php?act=merchant&op=provider"><span><?php echo $lang['nc_manage'] ?></span></a></li>
  119. <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=common" class="classA" data-type="2-common"><span>普通话费单量控制</span></a></li>
  120. <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=fast" class="classA" data-type="2-fast"><span>快充话费单量控制</span></a></li>
  121. <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=card" class="classA" data-type="2-card"><span>卡密话费单量控制</span></a></li>
  122. <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=third" class="classA" data-type="2-third"><span>三方话费单量控制</span></a></li>
  123. <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow" class="classA" data-type="2-slow"><span>慢充话费单量控制</span></a></li>
  124. <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common" class="classA" data-type="1-common"><span>普通油卡单量控制</span></a></li>
  125. <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast" class="classA" data-type="1-fast"><span>快充油卡单量控制</span></a></li>
  126. </ul>
  127. </div>
  128. </div>
  129. <div class="fixed-empty"></div>
  130. <form id="price_form" enctype="multipart/form-data" method="post">
  131. <input type="hidden" name="form_submit" value="ok"/>
  132. <table class="table tb-type2 tableFixed">
  133. <tbody class="tbody" >
  134. <tr>
  135. <td colspan="2" class="required" ><label>单量设置:</label></td>
  136. </tr>
  137. <tr>
  138. <td style="border-top: 0;color: #e60d0d;font-size:13px">
  139. 单量:请输入大于-1的数字,-1表示不限;&nbsp;&nbsp;&nbsp;&nbsp;
  140. 优先级:请输入1-100的数字;&nbsp;&nbsp;&nbsp;&nbsp;是否启动:1-开启,0-关闭
  141. </td>
  142. </tr>
  143. <tr class="noborder">
  144. <table class="spec_table tb-type2" style="width: 100%;margin-top: 77px;display: block;">
  145. <tbody id="tableHread" style="position: fixed;top:138px;left:20px;background-color: #fff;z-index:999;width: 96.5%%;">
  146. <tr class="w550">
  147. <th style="text-align: center;width: 120px;min-width:120px;padding-right:0;"></th>
  148. <?php foreach ($output['providers'] as $provider) { ?>
  149. <th style="text-align: center;width: 160px;min-width:160px;padding-right:0;background-color: #fff"><?php echo $provider['store_name']?>(<?php if($provider['opened'] == 1){?>
  150. <span style="color: #0bb20c">开启</span>
  151. <?php }?><?php if($provider['opened'] == 2){?>
  152. <span style="color: #f30707">关闭</span>
  153. <?php }?>)
  154. <?php }?>
  155. </tr>
  156. <tr class="w500" style="display:block;">
  157. <td style="text-align: center;width: 120px;min-width:120px;height:16px"></td>
  158. <?php foreach ($output['providers'] as $provider) { ?>
  159. <td style="text-align: center;width: 150px;min-width:150px;padding-right: 10px;background-color: #fff;" class="batch-td">
  160. <div style="width: 46px;display:inline-block">
  161. 单量
  162. </div>
  163. <div style="width: 40px;display:inline-block">
  164. 优先级
  165. </div>
  166. <div style="width: 40px;display:inline-block">
  167. 开关
  168. </div>
  169. </td>
  170. <?php }?>
  171. </tr>
  172. </tbody>
  173. <tbody class="tbody tableContent" style="display: block;padding-top: 56px;">
  174. <?php foreach ($output['form']['amountData'] as $key => $amount) { ?>
  175. <tr class="w500 trFlex">
  176. <td style="text-align: center;width: 120px;min-width:120px;" class="tbFlex">
  177. <?php echo $amount['text']?>
  178. </td>
  179. <?php foreach ($output['providers'] as $provider) { ?>
  180. <input type="hidden" name="pid[]" value="<?php echo $provider['provider_id'];?>">
  181. <input type="hidden" name="name[]" value="<?php echo $provider['name'];?>">
  182. <input type="hidden" name="types[]" value="<?php echo $amount['type'];?>">
  183. <input type="hidden" name="amount[]" value="<?php echo $amount['amount'];?>">
  184. <input type="hidden" name="has[]" value="<?php echo $output['datas'][$provider['provider_id']][$key]['has'];?>">
  185. <td style="text-align: center;width: 150px;min-width:150px;padding-right: 10px;" class="batch-td">
  186. <div style="width: 46px;display:inline-block">
  187. <input type="text" class="input-one styleOne" name="speed[]" autocomplete="off"
  188. value="<?php echo $output['datas'][$provider['provider_id']][$key]['speed']?>"
  189. <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
  190. readOnly
  191. style="background-color:#eaeaea;"
  192. <?php }?>
  193. >
  194. <div class="batch-input" >
  195. <h6>提示:</h6>
  196. <a href="javascript:void(0)" class="close">X</a>
  197. <span>请输入大于-1的数字</span>
  198. </div>
  199. </div>
  200. <div style="width: 40px;display:inline-block;">
  201. <input type="text" class="input-tow styleTow" name="sort[]" autocomplete="off"
  202. value="<?php echo $output['datas'][$provider['provider_id']][$key]['sort']?>"
  203. <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
  204. readOnly
  205. style="background-color:#eaeaea;"
  206. <?php }?>
  207. >
  208. <div class="batch-input" >
  209. <h6>提示:</h6>
  210. <a href="javascript:void(0)" class="close">X</a>
  211. <span>请输入数字,范围在1-100</span>
  212. </div>
  213. </div>
  214. <div style="width: 40px;display:inline-block">
  215. <input type="text" class="input-three styleTow" name="opened[]" autocomplete="off"
  216. value="<?php echo $output['datas'][$provider['provider_id']][$key]['opened']?>"
  217. <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
  218. readOnly
  219. style="background-color:#eaeaea;"
  220. <?php }?>
  221. >
  222. <div class="batch-input" >
  223. <h6>提示:</h6>
  224. <a href="javascript:void(0)" class="close">X</a>
  225. <span>请输入数字0或1,1-开启;0-关闭</span>
  226. </div>
  227. </div>
  228. </td>
  229. <?php }?>
  230. </tr>
  231. <?php }?>
  232. </tbody>
  233. </table>
  234. </tr>
  235. </tbody>
  236. <tfoot>
  237. <tr class="tfoot">
  238. <td colspan="15"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
  239. </tr>
  240. </tfoot>
  241. </table>
  242. </form>
  243. </div>
  244. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
  245. charset="utf-8"></script>
  246. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  247. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
  248. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
  249. <link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
  250. id="cssfile2"/>
  251. <script type="text/javascript">
  252. $(function () {
  253. $(window).scroll(function() {
  254. let toLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
  255. // let toTop = document.documentElement.scrollTop || document.body.scrollTop;
  256. // console.log('toTop',toTop);
  257. if (toLeft>0) {
  258. let headLeft = toLeft - 20
  259. $('#tableHread')[0].style.left = '-'+headLeft+'px'
  260. } else if (toLeft == 0) {
  261. $('#tableHread')[0].style.left = 20+'px'
  262. }
  263. // if (toTop>0) {
  264. // console.log('11', $('.tbFlex')[0].offsetTop);
  265. // $('.tbFlex').each(function () {
  266. // let trTop = $(this)[0].offsetTop
  267. // $(this)[0].style.top = trTop - toTop + 'px'
  268. // })
  269. // } else if (toTop == 0) {
  270. // $('.tbFlex').each(function () {
  271. // $(this)[0].style.top = 'auto'
  272. // })
  273. // }
  274. });
  275. let isSubmit = true
  276. $('.input-one').blur(function () {
  277. // console.log('$(this).value', ($(this)));
  278. let value = $(this)[0].value
  279. if (value >= -1 ) {
  280. isSubmit = true;
  281. $(this)[0].style['borderColor'] = ''
  282. } else {
  283. isSubmit = false
  284. $(this)[0].style['borderColor'] = '#e64444'
  285. }
  286. })
  287. $('.input-tow').blur(function () {
  288. let value = $(this)[0].value
  289. // console.log(value);
  290. if (value >= 1 && value <= 100) {
  291. isSubmit = true;
  292. $(this)[0].style['borderColor'] = ''
  293. } else {
  294. isSubmit = false
  295. $(this)[0].style['borderColor'] = '#e64444'
  296. }
  297. })
  298. $('.input-three').blur(function () {
  299. let value = $(this)[0].value
  300. if (value == 0 || value == 1) {
  301. isSubmit = true
  302. $(this)[0].style['borderColor'] = ''
  303. } else {
  304. isSubmit = false
  305. $(this)[0].style['borderColor'] = '#e64444'
  306. }
  307. })
  308. // $('input').each(function () {
  309. // $(this).focus(function () {
  310. // })
  311. // });
  312. // 开始获取当前地址
  313. let type = '<?php echo $_GET['type'];?>';
  314. let form = '<?php echo $_GET['form'];?>';
  315. $(".classA").each(function () {
  316. if (type+'-'+form == $(this).attr("data-type")) {
  317. $(this).addClass('current')
  318. $(this).attr('href','JavaScript:void(0);')
  319. }
  320. })
  321. // 提交
  322. $("#submitBtn").click(function () {
  323. console.log('isSubmit', isSubmit);
  324. if (isSubmit) {
  325. $("#price_form").submit();
  326. }
  327. })
  328. // tab样式
  329. $(".tab-base a").click(function () {
  330. // console.log('this', $(this));
  331. $(this).addClass('current')
  332. $(this).siblings().removeClass('current')
  333. })
  334. // 表格hover时背景
  335. $('.trFlex').each(function () {
  336. $(this).hover(function () {
  337. $(this)[0].style.backgroundColor = '#cbe9f3'
  338. },function() {
  339. $(this)[0].style.backgroundColor = '#fff'
  340. })
  341. })
  342. });
  343. </script>