add.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <include file="public@header" />
  2. </head>
  3. <body>
  4. <div class="wrap">
  5. <ul class="nav nav-tabs">
  6. <li ><a href="{:url('Gift/index')}">礼物列表</a></li>
  7. <li class="active"><a >{:lang('ADD')}</a></li>
  8. </ul>
  9. <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Gift/addPost')}">
  10. <div class="form-group">
  11. <label for="input-type" class="col-sm-2 control-label"><span class="form-required">*</span>类型</label>
  12. <div class="col-md-6 col-sm-10" id="type">
  13. <volist name="type" id="v">
  14. <label class="radio-inline"><input type="radio" name="type" value="{$key}" <if condition="$i eq 1">checked</if>>{$v}</label>
  15. </volist>
  16. </div>
  17. </div>
  18. <div class="form-group">
  19. <label for="input-mark" class="col-sm-2 control-label"><span class="form-required">*</span>标识</label>
  20. <div class="col-md-6 col-sm-10" id="mark" style="position: relative;">
  21. <volist name="mark" id="v">
  22. <label class="radio-inline" for="mark_{$key}"><input type="radio" name="mark" value="{$key}" id="mark_{$key}" <if condition="$i eq 1">checked</if>>{$v}</label>
  23. </volist>
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. <label for="input-giftname" class="col-sm-2 control-label"><span class="form-required">*</span>名称</label>
  28. <div class="col-md-6 col-sm-10">
  29. <input type="text" class="form-control" id="input-giftname" name="giftname" style="width:300px;">
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label for="input-needcoin" class="col-sm-2 control-label"><span class="form-required">*</span>价格</label>
  34. <div class="col-md-6 col-sm-10">
  35. <input type="text" class="form-control" id="input-needcoin" name="needcoin" style="width:300px;">
  36. </div>
  37. </div>
  38. <div class="form-group">
  39. <label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>图片</label>
  40. <div class="col-md-6 col-sm-10">
  41. <input type="hidden" name="gifticon" id="thumbnail" value="">
  42. <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
  43. <img src="__TMPL__/public/assets/images/default-thumbnail.png"
  44. id="thumbnail-preview"
  45. style="cursor: pointer;max-width:100px;max-height:100px;"/>
  46. </a>
  47. <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
  48. <p class="help-block">建议尺寸: 50 X 50 太大会造成加载图片加载慢等各种问题</p>
  49. </div>
  50. </div>
  51. <div id="swf_area" style="display: none;">
  52. <div class="form-group">
  53. <label for="input-swftype" class="col-sm-2 control-label"><span class="form-required">*</span>动画类型</label>
  54. <div class="col-md-6 col-sm-10" id="swftype">
  55. <volist name="swftype" id="v">
  56. <label class="radio-inline"><input type="radio" name="swftype" value="{$key}" <if condition="$i eq 1">checked</if>>{$v}</label>
  57. </volist>
  58. </div>
  59. </div>
  60. <div class="form-group" id="">
  61. <label for="input-gif" class="col-sm-2 control-label">GIF图片</label>
  62. <div class="col-md-6 col-sm-10">
  63. <div id="swftype_bd_0">
  64. <input type="hidden" name="gif" id="thumbnail2" value="">
  65. <a href="javascript:uploadOneImage('图片上传','#thumbnail2');">
  66. <img src="__TMPL__/public/assets/images/default-thumbnail.png"
  67. id="thumbnail2-preview"
  68. style="cursor: pointer;max-width:100px;max-height:100px;"/>
  69. </a>
  70. <input type="button" class="btn btn-sm btn-cancel-thumbnail2" value="取消图片">
  71. <p class="help-block">建议尺寸: 200 X 200</p>
  72. </div>
  73. <div id="swftype_bd_1" style="display:none;">
  74. <input class="form-control" id="js-file-input" type="text" name="svga" value="" style="width: 300px;display: inline-block;" title="文件名称">
  75. <a href="javascript:uploadOne('文件上传','#js-file-input','file');">上传SVGA文件</a>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label for="input-swftime" class="col-sm-2 control-label">动画时长</label>
  81. <div class="col-md-6 col-sm-10">
  82. <input type="text" class="form-control" id="input-swftime" name="swftime" value="0" style="width:300px;">
  83. <p class="help-block">秒 精度:小数点后两位</p>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <div class="col-sm-offset-2 col-sm-10">
  89. <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
  90. <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
  91. </div>
  92. </div>
  93. </form>
  94. </div>
  95. <script src="__STATIC__/js/admin.js"></script>
  96. <script>
  97. (function(){
  98. $('.btn-cancel-thumbnail').click(function () {
  99. $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
  100. $('#thumbnail').val('');
  101. });
  102. $('.btn-cancel-thumbnail2').click(function () {
  103. $('#thumbnail2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
  104. $('#thumbnail2').val('');
  105. });
  106. $("#type label input").on('click',function(){
  107. var v=$(this).val();
  108. if(v==0){
  109. $("#mark_3").removeAttr('disabled')
  110. }else{
  111. //if($("#mark_3").attr("checked")){
  112. if($('#mark label input:checked').val()==3){
  113. //$("#mark_0").removeAttr('checked');
  114. $("#mark_0").attr('checked','checked');
  115. }
  116. $("#mark_3").attr('disabled','disabled');
  117. }
  118. if(v==1){
  119. $("#swf_area").show();
  120. }else{
  121. $("#swf_area").hide();
  122. }
  123. })
  124. $("#swftype label").on('click',function(){
  125. var v=$("input",this).val();
  126. var b=$("#swftype_bd_"+v);
  127. b.siblings().hide();
  128. b.show();
  129. })
  130. })()
  131. </script>
  132. </body>
  133. </html>