main.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use addons\RandFee\backend\assets\AppAsset;
  3. use common\helpers\Html;
  4. AppAsset::register($this);
  5. ?>
  6. <?php $this->beginPage() ?>
  7. <!DOCTYPE html>
  8. <html lang="<?= Yii::$app->language ?>">
  9. <head>
  10. <meta charset="<?= Yii::$app->charset ?>">
  11. <meta name="keywords" content="">
  12. <meta name="description" content="">
  13. <meta name="format-detection" content="telephone=no" />
  14. <meta name="format-detection" content="address=no" />
  15. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  16. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  17. <?php $this->registerCsrfMetaTags() ?>
  18. <title><?= Html::encode($this->title) ?></title>
  19. <?php $this->head() ?>
  20. </head>
  21. <script>
  22. var validateMoney = (rule, value, callback) => {
  23. console.log("1111")
  24. if(!value){
  25. callback(new Error('价格不能为空'))
  26. }else if(value.indexOf(".") != -1 && value.split('.').length > 2){
  27. callback(new Error('请输入正确格式的金额')) //防止输入多个小数点
  28. }else if(value.indexOf(".") != -1 && value.split('.')[1].length > 2){
  29. callback(new Error('请输入正确的小数位数')) //小数点后两位
  30. }else{
  31. callback();
  32. }
  33. };
  34. </script>
  35. <body>
  36. <?php $this->beginBody() ?>
  37. <?= $content ?>
  38. <?php $this->endBody() ?>
  39. </body>
  40. </html>
  41. <?php $this->endPage() ?>