distributionconfig.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  42. <link href="/static/css/snailfish.css" rel="stylesheet">
  43. <style>
  44. .modal-dialog{background-color: #fff;}
  45. .content{
  46. display:none;
  47. width:200px;
  48. height:200px;
  49. border-radius:10px;
  50. padding:20px;
  51. position:relative;
  52. top:15px;
  53. left:80px;
  54. background-color:FFFFFF;
  55. border:1px solid;
  56. }
  57. .shide{display:none}
  58. </style>
  59. </head>
  60. <body layadmin-themealias="default">
  61. <div class="layui-fluid">
  62. <div class="layui-card">
  63. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">配送设置</span></div>
  64. <div class="layui-card-body" style="padding:15px;">
  65. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  66. <div class="layui-form-item shide">
  67. <label class="layui-form-label">配送员最多可抢</label>
  68. <div class="layui-input-block">
  69. <div class="input-group fixsingle-input-group">
  70. <input class="form-control" name="data[distri_config_maxcan_mbget]" type="text" placeholder="" value="{$data['distri_config_maxcan_mbget']}">
  71. <div class="input-group-addon">单</div>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="layui-form-item" >
  76. <label class="layui-form-label">配送员佣金</label>
  77. <div class="col-sm-10 col-xs-12" id="radPickupDateTip">
  78. <label class="radio-inline"><input type="radio" lay-filter="commiss_type" name="data[distr_commiss_type]" <?php if( !isset($data['distr_commiss_type']) || $data['distr_commiss_type'] ==0 ){ ?> checked <?php } ?> value="0" title="每单固定" /><span class="fake-radio" ></span></label>
  79. <label class="radio-inline"><input type="radio" lay-filter="commiss_type" name="data[distr_commiss_type]" <?php if( isset($data['distr_commiss_type']) && $data['distr_commiss_type'] ==1 ){ ?> checked <?php } ?> value="1" title="每单按照订单配送费抽成" /><span class="fake-radio" ></span></label>
  80. <label class="radio-inline"><input type="radio" lay-filter="commiss_type" name="data[distr_commiss_type]" <?php if( isset($data['distr_commiss_type']) && $data['distr_commiss_type'] ==2 ){ ?> checked <?php } ?> value="2" title="按距离收配送费" /><span class="fake-radio" ></span></label>
  81. </div>
  82. </div>
  83. <div class="layui-form-item" id="distri_1" style="<?php if( !isset($data['distr_commiss_type']) || $data['distr_commiss_type'] ==0){ ?>display:block;<?php }else{ ?>display: none;<?php } ?>">
  84. <label class="layui-form-label"></label>
  85. <div class="layui-input-block">
  86. <div class="input-group fixsingle-input-group">
  87. <div class="input-group-addon">每单固定</div>
  88. <input class="form-control" name="data[distri_shippingfare_fixed]" type="text" placeholder="" value="{$data['distri_shippingfare_fixed']}">
  89. <div class="input-group-addon">元</div>
  90. </div>
  91. <span class='layui-form-mid help-block'>配送员每一单获得的固定佣金金额</span>
  92. </div>
  93. </div>
  94. <div class="layui-form-item" id="distri_2" style="<?php if( isset($data['distr_commiss_type']) && $data['distr_commiss_type'] ==1){ ?>display:block;<?php }else{ ?>display: none;<?php } ?>">
  95. <label class="layui-form-label"></label>
  96. <div class="layui-input-block">
  97. <div class="input-group fixsingle-input-group">
  98. <input class="form-control" name="data[distri_shippingfare_commission]" type="text" placeholder="" value="{$data['distri_shippingfare_commission']}">
  99. <div class="input-group-addon">%</div>
  100. </div>
  101. <span class='layui-form-mid help-block'>配送员佣金按照每单配送费的百分比进行收取</span>
  102. </div>
  103. </div>
  104. <div class="layui-form-item" id="distri_3" style="<?php if( isset($data['distr_commiss_type']) && $data['distr_commiss_type'] ==2){ ?>display:block;<?php }else{ ?>display: none;<?php } ?>">
  105. <label class="layui-form-label"></label>
  106. <div class="layui-input-block">
  107. <div class="input-group fixsingle-input-group">
  108. <div class="input-group-addon">每单基础配送费</div>
  109. <input class="form-control" name="data[distri_shippingfare_distance_default]" type="text" placeholder="" value="{$data['distri_shippingfare_distance_default']}">
  110. <div class="input-group-addon">元,超过</div>
  111. <input class="form-control" name="data[distri_distance]" type="text" placeholder="" value="{$data['distri_distance']}">
  112. <div class="input-group-addon">公里(km),超过部分每公里增加</div>
  113. <input class="form-control" name="data[distri_shippingfare_distance_increase]" type="text" placeholder="" value="{$data['distri_shippingfare_distance_increase']}">
  114. <div class="input-group-addon">元,最高</div>
  115. <input class="form-control" name="data[distri_shippingfare_distance_max]" type="text" placeholder="" value="{$data['distri_shippingfare_distance_max']}">
  116. <div class="input-group-addon">元</div>
  117. </div>
  118. <span class='layui-form-mid help-block'>
  119. 仅适用于开启按照距离收取配送费的计费模式。最高设置为0表示不限制,<br/>
  120. 计费规则:例如设置 每单基础配送费3元,超过 3km 超过部分每公里增加 3 元,最高100元。如果配送距离10km,配送员佣金:3 + (10 - 3)* 3 = 24元;
  121. </span>
  122. </div>
  123. </div>
  124. <div class="layui-form-item">
  125. <label class="layui-form-label"> </label>
  126. <div class="layui-input-block">
  127. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  128. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  129. </div>
  130. </div>
  131. </form>
  132. </div>
  133. </div>
  134. </div>
  135. <script src="/layuiadmin/layui/layui.js"></script>
  136. <script>
  137. layui.config({
  138. base: '/layuiadmin/' //静态资源所在路径
  139. }).extend({
  140. index: 'lib/index' //主入口模块
  141. }).use('index');
  142. </script>
  143. <script>
  144. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  145. var layer = layui.layer;
  146. var $;
  147. var cur_open_div;
  148. layui.use(['jquery', 'layer','form'], function(){
  149. $ = layui.$;
  150. var form = layui.form;
  151. form.on('radio(commiss_type)', function(data){
  152. if (data.value == 0) {
  153. $('#distri_2').hide();
  154. $('#distri_3').hide();
  155. $('#distri_1').show();
  156. }
  157. else if( data.value == 1 )
  158. {
  159. $('#distri_1').hide();
  160. $('#distri_3').hide();
  161. $('#distri_2').show();
  162. }
  163. else if(data.value == 2)
  164. {
  165. $('#distri_1').hide();
  166. $('#distri_2').hide();
  167. $('#distri_3').show();
  168. }
  169. });
  170. //监听提交
  171. form.on('submit(formDemo)', function(data){
  172. $.ajax({
  173. url: data.form.action,
  174. type: data.form.method,
  175. data: data.field,
  176. dataType:'json',
  177. success: function (info) {
  178. if(info.status == 0)
  179. {
  180. layer.msg(info.result.message,{icon: 1,time: 2000});
  181. }else if(info.status == 1){
  182. var go_url = location.href;
  183. if( info.result.hasOwnProperty("url") )
  184. {
  185. go_url = info.result.url;
  186. }
  187. layer.msg('操作成功',{time: 1000,
  188. end:function(){
  189. location.href = info.result.url;
  190. }
  191. });
  192. }
  193. }
  194. });
  195. return false;
  196. });
  197. })
  198. </script>
  199. </body>