spec.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <div class='spec_item spec_class_{$cur_cate_id}' id='spec_{$spec['id']}' >
  2. <div style='border:1px solid #e7eaec;padding:10px;margin-bottom: 10px;' >
  3. <input name="spec_id[]" type="hidden" class="form-control spec_id" value="{$spec['id']}"/>
  4. <div class="form-group">
  5. <div class="col-sm-12">
  6. <div class='input-group'>
  7. <input name="spec_title[{$spec['id']}]" type="text" class="form-control spec_title" value="{$spec['title']}" placeholder="规格名称 (比如: 颜色)"/>
  8. <div class='input-group-btn'>
  9. <a href="javascript:;" id="add-specitem-{$spec['id']}" specid='{$spec['id']}' class='btn btn-info add-specitem' onclick="addSpecItem('{$spec['id']}')"><i class="fa fa-plus"></i> 添加规格项</a>
  10. <a href="javascript:void(0);" class='btn btn-danger' onclick="removeSpec('{$spec['id']}')"><i class="fa fa-remove"></i></a>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <div class="col-md-12">
  17. <div id='spec_item_{$spec['id']}' class='spec_item_items'>
  18. <?php foreach( $spec['items'] as $specitem ){ ?>
  19. <div class="spec_item_item" style="float:left;margin:5px;width:250px; position: relative">
  20. <input type="hidden" class="form-control spec_item_show" name="spec_item_show_{$spec['id']}[]" value="{$specitem['show']}" />
  21. <input type="hidden" class="form-control spec_item_id" name="spec_item_id_{$spec['id']}[]" value="{$specitem['id']}" />
  22. <div class="input-group">
  23. <span class="input-group-addon">
  24. <input type="checkbox" <?php if($specitem['id']>0){ ?>checked<?php } ?> value="1" onclick='showItem(this)'>
  25. </span>
  26. <input type="text" class="form-control spec_item_title" onblur="refreshOptions()" name="spec_item_title_{$spec['id']}[]" VALUE="{$specitem['title']}" />
  27. <span class="input-group-addon spec_item_thumb <?php if(!empty($specitem['thumb'])){ ?>has_thumb<?php } ?>">
  28. <input type='hidden' name="spec_item_thumb_{$spec['id']}[]" value="{$specitem['thumb']}"
  29. />
  30. <img onclick="selectSpecItemImage(this)" onerror="this.src='/static/images/nopic100.jpg'"
  31. src="<?php if(empty($specitem['thumb'])){ ?>/static/images/nopic100.jpg<?php }else{ ?>{:resize($specitem['thumb'],100)}<?php } ?>" style='width:100%;'
  32. <?php if(!empty($specitem['thumb'])){ ?>
  33. data-toggle='popover'
  34. data-html ='true'
  35. data-placement='top'
  36. data-trigger ='hover'
  37. data-content="<img src='{:tomedia($specitem['thumb'])}' style='width:100px;height:100px;' />"
  38. <?php } ?>
  39. >
  40. <i class="fa fa-times-circle" <?php if(empty($specitem['thumb'])){ ?>style="display:none"<?php } ?>></i>
  41. </span>
  42. <span class="input-group-addon">
  43. <a href="javascript:;" onclick="removeSpecItem(this)" title='删除'><i class="fa fa-times"></i></a>
  44. <a href="javascript:;" class="fa fa-arrows" title="拖动调整显示顺序" ></a>
  45. </span>
  46. </div>
  47. </div>
  48. <?php } ?>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>