如何去除(提请首信易支付时)金额中的逗号

rewrty 发布于 2018/05/03 08:04
阅读 230
收藏 0

高手求救啊!如何将下网页截图中提交支付金额50,000.00   中的逗号去除,否则首信易支付不支持逗号啊(总是支付报错,我想哭了)!此页面代码已附在图下面第一篇代码(总共附了三个文件的代码),改哪里?怎么改?还是有其他地方也需要修改??是从开始填写的金额是就要修改不带逗号吗???高手帮帮忙我吧

代码一

 

<?php

 

/* @var $this yii\web\View */

 

use yii\helpers\Html;

use yii\helpers\Url;

use yii\widgets\ActiveForm;

use app\assets\SmartWizardAsset;

SmartWizardAsset::register($this);

 

$this->title = '充值';

$this->params['breadcrumbs'][] = $this->title;

?>

<!-- page title -->

<div class="page-title">

  <div>

    <h1><i class="fa fa-trophy"></i> 充值</h1>

  </div>

</div>

<!-- page title end-->

 

<!-- page body start -->

<div class="card">

  <div id="wizard" class="form_wizard wizard_horizontal">

    <ul class="wizard_steps">

      <li>

        <a href="#step-1">

          <span class="step_no">1</span>

          <span class="step_descr">

                            第一步<br />

                            <small>选择通道</small>

                        </span>

        </a>

      </li>

      <li>

        <a href="#step-2">

          <span class="step_no">2</span>

          <span class="step_descr">

                            第二步<br />

                            <small>设置金额</small>

                        </span>

        </a>

      </li>

      <li>

        <a href="#step-3">

          <span class="step_no">3</span>

          <span class="step_descr">

                            第三步<br />

                            <small>充值</small>

                        </span>

        </a>

      </li>

      <li>

        <a href="#step-4">

          <span class="step_no">4</span>

          <span class="step_descr">

                            第四步<br />

                            <small>完成</small>

                        </span>

        </a>

      </li>

    </ul>

    <div id="step-1">

    </div>

    <div id="step-2">

    </div>

    <div id="step-3">

    </div>

    <div id="step-4">

    </div>

 

  </div>

</div>

<!-- page body end-->

 

 

<!-- Modal -->

<!--div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">

  <div class="modal-dialog modal-sm" role="document">

    <div class="modal-content">

      <div class="modal-header btn-warning">

        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>

        <h4 class="modal-title" id="myModalLabel"><i class="fa fa-key"></i> 已完成充值</h4>

      </div>

      <div class="modal-body">

        <h3>已完成充值</h3>

      </div>

      <div class="modal-footer">

        <button id='finish_congzhi' type="button" class="btn btn-warning"  data-dismiss="modal">关闭</button>

      </div>

    </div>

  </div>

</div-->

 

<?php $this->beginBlock('wizard-js') ?>

