plate_add.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-form-default">
  4. <form method="post" action="{if $Request.action eq 'plate_add'}{:url('Sellerplate/plate_add')}{else/}{:url('Sellerplate/plate_edit',['p_id'=>$Request.param.p_id])}{/if}" id="plate_form">
  5. <dl>
  6. <dt><i class="required">*</i>{$Think.lang.format_name}{$Think.lang.ds_colon}</dt>
  7. <dd>
  8. <input type="text" class="text w200" name="p_name" value="{$plate_info.storeplate_name}" id="p_name" />
  9. <p class="hint">{$Think.lang.format_name_description}</p>
  10. </dd>
  11. </dl>
  12. <dl>
  13. <dt><i class="required">*</i>{$Think.lang.layout_position}{$Think.lang.ds_colon}</dt>
  14. <dd id="gcategory">
  15. <ul class="dssc-form-radio-list">
  16. <li><label><input type="radio" name="p_position" id="p_position" value="1" class="radio" {if empty($plate_info) || $plate_info['storeplate_position'] == 1}checked="checked"{/if} />{$Think.lang.top}</label></li>
  17. <li><label><input type="radio" name="p_position" id="p_position" value="0" class="radio" {if !empty($plate_info) && $plate_info['storeplate_position'] == 0}checked="checked"{/if}/>{$Think.lang.bottom}</label></li>
  18. </ul>
  19. <p class="hint">{$Think.lang.insert_description}</p>
  20. </dd>
  21. </dl>
  22. <dl>
  23. <dt><i class="required">*</i>{$Think.lang.format_content}{$Think.lang.ds_colon}</dt>
  24. <dd>
  25. {:build_editor(['name'=>'p_content','content'=>htmlspecialchars_decode($plate_info.storeplate_content)])}
  26. <textarea id="p_content" name="p_content"></textarea>
  27. <p class="hr8">
  28. <a class="dssc-btn" dstype="show_desc" href="{:url('Selleralbum/pic_list',['item'=>'des'])}"><i class="iconfont">&#xe72a;</i>{$Think.lang.insert_photo_album}</a>
  29. <a href="javascript:void(0);" dstype="del_desc" class="dssc-btn ml5" style="display: none;"><i class=" iconfont">&#xe67a;</i>{$Think.lang.close_album}</a>
  30. </p>
  31. <p id="des_demo"></p>
  32. </dd>
  33. </dl>
  34. <div class="bottom">
  35. <input type="submit" class="submit" value="{$Think.lang.ds_submit}"/>
  36. </div>
  37. </form>
  38. </div>
  39. <script src="{$Think.PLUGINS_SITE_ROOT}/jquery.ajaxContent.pack.js"></script>
  40. <style type="text/css">
  41. .dssc-form-default dl dt { width: 16%;}
  42. .dssc-form-default dl dd { width: 82%;}
  43. </style>
  44. <script>
  45. $(function () {
  46. $('#plate_form').validate({
  47. submitHandler: function (form) {
  48. ds_ajaxpost('plate_form', 'url', "{:url('Sellerplate/index')}");
  49. },
  50. rules: {
  51. p_name: {
  52. required: true,
  53. maxlength: 10
  54. },
  55. p_content: {
  56. required: true
  57. }
  58. },
  59. messages: {
  60. p_name: {
  61. required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.fill_format_name}',
  62. maxlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.format_name_limit}'
  63. },
  64. p_content: {
  65. required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.fill_format_content}'
  66. }
  67. }
  68. });
  69. // 版式内容使用
  70. $('a[dstype="show_desc"]').ajaxContent({
  71. event: 'click', //mouseover
  72. loaderType: "img",
  73. loadingMsg: "{$Think.HOME_SITE_ROOT}/images/loading.gif",
  74. target: '#des_demo'
  75. }).click(function () {
  76. $(this).hide();
  77. $('a[dstype="del_desc"]').show();
  78. });
  79. $('a[dstype="del_desc"]').click(function () {
  80. $(this).hide();
  81. $('a[dstype="show_desc"]').show();
  82. $('#des_demo').html('');
  83. });
  84. });
  85. /* 插入编辑器 */
  86. function insert_editor(file_path) {
  87. ue.execCommand('insertimage', {src: file_path});
  88. }
  89. </script>
  90. </div>
  91. {/block}