index.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
  6. <title>提现</title>
  7. <link rel="stylesheet" href="__STATIC__/box/css/index.css?v=14">
  8. <script src="__STATIC__/box/js/flexible.js?v={:config('js_version')}"></script>
  9. <script src="https://cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
  10. </head>
  11. <body>
  12. <div class="withdraw">
  13. <div class="withdraw_able">
  14. <h3>可提现金额</h3>
  15. <p class="withdraw_amount">{$balance}</p>
  16. </div>
  17. <div class="withdraw_list">
  18. <h3>提现金额</h3>
  19. <?php $_i = 0; ?>
  20. <foreach name="amount_mapping.wechat" item="vo" key="key">
  21. <if condition=" $_i eq 0 && $withdraw_cnt eq 0">
  22. <a href="javascript:;" data-balence="{$balance}" class="withdraw_item">全部提现</a>
  23. <?php $_i +=1; ?>
  24. <else/>
  25. <a href="javascript:;" data-balence="{$vo}" class="withdraw_item">{$key}元</a>
  26. <?php $_i +=1; ?>
  27. </if>
  28. </foreach>
  29. </div>
  30. <if condition="($verified['is_verified'] == 2 && $withdraw_cnt neq 0) || ($verified['first_verified'] == 2 && $withdraw_cnt eq 0)">
  31. <div class="withdraw_info">
  32. <h3>请填写实名信息(带*必填):</h3>
  33. <p class="withdraw_info-item">
  34. <label>
  35. <i>*</i>姓名:<input id="realName" type="text" value="{$real_name}"/>
  36. </label>
  37. </p>
  38. <p class="withdraw_info-item">
  39. <label>
  40. <if condition="$verified['mobile_must'] == 2"><i>*</i></if>手机号:<input id="mobile" type="text" value="{$mobile}" maxlength="11"/>
  41. </label>
  42. </p>
  43. </div>
  44. </if>
  45. <div class="withdraw_tips">
  46. <h3>{$notice.title}</h3>
  47. <p class="withdraw_content">
  48. {$notice.text}
  49. </p>
  50. </div>
  51. <div class="withdraw_btngroup">
  52. <button class="withdraw_btn js-withdraw">提现</button>
  53. </div>
  54. <div class="pop_outer" id="pop" style="display: none;">
  55. <div class="pop_inner">
  56. <div class="pop_title">温馨提示</div>
  57. <div class="pop_content" id="popContent">
  58. </div>
  59. <div class="pop_btn-group">
  60. <button class="pop_btn pop_btn__block" id="popBtn">确定</button>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <script>
  66. $(function () {
  67. $('.withdraw_list .withdraw_item').eq(0).addClass('active')
  68. $('.withdraw_list .withdraw_item').on('click', function () {
  69. $(this).addClass('active').siblings('a').removeClass('active')
  70. })
  71. $('#popBtn').on('click', function () {
  72. $('#pop').hide()
  73. })
  74. var oldValue
  75. $('#mobile').on('input', function () {
  76. $(this).val($.trim($(this).val()))
  77. var newValue = $(this).val()
  78. if (isNaN(newValue)) {
  79. $(this).val(oldValue)
  80. return false
  81. }
  82. oldValue = $(this).val()
  83. })
  84. $('.js-withdraw').on('click', function () {
  85. var isVerified = "{$verified['is_verified']}" // 是否开启实名
  86. var firstVerified = "{$verified['first_verified']}" // 首次提现是否开启实名
  87. var mobileMust = "{$verified['mobile_must']}" // 手机号是否必须
  88. var withdrawCnt = "{$withdraw_cnt}" // 提现次数
  89. var realName = $.trim($('#realName').val())
  90. var mobile = $.trim($('#mobile').val())
  91. if ((withdrawCnt == 0 && firstVerified == 2) || (isVerified == 2 && withdrawCnt > 0)) {
  92. if (!realName) {
  93. $('#popContent').html('请填写姓名!')
  94. $('#pop').show()
  95. return false
  96. }
  97. }
  98. if ((withdrawCnt == 0 && firstVerified == 2 && mobileMust == 2 && !mobile) || (isVerified == 2 && withdrawCnt > 0 && mobileMust == 2 && !mobile)) {
  99. $('#popContent').html('请填写手机号!')
  100. $('#pop').show()
  101. return false
  102. }
  103. if ((withdrawCnt == 0 && firstVerified == 2 && mobileMust == 2 && !/1[0-9]{10}/.test(mobile)) || (isVerified == 2 && withdrawCnt > 0 && mobileMust == 2 && !/1[0-9]{10}/.test(mobile))) {
  104. $('#popContent').html('请填写正确的手机号!')
  105. $('#pop').show()
  106. return false
  107. }
  108. var params = {
  109. format: 'json',
  110. real_name: realName,
  111. mobile: mobile,
  112. amount: $('.withdraw_list .active').eq(0).attr('data-balence')
  113. }
  114. $.ajax({
  115. url : '/index/settle/add/{$wx_app_id}',
  116. type : 'get',
  117. data : params,
  118. success: function (res) {
  119. if (res.code === 200) {
  120. location.href = '/index/settle/list/{$wx_app_id}.html'
  121. } else {
  122. $('#popContent').html(res.msg)
  123. $('#pop').show()
  124. }
  125. }
  126. })
  127. })
  128. })
  129. </script>
  130. </body>
  131. </html>