order.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {template 'common/header'}
  2. <style>
  3. .wx-qr-pay{padding:10px; max-width:640px; margin:0 auto;}
  4. .wx-qr-pay .avatar{text-align:center; margin:20px;}
  5. .wx-qr-pay .avatar img{width:60px; height:60px;}
  6. .wx-qr-pay .qr-pay h5{text-align:center; border-bottom:1px solid #ddd; padding-bottom:10px;}
  7. .wx-qr-pay .qr-pay .qr-img{text-align:center;}
  8. .wx-qr-pay .qr-pay .qr-img img{width:70%; margin-bottom:5px;}
  9. </style>
  10. <div class="wx-qr-pay">
  11. <div class="avatar">
  12. <img src="{$fans['headimgurl']}" alt="" class="img-circle"/>
  13. </div>
  14. <form action="{php echo $this->createMobileUrl('order')}" method="post" id="form1">
  15. <div class="form-group">
  16. <input type="text" placeholder="付款人姓名" class="form-control" value="{$fans['nickname']}" disabled/>
  17. </div>
  18. <div class="form-group">
  19. <input type="text" name="fee" placeholder="输入您要付的金额(必填,最小值0.01)" class="form-control" value="{$order['fee']}"/>
  20. </div>
  21. <div class="form-group">
  22. <input type="text" name="body" placeholder="输入收款理由(必填)" class="form-control" value="{$order['body']}"/>
  23. </div>
  24. <div class="form-group">
  25. <input type="hidden" name="openid" value="{$fans['openid']}"/>
  26. <input type="hidden" name="nickname" value="{$fans['nickname']}"/>
  27. <input type="hidden" name="token"" value="{$_W['token']}"/>
  28. {loop $payment $row}
  29. <input type="submit" name="submit" class="btn btn-success btn-block" value="提交订单">
  30. {/loop}
  31. </div>
  32. </form>
  33. </div>
  34. <script type="text/javascript">
  35. $(function(){
  36. $('#form1').submit(function(){
  37. var body = $.trim($('#form1 :text[name="body"]').val());
  38. if(!body) {
  39. alert('付款理由不能为空');
  40. return false;
  41. }
  42. var reg = /^(([1-9]{1}\d*)|([0]{1}))(\.(\d){1,2})?$/;
  43. var fee = $.trim($('#form1 :text[name="fee"]').val());
  44. if(!reg.test(fee)) {
  45. alert('支付金额不能少于0.01元');
  46. return false;
  47. }
  48. return true;
  49. });
  50. });
  51. </script>
  52. {template 'common/footer'}