xianshi_add.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-form-default">
  4. {empty name="xianshi_info"}
  5. <form id="add_form" action="{:url('Sellerpromotionxianshi/xianshi_save')}" method="post">
  6. {else /}
  7. <form id="add_form" action="{:url('Sellerpromotionxianshi/xianshi_edit_save')}" method="post">
  8. <input type="hidden" name="xianshi_id" value="{$xianshi_info.xianshi_id}">
  9. {/empty}
  10. <dl>
  11. <dt><i class="required">*</i>{$Think.lang.xianshi_name}{$Think.lang.ds_colon}
  12. </dt>
  13. <dd>
  14. <input id="xianshi_name" name="xianshi_name" type="text" maxlength="25" class="text w400"
  15. value="{present name='xianshi_info'}{$xianshi_info.xianshi_name}{/present}"/>
  16. <span></span>
  17. <p class="hint">{$Think.lang.xianshi_name_explain}</p>
  18. </dd>
  19. </dl>
  20. <dl>
  21. <dt><i class="required">*</i>{$Think.lang.activity_title}{$Think.lang.ds_colon}</dt>
  22. <dd>
  23. <input id="xianshi_title" name="xianshi_title" type="text" maxlength="10" class="text w200"
  24. value="{present name='xianshi_info'}{$xianshi_info.xianshi_title}{/present}"/>
  25. <span></span>
  26. <p class="hint">{$Think.lang.xianshi_title_explain|raw}</p>
  27. </dd>
  28. </dl>
  29. <dl>
  30. <dt>{$Think.lang.activity_description}{$Think.lang.ds_colon}</dt>
  31. <dd>
  32. <input id="xianshi_explain" name="xianshi_explain" type="text" maxlength="30"
  33. class="text w400"
  34. value="{present name='xianshi_info'}{$xianshi_info.xianshi_explain}{/present}"/>
  35. <span></span>
  36. <p class="hint">{$Think.lang.xianshi_explain_explain|raw}</p>
  37. </dd>
  38. </dl>
  39. {empty name="xianshi_info"}
  40. <dl>
  41. <dt><i class="required">*</i>{$Think.lang.start_time}{$Think.lang.ds_colon}
  42. </dt>
  43. <dd>
  44. <input id="start_time" name="start_time" type="text" class="text w130"/><em
  45. class="add-on"><i class="iconfont">&#xe8d6;</i></em><span></span>
  46. <p class="hint">
  47. {notpresent name="isPlatformStore"}{if $current_xianshi_quota.xianshiquota_starttime > 1}
  48. {$Think.lang.xianshi_add_start_time_explain}{$current_xianshi_quota.xianshiquota_starttime|date="Y-m-d H:i:s"}
  49. {/if}{/notpresent}
  50. </p>
  51. </dd>
  52. </dl>
  53. <dl>
  54. <dt><i class="required">*</i>{$Think.lang.end_time}{$Think.lang.ds_colon}</dt>
  55. <dd>
  56. <input id="end_time" name="end_time" type="text" class="text w130"/><em class="add-on"><i
  57. class="iconfont">&#xe8d6;</i></em><span></span>
  58. <p class="hint">
  59. {notpresent name="isPlatformStore"}
  60. {$Think.lang.xianshi_add_end_time_explain}{$current_xianshi_quota.xianshiquota_endtime|date="Y-m-d H:i:s"}
  61. {/notpresent}
  62. </p>
  63. </dd>
  64. </dl>
  65. {/empty}
  66. <dl>
  67. <dt><i class="required">*</i>{$Think.lang.buy_lower_limit}{$Think.lang.ds_colon}</dt>
  68. <dd>
  69. <input id="lower_limit" name="lower_limit" type="text" class="text w130"
  70. value="{empty name='xianshi_info'}1{else}{$xianshi_info.xianshi_lower_limit}{/empty}"/><span></span>
  71. <p class="hint">{$Think.lang.minimum_purchase_quantity}</p>
  72. </dd>
  73. </dl>
  74. <div class="bottom">
  75. <input id="submit_button" type="submit" class="submit" value="{$Think.lang.ds_submit}">
  76. </div>
  77. </form>
  78. </div>
  79. <link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.css">
  80. <script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.js"></script>
  81. <script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/i18n/jquery-ui-timepicker-zh-CN.js"></script>
  82. <script>
  83. $(function () {
  84. {empty name = "xianshi_info"}
  85. $('#start_time').datetimepicker({dateFormat: 'yy-mm-dd'});
  86. $('#end_time').datetimepicker({dateFormat: 'yy-mm-dd'});
  87. {/empty}
  88. jQuery.validator.methods.greaterThanDate = function (value, element, param) {
  89. var date1 = new Date(Date.parse(param.replace(/-/g, "/")));
  90. var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
  91. return date1 < date2;
  92. };
  93. jQuery.validator.methods.lessThanDate = function (value, element, param) {
  94. var date1 = new Date(Date.parse(param.replace(/-/g, "/")));
  95. var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
  96. return date1 > date2;
  97. };
  98. jQuery.validator.methods.greaterThanStartDate = function (value, element) {
  99. var start_date = $("#start_time").val();
  100. var date1 = new Date(Date.parse(start_date.replace(/-/g, "/")));
  101. var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
  102. return date1 < date2;
  103. };
  104. //页面输入内容验证
  105. $("#add_form").validate({
  106. errorPlacement: function (error, element) {
  107. var error_td = element.parent('dd').children('span');
  108. error_td.append(error);
  109. },
  110. onfocusout: false,
  111. submitHandler: function (form) {
  112. ds_ajaxpost('add_form', 'url', "{:url('Sellerpromotionxianshi/index')}",1000);
  113. },
  114. rules: {
  115. xianshi_name: {
  116. required: true
  117. },
  118. xianshi_title: {
  119. required: true
  120. },
  121. start_time: {
  122. required: true,
  123. greaterThanDate: "{:date('Y-m-d H:i',@$current_xianshi_quota['xianshiquota_starttime'])}"
  124. },
  125. end_time: {
  126. required: true,
  127. {if !$isPlatformStore}
  128. lessThanDate : "{present name='current_xianshi_quota.xianshiquota_starttime'}{$current_xianshi_quota.xianshiquota_endtime|date='Y-m-d H:i'}{/present}",
  129. {/if}
  130. greaterThanStartDate : true
  131. },
  132. lower_limit: {
  133. required: true,
  134. digits:true,
  135. min:1
  136. }
  137. },
  138. messages : {
  139. xianshi_name : {
  140. required : '<i class="iconfont">&#xe64c;</i>{$Think.lang.xianshi_name_error}'
  141. },
  142. xianshi_title : {
  143. required : '<i class="iconfont">&#xe64c;</i>{$Think.lang.xianshi_title_error}'
  144. },
  145. start_time : {
  146. required : '<i class="iconfont">&#xe64c;</i>' +
  147. '<?php echo sprintf(lang('xianshi_add_start_time_explain'),@date('Y-m-d H:i',$current_xianshi_quota['xianshiquota_starttime']));?>',
  148. greaterThanDate : '<i class="iconfont">&#xe64c;</i>' +
  149. '<?php echo sprintf(lang('xianshi_add_start_time_explain'),@date('Y-m-d H:i',$current_xianshi_quota['xianshiquota_starttime']));?>'
  150. },
  151. end_time : {
  152. required : '<i class="iconfont">&#xe64c;</i>' +
  153. '<?php echo sprintf(lang('xianshi_add_end_time_explain'),@date('Y-m-d H:i',$current_xianshi_quota['xianshiquota_endtime']));?>',
  154. {if !$isPlatformStore}
  155. lessThanDate : '<i class="iconfont">&#xe64c;</i>' +
  156. '<?php echo sprintf(lang('xianshi_add_end_time_explain'),@date('Y-m-d H:i',$current_xianshi_quota['xianshiquota_endtime']));?>',
  157. {/if}
  158. greaterThanStartDate : '<i class="iconfont">&#xe64c;</i>{$Think.lang.greater_than_start_time}'
  159. },
  160. lower_limit: {
  161. required : '<i class="iconfont">&#xe64c;</i>{$Think.lang.purchase_limits_cannot_empty}',
  162. digits: '<i class="iconfont">&#xe64c;</i>{$Think.lang.minimum_purchase_must_figure}',
  163. min: '<i class="iconfont">&#xe64c;</i>{$Think.lang.buy_lower_limit_minimum}'
  164. }
  165. }
  166. });
  167. });
  168. </script>
  169. {/block}