12a95d888f43d458ac24724bd90075cb.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?php if (!defined('THINK_PATH')) exit();?><style>
  2. .recharge_info{
  3. display: -webkit-box;
  4. display: -webkit-flex;
  5. display: -ms-flexbox;
  6. display: flex;
  7. justify-content: space-around;
  8. margin-bottom: 10px;
  9. }
  10. .recharge_info>div{
  11. -webkit-box-flex: 1;
  12. -webkit-flex: 1;
  13. -ms-flex: 1;
  14. flex: 1;
  15. border:1px solid #efefef;
  16. margin: 0 10px;
  17. padding:10px 22px;
  18. line-height: 25px;
  19. color: #333;
  20. }
  21. </style>
  22. <form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data">
  23. <input type="hidden" name="c" value="user" />
  24. <input type="hidden" name="a" value="recharge" />
  25. <input type='hidden' name='type' value="<?php echo ($type); ?>" id="leixing"/>
  26. <input type='hidden' name='id' value="<?php echo ($id); ?>" />
  27. <input type="hidden" name="final_type" value="<?php echo ($type); ?>" id="final_type">
  28. <div class="modal-dialog">
  29. <div class="modal-content">
  30. <div class="modal-header">
  31. <button data-dismiss="modal" class="close" type="button">×</button>
  32. <h4 class="modal-title">会员充值</h4>
  33. </div>
  34. <div class="modal-body">
  35. <div class="recharge_info">
  36. <div>
  37. <label class="pull-left" style="margin-right: 25px">粉丝</label>
  38. <div class="pull-left">
  39. <img class="radius50" src='<?php echo ($profile['avatar']); ?>' style='width:20px;height:20px;padding:1px;border:1px solid #ccc'/>
  40. <?php echo ($profile['username']); ?>
  41. </div>
  42. </div>
  43. <div>
  44. <label class="pull-left " style="margin-right: 25px">会员信息</label>
  45. <div class="pull-left">
  46. ID: <?php echo ($profile['id']); ?></br>
  47. 姓名: <?php echo ($profile['realname']); ?></br>
  48. 手机号: <?php echo ($profile['mobile']); ?>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="tabs-container">
  53. <div class="tabs">
  54. <ul class="nav nav-tabs">
  55. <li <?php if( $type=='score'){ ?>class="active"<?php } ?>><a data-toggle="tab" href="#tab-1" data-rechargetype="score" aria-expanded="true"> 充值积分</a></li>
  56. <li <?php if( $type=='account_money'){ ?>class="active"<?php } ?>><a data-toggle="tab" href="#tab-2" data-rechargetype="account_money" aria-expanded="false"> 充值余额</a></li>
  57. </ul>
  58. <div class="tab-content ">
  59. <div id="tab-1" class="tab-pane <?php if( $type=='score'){ ?>active<?php } ?>">
  60. <div class="form-group"></div>
  61. <div class="form-group">
  62. <label class="col-sm-2 control-label">当前积分</label>
  63. <div class="col-sm-9 col-xs-12">
  64. <div class="form-control-static"><?php echo ($profile['score']); ?></div>
  65. </div>
  66. </div>
  67. </div>
  68. <div id="tab-2" class="tab-pane <?php if( $type=='account_money'){ ?>active<?php } ?>">
  69. <div class="form-group"></div>
  70. <div class="form-group">
  71. <label class="col-sm-2 control-label">当前余额</label>
  72. <div class="col-sm-9 col-xs-12">
  73. <div class="form-control-static"><?php echo ($profile['account_money']); ?></div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <label class="col-sm-2 control-label">变化</label>
  82. <div class="col-sm-9 col-xs-12">
  83. <label class='radio-inline'>
  84. <input type='radio' name='changetype' value='0' checked /> 增加
  85. </label>
  86. <label class='radio-inline'>
  87. <input type='radio' name='changetype' value='1' /> 减少
  88. </label>
  89. <label class='radio-inline'>
  90. <input type='radio' name='changetype' value='2' /> 最终<span class='name'><?php if( $type=='score'){ ?>积分<?php }else{ ?>余额<?php } ?></span>
  91. </label>
  92. </div>
  93. </div>
  94. <div class="form-group">
  95. <label class="col-sm-2 control-label mustl">充值数目</label>
  96. <div class="col-sm-9 col-xs-12">
  97. <input type="text" name="num" class="form-control" value="" data-rule-number='true' data-rule-required='true' data-rule-min='0.01' />
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="col-sm-2 control-label">备注</label>
  102. <div class="col-sm-9 col-xs-12">
  103. <textarea name="remark" class="form-control richtext" cols="70"></textarea>
  104. </div>
  105. </div>
  106. </div> <div class="modal-footer">
  107. <button class="btn btn-info btn-submit" type="submit" id="recharge">确认充值<?php if( $type=='score'){ ?>积分<?php }else{ ?>余额<?php } ?></button>
  108. <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
  109. </div>
  110. </div>
  111. </div>
  112. </form>
  113. <script language='javascript'>
  114. $(function(){
  115. $('[data-toggle="tab"]').click(function(){
  116. var type =$(this).data('rechargetype');
  117. console.log(type);
  118. if(type=='score') {
  119. $('.name').html('积分');
  120. $(".btn-submit").text('确认充值积分');
  121. }else{
  122. $('.name').html('余额');
  123. $(".btn-submit").text('确认充值余额');
  124. }
  125. $("#leixing").val( type) ;
  126. });
  127. $("#recharge").click(function(){
  128. var myurl = $(this).attr('data-href');
  129. var s_data = $('#ajaxModal form').serialize();
  130. $.ajax({
  131. url:myurl,
  132. type:'post',
  133. dataType:'json',
  134. data:s_data,
  135. success:function(info){
  136. if(info.status == 0)
  137. {
  138. layer.msg(info.result.message,{icon: 1,time: 2000});
  139. }else if(info.status == 1){
  140. var go_url = location.href;
  141. if( info.result.hasOwnProperty("url") )
  142. {
  143. go_url = info.result.url;
  144. }
  145. layer.msg('操作成功',{time: 1000,
  146. end:function(){
  147. location.href = info.result.url;
  148. }
  149. });
  150. }
  151. }
  152. })
  153. return false;
  154. })
  155. })
  156. // $('.btn-submit').click(function() {
  157. // var d = {};
  158. // var t = $('form').serializeArray();
  159. // //t的值为[{name: "a1", value: "xx"},
  160. // //{name: "a2", value: "xx"}...]
  161. // $.each(t, function() {
  162. // d[this.name] = this.value;
  163. // });
  164. // alert(JSON.stringify(d));
  165. // });
  166. </script>