scanpay.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. {php define(MUI, true);}
  2. {template 'common/header'}
  3. <header class="mui-bar mui-bar-nav">
  4. <h1 class="mui-title">{$_W['user']['store_name']}</h1>
  5. </header>
  6. {template 'nav'}
  7. {if $op == 'index'}
  8. <header class="mui-bar mui-bar-nav">
  9. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  10. <button class="mui-btn mui-btn-link mui-btn-nav mui-pull-right">
  11. <a href="{php echo $this->createMobileUrl('scanpay',array('op' => 'list'))}">收款记录</a>
  12. </button>
  13. <h1 class="mui-title">扫码收款</h1>
  14. </header>
  15. <div class="mui-content scan-pay">
  16. <div class="mui-text-center mui-pa10 qrcode">
  17. <div class="qrcode-block" data-url="{php echo murl('entry', array('m' => 'paycenter', 'do' => 'selfpay', 'clerk_id' => $_W['user']['clerk_id']), true, true);}" style="margin-top:20px"></div>
  18. <div class="mui-card-block">
  19. <div class="mui-text-muted">未设置优惠 <span class="problem">?</span></div>
  20. <div class="scan">让顾客扫一扫,向我付款</div>
  21. </div>
  22. </div>
  23. <div class="or mui-text-muted mui-text-center">或者</div>
  24. <form action="{php echo $this->createMobileUrl('scanpay', array('op' => 'post'));}" method="post" id="pay-form">
  25. <div class="mui-pa10 mui-bg-white">
  26. <h5 class="mui-desc-title">设置收款金额</h5>
  27. <div class="mui-input-row"><input type="text" value="" name="fee" placeholder="输入金额"/></div>
  28. <div style="display:none">
  29. <div class="mui-input-row"><input type="text" value="" name="body" placeholder="添加收款理由"/></div>
  30. <div class="mui-text-right mui-text-success mui-mb10 hide-body">收起</div>
  31. </div>
  32. <div class="mui-text-right mui-text-success mui-mb10 add-body">添加收款理由</div>
  33. <button class="mui-btn mui-btn-success mui-btn-block">发起收款</button>
  34. <input type="hidden" name="token" value="{$_W['token']}"/>
  35. <input type="hidden" name="submit" value="{$_W['token']}"/>
  36. </div>
  37. </form>
  38. </div>
  39. {/if}
  40. {if $op == 'qrcode'}
  41. <header class="mui-bar mui-bar-nav">
  42. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  43. <button class="mui-btn mui-btn-link mui-btn-nav mui-pull-right">
  44. <a href="{php echo $this->createMobileUrl('scanpay',array('op' => 'list'))}">收款记录</a>
  45. </button>
  46. <h1 class="mui-title">扫码收款</h1>
  47. </header>
  48. <div class="mui-content scan-pay">
  49. <div class="mui-content-padded mui-text-center qrcode">
  50. <div class="qrcode-block" data-url="{php echo murl('entry', array('m' => 'paycenter', 'do' => 'pay', 'id' => $id), true, true);}" style="margin-top:20px"></div>
  51. <div class="mui-card-block">
  52. <div class="mui-text-muted">¥{$order['fee']}</div>
  53. <div class="scan">让顾客扫一扫,向我付款</div>
  54. </div>
  55. </div>
  56. </div>
  57. {/if}
  58. {if $op == 'list'}
  59. <header class="mui-bar mui-bar-nav">
  60. <a class="mui-icon mui-action-back mui-icon-left-nav mui-pull-left"></a>
  61. <a class="mui-btn mui-btn-link mui-btn-nav mui-pull-right" href="#check-date">
  62. 筛选
  63. </a>
  64. <h1 class="mui-title">账单</h1>
  65. </header>
  66. <div class="mui-content trading-record">
  67. <ul class="mui-table-view">
  68. {if empty($orders)}
  69. <h1 class="mui-title">暂无记录</h1>
  70. {else}
  71. {loop $orders $order}
  72. <li class="mui-table-view-cell">
  73. <a href="{php echo $this->createMobileUrl('scanpay',array('op' => 'detail', 'id' => $order['id']))}">
  74. <div class="mui-row">
  75. <div class="mui-col-xs-4 mui-text-muted">
  76. <span class="mui-block">{php echo date('Y-m-d', $order['paytime'])}</span>
  77. <span class="mui-block">{php echo date("H:i", $order['paytime'])}</span>
  78. </div>
  79. <div class="mui-col-xs-3 mui-text-center">
  80. <img src="./resource/images/icon-pay.png" alt="" class="mui-img-circle"/>
  81. </div>
  82. <div class="mui-col-xs-5">
  83. <div><span class="mui-big">+{$order['final_fee']} </span></div>
  84. <div class="mui-ellipsis">{if !empty($order['body'])}{$order['body']}{else}{暂无}{/if}</div>
  85. </div>
  86. </div>
  87. </a>
  88. </li>
  89. {/loop}
  90. {/if}
  91. </ul>
  92. <div id="check-date" class="mui-popover mui-popover-top">
  93. <ul class="mui-table-view">
  94. <li class="mui-table-view-cell">
  95. <a href="{php echo $this->createMobileUrl('scanpay',array('op' => 'list', 'period' =>'1'))}">查看全部</a>
  96. </li>
  97. <li class="mui-table-view-cell">
  98. <a href="{php echo $this->createMobileUrl('scanpay',array('op' => 'list', 'period' => '0'))}">{php echo date('Y.m.d',time());}</a>
  99. </li>
  100. <li class="mui-table-view-cell">
  101. <a href="{php echo $this->createMobileUrl('scanpay',array('op' => 'list', 'period' => '-1'))}">{php echo date('Y.m.d',strtotime('-1day'));}</a>
  102. </li>
  103. <li class="mui-table-view-cell">
  104. <a href="{php echo $this->createMobileUrl('scanpay',array('op' => 'list', 'period' => '-2'))}">{php echo date('Y.m.d',strtotime('-2day'));}</a>
  105. </li>
  106. </ul>
  107. </div>
  108. </div>
  109. {/if}
  110. {if $op == 'detail'}
  111. <header class="mui-bar mui-bar-nav">
  112. <a class="mui-icon mui-action-back mui-icon-left-nav mui-pull-left"></a>
  113. <h1 class="mui-title">账单详情</h1>
  114. </header>
  115. <div class="mui-content trading-detail">
  116. <ul class="mui-table-view">
  117. <li class="mui-table-view-cell">
  118. <div class="mui-text-muted">交易成功</div>
  119. <div class="account">+{$order['final_fee']}</div>
  120. </li>
  121. <li class="mui-table-view-cell mui-media">
  122. <a href="#">
  123. <img src="./resource/images/icon-pay.png" alt="" class="mui-media-object mui-pull-left mui-img-rounded"/>
  124. <div class="mui-media-body company">{$store_info['business_name']}</div>
  125. </a>
  126. </li>
  127. </ul>
  128. <ul class="mui-table-view">
  129. <li class="mui-table-view-cell">
  130. <label>订单详情</label>
  131. </li>
  132. <li class="mui-table-view-cell">
  133. <label>付款说明</label>
  134. <span class="mui-text-muted mui-ml15">{$order['body']}</span>
  135. </li>
  136. <li class="mui-table-view-cell">
  137. <label>支付方式</label>
  138. <span class="mui-text-muted mui-ml15">{$types[$order['type']]}-{$trade_types[$order['trade_type']]}</span>
  139. </li>
  140. <li class="mui-table-view-cell">
  141. <label>支付者</label>
  142. <span class="mui-text-muted mui-ml15">{if !empty($order['nickname'])}{$order['nickname']}{else}未知{/if}</span>
  143. </li>
  144. <li class="mui-table-view-cell">
  145. <label>创建时间</label>
  146. <span class="mui-text-muted mui-ml15">{php echo date('Y-m-d H:i:s', $order['createtime'])}</span>
  147. </li>
  148. </ul>
  149. <ul class="mui-table-view">
  150. <li class="mui-table-view-cell">
  151. <label>支付详情</label>
  152. </li>
  153. <li class="mui-table-view-cell">
  154. <label>应付金额</label>
  155. <span class="mui-text-muted mui-ml15">{$order['fee']}</span>
  156. </li>
  157. <li class="mui-table-view-cell">
  158. <label>实付金额</label>
  159. <span class="mui-text-muted mui-ml15">{$order['final_fee']}</span>
  160. </li>
  161. <li class="mui-table-view-cell">
  162. <label>积分抵现</label>
  163. <span class="mui-text-muted mui-ml15">{$order['credit1_fee']}</span>
  164. </li>
  165. <li class="mui-table-view-cell">
  166. <label>余额支付</label>
  167. <span class="mui-text-muted mui-ml15">{$order['credit2']}</span>
  168. </li>
  169. <li class="mui-table-view-cell">
  170. <label>线上支付</label>
  171. <span class="mui-text-muted mui-ml15">{$order['cash']}</span>
  172. </li>
  173. <li class="mui-table-view-cell">
  174. <label>支付时间</label>
  175. <span class="mui-text-muted mui-ml15">{php echo date('Y-m-d H:i:s', $order['paytime'])}</span>
  176. </li>
  177. </ul>
  178. </div>
  179. {/if}
  180. <script>
  181. require(['jquery.qrcode'], function(){
  182. $('#pay-form').submit(function(){
  183. var fee = $.trim($('#pay-form :text[name="fee"]').val());
  184. if(!fee) {
  185. alert('收款金额应大于0');
  186. return false;
  187. }
  188. return true;
  189. });
  190. $('.add-body').click(function(){
  191. $(this).prev().show();
  192. $(this).hide();
  193. });
  194. $('.hide-body').click(function(){
  195. $(this).parent().hide();
  196. $('.add-body').show();
  197. });
  198. var url = $('.qrcode-block').data('url');
  199. $('.qrcode-block').html('').qrcode({
  200. render: 'canvas',
  201. width: 150,
  202. height: 150,
  203. text: url
  204. });
  205. });
  206. </script>
  207. {template 'common/footer'}