privilege.blade.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <link href="{{static_url('yunshop/goods/goods.css')}}" media="all" rel="stylesheet" type="text/css"/>
  2. <div class="form-group">
  3. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员等级浏览权限</label>
  4. <div class="col-sm-9 col-xs-12 chks">
  5. <label class="checkbox-inline">
  6. <input type="checkbox" class='chkall' name="widgets[privilege][show_levels]" value="" @if ( $privilege['show_levels']==='') checked="true" @endif /> 全部会员等级
  7. </label>
  8. <label class="checkbox-inline">
  9. <input type="checkbox" class='chksingle' name="widgets[privilege][show_levels][]" value="0" @if ( $privilege['show_levels'] !== '' && is_array($privilege['show_levels']) && in_array('0', $privilege['show_levels'])) checked="true" @endif /> 普通等级
  10. </label>
  11. @foreach ( $levels as $level)
  12. <label class="checkbox-inline">
  13. <input type="checkbox" class='chksingle' name="widgets[privilege][show_levels][]" value="{{ $level['id'] }}" @if ( $privilege['show_levels'] !== '' && is_array($privilege['show_levels']) && in_array($level['id'], $privilege['show_levels'])) checked="true" @endif /> {{ $level['level_name'] }}
  14. </label>
  15. @endforeach
  16. </div>
  17. </div>
  18. <div class="form-group">
  19. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员等级购买权限</label>
  20. <div class="col-sm-9 col-xs-12 chks" >
  21. <label class="checkbox-inline">
  22. <input type="checkbox" class='chkall' name="widgets[privilege][buy_levels]" value="" @if ( $privilege['buy_levels'] === '' ) checked="true" @endif /> 全部会员等级
  23. </label>
  24. <label class="checkbox-inline">
  25. <input type="checkbox" class='chksingle' name="widgets[privilege][buy_levels][]" value="0" @if ( $privilege['buy_levels'] !== '' && is_array($privilege['buy_levels']) && in_array('0', $privilege['buy_levels'])) checked="true" @endif /> 普通等级
  26. </label>
  27. @foreach ($levels as $level)
  28. <label class="checkbox-inline">
  29. <input type="checkbox" class='chksingle' name="widgets[privilege][buy_levels][]" value="{{ $level['id'] }}" @if ( $privilege['buy_levels'] !== '' && is_array($privilege['buy_levels']) && in_array($level['id'], $privilege['buy_levels']) ) checked="true" @endif /> {{ $level['level_name'] }}
  30. </label>
  31. @endforeach
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员组浏览权限</label>
  36. <div class="col-sm-9 col-xs-12 chks" >
  37. <label class="checkbox-inline">
  38. <input type="checkbox" class='chkall' name="widgets[privilege][show_groups]" value="" @if ( $privilege['show_groups'] === '' )checked="true" @endif /> 全部会员组
  39. </label>
  40. <label class="checkbox-inline">
  41. <input type="checkbox" class='chksingle' name="widgets[privilege][show_groups][]" value="0" @if ( $privilege['show_groups'] !== '' && is_array($privilege['show_groups']) && in_array('0', $privilege['show_groups'])) checked="true" @endif /> 无分组
  42. </label>
  43. @foreach ($groups as $group)
  44. <label class="checkbox-inline">
  45. <input type="checkbox" class='chksingle' name="widgets[privilege][show_groups][]" value="{{ $group['id'] }}" @if ( $privilege['show_groups'] !== '' && in_array($group['id'], $privilege['show_groups']) && is_array($privilege['show_groups'])) checked="true" @endif /> {{ $group['group_name'] }}
  46. </label>
  47. @endforeach
  48. </div>
  49. </div>
  50. <div class="form-group">
  51. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员组购买权限</label>
  52. <div class="col-sm-9 col-xs-12 chks" >
  53. <label class="checkbox-inline">
  54. <input type="checkbox" class='chkall' name="widgets[privilege][buy_groups]" value="" @if ( $privilege['buy_groups' ] === '' )checked="true" @endif /> 全部会员组
  55. </label>
  56. <label class="checkbox-inline">
  57. <input type="checkbox" class='chksingle' name="widgets[privilege][buy_groups][]" value="0" @if ( $privilege['buy_groups'] !== '' && is_array($privilege['buy_groups']) && in_array('0', $privilege['buy_groups'])) checked="true" @endif /> 无分组
  58. </label>
  59. @foreach ($groups as $group)
  60. <label class="checkbox-inline">
  61. <input type="checkbox" class='chksingle' name="widgets[privilege][buy_groups][]" value="{{ $group['id'] }}" @if ( $privilege['buy_groups'] !== '' && is_array($privilege['buy_groups']) && in_array($group['id'], $privilege['buy_groups']) ) checked="true" @endif /> {{ $group['group_name'] }}
  62. </label>
  63. @endforeach
  64. </div>
  65. </div>
  66. <div class="form-group">
  67. <label class="col-xs-12 col-sm-3 col-md-2 control-label">每次限购数量</label>
  68. <div class="col-sm-9 col-md-2 col-xs-12">
  69. <input type="text" name="widgets[privilege][once_buy_limit]" id="widgets[privilege][once_buy_limit]" class="form-control" value="{{ $privilege['once_buy_limit'] }}" />
  70. <span class='help-block'>每次下单限购数量</span>
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员限购总数</label>
  75. <div class="col-sm-9 col-md-2 col-xs-12">
  76. <input type="text" name="widgets[privilege][total_buy_limit]" id="widgets[privilege][total_buy_limit]" class="form-control" value="{{ $privilege['total_buy_limit'] }}" />
  77. <span class='help-block'>会员限购的总数</span>
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员每天限购数量</label>
  82. <div class="col-sm-9 col-md-2 col-xs-12">
  83. <input type="text" name="widgets[privilege][day_buy_limit]" id="widgets[privilege][day_buy_limit]" class="form-control" value="{{ $privilege['day_buy_limit'] }}" />
  84. <span class='help-block'>会员每天限购数量</span>
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员每周限购数量</label>
  89. <div class="col-sm-9 col-md-2 col-xs-12">
  90. <input type="text" name="widgets[privilege][week_buy_limit]" id="widgets[privilege][week_buy_limit]" class="form-control" value="{{ $privilege['week_buy_limit'] }}" />
  91. <span class='help-block'>会员每周限购数量</span>
  92. </div>
  93. </div>
  94. <div class="form-group">
  95. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员每月限购数量</label>
  96. <div class="col-sm-9 col-md-2 col-xs-12">
  97. <input type="text" name="widgets[privilege][month_buy_limit]" id="widgets[privilege][month_buy_limit]" class="form-control" value="{{ $privilege['month_buy_limit'] }}" />
  98. <span class='help-block'>会员每月限购数量</span>
  99. </div>
  100. </div>
  101. <div class="form-group">
  102. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员起购数量</label>
  103. <div class="col-sm-9 col-md-2 col-xs-12">
  104. <input type="text" name="widgets[privilege][min_buy_limit]" id="widgets[privilege][min_buy_limit]" class="form-control" value="{{ $privilege['min_buy_limit'] }}" />
  105. <span class='help-block'>会员单次最少购买数量,为空、0不限制</span>
  106. </div>
  107. </div>
  108. {{--
  109. <div class="form-group">
  110. <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启限时限购</label>
  111. <div class="col-sm-6 col-xs-6">
  112. <div class='input-group'>
  113. <label class="radio-inline">
  114. <input type="radio" name="widgets[privilege][enable_time_limit]" value="1" @if ( $privilege['enable_time_limit'] == 1) checked="true" @endif /> 开启
  115. </label>
  116. <label class="radio-inline">
  117. <input type="radio" name="widgets[privilege][enable_time_limit]" value="0" @if ( empty($privilege) || $privilege['enable_time_limit'] == 0) checked="true" @endif /> 关闭
  118. </label>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="form-group" id="time_limit" style="display: none;">
  123. <label class="col-xs-12 col-sm-3 col-md-2 control-label">限购时间</label>
  124. <div class="col-sm-4 col-xs-6">
  125. {!! \app\backend\modules\goods\services\GoodsPrivilegeService::tpl_form_field_date('widgets[privilege][time_begin_limit]', !empty($privilege['time_begin_limit']) ? date('Y-m-d H:i',$privilege['time_begin_limit']) : date('Y-m-d H:i'), 1) !!}
  126. </div>
  127. <div class="col-sm-4 col-xs-6">
  128. {!! \app\backend\modules\goods\services\GoodsPrivilegeService::tpl_form_field_date('widgets[privilege][time_end_limit]', !empty($privilege['time_end_limit']) ? date('Y-m-d H:i',$privilege['time_end_limit']) : date('Y-m-d H:i'), 1) !!}
  129. </div>
  130. </div>
  131. --}}
  132. {{--<script language='javascript'>
  133. if ($('input:radio[name="widgets[privilege][enable_time_limit]"]:checked').val() == 1) {
  134. $('#time_limit').show();
  135. };
  136. $('input[name="widgets[privilege][enable_time_limit]').click(function(){
  137. var discounttype = $('input:radio[name="widgets[privilege][enable_time_limit]"]:checked').val();
  138. if(discounttype == 1){
  139. $('#time_limit').show();
  140. }else{
  141. $('#time_limit').hide();
  142. }
  143. });
  144. </script>--}}