Browse Source

完成商品创建和修改的tabx改造

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
ef9606aaed
  1. 1
      vendor/antgoods/goods/src/views/goods/goods.php
  2. 2
      vendor/antgoods/goods/src/views/goods/picture.php
  3. 53
      vendor/antgoods/goods/src/views/goods/update.php

1
vendor/antgoods/goods/src/views/goods/goods.php

@ -4,6 +4,7 @@ use antgoods\goods\models\ars\Category;
use antgoods\goods\models\ars\Brand;
use antgoods\goods\models\ars\ShopCategory;
use antgoods\goods\models\ars\Supplier;
use linyao\widgets\Select2;
/* @var $this yii\web\View */
/* @var $model antgoods\goods\models\ars\Goods */

2
vendor/antgoods/goods/src/views/goods/picture.php

@ -15,6 +15,7 @@ use yii\helpers\Url;
'maxCount' => 1,
'fillInAttribute' => 'coverImageId',
'model' => $model,
'ruleVerify' => $model->ruleVerify,
'previewConfig' => [
'url' => Url::to(['image-file', 'fileidstr' => $model->coverImageId]),
],
@ -29,6 +30,7 @@ use yii\helpers\Url;
'maxCount' => 5,
'fillInAttribute' => 'detailImageId',
'model' => $model,
'ruleVerify' => $model->ruleVerify,
'previewConfig' => [
'url' => Url::to(['image-file', 'fileidstr' => $model->detailImageId]),
],

53
vendor/antgoods/goods/src/views/goods/update.php

@ -1,6 +1,8 @@
<?php
use yii\helpers\Html;
use yii\bootstrap4\Html;
use yii\bootstrap4\ActiveForm;
use kartik\tabs\TabsX;
/* @var $this yii\web\View */
/* @var $model antgoods\goods\models\ars\Goods */
@ -9,11 +11,56 @@ $this->title = '编辑商品: ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => '商品管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = '编辑 ';
Yii::$app->params['bsVersion'] = '4.x';
?>
<div class="goods-update">
<div class="goods-form">
<?php
$form = ActiveForm::begin(['options' => ['class' => 'container-fluid']]);
<?= $this->render('_form', [
echo TabsX::widget([
'bordered' => true,
'items' => [
[
'label' => '<i class="fas fa-user"></i> 基本信息',
'content' => $this->render('goods', [
'model' => $model,
]) ?>
'form' => $form
]),
],
[
'label' => '<i class="fas fa-list-alt"></i> 商品规格',
'content' => $this->render('attribute', [
'model' => $attributeModel,
'attrValue' => [],
'attrValue' => $attrValue,
]),
],
[
'label' => '<i class="fas fa-picture-o"></i> 图片上传',
'content' => $this->render('picture', [
'model' => $model,
'form' => $form,
]),
],
],
'position' => TabsX::POS_ABOVE,
'encodeLabels' => false
]);
?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
// $this->render('_form', [
// 'model' => $model,
// ])
?>
</div>
Loading…
Cancel
Save