exchange.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-vr-order-exchange">
  4. <dl>
  5. <dt><h3>{$Think.lang.e_exchange_code}</h3></dt>
  6. <dd>
  7. <input class="vr-code" name="vr_code" type="text" id="vr_code" placeholder="{$Think.lang.enter_e_exchange_code}" maxlength="18" />
  8. <label class="error" id="vr_code_waring" for="vr_code" style="display: inline;"></label>
  9. <span></span>
  10. <div class="dssc-keyboard">
  11. <button onclick="demo(this,1)">1</button>
  12. <button onclick="demo(this,1)">2</button>
  13. <button onclick="demo(this,1)">3</button>
  14. <button onclick="demo(this, 1)">4</button>
  15. <button onclick="demo(this, 1)">5</button>
  16. <button onclick="demo(this, 1)">6</button>
  17. <button onclick="demo(this, 1)">7</button>
  18. <button onclick="demo(this, 1)">8</button>
  19. <button onclick="demo(this, 1)">9</button>
  20. <button onclick="demo(this, 1)">0</button>
  21. <button class="cn" onclick="demo(this, 2)">{$Think.lang.store_order_clear}</button>
  22. <button class="cn" onclick="demo(this, 3)">{$Think.lang.store_order_back}</button>
  23. <label class="enter-border">
  24. <input type="button" id="_submit" class="enter" value="{$Think.lang.submit_validation}">
  25. </label>
  26. </div><p class="hint">{$Think.lang.exchange_codes_offset_consumption}</p>
  27. </dd>
  28. </dl>
  29. <div class="bottom">
  30. </div>
  31. </div>
  32. <table class="dssc-default-table order">
  33. <thead>
  34. <tr>
  35. <th class="w10"></th>
  36. <th colspan="20" class="tl"></th>
  37. </tr>
  38. <tr>
  39. <th class="w10"></th>
  40. <th class="w150">{$Think.lang.conversion_code}</th>
  41. <th colspan="2">{$Think.lang.store_order_goods_detail}</th>
  42. <th>{$Think.lang.store_order_sn}</th>
  43. <th>{$Think.lang.order_message}</th>
  44. </tr>
  45. </thead>
  46. <tbody id="order_panel"></tbody>
  47. </table>
  48. <script>
  49. function demo(obj,tip){
  50. if(tip==1){
  51. var con=document.getElementById('vr_code').value;
  52. document.getElementById('vr_code').value=con+obj.innerHTML;
  53. }else if(tip==2){
  54. document.getElementById('vr_code').value="";
  55. }else if(tip==3){
  56. var con=document.getElementById('vr_code').value;
  57. document.getElementById('vr_code').value=con.slice(0,-1);
  58. }
  59. }
  60. </script>
  61. <script>
  62. $(document).ready(function(){
  63. Tpl = "<tr id=\"PEND_ID\"><td class=\"bdl\"></td>\n";
  64. Tpl += "<td>DS_CODE</td>\n";
  65. Tpl += "<td class=\"w70\"><div class=\"dssc-goods-thumb\"><a target=\"_blank\" href=\"DS_GOODS_URL\"><img src=\"DS_IMG60\"></a></div></td>\n";
  66. Tpl += "<td class=\"tl\"><a href=\"DS_GOODS_URL\" target=\"_blank\">DS_GOODS_NAME</a></td>\n";
  67. Tpl += "<td><a target=\"_blank\" href=\"DS_ORDER_URL\">DS_ORDER_SN</a></td>\n";
  68. Tpl += "<td class=\"bdr\">DS_ORDER_MSG</td></tr>\n";
  69. function exPost() {
  70. $('#vr_code_waring').html('');
  71. $.getJSON(HOMESITEURL+'/Sellervrorder/exchange.html?submit_exchange=ok&vr_code='+$("#vr_code").val(),null, function(data){
  72. if (data == null) return false;
  73. if (data.error) {
  74. $('#vr_code_waring').show().html(data.error);return false;
  75. }
  76. content = Tpl.replace(/PEND_ID/g,$("#vr_code").val());
  77. content = content.replace(/DS_CODE/g,$("#vr_code").val());
  78. content = content.replace(/DS_GOODS_URL/g,data.data.goods_url);
  79. content = content.replace(/DS_IMG60/g,data.data.img_240);
  80. content = content.replace(/DS_GOODS_NAME/g,data.data.goods_name);
  81. content = content.replace(/DS_ORDER_URL/g,data.data.order_url);
  82. content = content.replace(/DS_ORDER_SN/g,data.data.order_sn);
  83. content = content.replace(/DS_ORDER_MSG/g,data.data.buyer_msg);
  84. $('#order_panel').prepend(content);
  85. $('#vr_code').val('').focus();
  86. layer.alert('{$Think.lang.exchange_successful}', {time: 2000}, function () {
  87. location.reload();
  88. });
  89. });
  90. }
  91. $('#_submit').on('click',function(){
  92. exPost();
  93. });
  94. $(document).keydown(function(e) {
  95. if (e.keyCode == 13) {
  96. exPost();
  97. }
  98. });
  99. });
  100. </script>
  101. {/block}