123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
- <title>提现</title>
- <link rel="stylesheet" href="__STATIC__/box/css/index.css?v=14">
- <script src="__STATIC__/box/js/flexible.js?v={:config('js_version')}"></script>
- <script src="https://cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
- </head>
- <body>
-
- <div class="withdraw">
- <div class="withdraw_able">
- <h3>可提现金额</h3>
- <p class="withdraw_amount">{$balance}</p>
- </div>
- <div class="withdraw_list">
- <h3>提现金额</h3>
- <?php $_i = 0; ?>
- <foreach name="amount_mapping.wechat" item="vo" key="key">
- <if condition=" $_i eq 0 && $withdraw_cnt eq 0">
- <a href="javascript:;" data-balence="{$balance}" class="withdraw_item">全部提现</a>
- <?php $_i +=1; ?>
- <else/>
- <a href="javascript:;" data-balence="{$vo}" class="withdraw_item">{$key}元</a>
- <?php $_i +=1; ?>
- </if>
- </foreach>
- </div>
- <if condition="($verified['is_verified'] == 2 && $withdraw_cnt neq 0) || ($verified['first_verified'] == 2 && $withdraw_cnt eq 0)">
- <div class="withdraw_info">
- <h3>请填写实名信息(带*必填):</h3>
- <p class="withdraw_info-item">
- <label>
- <i>*</i>姓名:<input id="realName" type="text" value="{$real_name}"/>
- </label>
- </p>
- <p class="withdraw_info-item">
- <label>
- <if condition="$verified['mobile_must'] == 2"><i>*</i></if>手机号:<input id="mobile" type="text" value="{$mobile}" maxlength="11"/>
- </label>
- </p>
- </div>
- </if>
- <div class="withdraw_tips">
- <h3>{$notice.title}</h3>
- <p class="withdraw_content">
- {$notice.text}
- </p>
- </div>
- <div class="withdraw_btngroup">
- <button class="withdraw_btn js-withdraw">提现</button>
- </div>
- <div class="pop_outer" id="pop" style="display: none;">
- <div class="pop_inner">
- <div class="pop_title">温馨提示</div>
- <div class="pop_content" id="popContent">
- </div>
- <div class="pop_btn-group">
- <button class="pop_btn pop_btn__block" id="popBtn">确定</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function () {
- $('.withdraw_list .withdraw_item').eq(0).addClass('active')
- $('.withdraw_list .withdraw_item').on('click', function () {
- $(this).addClass('active').siblings('a').removeClass('active')
- })
- $('#popBtn').on('click', function () {
- $('#pop').hide()
- })
- var oldValue
- $('#mobile').on('input', function () {
- $(this).val($.trim($(this).val()))
- var newValue = $(this).val()
- if (isNaN(newValue)) {
- $(this).val(oldValue)
- return false
- }
- oldValue = $(this).val()
- })
- $('.js-withdraw').on('click', function () {
- var isVerified = "{$verified['is_verified']}" // 是否开启实名
- var firstVerified = "{$verified['first_verified']}" // 首次提现是否开启实名
- var mobileMust = "{$verified['mobile_must']}" // 手机号是否必须
- var withdrawCnt = "{$withdraw_cnt}" // 提现次数
- var realName = $.trim($('#realName').val())
- var mobile = $.trim($('#mobile').val())
- if ((withdrawCnt == 0 && firstVerified == 2) || (isVerified == 2 && withdrawCnt > 0)) {
- if (!realName) {
- $('#popContent').html('请填写姓名!')
- $('#pop').show()
- return false
- }
- }
- if ((withdrawCnt == 0 && firstVerified == 2 && mobileMust == 2 && !mobile) || (isVerified == 2 && withdrawCnt > 0 && mobileMust == 2 && !mobile)) {
- $('#popContent').html('请填写手机号!')
- $('#pop').show()
- return false
- }
- 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))) {
- $('#popContent').html('请填写正确的手机号!')
- $('#pop').show()
- return false
- }
- var params = {
- format: 'json',
- real_name: realName,
- mobile: mobile,
- amount: $('.withdraw_list .active').eq(0).attr('data-balence')
- }
- $.ajax({
- url : '/index/settle/add/{$wx_app_id}',
- type : 'get',
- data : params,
- success: function (res) {
- if (res.code === 200) {
- location.href = '/index/settle/list/{$wx_app_id}.html'
- } else {
- $('#popContent').html(res.msg)
- $('#pop').show()
- }
- }
- })
- })
- })
- </script>
- </body>
- </html>
|