settime.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style>
  45. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect
  46. {
  47. width: auto!important;
  48. }
  49. </style>
  50. </head>
  51. <body layadmin-themealias="default">
  52. <div class="layui-fluid">
  53. <div class="layui-card">
  54. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">一键设置商品时间</span></div>
  55. <div class="layui-card-body" style="padding:15px;">
  56. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  57. <?php
  58. if (defined('ROLE') && ROLE == 'agenter' )
  59. {
  60. ?>
  61. <div class="layui-form-item">
  62. <label class="layui-form-label">统一商品团购时间</label>
  63. <div class="layui-input-block">
  64. <label class="radio-inline"><input type="radio" lay-filter="is_samedefault_now" name="is_samedefault_now" value="0" <?php if( !isset($data['is_samedefault_now']) || $data['is_samedefault_now'] == 0){ ?>checked="true"<?php } ?> title="默认当前" /> </label>
  65. <label class="radio-inline"><input type="radio" lay-filter="is_samedefault_now" name="is_samedefault_now" value="2" <?php if( isset($data['is_samedefault_now']) && $data['is_samedefault_now'] == 2){ ?>checked="true"<?php } ?> title="统一供应商团购时间" /> </label>
  66. <br/>
  67. <span class="layui-form-mid layui-word-aux" id="same_form">保持目前团购时间不变</span>
  68. </div>
  69. </div>
  70. <div class="layui-form-item" id="samedefault_now" <?php if( !isset($data['is_samedefault_now']) || $data['is_samedefault_now'] == 0 ){ ?> style="display:none;"<?php } ?>>
  71. <label class="layui-form-label">团购时间</label>
  72. <div class="layui-input-block">
  73. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $data[goods_same_starttime]),'endtime'=>date('Y-m-d H:i', $data[goods_same_endtime])),true);}
  74. </div>
  75. </div>
  76. <div class="layui-form-item">
  77. <label class="layui-form-label">统一商品提货时间</label>
  78. <div class="layui-input-block">
  79. <label class="radio-inline"><input type="radio" lay-filter="is_sametihuo_time" name="is_sametihuo_time" value="0" <?php if( !isset($data['is_sametihuo_time']) || $data['is_sametihuo_time'] == 0){ ?>checked="true"<?php } ?> title="默认当前" /> </label>
  80. <label class="radio-inline"><input type="radio" lay-filter="is_sametihuo_time" name="is_sametihuo_time" value="2" <?php if( isset($data['is_sametihuo_time']) && $data['is_sametihuo_time'] == 2){ ?>checked="true"<?php } ?> title="供应商团购时间" /> </label>
  81. <br/>
  82. <span class="layui-form-mid layui-word-aux" id="same_tihuo">保持目前提货时间不变</span>
  83. </div>
  84. </div>
  85. <div class="layui-form-item" id="sametihuo_time" <?php if( !isset($data['is_sametihuo_time']) || $data['is_sametihuo_time'] == 0){ ?>style="display:none;"<?php } ?>>
  86. <label class="layui-form-label">提货时间</label>
  87. <div class="col-sm-10 col-xs-12" id="radPickupDateTip">
  88. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( !isset($data['pick_up_type']) || $data['pick_up_type'] ==0 ){ ?> checked <?php } ?> value="4" title="当日达" /><span class="fake-radio"></span></label>
  89. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($data['pick_up_type']) && $data['pick_up_type'] ==1 ){ ?> checked <?php } ?> value="1" title="次日达" /><span class="fake-radio"></span></label>
  90. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($data['pick_up_type']) && $data['pick_up_type'] ==2 ){ ?> checked <?php } ?> value="2" title="隔日达" /><span class="fake-radio"></span></label>
  91. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($data['pick_up_type']) && $data['pick_up_type'] ==3 ){ ?> checked <?php } ?> value="3" title="自定义" /><span class="fake-radio"></span></label>
  92. <input class="form-control " id="txtPickupDateTip" name="pick_up_modify" style="vertical-align: sub; <?php if( isset($data['pick_up_type']) && $data['pick_up_type'] ==3){ ?>display:inline-block;<?php }else{ ?>display: none;<?php } ?>width: 120px;" type="text" value="{$data['pick_up_modify']}">
  93. <div style="clear:both;"></div>
  94. </div>
  95. </div>
  96. <?php }else{ ?>
  97. <div class="layui-form-item">
  98. <label class="layui-form-label">统一商品团购时间</label>
  99. <div class="layui-input-block">
  100. <label class="radio-inline"><input type="radio" lay-filter="is_samedefault_now" name="is_samedefault_now" value="0" <?php if( !isset($data['is_samedefault_now']) || $data['is_samedefault_now'] == 0){ ?>checked="true"<?php } ?> title="默认当前" /> </label>
  101. <label class="radio-inline"><input type="radio" lay-filter="is_samedefault_now" name="is_samedefault_now" value="1" <?php if( isset($data['is_samedefault_now']) && $data['is_samedefault_now'] == 1){ ?>checked="true"<?php } ?> title="统一平台团购时间" /> </label>
  102. <label class="radio-inline"><input type="radio" lay-filter="is_samedefault_now" name="is_samedefault_now" value="2" <?php if( isset($data['is_samedefault_now']) && $data['is_samedefault_now'] == 2){ ?>checked="true"<?php } ?> title="统一平台及供应商团购时间" /> </label>
  103. <br/>
  104. <span class="layui-form-mid layui-word-aux" id="same_form">保持目前团购时间不变</span>
  105. </div>
  106. </div>
  107. <div class="layui-form-item" id="samedefault_now" <?php if( !isset($data['is_samedefault_now']) || $data['is_samedefault_now'] == 0 ){ ?> style="display:none;"<?php } ?> >
  108. <label class="layui-form-label">团购时间</label>
  109. <div class="layui-input-block">
  110. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $data[goods_same_starttime]),'endtime'=>date('Y-m-d H:i', $data[goods_same_endtime])),true);}
  111. </div>
  112. </div>
  113. <div class="layui-form-item">
  114. <label class="layui-form-label">统一商品提货时间</label>
  115. <div class="layui-input-block">
  116. <label class="radio-inline"><input type="radio" lay-filter="is_sametihuo_time" name="is_sametihuo_time" value="0" <?php if( !isset($data['is_sametihuo_time']) || $data['is_sametihuo_time'] == 0){ ?>checked="true"<?php } ?> title="默认当前" /> </label>
  117. <label class="radio-inline"><input type="radio" lay-filter="is_sametihuo_time" name="is_sametihuo_time" value="1" <?php if( isset($data['is_sametihuo_time']) && $data['is_sametihuo_time'] == 1){ ?>checked="true"<?php } ?> title="统一平台提货时间" /> </label>
  118. <label class="radio-inline"><input type="radio" lay-filter="is_sametihuo_time" name="is_sametihuo_time" value="2" <?php if( isset($data['is_sametihuo_time']) && $data['is_sametihuo_time'] == 2){ ?>checked="true"<?php } ?> title="统一平台及供应商提货时间" /> </label>
  119. <br/>
  120. <span class="layui-form-mid layui-word-aux" id="same_tihuo">保持目前提货时间不变</span>
  121. </div>
  122. </div>
  123. <div class="layui-form-item" id="sametihuo_time" <?php if( !isset($data['is_sametihuo_time']) || $data['is_sametihuo_time'] == 0){ ?>style="display:none;"<?php } ?> >
  124. <label class="layui-form-label">提货时间</label>
  125. <div class="col-sm-10 col-xs-12" id="radPickupDateTip">
  126. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( !isset($data['pick_up_type']) || $data['pick_up_type'] ==0 ){ ?> checked <?php } ?> value="4" title="当日达" /><span class="fake-radio"></span></label>
  127. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($data['pick_up_type']) && $data['pick_up_type'] ==1 ){ ?> checked <?php } ?> value="1" title="次日达" /><span class="fake-radio"></span></label>
  128. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($data['pick_up_type']) && $data['pick_up_type'] ==2 ){ ?> checked <?php } ?> value="2" title="隔日达" /><span class="fake-radio"></span></label>
  129. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($data['pick_up_type']) && $data['pick_up_type'] ==3 ){ ?> checked <?php } ?> value="3" title="自定义" /><span class="fake-radio"></span></label>
  130. <input class="form-control " id="txtPickupDateTip" name="pick_up_modify" style="vertical-align: sub; <?php if( isset($data['pick_up_type']) && $data['pick_up_type'] ==3){ ?>display:inline-block;<?php }else{ ?>display: none;<?php } ?>width: 120px;" type="text" value="{$data['pick_up_modify']}">
  131. <div style="clear:both;"></div>
  132. </div>
  133. </div>
  134. <?php } ?>
  135. <div class="layui-form-item">
  136. <label class="layui-form-label"> </label>
  137. <div class="layui-input-block">
  138. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  139. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  140. </div>
  141. </div>
  142. </form>
  143. </div>
  144. </div>
  145. </div>
  146. <script src="/layuiadmin/layui/layui.js"></script>
  147. <script>
  148. layui.config({
  149. base: '/layuiadmin/' //静态资源所在路径
  150. }).extend({
  151. index: 'lib/index' //主入口模块
  152. }).use('index');
  153. </script>
  154. <script>
  155. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  156. var layer = layui.layer;
  157. var $;
  158. var cur_open_div;
  159. layui.use(['jquery', 'layer','form'], function(){
  160. $ = layui.$;
  161. var form = layui.form;
  162. form.on('radio(is_samedefault_now)', function(data){
  163. <?php
  164. if (defined('ROLE') && ROLE == 'agenter' )
  165. {
  166. ?>
  167. if (data.value == 0) {
  168. $('#samedefault_now').hide();
  169. $('#same_form').html('保持目前团购时间不变');
  170. }
  171. else if( data.value == 2 )
  172. {
  173. $('#samedefault_now').show();
  174. $('#same_form').html('此操作会变更独立供应商商品的团购时间(不包含拼团),请谨慎操作。');
  175. }
  176. <?php }else{ ?>
  177. if (data.value == 0) {
  178. $('#samedefault_now').hide();
  179. $('#same_form').html('保持目前团购时间不变');
  180. }else if( data.value == 1 )
  181. {
  182. $('#samedefault_now').show();
  183. $('#same_form').html('此操作会变更所有平台商品的团购时间(不包含拼团),请谨慎操作。');
  184. }
  185. else if( data.value == 2 )
  186. {
  187. $('#samedefault_now').show();
  188. $('#same_form').html('此操作会变更平台+独立供应商商品的团购时间(不包含拼团),请谨慎操作。');
  189. }
  190. <?php } ?>
  191. });
  192. form.on('radio(is_sametihuo_time)', function(data){
  193. <?php
  194. if (defined('ROLE') && ROLE == 'agenter' )
  195. {
  196. ?>
  197. if (data.value == 0) {
  198. $('#sametihuo_time').hide();
  199. $('#same_tihuo').html('保持目前提货时间不变');
  200. }
  201. else if( data.value == 2 )
  202. {
  203. $('#sametihuo_time').show();
  204. $('#same_tihuo').html('此操作会变更独立供应商商品的提货时间(不包含拼团),请谨慎操作。');
  205. }
  206. <?php }else{ ?>
  207. if (data.value == 0) {
  208. $('#sametihuo_time').hide();
  209. $('#same_tihuo').html('保持目前提货时间不变');
  210. }else if( data.value == 1 )
  211. {
  212. $('#sametihuo_time').show();
  213. $('#same_tihuo').html('此操作会变更所有平台商品的提货时间(不包含拼团),请谨慎操作。');
  214. }
  215. else if( data.value == 2 )
  216. {
  217. $('#sametihuo_time').show();
  218. $('#same_tihuo').html('此操作会变更平台+独立供应商商品的提货时间(不包含拼团),请谨慎操作。');
  219. }
  220. <?php } ?>
  221. });
  222. $('#radPickupDateTip input[type=radio]').click(function(){
  223. var s_val = $(this).val();
  224. if(s_val == 3)
  225. {
  226. $('#txtPickupDateTip').css('display','inline-block');
  227. }else{
  228. $('#txtPickupDateTip').css('display', 'none');
  229. }
  230. })
  231. $('#chose_link').click(function(){
  232. cur_open_div = $(this).attr('data-input');
  233. $.post("{:U('util.selecturl', array('ok' => 1))}", {}, function(shtml){
  234. layer.open({
  235. type: 1,
  236. area: '930px',
  237. content: shtml //注意,如果str是object,那么需要字符拼接。
  238. });
  239. });
  240. })
  241. //监听提交
  242. form.on('submit(formDemo)', function(data){
  243. layer.confirm('是否确认统一修改团购时间和提货时间?', function(index){
  244. $.ajax({
  245. url: data.form.action,
  246. type: data.form.method,
  247. data: data.field,
  248. dataType:'json',
  249. success: function (info) {
  250. if(info.status == 0)
  251. {
  252. layer.msg(info.result.message,{icon: 1,time: 2000});
  253. }else if(info.status == 1){
  254. var go_url = location.href;
  255. if( info.result.hasOwnProperty("url") )
  256. {
  257. go_url = info.result.url;
  258. }
  259. layer.msg('操作成功',{time: 1000,
  260. end:function(){
  261. location.href = info.result.url;
  262. }
  263. });
  264. }
  265. }
  266. });
  267. });
  268. return false;
  269. });
  270. })
  271. </script>
  272. </body>