pointvoucher.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. {extend name="default/base/base_home" /}
  2. {block name="mall_main"}
  3. <link rel="stylesheet" href="{$Think.HOME_SITE_ROOT}/css/point.css">
  4. {include file="default/member/pointprod/pointshop_minfo" /}
  5. <div class="exchange-cate">
  6. <div class="w w1200">
  7. <input type="hidden" id="storeclass_id" value="{$Request.param.storeclass_id}"/>
  8. <a class="{if $Request.param.storeclass_id<=0}curr{/if}" href="javascript:void(0);" ds_type="search_cate" data-param='{"storeclass_id":""}'>{$Think.lang.ds_all}</a><i class="point">·</i>
  9. {foreach name="store_class" item="v"}
  10. <a class="{if $Request.param.storeclass_id == $v.storeclass_id}curr{/if}" href="javascript:void(0);" ds_type="search_cate" data-param='{"storeclass_id":"{$v.storeclass_id}"}'>{$v.storeclass_name}</a><i class="point">·</i>
  11. {/foreach}
  12. </div>
  13. </div>
  14. <div class="dsp-container">
  15. <div class="dsp-main-layout">
  16. <div class="dsp-category">
  17. <!-- 高级搜索start -->
  18. <dl class="searchbox">
  19. <dd>
  20. <ul>
  21. <li>{$Think.lang.ds_sort}:</li>
  22. <input type="hidden" id="orderby" name="orderby" value="{$Request.param.orderby ? $Request.param.orderby:'default'}"/>
  23. <!-- 默认排序s -->
  24. {if $Request.param.orderby=='default' ||!$Request.param.orderby}
  25. <li class="selected">{$Think.lang.default_sort}</li>
  26. {else /}
  27. <li ds_type="search_orderby" data-param='{"orderval":"default"}'>{$Think.lang.default_sort}</li>
  28. {/if}
  29. <!-- 默认排序e -->
  30. <!-- 兑换量s -->
  31. {if $Request.param.orderby=='exchangenumdesc'}
  32. <li class="selected" ds_type="search_orderby" data-param='{"orderval":"exchangenumasc"}'>{$Think.lang.exchange_amount}<em class="desc"></em></li>
  33. {elseif $Request.param.orderby=='exchangenumasc'}
  34. <li class="selected" ds_type="search_orderby" data-param='{"orderval":"exchangenumdesc"}'>{$Think.lang.exchange_amount}<em class="asc"></em></li>
  35. {else /}
  36. <li ds_type="search_orderby" data-param='{"orderval":"exchangenumdesc"}'>{$Think.lang.exchange_amount}<em></em></li>
  37. {/if}
  38. <!-- 兑换量e -->
  39. <!-- 积分值s -->
  40. {if $Request.param.orderby=='pointsdesc'}
  41. <li class="selected" ds_type="search_orderby" data-param='{"orderval":"pointsasc"}'>{$Think.lang.points}<em class="desc"></em></li>
  42. {elseif $Request.param.orderby=='pointsasc'}
  43. <li class="selected" ds_type="search_orderby" data-param='{"orderval":"pointsdesc"}'>{$Think.lang.points}<em class="asc"></em></li>
  44. {else /}
  45. <li ds_type="search_orderby" data-param='{"orderval":"pointsdesc"}'>{$Think.lang.points}<em></em></li>
  46. {/if}
  47. <!-- 积分值e -->
  48. <li>&nbsp;</li>
  49. <!-- 面额s -->
  50. <li>{$Think.lang.coupon_values}:
  51. <select id="price" onchange="javascript:searchvoucher();">
  52. <option value='' selected >{$Think.lang.ds_please_choose}</option>
  53. {notempty name="pricelist"}
  54. {foreach name="pricelist" item="v"}
  55. <option value="{$v.voucherprice}" {$Request.param.price == $v.voucherprice ?'selected':''}>{$v.voucherprice}{$Think.lang.ds_yuan}{$Think.lang.home_voucher}</option>
  56. {/foreach}
  57. {/notempty}
  58. </select>
  59. </li>
  60. <!-- 面额e -->
  61. <li>&nbsp;</li>
  62. <!-- 所需积分s -->
  63. <li>{$Think.lang.home_voucher_points}:
  64. <input type="text" id="points_min" class="text w50" value="{$Request.param.points_min}"/>
  65. ~
  66. <input type="text" id="points_max" class="text w50" value="{$Request.param.points_max}" />
  67. <a href="javascript:searchvoucher();" class="dsp-btn">{$Think.lang.ds_search}</a> </li>
  68. <!-- 所需积分e -->
  69. {if session('is_login')=='1'}
  70. <li>
  71. <label for="isable"><input type="checkbox" id="isable" {$Request.param.isable ==1?'checked="checked"':''} onclick="javascript:searchvoucher();">
  72. &nbsp;{$Think.lang.watch_exchange_them} </label></li>
  73. {/if}
  74. </ul>
  75. </dd>
  76. </dl>
  77. <!-- 高级搜索end --></div>
  78. {notempty name="voucherlist"}
  79. <ul class="dsp-voucher-list">
  80. {foreach name="voucherlist" item="v"}
  81. <li>
  82. <div class="coupon_item">
  83. <div class="coupon_lk">
  84. <div class="lazyimg lazyimg_loaded coupon_img">
  85. <img class="lazyload" data-original="{$v.vouchertemplate_customimg}" onerror="this.src='{:ds_get_pic(ATTACH_COMMON,$Think.config.ds_config.default_goods_image)}'">
  86. </div>
  87. <a href="javascript:void(0);" ds_type="exchangebtn" data-param='{"vid":"{$v.vouchertemplate_id}"}'>
  88. <div class="coupon_more">
  89. <div class="coupon_more_inner">{$Think.lang.immediately_change}</div>
  90. </div>
  91. </a>
  92. <div class="coupon_info">
  93. <div class="mod_price coupon_price"><i>¥</i><span>{$v.vouchertemplate_price}</span></div>
  94. <div class="coupon_limit" title="{$v.vouchertemplate_storename}{$Think.lang.home_voucher_desc_1}{$v.vouchertemplate_limit}{$Think.lang.yuan_available}"><a href="{:url('Store/index',['store_id'=>$v.vouchertemplate_store_id])}">{$v.vouchertemplate_storename}</a>{$Think.lang.home_voucher_desc_1}{$v.vouchertemplate_limit}{$Think.lang.yuan_available}</div>
  95. <div class="coupon_desc" title="{$Think.lang.required}{$v.vouchertemplate_points}{$Think.lang.points_unit}">{$Think.lang.required}<em>{$v.vouchertemplate_points}</em>{$Think.lang.points_unit}</div>
  96. </div>
  97. </div>
  98. </div>
  99. </li>
  100. {/foreach}
  101. </ul>
  102. <div class="tc mt20 mb20">
  103. <div class="pagination">{$show_page|raw}</div>
  104. </div>
  105. {else /}
  106. <div class="no_results">{$Think.lang.home_voucher_list_null}</div>
  107. {/notempty}
  108. </div>
  109. </div>
  110. <script>
  111. $(function(){
  112. //代金券兑换功能
  113. $("[ds_type='exchangebtn']").on('click',function(){
  114. var data_str = $(this).attr('data-param');
  115. eval( "data_str = "+data_str);
  116. {if session('is_login') != '1'}
  117. login_dialog();
  118. {else}
  119. ajax_form('vexchange', '{$Think.lang.home_voucher_exchangtitle}', "{:url('Pointvoucher/voucherexchange')}?vid="+data_str.vid, 550);
  120. {/if}
  121. return false;
  122. });
  123. });
  124. </script>
  125. <script>
  126. $(function () {
  127. $("[ds_type='search_orderby']").click(function(){
  128. var data_str = $(this).attr('data-param');
  129. eval( "data_str = "+data_str);
  130. $("#orderby").val(data_str.orderval);
  131. searchvoucher();
  132. });
  133. $("[ds_type='search_cate']").click(function(){
  134. var data_str = $(this).attr('data-param');
  135. eval( "data_str = "+data_str);
  136. $("#storeclass_id").val(data_str.storeclass_id);
  137. searchvoucher();
  138. });
  139. });
  140. function searchvoucher(){
  141. var url = "{:url('Pointvoucher/index')}"+'?';
  142. var storeclass_id = $("#storeclass_id").val();
  143. if(storeclass_id){
  144. url += ('storeclass_id='+storeclass_id)+'&';
  145. }
  146. var orderby = $("#orderby").val();
  147. if(orderby){
  148. url += ('orderby='+orderby)+'&';
  149. }
  150. var price = $("#price").val();
  151. if(price){
  152. url += ('price='+price)+'&';
  153. }
  154. var points_min = $("#points_min").val();
  155. if(points_min){
  156. url += ('points_min='+points_min)+'&';
  157. }
  158. var points_max = $("#points_max").val();
  159. if(points_max){
  160. url += ('points_max='+points_max)+'&';
  161. }
  162. if($("#isable").attr("checked") == 'checked'){
  163. url += 'isable=1';
  164. }
  165. go(url);
  166. }
  167. </script>
  168. {/block}