$(document).ready(function() {

  if( typeof ($.fn.smartWizard) === 'undefined'){ return; }

  var tokenName = '<?=Yii::$app->getRequest()->csrfParam?>';

  var tokenVal = '<?=Yii::$app->getRequest()->getCsrfToken()?>';

  var $this=this;

  $('#wizard').smartWizard({

    contentURL:'<?=Url::toRoute('site/wizardcongzhiajax')?>',

    contentCache:false,

    labelNext:'下一步',

    labelPrevious:'上一步',

    labelFinish:'完成',

    onLeaveStep:function($step,context){

      if(context.toStep>context.fromStep){

      }else if(context.toStep < context.fromStep){

      }

      return true;

    },

    onShowStep:function($step,context){

      if(context.toStep===3){

        $('.buttonNext').text('立即充值');

      }else{

        $('.buttonNext').text('下一步');

      }

      if(context.toStep===4){

        $('.buttonNext').hide();

        $('.buttonPrevious').hide();

        $('.buttonFinish').removeClass('.btn-default').addClass('.btn-info');

 

        var paychannel = $('#deal-channel').attr('channel');

        if(paychannel==1){

          $('#easepay').submit();

        }

        if((paychannel==1)||(paychannel==3)){

          //console.log($('#order-no').text());

          var order_no=$('#order-no').text();

 

          var query_result_timer = function()

          {

            $.ajax({

              url:"<?=Url::toRoute('pay/querycongzhiresultajax')?>",

              type:"get",

              datatype:"json",

              cache:false,

              data:{

                orderno:order_no

              },

              success:function(data){

                 var obj = JSON.parse(data);

                 if(obj.errcode==0){

                   $('#result-text').text('充值成功。');

                   $('#congzhi-result').modal();

                     //console.log('充值成功。5秒后跳转');

                   //自动跳转

                   setTimeout(

                   function () {

                     $this.location.href = "<?=Url::toRoute('site/wizardcongzhi')?>"

                   }, 5000);

                 }else if(obj.errcode==1){

                   $('.fa-exclamation').removeClass('alert-info').addClass('alert-danger');

                   $('#result-text').text('充值失败。');

                   $('#congzhi-result').modal();

                   //console.log('充值失败。5秒后跳转');

                   //自动跳转

                   setTimeout(

                   function () {

                     $this.location.href = "<?=Url::toRoute('site/wizardcongzhi')?>"

                   }, 5000);

                 }else if(obj.errcode==2){

                   //console.log('等待结果...');

                   //循环等待

                   setTimeout(

                   query_result_timer, 1000);

                 }else if(obj.errcode==3){

                   $('.fa-exclamation').removeClass('alert-info').addClass('alert-danger');

                   $('#result-text').text(obj.errmsg);

                   $('#congzhi-result').modal();

                   //console.log('发生错误。5秒后跳转');

                   //自动跳转

                   setTimeout(

                   function () {

                     $this.location.href = "<?=Url::toRoute('site/wizardcongzhi')?>"

                   }, 5000);

                 }

              },

              error:function(jqXHR,textStatus,errorThrown){

                console.log(jqXHR);

                console.log(textStatus);

                console.log(errorThrown);

                $('.compose').slideToggle();

              }

            });

          };

          //console.log('首次执行结果查询');

          query_result_timer();

        }

 

      }

      if(context.toStep===2)

      {

        //$('#congzhimoneyform-money').val(10.00);

        //this.curStepIdx=2;

        //this.goToStep(3);

        //this.goForward();

      }

      return true;

    },

    onFinish:function($step, context){

      //alert('完成充值,返回充值开始页面');

      window.location.href='<?=Url::toRoute('site/wizardcongzhi')?>';

      return true;

    },

    contentURLData:function(stepNum){

 

      switch(stepNum){

        //第一步:设置通道

        case 1:

          var obj= {

            data:{

              step_number : stepNum

            }

          };

          obj.data[tokenName]=tokenVal;

          return obj;

        break;

        //设置金额

        case 2:

        var obj= {

          data:{

            step_number : stepNum,

            channel: $('#congzhichannelform-channel option:selected').val()

          }

        };

        obj.data[tokenName]=tokenVal;

          return obj;

        break;

        //第三步:验证

        case 3:

        var obj= {

          data:{

            step_number : stepNum,

            channel:$('#congzhimoneyform-channel').val(),

            money:$('#congzhimoneyform-money').val()

          }

        };

        obj.data[tokenName]=tokenVal;

          return obj;

        break;

        //第四步:扫码(支付宝,微信),网银

        case 4:

        var obj= {

          data:{

            step_number : stepNum,

            channel:$('#congzhimoneyform-channel').val(),

            money:$('#congzhimoneyform-money').val()

          }

        };

        obj.data[tokenName]=tokenVal;

          return obj;

          

        break;

        default:

      }

    }

  });

 

  $('.buttonNext').addClass('btn btn-warning');

  $('.buttonPrevious').addClass('btn btn-warning');

  $('.buttonFinish').addClass('btn btn-default');

});

<?php $this->endBlock() ?>

<?php $this->registerJs($this->blocks['wizard-js'],\yii\web\View::POS_END); ?>

 

 

 

 

 

 

代码2

 

<?php

/* @var $this yii\web\View */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\Url;

//use app\assets\SmartWizardAsset;
//SmartWizardAsset::register($this);

