adjust.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form id="user_form" method="post">
  4. <div class="ds-default-table">
  5. <table>
  6. <tbody>
  7. <tr class="noborder">
  8. <td class="required w120">{$Think.lang.admin_storemoney_membername}</td>
  9. <td class="vatop rowform">
  10. <input type="hidden" name="store_id" id="store_id" value="{$store_info.store_id|default='0'}"/>
  11. <input id="seller_name" name="seller_name" value="{$store_info.seller_name|default=''}" class="input-txt" type="text" onchange="javascript:checkseller();">
  12. <span class="err"></span>
  13. <p class="notic"></p>
  14. </td>
  15. </tr>
  16. <tr class="noborder" id="tr_memberinfo">
  17. <td colspan="2" class="required" id="td_memberinfo">
  18. {notempty name="store_info"}
  19. {$store_info.seller_name}{$Think.lang.admin_storemoney_storemoney_info_1}{$store_info.store_avaliable_money}{$Think.lang.admin_storemoney_storemoney_info_2}{$store_info.store_freeze_money}
  20. {/notempty}
  21. </td>
  22. </tr>
  23. <tr>
  24. <td class="required w120">{$Think.lang.admin_storemoney_artificial_operatetype}</td>
  25. <td class="vatop rowform">
  26. <select id="operatetype" name="operatetype">
  27. <option value="1">{$Think.lang.admin_storemoney_artificial_operatetype_add}</option>
  28. <option value="2">{$Think.lang.admin_storemoney_artificial_operatetype_reduce}</option>
  29. <option value="3">{$Think.lang.admin_storemoney_artificial_operatetype_freeze}</option>
  30. <option value="4">{$Think.lang.admin_storemoney_artificial_operatetype_unfreeze}</option>
  31. </select>
  32. </td>
  33. </tr>
  34. <tr>
  35. <td class="required w120">{$Think.lang.admin_storemoney_price}</td>
  36. <td class="vatop rowform"><input type="text" class="form-control" name="amount" id="amount" value="" /></td>
  37. </tr>
  38. <tr>
  39. <td class="required w120">{$Think.lang.admin_storemoney_remark}</td>
  40. <td class="vatop rowform"><textarea name="lg_desc" ></textarea></td>
  41. </tr>
  42. </tbody>
  43. <tfoot>
  44. <tr class="tfoot">
  45. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  46. </tr>
  47. </tfoot>
  48. </table>
  49. </div>
  50. </form>
  51. </div>
  52. <script>
  53. function checkseller() {
  54. var membername = $.trim($("#seller_name").val());
  55. if (membername == '') {
  56. $("#store_id").val('0');
  57. layer.alert('{$Think.lang.admin_storemoney_artificial_membernamenull_error}');
  58. return false;
  59. }
  60. var url = ADMINSITEURL + '/Storemoney/checkseller.html';
  61. $.post(url, {'name': membername}, function(data) {
  62. if (data.id)
  63. {
  64. $("#tr_memberinfo").show();
  65. var msg = " " + data.name + "{$Think.lang.admin_storemoney_storemoney_info_1}" + data.store_avaliable_money + "{$Think.lang.admin_storemoney_storemoney_info_2}" + data.store_freeze_money;
  66. $("#seller_name").val(data.name);
  67. $("#store_id").val(data.id);
  68. $("#td_memberinfo").text(msg);
  69. }
  70. else
  71. {
  72. $("#seller_name").val('');
  73. $("#store_id").val('0');
  74. layer.alert("{$Think.lang.admin_storemoney_userrecord_error}");
  75. }
  76. }, 'json');
  77. }
  78. </script>
  79. <script type="text/javascript">
  80. $(function(){
  81. $('#user_form').validate({
  82. errorPlacement: function(error, element) {
  83. error.appendTo(element.parent().parent().find('td:last'));
  84. },
  85. rules: {
  86. amount :{
  87. required: true,
  88. digits:true,
  89. min:0,
  90. },
  91. store_id:{
  92. required: true,
  93. }
  94. },
  95. messages: {
  96. amount :{
  97. required: '{$Think.lang.admin_storemoney_artificial_pricenull_error}',
  98. digits: '{$Think.lang.admin_storemoney_artificial_pricedigits_error}',
  99. min: '{$Think.lang.admin_storemoney_artificial_pricemin_error}'
  100. },
  101. }
  102. });
  103. });
  104. </script>
  105. </body>