123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- use common\models\Goods;
- use slavkovrn\lightbox\LightBoxWidget;
- use yii\data\ActiveDataProvider;
- use yii\grid\GridView;
- use yii\helpers\Html;
- use yii\helpers\Url;
- use yii\widgets\DetailView;
- /* @var $this yii\web\View */
- /* @var $model common\models\Goods */
- /* @var $goodsSkuProvider ActiveDataProvider */
- /* @var $goodsAttrProvider ActiveDataProvider */
- $this->title = $model->name;
- $this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'Goods'), 'url' => ['index']];
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <p>
- <?= Html::a(Yii::t('common', '更新商品'), ['update', 'id' => $model->id], ['class' => 'btn btn-success']) ?>
- <?= Html::a(Yii::t('common', '删除商品'), ['delete', 'id' => $model->id], [
- 'class' => 'btn btn-danger',
- 'data' => [
- 'confirm' => Yii::t('common', 'Are you sure you want to delete this item?'),
- 'method' => 'post',
- ],
- ]) ?>
- </p>
- <div class="box box-success">
- <div class="box-body">
- <?= DetailView::widget([
- 'model' => $model,
- 'attributes' => [
- 'id',
- 'cat.title:text:分类',
- 'store.name:text:商家',
- 'name',
- 'desc',
- 'origin_price',
- 'price',
- 'actual_sales',
- 'virtual_sales',
- 'actual_views',
- 'virtual_views',
- 'stock',
- [
- 'attribute' => 'cover',
- 'format' => ['image'],
- 'contentOptions' => ['class' => 'media-content']
- ],
- // [
- // 'attribute' => 'banner',
- // 'format' => ['images'],
- // 'contentOptions' => ['class' => 'media-content']
- // ],
- [
- 'attribute' => 'picture',
- 'format' => ['images'],
- 'contentOptions' => ['class' => 'media-content']
- ],
- 'created_at:datetime',
- 'updated_at:datetime',
- [
- 'attribute' => 'status',
- 'value' => Goods::getStatusList($model->status),
- ],
- ],
- ]) ?>
- </div>
- </div>
- <?php
- $js = <<<JS
- //layer相册
- layer.ready(function () {
- layer.photos({
- photos: '.media-content',
- shift: 5
- });
- });
- JS;
- $this->registerJs($js);
- ?>
|