add.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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">
  14. <form class="form-horizontal" id="validation-form" method="post" action='{:U("SellerManage/add")}'>
  15. <div class="form-group required">
  16. <label class="col-sm-2 control-label" for="input-image">
  17. <span title="" data-toggle="tooltip" data-original-title="上传800x800的图片">LOGO:</span>
  18. </label>
  19. <div class="col-sm-10" id="thumb">
  20. <a href="#" data-toggle="image" class="img-thumbnail">
  21. <img osctype="image" src="__ROOT__/Common/image/no_image_100x100.jpg" />
  22. </a>
  23. <input osctype="image_input" type="hidden" name="s_logo" value="" id="input-s_logo" />
  24. </div>
  25. </div>
  26. <div class="form-group required">
  27. <label class="col-sm-2 control-label">用户名:</label>
  28. <div class="col-sm-10">
  29. <input class="form-control" type="text" placeholder="用户名" name="s_uname" value="" />
  30. </div>
  31. </div>
  32. <div class="form-group required">
  33. <label class="col-sm-2 control-label">密码:</label>
  34. <div class="col-sm-10">
  35. <input class="form-control" type="text" placeholder="密码" name="s_passwd" value="888888" />
  36. </div>
  37. </div>
  38. <div class="form-group required">
  39. <label class="col-sm-2 control-label">店铺名称:</label>
  40. <div class="col-sm-10">
  41. <input class="form-control" type="text" placeholder="店铺名称" name="s_true_name" value="" />
  42. </div>
  43. </div>
  44. <div class="form-group required">
  45. <label class="col-sm-2 control-label">手机号码:</label>
  46. <div class="col-sm-10">
  47. <input class="form-control" type="text" placeholder="手机号码" name="s_telephone" value="" />
  48. </div>
  49. </div>
  50. <div class="form-group required">
  51. <label class="col-sm-2 control-label">客服电话:</label>
  52. <div class="col-sm-10">
  53. <input class="form-control" type="text" placeholder="客服电话" name="s_mobile" value="" />
  54. </div>
  55. </div>
  56. <div class="form-group required">
  57. <label class="col-sm-2 control-label">客服qq:</label>
  58. <div class="col-sm-6">
  59. <input class="form-control" type="text" placeholder="客服qq" name="s_qq" value="" />
  60. </div>
  61. <span class="help-inline col-sm-4">
  62. <span class="middle">请使用该QQ登录一次<a href="http://shang.qq.com" target="_blank">shang.qq.com</a></span>
  63. </span>
  64. </div>
  65. <div class="form-group required">
  66. <label class="col-sm-2 control-label">微信客服:</label>
  67. <div class="col-sm-10">
  68. <input class="form-control" type="text" placeholder="微信客服" name="s_weixin" value="" />
  69. </div>
  70. </div>
  71. <div class="form-group required">
  72. <label class="col-sm-2 control-label">支付宝:</label>
  73. <div class="col-sm-10">
  74. <input class="form-control" type="text" placeholder="支付宝" name="s_alipay" value="" />
  75. </div>
  76. </div>
  77. <div class="form-group required">
  78. <label class="col-sm-2 control-label">银行卡名称:</label>
  79. <div class="col-sm-10">
  80. <input class="form-control" type="text" placeholder="银行卡名称" name="s_cardname" value="" />
  81. </div>
  82. </div>
  83. <div class="form-group required">
  84. <label class="col-sm-2 control-label">银行卡账号:</label>
  85. <div class="col-sm-10">
  86. <input class="form-control" type="text" placeholder="银行卡账号" name="s_cardnumber" value="" />
  87. </div>
  88. </div>
  89. <div class="form-group required">
  90. <label class="col-sm-2 control-label">收款名称:</label>
  91. <div class="col-sm-10">
  92. <input class="form-control" type="text" placeholder="收款名称" name="s_cardrealname" value="" />
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <label class="col-sm-1 control-label no-padding-left"> </label>
  97. <div class="col-sm-11">
  98. <input name="send" type="submit" value="提交" class="btn btn-primary" />
  99. </div>
  100. </div>
  101. </form>
  102. </div>
  103. </div>
  104. </block>
  105. <block name="javascript">
  106. <script src="__PUBLIC__/fileupload/jquery.ui.widget.js"></script>
  107. <script src="__PUBLIC__/fileupload/jquery.fileupload.js"></script>
  108. <script>
  109. $(function(){
  110. $(document).delegate('a[data-toggle=\'image\']', 'click', function(e) {
  111. e.preventDefault();
  112. var index=$(this).attr('num');
  113. var element = this;
  114. if(index==undefined){
  115. $(element).popover({
  116. html: true,
  117. placement: 'right',
  118. trigger: 'manual',
  119. content: function() {
  120. 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>';
  121. }
  122. });
  123. }else{
  124. $(element).popover({
  125. html: true,
  126. placement: 'right',
  127. trigger: 'manual',
  128. content: function() {
  129. 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>';
  130. }
  131. });
  132. }
  133. $(element).popover('toggle');
  134. $('#thumb-image').on('click', function() {
  135. $('#modal-image').remove();
  136. $('#form-upload').remove();
  137. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_image" type="file" name="file" /></form>');
  138. $('#form-upload input[name=\'file\']').trigger('click');
  139. $(element).popover('hide');
  140. $('[osctype="btn_upload_image"]').fileupload({
  141. dataType: 'json',
  142. url: "{:U('Image/upload_image',array('dir'=>'seller'))}",
  143. add: function(e, data) {
  144. $parent = $('#thumb');
  145. $input = $parent.find('[osctype="image_input"]');
  146. $img = $parent.find('[osctype="image"]');
  147. data.formData = {old_blog_images:$input.val()};
  148. $img.attr('src', "__IMG__/loading.gif");
  149. data.submit();
  150. },
  151. done: function (e,data) {
  152. var image=data.result;
  153. $parent = $('#thumb');
  154. $input = $parent.find('[osctype="image_input"]');
  155. $img = $parent.find('[osctype="image"]');
  156. if(image) {
  157. // $img.prev('i').hide();
  158. $img.attr('src', '__ROOT__'+image.image_thumb);
  159. $img.show();
  160. $input.val(image.image);
  161. } else {
  162. alert('上传失败');
  163. }
  164. }
  165. });
  166. });
  167. $('#button-clear').on('click', function() {
  168. $(element).find('img').attr('src', $(element).find('img').attr('data-placeholder'));
  169. $(element).parent().find('input').attr('value', '');
  170. $(element).popover('hide');
  171. });
  172. });
  173. })
  174. </script>
  175. </block>