color_edit.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {Template header}
  2. <body>
  3. <div class="warp">
  4. <ul class="setting">
  5. <li class="length"><em>文档:</em>
  6. <input value="{$color['wdurl']}" name="wdurl" type="hidden">
  7. <font class="scwd">点击上传文档</font>
  8. <font class="wdxz">
  9. {if $color['wdurl'] != ''}<a href="{$color['wdurl']}" style="color:#F33"><i class="fa fa-file-text"></i> 下载文档</a> <font class='delwd'>X</font>
  10. {/if}
  11. </font>
  12. </li>
  13. <li>
  14. <em>标题:</em>
  15. <input type="text" name="title" value="{$color['title']}" class='must' />
  16. </li>
  17. <li>
  18. <em>配图类型:</em>
  19. <select name="type" id="type" class="select class">
  20. <option value="0" {if $color['type'] == 0}selected="selected"{/if}>未选择</option>
  21. <option value="1" {if $color['type'] == 1}selected="selected"{/if}>编号款配图</option>
  22. <option value="2" {if $color['type'] == 2}selected="selected"{/if}>颜色配图</option>
  23. <option value="3" {if $color['type'] == 3}selected="selected"{/if}>曲度配图</option>
  24. <option value="5" {if $color['type'] == 5}selected="selected"{/if}>化纤编号款</option>
  25. <option value="6" {if $color['type'] == 6}selected="selected"{/if}>化纤颜色</option>
  26. <option value="4" {if $color['type'] == 4}selected="selected"{/if}>其他配图</option>
  27. </select>
  28. </li>
  29. <li>
  30. <em>色号:</em>
  31. <input type="text" name="color" value="{$color['color']}" />
  32. </li>
  33. <li>
  34. <em>曲度:</em>
  35. <input type="text" name="lowe" value="{$color['lowe']}"/>
  36. </li>
  37. <li>
  38. <em>开发人:</em>
  39. <input type="text" name="developer" value="{$color['developer']}" />
  40. </li>
  41. <li>
  42. <em>是否在售:</em>
  43. <select name="state" id="state" class="select class">
  44. <option value="0" {if $color['state'] == 0}selected="selected"{/if}>未选择</option>
  45. <option value="1" {if $color['state'] == 1}selected="selected"{/if}>在售款</option>
  46. <option value="2" {if $color['state'] == 2}selected="selected"{/if}>已停售</option>
  47. </select>
  48. </li>
  49. <li class="length scimg">
  50. <span class="upimg">{$color['img']}</span>
  51. <font>+</font>
  52. </li>
  53. <li class="length remark">
  54. <em>情况备注:</em>
  55. <textarea name="content" style="height:75px;">{$color['content']}</textarea>
  56. </li>
  57. <li class="length">
  58. <em>工艺流程:</em>
  59. <textarea name="craft_process" style="height:75px;">{$color['craft_process']}</textarea>
  60. </li>
  61. <div style="clear:both;"></div>
  62. </ul>
  63. <input type="hidden" name="id" value="{$color['id']}" />
  64. <div class="button"><font class="datasave">提 交</font> <font class="fh">关 闭</font></div>
  65. </div>
  66. <div style="display:none;">
  67. <input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">
  68. </div>
  69. <script>var addedit="/color/edit/";
  70. var scwd = "/fullorderexcel/scwd";
  71. $(document).ready(function() {
  72. var button = $(".scimg font"), interval;
  73. var fileType = "pic", fileNum = "one";
  74. new AjaxUpload(button, {
  75. action: "/img/",
  76. name: "userfile",
  77. onSubmit: function(file, ext) {
  78. if (fileType == "pic") {
  79. if (ext && /^(jpg|png|jpeg|gif)$/.test(ext)) {
  80. this.setData({
  81. info: "文件类型为图片"
  82. });
  83. }
  84. else if (ext && /^(3gp|rmvb|flv|wmv|avi|mkv|mp4|mp3|wav)$/.test(ext)) {
  85. this.setData({
  86. info: "文件类型为视频"
  87. });
  88. } else {
  89. alert("提示:您上传的是非图片或视频类型!");
  90. return false;
  91. }
  92. }
  93. $(".scimg font").hide();
  94. $(".loadimg").show();
  95. layx.load('loadId','上传中');
  96. if (fileNum == "one") {
  97. this.disable();
  98. }
  99. },
  100. onComplete: function(file, response) {
  101. eval("var obj=" + response);
  102. layx.destroy('loadId');
  103. if (obj.ok)
  104. {
  105. if (/^(.jpg|.png|.jpeg|.gif)$/.test(obj.lx))
  106. {
  107. $(".scimg .upimg").append('<span class="deldata"><a href="'+ obj.filename +'" target="_blank"><img src="{site_url("img/thumb")}?src='+ obj.filename +'&w=500&h=500"></a><em style="width:30px;height:30px;line-height:30px;text-align: center;display: inline-block;position: absolute;top: 0px;right: 20px;z-index: 10;background-color: #FFF;cursor: pointer;" title="点击删除">X</em></span>');
  108. }
  109. else if (/^(.3gp|.rmvb|.flv|.wmv|.avi|.mkv|.mp4|.mp3|.wav)$/.test(obj.lx))
  110. {
  111. $(".scimg .upimg").append('<span class="deldata"><video src="'+ obj.filename +'" controls="controls"></video><em style=”width:30px;height:30px;line-height:30px;text-align: center;display: inline-block;position: absolute;top: 0px;right: 20px;z-index: 10;background-color: #FFF;cursor: pointer;" title="点击删除">X</em></span>');
  112. }
  113. }
  114. else
  115. {
  116. $(".ts p").html(obj.msg);
  117. $(".ts").fadeIn();
  118. setTimeout('$(".ts").fadeOut()', 800);
  119. }
  120. $(".loadimg").hide();
  121. $(".scimg font").show();
  122. window.clearInterval(interval);
  123. this.enable();
  124. }
  125. });
  126. });
  127. $(document).on("click", ".scimg .upimg .deldata em", function() {
  128. $(this).parent(".deldata").remove();
  129. });
  130. $(document).on("click", ".scimg .upimg .deldata em", function() {
  131. $(this).parent(".deldata").remove();
  132. });
  133. </script>
  134. <script type="text/javascript" src="{$theme}js/ajaxupload.3.5.js"></script>
  135. {Template footer}