?>
<div class='container' style='margin-bottom:100px;'>
  <h3>将按照以下设置进行充值,请仔细核对,如果核对无误,点击"立即充值"按钮进行充值</h3>
  <br>
  <?php
    if('1'==$model->channel){
      //商户提交待付款订单接口(商户-》首信易支付,必做接口)
      ?>

        <table class="table table-striped detail-view" id="w0">
          <tbody>
            <tr><th style="vertical-align:middle !important">充值通道</th><td>网银支付 <img src='<?=Url::toRoute('images/payease.png')?>' width='175' height='56'></td></tr>
            <tr><th>充值金额</th><td><i class="fa fa-cny"></i> <span style="color:red"><?=number_format($model->money,2)?></span></td></tr>
              </tbody>
        </table>
  <?php
    }else{
   ?>


<?php $form = ActiveForm::begin();?>
<?php
  if(isset($tip)&&$tip===true){
    if($model->hasErrors()){
?>
      <div class="alert alert-danger" role="alert">
        <?php
            foreach($model->getErrors("") as $key=>$value){
              echo $value."<br>";
            }
        ?>
      </div>
<?php
    }else{
?>
      <div class="alert alert-success" role="alert"></div>
<?php
    }
  }
?>

<!--?= $form->field($model, 'channel_name',['inputOptions'=>['class'=>'form-control','readonly'=>true]]) ?-->
<?= $form->field($model, 'channel',['template'=>'{input}'])->hiddenInput() ?>
<?= $form->field($model, 'money',['template'=>'{input}'])->hiddenInput() ?>
<!--?= $form->field($model, 'real_name',['template'=>'{input}'])->hiddenInput() ?-->
<table class="table table-striped detail-view" id="w0">
  <tbody>
    <tr><th>充值通道</th><td><?=Html::encode($model->channel_name)?></td></tr>
    <tr><th>充值金额</th><td><i class="fa fa-cny"></i> <span style='color:red'><?=Html::encode(number_format($model->money,2))?></span></td></tr>
    <?php
      /*$keys=  [
              '1'=>'网银支付',
              '2'=>'支付宝',
              '3'=>'微信支付'
            ];*/
      if('2'==$model->channel){
    ?>
        <tr><th>充值备注提示</th><td>
          充值转账时,请务必在支付宝APP的备注中填写您的用户名
        </td></tr>

    <?php
      }
     ?>
  </tbody>
</table>
<?php ActiveForm::end(); ?>
<?php
}
 ?>
</div>

 

 

 

 

 

 

代码3

 

<?php

/* @var $this yii\web\View */

use yii\helpers\Html;
use yii\widgets\ActiveForm;

//use app\assets\SmartWizardAsset;
//SmartWizardAsset::register($this);
?>
<div class='container' style='margin-bottom:100px;'>

<?php $form = ActiveForm::begin();?>
<?= $form->field($model, 'channel_name',['inputOptions'=>['class'=>'form-control','readonly'=>true]]) ?>
<?= $form->field($model, 'channel',['template'=>'{input}'])->hiddenInput() ?>
<?= $form->field($model, 'money')->widget(\yii\widgets\MaskedInput::className(), ['mask' =>'9{1,9}[\.99]'])->label('充值金额(单位:元)') ?>
<?php
  /*$keys=  [
          '1'=>'网银支付',
          '2'=>'支付宝',
          '3'=>'微信支付'
        ];*/
  if('2'==$model->channel){
?>
    <div class="form-group">
      <label class="control-label">充值备注提示</label>
      <!--input name="CongzhiMoneyForm[real_name]" class="form-control" id="congzhimoneyform-real_name" aria-required="true" type="text"-->
      <div class="hint-block">充值转账时,请务必在支付宝APP的备注中填写您的用户名</div>
    </div>

<?php
  }
 ?>
<?php ActiveForm::end(); ?>

</div>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<?php

