From e73256899be7d02136520e7254bcbed4f79c1d63 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Sat, 7 Dec 2019 10:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=B4=B9=E6=A8=A1=E6=9D=BF=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=88=A0=E9=99=A4=E5=9F=BA=E6=9C=AC=E6=95=B0=E9=87=8F?= =?UTF-8?q?=EF=BC=8C=E5=9F=BA=E6=9C=AC=E8=B4=B9=E7=94=A8=EF=BC=8C=E7=BB=AD?= =?UTF-8?q?=E9=87=8D=E6=95=B0=E9=87=8F=EF=BC=8C=E7=BB=AD=E9=87=8D=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/views/express-template/_form.php | 145 ++---------------- 1 file changed, 16 insertions(+), 129 deletions(-) diff --git a/backend/modules/shop/views/express-template/_form.php b/backend/modules/shop/views/express-template/_form.php index 940b46f..c919f92 100755 --- a/backend/modules/shop/views/express-template/_form.php +++ b/backend/modules/shop/views/express-template/_form.php @@ -2,144 +2,31 @@ use blobt\widgets\Icheck; use backend\modules\shop\models\ars\ExpressTemplate; +use yii\bootstrap4\ActiveForm; +use yii\bootstrap4\Html; /* @var $this yii\web\View */ /* @var $model backend\modules\shop\models\ars\ExpressTemplate */ /* @var $form yii\widgets\ActiveForm */ ?> -request->get('status'); -if ($status == 1) { - ?> - - - -field($model, 'name')->textInput(['maxlength' => true]) ?> - -field($model, 'calculation_type')->widget(Icheck::className(), ["items" => ExpressTemplate::$calculationType, 'type' => "radio"]) ?> - -field($model, 'basic_count')->textInput() ?> +
-field($model, 'basic_price')->textInput() ?> + -field($model, 'extra_count')->textInput() ?> + field($model, 'name')->textInput(['maxlength' => true]) ?> -field($model, 'extra_price')->textInput() ?> - -field($model, 'calculation_type')->widget(Icheck::className(), ["items" => ExpressTemplate::$calculationType, 'type' => "radio"]); + } + ?> - $.each(formList[type],function(index,value){ //更改文字标题 - $("." + index).children("label").html(value) - }); - - $("#expresstemplate-basic_count").val(udfVal[type][0])//重置初始值 - $("#expresstemplate-basic_price").val(udfVal[type][1]) - $("#expresstemplate-extra_count").val(0) - $("#expresstemplate-extra_price").val(udfVal[type][1]) - calType = type; -} -function changeCalType(type){//当切换计算方式 +
+ 'btn btn-success']) ?> + 'btn btn-info']) ?> +
- $.each(formList[type],function(index,value){ //更改文字标题 - $("." + index).children("label").html(value) - }); - - if(!$("#expresstemplate-basic_count").val()){ - $("#expresstemplate-basic_count").val(udfVal[type][0])//重置初始值 - } - if(!$("#expresstemplate-basic_price").val()){ - $("#expresstemplate-basic_price").val(udfVal[type][1]) - } - if(!$("#expresstemplate-extra_count").val()){ - $("#expresstemplate-extra_count").val(0) - } - if(!$("#expresstemplate-extra_price").val()){ - $("#expresstemplate-extra_price").val(udfVal[type][1]) - } - calType = type; -} -$(document).ready(function(){ - $("#expresstemplate-basic_count").blur(function(){ - if (calType == 0) { - if($(this).val() < 0.1){ - $(this).val(0.1) - } - var basiccount = $(this).val(); - $(this).val(Math.floor(basiccount * 10) / 10); - } else{ - if($(this).val() < 1){ - $(this).val(1) - } - var basiccount = $(this).val(); - $(this).val(Math.floor(basiccount * 1) / 1); - } - }) - $("#expresstemplate-basic_price").blur(function(){ - if($(this).val().indexOf('-') != -1){ - $(this).val("0.00") - } - var basicPrice = $(this).val(); - $(this).val(basicPrice.toString().match(/^\d+(?:\.\d{0,2})?/)); - }) - $("#expresstemplate-extra_count").blur(function(){ - if (calType == 0) { - if($(this).val() < 0){ - $(this).val(0) - } - var basiccount = $(this).val(); - $(this).val(Math.floor(basiccount * 10) / 10); - } else{ - if($(this).val() < 0){ - $(this).val(0) - } - var basiccount = $(this).val(); - $(this).val(Math.floor(basiccount * 1) / 1); - } - }) - $("#expresstemplate-extra_price").blur(function(){ - if($(this).val().indexOf('-') != -1){ - $(this).val("0.00") - } - var basicPrice = $(this).val(); - $(this).val(basicPrice.toString().match(/^\d+(?:\.\d{0,2})?/)); - }) - - $("input:radio[name='ExpressTemplate[calculation_type]']").on('ifChecked', function(event){ - updateTypeChangeCalType($(this).val()-1) - }) - changeCalType(calType) -}) -JS; -$this->registerJs($js) + -?> \ No newline at end of file +
\ No newline at end of file