modifylevel.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <form action="<?php if( empty($level['id'])){ ?>{:U('communityhead/addlevel')}<?php }else{ ?>{:U('communityhead/editlevel')}<?php } ?>" method="post" class="form-horizontal form-validate" enctype="multipart/form-data">
  2. <input type="hidden" name="id" value="{$level['id']}" />
  3. <div class="modal-dialog">
  4. <div class="modal-content">
  5. <div class="modal-header">
  6. <button data-dismiss="modal" class="close" type="button">×</button>
  7. <h4 class="modal-title"><?php if( !empty($level['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>团长等级</h4>
  8. </div>
  9. <div class="modal-body">
  10. <?php if( $has_notice == 0){ ?>
  11. <div class="form-group">
  12. <label class="col-sm-9 control-label " style="color:red;">此操作将启用等级全局提成,原商品比例失效,可到商品编辑“等级/分销”单独设置</label>
  13. </div>
  14. <?php } ?>
  15. <div class="form-group">
  16. <label class="col-sm-2 control-label must">等级名称</label>
  17. <div class="col-sm-9 col-xs-12">
  18. <input type="text" name="levelname" class="form-control" value="{$level['levelname']}" data-rule-required='true'/>
  19. </div>
  20. </div>
  21. <?php if(!empty($community_money_type) && $community_money_type ==1){ ?>
  22. <div class="form-group">
  23. <label class="col-sm-2 control-label">团长提成金额</label>
  24. <div class="col-sm-9 col-xs-12">
  25. <div class='input-group'>
  26. <input type="text" name="commission" class="form-control" value="{$level['commission']}" />
  27. <div class='input-group-addon'>元</div>
  28. </div>
  29. </div>
  30. </div>
  31. <?php }else{ ?>
  32. <div class="form-group">
  33. <label class="col-sm-2 control-label">团长提成比例</label>
  34. <div class="col-sm-9 col-xs-12">
  35. <div class='input-group'>
  36. <input type="text" name="commission" class="form-control" value="{$level['commission']}" />
  37. <div class='input-group-addon'>%</div>
  38. </div>
  39. <div class="help-block">
  40. 提成 = 订单有效金额 * 设置比例
  41. </div>
  42. </div>
  43. </div>
  44. <?php } ?>
  45. <?php if( $level['id']!='default'){ ?>
  46. <div class="form-group">
  47. <label class="col-sm-2 control-label">团长自动升级</label>
  48. <div class="col-sm-9 col-xs-12">
  49. <label class='radio-inline'>
  50. <input type='radio' name='auto_upgrade' value='0' <?php if( empty($level) || $level['auto_upgrade'] ==0 ){ ?>checked <?php } ?> title="关闭" />关闭
  51. </label>
  52. <label class='radio-inline'>
  53. <input type='radio' name='auto_upgrade' value='1' <?php if( !empty($level) && $level['auto_upgrade'] ==1 ){ ?>checked <?php } ?> title="开启" /> 开启
  54. </label>
  55. </div>
  56. </div>
  57. <div class="form-group" id="auto_condition" <?php if( empty($level) || $level['auto_upgrade'] ==0 ){ ?> style="display:none;" <?php } ?>>
  58. <label class="col-sm-2 control-label">自动升级条件</label>
  59. <div class="col-sm-9 col-xs-12">
  60. <label class='radio-inline'>
  61. <input type='radio' name='condition_type' value='0' <?php if( empty($level) || $level['condition_type'] ==0 ){ ?>checked <?php } ?> title="" /> 订单总金额
  62. </label>
  63. <label class='radio-inline'>
  64. <input type='radio' name='condition_type' value='1' <?php if( !empty($level) && $level['condition_type'] ==1 ){ ?>checked <?php } ?> title="" /> 累计社区用户
  65. </label>
  66. </div>
  67. </div>
  68. <div class="form-group" id="condition_one" <?php if( (!empty($level) && $level['auto_upgrade'] ==1) && (empty($level) || $level['condition_type'] ==0) ){ ?> style="display:block;"<?php }else{ ?> style="display:none;"<?php } ?> >
  69. <label class="col-sm-2 control-label">订单总金额</label>
  70. <div class="col-sm-9 col-xs-12">
  71. <div class='input-group'>
  72. <input type="text" name="condition_one" class="form-control" value="{$level['condition_one']}" />
  73. <div class='input-group-addon'>元</div>
  74. </div>
  75. <div class="help-block">累计社区用户完成订单总金额</div>
  76. </div>
  77. </div>
  78. <div class="form-group" id="condition_two" <?php if( (!empty($level) && $level['auto_upgrade'] ==1) && (!empty($level) && $level['condition_type'] ==1) ){ ?> style="display:block;"<?php }else{ ?> style="display:none;"<?php } ?> >
  79. <label class="col-sm-2 control-label">累计社区用户</label>
  80. <div class="col-sm-9 col-xs-12">
  81. <div class='input-group'>
  82. <input type="text" name="condition_two" class="form-control" value="{$level['condition_two']}" />
  83. <div class='input-group-addon'>人</div>
  84. </div>
  85. <div class="help-block">累计社区用户数量</div>
  86. </div>
  87. </div>
  88. <div class="form-group" id="condition_order_total" <?php if( (!empty($level) && $level['auto_upgrade'] ==1) && (!empty($level) && $level['condition_type'] ==2) ){ ?> style="display:block;"<?php }else{ ?> style="display:none;"<?php } ?> >
  89. <label class="col-sm-2 control-label">累计满*单</label>
  90. <div class="col-sm-9 col-xs-12">
  91. <div class='input-group'>
  92. <input type="text" name="condition_order_total" class="form-control" value="{$level['condition_order_total']}" />
  93. <div class='input-group-addon'>单</div>
  94. </div>
  95. <div class="help-block">累计满*单</div>
  96. </div>
  97. </div>
  98. <?php } ?>
  99. </div>
  100. <?php if( empty($level['id'])){ ?>
  101. <div class="form-group">
  102. <label class="col-sm-9 control-label " style="color:red;">新增等级可能会对已设置的商品独立团长提成比例产生影响,确认提交?</label>
  103. </div>
  104. <?php } ?>
  105. <div class="modal-footer">
  106. <button class="btn btn-primary" type="submit">提交</button>
  107. <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
  108. </div>
  109. </div>
  110. </form>
  111. <script>
  112. $(function(){
  113. $('input[name=auto_upgrade]').click(function(){
  114. var s_val = $(this).val();
  115. if(s_val == 0)
  116. {
  117. $('#auto_condition').hide();
  118. $('#condition_one').hide();
  119. $('#condition_two').hide();
  120. $('#condition_order_total').hide();
  121. }else{
  122. $('#auto_condition').show();
  123. var sc_val = $('input[name=condition_type]:checked').val();
  124. if(sc_val == 0)
  125. {
  126. $('#condition_one').show();
  127. $('#condition_two').hide();
  128. $('#condition_order_total').hide();
  129. }else if(sc_val == 1){
  130. $('#condition_one').hide();
  131. $('#condition_two').show();
  132. $('#condition_order_total').hide();
  133. }else if(sc_val == 2){
  134. $('#condition_one').hide();
  135. $('#condition_two').hide();
  136. $('#condition_order_total').show();
  137. }
  138. }
  139. })
  140. $('input[name=condition_type]').click(function(){
  141. var s_val = $(this).val();
  142. if(s_val == 0)
  143. {
  144. $('#condition_one').show();
  145. $('#condition_two').hide();
  146. $('#condition_order_total').hide();
  147. }else if(s_val == 1){
  148. $('#condition_one').hide();
  149. $('#condition_two').show();
  150. $('#condition_order_total').hide();
  151. }else if(s_val == 2){
  152. $('#condition_one').hide();
  153. $('#condition_two').hide();
  154. $('#condition_order_total').show();
  155. }
  156. })
  157. })
  158. </script>