/* @var $this yii\web\View */

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use app\models\SysConfig;
//use app\assets\SmartWizardAsset;
//SmartWizardAsset::register($this);
if($model->channel==1){
?>
<form name='easepay' id='easepay' method='post' action='https://pay.yizhifubj.com/prs/user_payment.checkit' target='_blank'>
  <input type='hidden' name='v_mid' value='<?=$payease['v6_mid']?>'>
  <!--日期-商户号-商户流水号(每日不可重复)-->
  <input type='hidden' name='v_oid' id='easepay-void' value='<?=$payease['v5_oid']?>'>
  <input type='hidden' name='v_rcvname' value='<?=$payease['v4_rcvname']?>'>
  <input type='hidden' name='v_rcvaddr' value='<?=$payease['v4_rcvname']?>'>
  <input type='hidden' name='v_rcvtel' value='<?=$payease['v4_rcvname']?>'>
  <input type='hidden' name='v_rcvpost' value='<?=$payease['v4_rcvname']?>'>
  <input type='hidden' name='v_amount' value='<?=$payease['v3_amount']?>'>
  <!--日期-yyyymmdd-->
  <input type='hidden' name='v_ymd' value='<?=$payease['v2_ymd']?>'>
  <input type='hidden' name='v_orderstatus' value='1'>
  <input type='hidden' name='v_ordername' value='<?=$payease['v4_rcvname']?>'>
  <!--0-人民币-->
  <input type='hidden' name='v_moneytype' value='<?=$payease['v1_moneytype']?>'>
  <input type='hidden' name='v_url' value='<?=$payease['v7_url']?>'>
  <input type='hidden' name='v_md5info' value='<?=$payease['sign']?>'>

</form>


<?php } ?>

<div class='container' style='margin-bottom:100px;'>
  <div class='center-block' style='padding:50px 0;'>

    <h2 style='text-align:center;'><i class="fa fa-rmb"></i> <?=number_format($model->money,2)?></h2>
    <br>
    <?php
    if($model->channel!=1){
    ?>
    <img src='<?=Url::toRoute(['site/qrcode','qrid'=>$deal->id,'rand'=>time()])?>' class='img-responsive center-block congzhi-qrcode'/>
    <br>
    <?php } ?>
    <?php
    //微信
    $scantext='';
    if($model->channel==1){
      $scantext='请在首信易支付页面完成实际充值';
    }
    else if($model->channel==2){
      $scantext='请使用支付宝扫描二维码以完成充值';
    }else if($model->channel==3){
      $scantext='请使用微信扫描二维码以完成充值';
    }else{

    }
    ?>
    <?php
    if($model->channel!=1){
    ?>
    <div style='display:flex;flex-direction:row;justify-content:center'>
    <img src='<?=Url::toRoute('images/scan.png')?>'  style='width:48px;height:48px;' class='img-responsive' />
    <div style='font-size:16px;max-width:150px;margin-left:10px;'><?=$scantext?></div>
    </div>
  <?php }else{
    echo '<div style="display:flex;flex-direction:row;justify-content:center">';
    echo '<div style="font-size:16px;max-width:150px;margin-left:10px;">'.$scantext.'</div>';
    echo "</div>";
  } ?>
    <table class="table table-striped detail-view" id="w0" style='max-width:500px;margin:10px auto;'>
      <tbody>
        <tr><th style='text-align:left;'>商家</th><td style='text-align:right;'>贝恩资本</td></tr>
        <tr><th style='text-align:left;'>商品名称</th><td style='text-align:right;'><?=$this->context->user->name ?>账户充值</td></tr>
        <tr><th style='text-align:left;'>支付通道</th><td style='text-align:right;' id='deal-channel' channel='<?=$model->channel?>'><?php
        if($model->channel==1){
          echo '网银(首信易)';
        }else if($model->channel==2){
          echo '支付宝';
        }else if($model->channel==3){
          echo '微信支付';
        }else{
          echo '非法通道';
        }
        ?></td></tr>
        <tr><th style='text-align:left;'>交易单号</th><td style='text-align:right;' id='order-no'><?=$model->orderno?></td></tr>
        <tr><th style='text-align:left;'>创建时间</th><td style='text-align:right;'><?=$deal->reg_dt?></td></tr>
      </tbody>
    </table>
  </div>
</div>

<!-- Modal -->
<div class="modal fade" id="congzhi-result" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header btn-warning">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><i class="fa fa-legal"></i> 充值结果</h4>

      </div>
      <div class="modal-body">
        <h3 class="page-header"><i class="fa fa-exclamation alert-info"></i> <span id='result-text'>充值成功!</span></h3>
        <p><b>5秒后跳转到充值起始页面,<a href='<?=Url::toRoute('site/wizardcongzhi')?>'>点此立即跳转</a></b></p>
      </div>
    </div>
  </div>
</div>

加载中
当前问题已关闭评论
返回顶部
顶部