config.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="page-header">
  4. <h1>
  5. 快递鸟参数配置
  6. <small>
  7. <i class="icon-double-angle-right"></i>
  8. {$crumbs}
  9. </small>
  10. </h1>
  11. </div>
  12. <div class="row">
  13. <div class="col-xs-12 search-row">
  14. <div class="panel-body">
  15. <ul class="nav nav-tabs">
  16. <li <?php if($type == 0){ ?>class="active" <?php } ?>><a href="{:U('SellerManage/express')}">全部快递</a></li>
  17. <li <?php if($type == 1){ ?>class="active" <?php } ?>><a href="{:U('SellerManage/config')}">快递参数配置</a></li>
  18. </ul>
  19. </div>
  20. </div>
  21. <div class="col-xs-12">
  22. <form class="form-horizontal" id="validation-form" method="post" action='{:U("SellerManage/configadd")}'>
  23. <div class="form-group required">
  24. <label class="col-sm-2 control-label">开启快递鸟:</label>
  25. <div class="col-sm-10">
  26. <label>
  27. <input type="radio" name="is_open" value="1" <?php if($is_open == 1){ ?> checked <?php } ?> />&nbsp;是
  28. </label>
  29. <label>
  30. <input type="radio" name="is_open" value="0" <?php if($is_open == 0){ ?> checked <?php } ?> />&nbsp;否
  31. </label>
  32. </div>
  33. </div>
  34. <div class="form-group required">
  35. <label class="col-sm-2 control-label">商户ID:</label>
  36. <div class="col-sm-10">
  37. <input class="form-control" type="text" placeholder="商户ID" name="ebuss_id" value="{$ebuss_id}" />
  38. </div>
  39. </div>
  40. <div class="form-group required">
  41. <label class="col-sm-2 control-label">API key:</label>
  42. <div class="col-sm-10">
  43. <input class="form-control" type="text" placeholder="API key" name="express_appkey" value="{$express_appkey}" />
  44. <span class="help-inline ">
  45. <span class="middle red">注册地址:<a href="http://www.kdniao.com/" target="_blank">http://www.kdniao.com/</a></span>
  46. </span>
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. <label class="col-sm-1 control-label no-padding-left"> </label>
  51. <div class="col-sm-11">
  52. <input name="send" type="submit" value="提交" class="btn btn-primary" />
  53. </div>
  54. </div>
  55. </form>
  56. </div>
  57. </div>
  58. </block>
  59. <block name="javascript">
  60. <script src="__PUBLIC__/fileupload/jquery.ui.widget.js"></script>
  61. <script src="__PUBLIC__/fileupload/jquery.fileupload.js"></script>
  62. <script>
  63. $(function(){
  64. $(document).delegate('a[data-toggle=\'image\']', 'click', function(e) {
  65. e.preventDefault();
  66. var index=$(this).attr('num');
  67. var element = this;
  68. if(index==undefined){
  69. $(element).popover({
  70. html: true,
  71. placement: 'right',
  72. trigger: 'manual',
  73. content: function() {
  74. return '<button type="button" id="thumb-image" class="btn btn-primary"><i class="icon-edit"></i></button> <button type="button" id="button-clear" class="btn btn-danger"><i class="icon-trash"></i></button>';
  75. }
  76. });
  77. }else{
  78. $(element).popover({
  79. html: true,
  80. placement: 'right',
  81. trigger: 'manual',
  82. content: function() {
  83. return '<button type="button" n="'+index+'" class="btn btn-primary button-image"><i class="icon-edit"></i></button> <button type="button" id="button-clear" class="btn btn-danger"><i class="icon-trash"></i></button>';
  84. }
  85. });
  86. }
  87. $(element).popover('toggle');
  88. $('#thumb-image').on('click', function() {
  89. $('#modal-image').remove();
  90. $('#form-upload').remove();
  91. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_image" type="file" name="file" /></form>');
  92. $('#form-upload input[name=\'file\']').trigger('click');
  93. $(element).popover('hide');
  94. $('[osctype="btn_upload_image"]').fileupload({
  95. dataType: 'json',
  96. url: "{:U('Image/upload_image',array('dir'=>'seller'))}",
  97. add: function(e, data) {
  98. $parent = $('#thumb');
  99. $input = $parent.find('[osctype="image_input"]');
  100. $img = $parent.find('[osctype="image"]');
  101. data.formData = {old_blog_images:$input.val()};
  102. $img.attr('src', "__IMG__/loading.gif");
  103. data.submit();
  104. },
  105. done: function (e,data) {
  106. var image=data.result;
  107. $parent = $('#thumb');
  108. $input = $parent.find('[osctype="image_input"]');
  109. $img = $parent.find('[osctype="image"]');
  110. if(image) {
  111. // $img.prev('i').hide();
  112. $img.attr('src', '__ROOT__'+image.image_thumb);
  113. $img.show();
  114. $input.val(image.image);
  115. } else {
  116. alert('上传失败');
  117. }
  118. }
  119. });
  120. });
  121. $('#button-clear').on('click', function() {
  122. $(element).find('img').attr('src', $(element).find('img').attr('data-placeholder'));
  123. $(element).parent().find('input').attr('value', '');
  124. $(element).popover('hide');
  125. });
  126. });
  127. })
  128. </script>
  129. </block>