order.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <style type="text/css">
  2. .icon-center{
  3. display: block;
  4. font-size:20px;
  5. text-align: center;
  6. }
  7. </style>
  8. {include file="../application/h5/view/wx_book_dinner/header.html"}
  9. <div class="weui_tab tab-bottom">
  10. <div class="weui-header bg-blue">
  11. <div class="weui-header-left"></div>
  12. <h1 class="weui-header-title">订餐</h1>
  13. <div class="weui-header-right">
  14. <!-- <a style="color:#fff;" href="{:url('userapply')}">特殊人群申请</a>-->
  15. <!-- <a style="color:#fff;" href="loginuser">订餐员登陆</a>-->
  16. </div>
  17. </div>
  18. <div class="weui_tab_bd">
  19. <div class="weui_tab_bd_item">
  20. </div>
  21. <div class="weui_tab_bd_item">
  22. </div>
  23. <div class="weui_tab_bd_item">
  24. <style type="text/css">
  25. .icon-center{
  26. display: block;
  27. font-size:20px;
  28. text-align: center;
  29. }
  30. </style>
  31. <style>
  32. .center {
  33. text-align: center;
  34. color: #fff;
  35. font-size: 18px;
  36. }
  37. .center img{
  38. width: 100px;
  39. height: 100px;
  40. border-radius: 50%;
  41. border: 4px solid #ececec;
  42. vertical-align: bottom;
  43. position:absolute;
  44. z-index: 999;
  45. bottom: 10px;
  46. display: block;
  47. left:50%;
  48. margin-left:-50px;
  49. }
  50. .center span{
  51. top: 50px;
  52. position:relative;
  53. color: #333;
  54. }
  55. </style>
  56. <div style="position: relative;">
  57. <img src="/static/mobile/weui/images/top.png" x="0" y="0" width="100%" />
  58. <p class="center">
  59. {if !empty($user) && $user['img']}
  60. <img src="{$user['img']}">
  61. {else}
  62. <img src="/static/img/defaulthead.png">
  63. {/if}
  64. </p>
  65. <p class="center">
  66. <span>{$user['nickname']}
  67. <!-- {if isset($user['isdinder']) && $user['isdinder']}-->
  68. <!-- (订餐员)-->
  69. <!-- {/if}-->
  70. {if $special == 1}
  71. {if $isSpecial == 2}(特殊人群){/if}
  72. {if $isSpecial == 1}(审核中){/if}
  73. {if $isSpecial == 0}
  74. <a style="" href="{:url('userapply')}">特殊人群申请</a>
  75. {/if}
  76. {/if}
  77. </span>
  78. </p>
  79. <p class="center">
  80. <span><a href="javascript:;">{$orgName}<i class="icon icon-74"></i></a></span>
  81. </p>
  82. </div>
  83. <div style="margin-top: 60px;"></div>
  84. <div class="weui-payrec weui-payrec1" style="margin-bottom: 60px;">
  85. <div class="weui_panel_bd weui_panel_bd1 weui_cells_access">
  86. </div>
  87. <div class="weui_cells_title tcenter" id="ss">
  88. <div class="weui-loadmore">
  89. <span class="weui-loadmore-tips" onclick="mm()">加载更多</span>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="weui_tabbar ">
  96. <a href="index" class="weui_tabbar_item">
  97. <div class="weui_tabbar_icon">
  98. <span class="icon icon-29 icon-center"></span>
  99. </div>
  100. <p class="weui_tabbar_label">主页</p>
  101. </a>
  102. <a href="cart" class="weui_tabbar_item">
  103. <div class="weui_tabbar_icon">
  104. <span class="icon icon-24 icon-center"></span>
  105. </div>
  106. <p class="weui_tabbar_label">我的购物车
  107. {if $cartCount >0}
  108. <span class="weui-badge" id="badgecart" data-cart="{$cartCount}">{$cartCount}</span>
  109. {else}
  110. <span class="weui-badge" id="badgecart" data-cart="{$cartCount}" style="display:none;">{$cartCount}</span>
  111. {/if}
  112. </p>
  113. </a>
  114. <a href="order" class="weui_tabbar_item weui_bar_item_on">
  115. <div class="weui_tabbar_icon">
  116. <span class="icon icon-99 icon-center"></span>
  117. </div>
  118. <p class="weui_tabbar_label">我的订单</p>
  119. </a>
  120. </div>
  121. </div>
  122. <div id="popup" class="weui-popup-container">
  123. <div class="weui-popup-modal" id="weui-popup-modal">
  124. </div>
  125. </div>
  126. <input type="hidden" id="pg" value="1">
  127. <script>
  128. $(function(){
  129. $('.weui_tab').tab({
  130. defaultIndex: 2,
  131. activeClass:'weui_bar_item_on',
  132. onToggle:function(index){
  133. }
  134. });
  135. $(document).on('click', '.show-dialog-get', function (e) {
  136. var $this = $(this), url = $this.attr('href') || $this.attr('data-url');
  137. var _content_ = '_content_'+$.md5(url);
  138. get_data(url, function (result) {
  139. result +='<input type="hidden" id="_Index_" value="'+index+'"/>';
  140. // $("#"+_content_).html(result);
  141. html = '<div id="'+_content_+'">'+result+'</div>';
  142. var index = layer.open({
  143. type: 1
  144. ,scrollbar: false
  145. ,content: html
  146. ,anim: 'up'
  147. ,style: 'position:fixed; left:0;top:0; width:100%; height:100%; border: none; -webkit-animation-duration: .5s; animation-duration: .5s;'
  148. ,success: function(elem){
  149. $(".layui-m-layercont").css({"overflow-x":"hidden !important","overflow-y":"scroll !important", "height":"100%",'width':'100%'});
  150. }
  151. }
  152. );
  153. });
  154. return false;
  155. });
  156. $(document).on('click', '.close-pop', function (e) {
  157. // var val = $(this).closest(".layui-m-layerchild").find('#_Index_').val();
  158. // layer.close(val);
  159. layer.closeAll();
  160. });
  161. window.onpopstate = function(e) {
  162. layer.closeAll();
  163. };
  164. });
  165. $(function() {
  166. get_list_data();
  167. });
  168. function get_list_data(){
  169. //页数
  170. var page = parseInt($('#pg').val());
  171. // 每页展示10个
  172. var size = 10;
  173. var url = 'get_orders_json?size=' + size + '&page=' + page;
  174. $.showLoading();
  175. loading = true;
  176. $.ajax({
  177. type : "GET",
  178. url : url,
  179. dataType : "json",
  180. beforeSend:function(){
  181. },
  182. error:function(){
  183. loading = false;
  184. },
  185. success : function(data) {
  186. var arrLen = data.length;
  187. var result = '';
  188. if(arrLen>0){
  189. for(var i=0; i<arrLen; i++){
  190. result+='<div class="weui_cells weui_panel weui_panel_access">';
  191. result+='<a class="weui_cell access show-dialog-get" href="order_detail?id='+data[i].id+ '">';
  192. result+='<div class="weui_cell_bd weui_cell_primary">';
  193. result+=' <h2 class="weui_cell_title">';
  194. result+='订 单 号:'+data[i].sn;
  195. result+='</h2>';
  196. result+='<div class="weui_cell_info">';
  197. result+=data[i].state==1?data[i].pay_time:data[i].create_time;
  198. result+='</div>';
  199. result+='</div>';
  200. result+='<div class="weui_cell_ft">';
  201. result+='<div class="weui_cell_title">';
  202. if(data[i].state==0){
  203. if(data[i].pay == 1){
  204. result+='<span style="color:red;">待支付</span>';
  205. }else{
  206. result+='<span style="color:red;">已过期</span>';
  207. }
  208. }else if(data[i].state==1){
  209. result+='<span style="color:green;">支付成功</span>';
  210. }
  211. else if(data[i].state==3){
  212. result+='<span style="color:red;">已分配送餐员</span>';
  213. }
  214. else if(data[i].state==4){
  215. result+='<span style="color:red;">正在申请退款中</span>';
  216. }
  217. else if(data[i].state==5){
  218. result+='<span style="color:green;">已退款</span>';
  219. }
  220. else if(data[i].state==6){
  221. result+='<span style="color:green;">申请退款被拒</span>';
  222. } else if(data[i].state==7){
  223. result+='<span style="color:green;">部分退款</span>';
  224. }
  225. result+='</div>';
  226. result+='</div>';
  227. result+='</a>';
  228. result+='<div class="weui-pay-area">';
  229. result+='<a class="weui-pay-c show-dialog-get" href="order_detail?id='+data[i].id+'">查看更多</a>';
  230. if(data[i].state==0 && data[i].pay == 1){
  231. result+='<a href="'+'pay?id='+data[i].id+'" class="weui-pay-v">立即付款</a>';
  232. }else if((data[i].state==1|| data[i].state==7) && data[i].refund == 1 && data[i].cate == 0){
  233. result+='<a href="'+'refuse?id='+data[i].id+'" class="weui-pay-v">申请退款</a>';
  234. }
  235. result+='</div>';
  236. result+='</div>';
  237. }
  238. if(arrLen < size){
  239. stop = false;
  240. $("#ss").css('display','none');
  241. }else{
  242. page++;
  243. }
  244. $("#pg").val(page);
  245. $('.weui_panel_bd1').append(result);
  246. }else{
  247. stop = true;
  248. $("#ss").css('display','none');
  249. }
  250. loading = false;
  251. $.hideLoading();
  252. }
  253. });
  254. }
  255. function mm() {
  256. get_list_data();
  257. }
  258. </script>