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