From 5d3427e4e2b6dd096b0bdc3ed0840154e03dd86d Mon Sep 17 00:00:00 2001 From: "changhai.lin" Date: Thu, 9 Jul 2015 19:31:56 +0800 Subject: [PATCH 01/12] no message --- .../modules/auth/views/auth/listRole.php | 14 ++- .../catalog/views/core/item-prop/index.php | 6 +- .../modules/catalog/views/core/item/index.php | 104 +++++++++--------- .../modules/order/views/core/order/index.php | 15 +-- .../payment/views/core/payment/index.php | 15 ++- .../system/views/core/setting/index.php | 15 ++- .../system/views/core/station/index.php | 17 ++- 7 files changed, 106 insertions(+), 80 deletions(-) diff --git a/star-themes/merchant/ultra/modules/auth/views/auth/listRole.php b/star-themes/merchant/ultra/modules/auth/views/auth/listRole.php index b3e69e5..af5b6bd 100644 --- a/star-themes/merchant/ultra/modules/auth/views/auth/listRole.php +++ b/star-themes/merchant/ultra/modules/auth/views/auth/listRole.php @@ -15,9 +15,8 @@ * @var $this yii\web\View */ - use yii\grid\ActionColumn; -use yii\grid\GridView; +use kartik\grid\GridView; use yii\helpers\Url; $this->title = Yii::t('rbac', 'Roles'); @@ -28,8 +27,6 @@ $this->params['sub-menu']['list-role'] = true; ?> - - $dataProvider, 'filterModel' => $filterModel, @@ -67,5 +64,14 @@ ], ] ], + 'export' => false, + 'responsive' => true, + 'panel' => [ + 'heading' => '

' . Yii::t('rbac', 'Roles') . '

', + 'type' => 'success', + 'before' => false, + 'footer' => false, + 'after' => false + ], ]) ?> diff --git a/star-themes/merchant/ultra/modules/catalog/views/core/item-prop/index.php b/star-themes/merchant/ultra/modules/catalog/views/core/item-prop/index.php index 8be1644..02ecae3 100644 --- a/star-themes/merchant/ultra/modules/catalog/views/core/item-prop/index.php +++ b/star-themes/merchant/ultra/modules/catalog/views/core/item-prop/index.php @@ -17,7 +17,6 @@
false, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ @@ -51,11 +50,14 @@ ['class' => 'yii\grid\ActionColumn'], ], + 'export' => false, + 'responsive' => true, 'panel' => [ 'heading' => '

' . Yii::t('catalog', 'Item Props') . '

', 'type' => 'success', 'before' => Html::a('' . Yii::t('catalog', 'Create Item Props'), ['create'], ['class' => 'btn btn-success']), - 'footer' => false + 'footer' => false, + 'after' => false ], ]); ?> diff --git a/star-themes/merchant/ultra/modules/catalog/views/core/item/index.php b/star-themes/merchant/ultra/modules/catalog/views/core/item/index.php index 0f17c53..a5e8c83 100644 --- a/star-themes/merchant/ultra/modules/catalog/views/core/item/index.php +++ b/star-themes/merchant/ultra/modules/catalog/views/core/item/index.php @@ -8,7 +8,7 @@ /* @var $searchModel star\catalog\models\ItemSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ -$this->title = Yii::t('catalog','Items'); +$this->title = Yii::t('catalog', 'Items'); $this->params['breadcrumbs'][] = $this->title; $this->params['title'] = $this->title; @@ -17,11 +17,10 @@ ?>
['/catalog/core/item/bulk'], + 'action' => ['/catalog/core/item/bulk'], 'method' => 'post' ]);?> false, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ @@ -31,23 +30,23 @@ ['class' => 'yii\grid\SerialColumn'], // 'item_id', [ - 'attribute'=>'category_id', - 'value'=>function ($model) { - return '['.$model->category->name.']'; + 'attribute' => 'category_id', + 'value' => function ($model) { + return '[' . $model->category->name . ']'; }, ], // 'outer_id', 'title', [ - 'attribute'=>'stock', - 'value'=>function ($model) { - $skus = $model->skus; - $a = 0; - foreach($skus as $sku){ - $a += $sku->quantity; - } - return $a; - }, + 'attribute' => 'stock', + 'value' => function ($model) { + $skus = $model->skus; + $a = 0; + foreach ($skus as $sku) { + $a += $sku->quantity; + } + return $a; + }, ], // 'min_number', // 'price', @@ -57,29 +56,29 @@ // 'desc:ntext', // 'shipping_fee', [ - 'class'=>'kartik\grid\BooleanColumn', - 'attribute'=>'is_show', - 'vAlign'=>'middle' + 'class' => 'kartik\grid\BooleanColumn', + 'attribute' => 'is_show', + 'vAlign' => 'middle' ], [ - 'class'=>'kartik\grid\BooleanColumn', - 'attribute'=>'is_promote', - 'vAlign'=>'middle' + 'class' => 'kartik\grid\BooleanColumn', + 'attribute' => 'is_promote', + 'vAlign' => 'middle' ], [ - 'class'=>'kartik\grid\BooleanColumn', - 'attribute'=>'is_new', - 'vAlign'=>'middle' + 'class' => 'kartik\grid\BooleanColumn', + 'attribute' => 'is_new', + 'vAlign' => 'middle' ], [ - 'class'=>'kartik\grid\BooleanColumn', - 'attribute'=>'is_hot', - 'vAlign'=>'middle' + 'class' => 'kartik\grid\BooleanColumn', + 'attribute' => 'is_hot', + 'vAlign' => 'middle' ], [ - 'class'=>'kartik\grid\BooleanColumn', - 'attribute'=>'is_best', - 'vAlign'=>'middle' + 'class' => 'kartik\grid\BooleanColumn', + 'attribute' => 'is_best', + 'vAlign' => 'middle' ], // 'click_count', // 'wish_count', @@ -94,33 +93,36 @@ [ 'class' => 'kartik\grid\ActionColumn', - 'headerOptions'=>['class'=>'kartik-sheet-style'], + 'headerOptions' => ['class' => 'kartik-sheet-style'], ], ], - 'panel'=>[ - 'heading'=>'

'.Yii::t('catalog','Items').'

', - 'type'=>'success', - 'before'=>Html::a(''.Yii::t('catalog','Create Items') , ['create'], ['class' => 'btn btn-success']), - 'footer'=>false + 'export' => false, + 'responsive' => true, + 'panel' => [ + 'heading' => '

' . Yii::t('catalog', 'Items') . '

', + 'type' => 'success', + 'before' => Html::a('' . Yii::t('catalog', 'Create Items'), ['create'], ['class' => 'btn btn-success']), + 'footer' => false, + 'after' => false ], 'toolbar' => [ [ - 'content'=> - Html::dropDownList('act','', + 'content' => + Html::dropDownList('act', '', [ - '' =>Yii::t('catalog','Choose Action'), - 'delete' => Yii::t('catalog','delete'), - 'is_show' => Yii::t('catalog','show'), - 'un_show' => Yii::t('catalog','un_show'), - 'is_promote' => Yii::t('catalog','promote'), - 'un_promote' => Yii::t('catalog','un_promote'), - 'is_new' => Yii::t('catalog','new'), - 'un_new' => Yii::t('catalog','un_new'), - 'is_hot' => Yii::t('catalog','hot'), - 'un_hot' =>Yii::t('catalog','un_hot'), - 'is_best' => Yii::t('catalog','best'), - 'un_best' => Yii::t('catalog','un_best'), - ],['class' => 'btn btn-default','style'=>'margin-right:10px']). Html::submitButton(Yii::t('catalog','Save'), ['class' => 'btn btn-success']) , + '' => Yii::t('catalog', 'Choose Action'), + 'delete' => Yii::t('catalog', 'delete'), + 'is_show' => Yii::t('catalog', 'show'), + 'un_show' => Yii::t('catalog', 'un_show'), + 'is_promote' => Yii::t('catalog', 'promote'), + 'un_promote' => Yii::t('catalog', 'un_promote'), + 'is_new' => Yii::t('catalog', 'new'), + 'un_new' => Yii::t('catalog', 'un_new'), + 'is_hot' => Yii::t('catalog', 'hot'), + 'un_hot' => Yii::t('catalog', 'un_hot'), + 'is_best' => Yii::t('catalog', 'best'), + 'un_best' => Yii::t('catalog', 'un_best'), + ], ['class' => 'btn btn-default', 'style' => 'margin-right:10px']) . Html::submitButton(Yii::t('catalog', 'Save'), ['class' => 'btn btn-success']), 'options' => ['class' => 'btn-group-sm'] ], '{export}', diff --git a/star-themes/merchant/ultra/modules/order/views/core/order/index.php b/star-themes/merchant/ultra/modules/order/views/core/order/index.php index 25b635c..9c5185a 100644 --- a/star-themes/merchant/ultra/modules/order/views/core/order/index.php +++ b/star-themes/merchant/ultra/modules/order/views/core/order/index.php @@ -15,13 +15,8 @@
false, - 'responsive' => false, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, - 'containerOptions' => ['style' => 'overflow: auto'], // only set when $responsive = false - 'headerRowOptions' => ['class' => 'kartik-sheet-style'], - 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'columns' => [ ['class' => 'yii\grid\SerialColumn'], @@ -53,13 +48,19 @@ ['class' => 'yii\grid\ActionColumn'], ], + 'export' => false, + 'responsive' => true, + 'containerOptions' => ['style' => 'overflow: auto'], // only set when $responsive = false + 'headerRowOptions' => ['class' => 'kartik-sheet-style'], + 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'panel' => [ 'heading' => '

' . Yii::t('order', 'Orders') . '

', 'type' => 'success', - 'footer' => false + 'footer' => false, + 'before' => false, + 'after' => false ], 'toolbar' => [ - '{export}', '{toggleData}' ], diff --git a/star-themes/merchant/ultra/modules/payment/views/core/payment/index.php b/star-themes/merchant/ultra/modules/payment/views/core/payment/index.php index 0989a04..d1c6461 100644 --- a/star-themes/merchant/ultra/modules/payment/views/core/payment/index.php +++ b/star-themes/merchant/ultra/modules/payment/views/core/payment/index.php @@ -1,7 +1,7 @@ render('_search', ['model' => $searchModel]); ?> -

- 'btn btn-success']) ?> -

- $dataProvider, 'filterModel' => $searchModel, @@ -37,6 +33,15 @@ ['class' => 'yii\grid\ActionColumn'], ], + 'export' => false, + 'responsive' => true, + 'panel' => [ + 'heading' => '

' . Yii::t('payment', 'Payments') . '

', + 'type' => 'success', + 'before' => Html::a('' . Yii::t('payment', 'Create Payment'), ['create'], ['class' => 'btn btn-success']), + 'footer' => false, + 'after' => false + ], ]); ?>
diff --git a/star-themes/merchant/ultra/modules/system/views/core/setting/index.php b/star-themes/merchant/ultra/modules/system/views/core/setting/index.php index 2b22a34..fec0c1f 100644 --- a/star-themes/merchant/ultra/modules/system/views/core/setting/index.php +++ b/star-themes/merchant/ultra/modules/system/views/core/setting/index.php @@ -1,7 +1,7 @@ render('_search', ['model' => $searchModel]); ?> -

- 'btn btn-success']) ?> -

- $dataProvider, 'filterModel' => $searchModel, @@ -38,6 +34,15 @@ ['class' => 'yii\grid\ActionColumn'], ], + 'export' => false, + 'responsive' => true, + 'panel' => [ + 'heading' => '

' . Yii::t('system', 'Setting') . '

', + 'type' => 'success', + 'before' => Html::a('' . Yii::t('system', 'Create Setting'), ['create'], ['class' => 'btn btn-success']), + 'footer' => false, + 'after' => false + ], ]); ?>
diff --git a/star-themes/merchant/ultra/modules/system/views/core/station/index.php b/star-themes/merchant/ultra/modules/system/views/core/station/index.php index 956fe8c..16093b3 100644 --- a/star-themes/merchant/ultra/modules/system/views/core/station/index.php +++ b/star-themes/merchant/ultra/modules/system/views/core/station/index.php @@ -1,13 +1,13 @@ title = 'Stations'; +$this->title = Yii::t('system', 'Stations'); $this->params['breadcrumbs'][] = $this->title; $this->params['title'] = $this->title; @@ -19,10 +19,6 @@

title) ?>

render('_search', ['model' => $searchModel]); ?> -

- 'btn btn-success']) ?> -

- $dataProvider, 'filterModel' => $searchModel, @@ -40,6 +36,15 @@ ['class' => 'yii\grid\ActionColumn'], ], + 'export' => false, + 'responsive' => true, + 'panel' => [ + 'heading' => '

' . Yii::t('system', 'Stations') . '

', + 'type' => 'success', + 'before' => Html::a('' . Yii::t('system', 'Create Station'), ['create'], ['class' => 'btn btn-success']), + 'footer' => false, + 'after' => false + ], ]); ?>
From 8615aa2554665920c073350550c9714d068e7332 Mon Sep 17 00:00:00 2001 From: "changhai.lin" Date: Thu, 9 Jul 2015 20:46:24 +0800 Subject: [PATCH 02/12] no message --- .../ultra/modules/auth/views/auth/addRole.php | 40 +-- .../ultra/modules/auth/views/auth/assign.php | 27 +- .../catalog/views/core/item-prop/_form.php | 247 ++++++++-------- .../modules/catalog/views/core/item/_form.php | 171 +++++------ .../system/views/core/setting/_form.php | 265 +++++++++--------- .../system/views/core/station/_form.php | 82 +++--- .../system/views/core/station/index.php | 1 - .../system/views/core/system/index.php | 23 +- 8 files changed, 447 insertions(+), 409 deletions(-) diff --git a/star-themes/merchant/ultra/modules/auth/views/auth/addRole.php b/star-themes/merchant/ultra/modules/auth/views/auth/addRole.php index fa1b058..2509aeb 100644 --- a/star-themes/merchant/ultra/modules/auth/views/auth/addRole.php +++ b/star-themes/merchant/ultra/modules/auth/views/auth/addRole.php @@ -14,21 +14,29 @@ $this->params['sub-menu']['create'] = true; ?> -

- This generator helps you to quickly generate permissions list from a controller. -

-

This is the name of the controller class to be generated. You should - provide a fully qualified namespaced class (e.g. app\controllers\PostController), - and class name should be in CamelCase ending with the word Controller. Make sure the class - is using the same namespace as specified by your application\'s controllerNamespace property.

+
+
+
- 'post', -]); -echo $form->field($roleModel, 'controllerClass'); -?> -
- 'btn btn-success']) ?> +

+ This generator helps you to quickly generate permissions list from a controller. +

+ +

This is the name of the controller class to be generated. You should + provide a fully qualified namespaced class (e.g. app\controllers\PostController), + and class name should be in CamelCase ending with the word Controller. Make sure the class + is using the same namespace as specified by your application\'s controllerNamespace property.

+ + 'post', + ]); + echo $form->field($roleModel, 'controllerClass'); + ?> +
+ 'btn btn-success']) ?> +
+ end(); ?> +
+
-end(); ?> diff --git a/star-themes/merchant/ultra/modules/auth/views/auth/assign.php b/star-themes/merchant/ultra/modules/auth/views/auth/assign.php index 70dc6d0..e195a0f 100644 --- a/star-themes/merchant/ultra/modules/auth/views/auth/assign.php +++ b/star-themes/merchant/ultra/modules/auth/views/auth/assign.php @@ -14,17 +14,26 @@ $form = ActiveForm::begin([ 'method' => 'post', ]); +?> -echo '

' . $assignModel->role_name . '

'; +
+
+
-foreach ($permissions as $key => $permission) { - echo '
'; - echo \yii\helpers\Html::checkboxList('AssignModel[permissions][' . $key . ']', isset($selected[$key]) ? $selected[$key] : NULL, $permission, ['class' => 'inline checkbox']); + ' . $assignModel->role_name . ''; -} + foreach ($permissions as $key => $permission) { + echo '
'; + echo \yii\helpers\Html::checkboxList('AssignModel[permissions][' . $key . ']', isset($selected[$key]) ? $selected[$key] : NULL, $permission, ['class' => 'inline checkbox']); -?> -
- 'btn btn-primary']) ?> + } + + ?> +
+ 'btn btn-primary']) ?> +
+ end(); ?> +
-end(); ?> \ No newline at end of file +
\ No newline at end of file diff --git a/star-themes/merchant/ultra/modules/catalog/views/core/item-prop/_form.php b/star-themes/merchant/ultra/modules/catalog/views/core/item-prop/_form.php index bad9177..c507fe1 100644 --- a/star-themes/merchant/ultra/modules/catalog/views/core/item-prop/_form.php +++ b/star-themes/merchant/ultra/modules/catalog/views/core/item-prop/_form.php @@ -13,133 +13,136 @@ $this->registerJsFile($url . '/js/dynoTable.js', ['depends' => [\core\assets\AppAsset::className()]]); ?> +
+
+
-
- - - - field($model, 'category_id')->dropDownList(Tree::getTreesByName('商品分类')) ?> - - field($model, 'prop_name')->textInput(['maxlength' => 100]) ?> - - field($model, 'prop_alias')->textInput(['maxlength' => 100]) ?> - - field($model, 'type')->radioList(['1' => '文本框', '2' => '下拉列表', '3' => '多选']) ?> - - field($model, 'is_key_prop')->dropDownList(['0' => '否', '1' => '是']) ?> - - field($model, 'is_sale_prop')->dropDownList(['0' => '否', '1' => '是']) ?> - - field($model, 'is_color_prop')->dropDownList(['0' => '否', '1' => '是']) ?> - - field($model, 'must')->dropDownList(['0' => '否', '1' => '是']) ?> - - field($model, 'multi')->dropDownList(['0' => '否', '1' => '是']) ?> - - field($model, 'status')->dropDownList(['0' => '正常', '1' => '已删除']) ?> - - field($model, 'sort_order')->textInput() ?> - -

添加属性值

-
- 属性值 -
- - - - - - - - isNewRecord) { - ?> - - - - - - - + + field($model, 'category_id')->dropDownList(Tree::getTreesByName('商品分类')) ?> + + field($model, 'prop_name')->textInput(['maxlength' => 100]) ?> + + field($model, 'prop_alias')->textInput(['maxlength' => 100]) ?> + + field($model, 'type')->radioList(['1' => '文本框', '2' => '下拉列表', '3' => '多选']) ?> + + field($model, 'is_key_prop')->dropDownList(['0' => '否', '1' => '是']) ?> + + field($model, 'is_sale_prop')->dropDownList(['0' => '否', '1' => '是']) ?> + + field($model, 'is_color_prop')->dropDownList(['0' => '否', '1' => '是']) ?> + + field($model, 'must')->dropDownList(['0' => '否', '1' => '是']) ?> + + field($model, 'multi')->dropDownList(['0' => '否', '1' => '是']) ?> + + field($model, 'status')->dropDownList(['0' => '正常', '1' => '已删除']) ?> + + field($model, 'sort_order')->textInput() ?> + +

添加属性值

+
+ 属性值 +
+
移动属性值名称克隆删除
- click and drag to rearrange - - - - Clone Row - - Remove Row -
+ + + + + + + isNewRecord) { + ?> + + + + + + + prop_id, // 'order' => 'sort_order asc, value_id asc' // ); - $propValues = star\catalog\models\PropValue::find()->where(['prop_id' => $model->prop_id]) - ->orderBy(['sort_order' => SORT_ASC, 'value_id' => SORT_ASC])->all(); - - foreach ($propValues as $k => $sv) { - ?> - - - - - - - - - - - - - - - -
移动属性值名称克隆删除
+ click and drag to rearrange + + + + Clone Row + + Remove Row +
- click and drag to rearrange - - - - - Clone Row - - Remove Row -
- click and drag to rearrange - - - - - Clone Row - - Remove Row -
-
-
+ $propValues = star\catalog\models\PropValue::find()->where(['prop_id' => $model->prop_id]) + ->orderBy(['sort_order' => SORT_ASC, 'value_id' => SORT_ASC])->all(); + + foreach ($propValues as $k => $sv) { + ?> + + + click and drag to rearrange + + + + + + + Clone Row + + + Remove Row + + + + + + + click and drag to rearrange + + + + + + + Clone Row + + + Remove Row + + + + +
+ + +
+ isNewRecord ? Yii::t('catalog', 'Create') : Yii::t('catalog', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + -
- isNewRecord ? Yii::t('catalog', 'Create') : Yii::t('catalog', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
- - -
diff --git a/star-themes/merchant/ultra/modules/catalog/views/core/item/_form.php b/star-themes/merchant/ultra/modules/catalog/views/core/item/_form.php index 13cba76..60683cd 100644 --- a/star-themes/merchant/ultra/modules/catalog/views/core/item/_form.php +++ b/star-themes/merchant/ultra/modules/catalog/views/core/item/_form.php @@ -10,101 +10,106 @@ use star\catalog\models\Language; use star\catalog\models\Currency; use yii\helpers\ArrayHelper; + /* @var $this yii\web\View */ /* @var $model star\catalog\models\Item */ /* @var $form yii\widgets\ActiveForm */ -list($path,$url) = Yii::$app->assetManager->publish('@star/catalog/assets/js'); +list($path, $url) = Yii::$app->assetManager->publish('@star/catalog/assets/js'); $this->registerJsFile($url . '/skus.js', ['depends' => [\core\assets\AppAsset::className()]]); ?> -
- - ['enctype'=>'multipart/form-data'] - ]); - - $fieldGroups = []; - $fields = []; - $fields[] = $form->field($model, 'title')->textInput(['maxlength' => 255]); - $currency = Currency::find()->all(); - $fields[] = $form->field($model, 'currency')->dropDownList(ArrayHelper::map($currency, 'currency_id', 'name')); - $language = Language::find()->all(); - $fields[] = $form->field($model, 'language')->dropDownList(ArrayHelper::map($language, 'language_id', 'name')); - $fieldGroups[] = ['label' => Yii::t('catalog','Base Info'), 'content' => implode('', $fields)]; - - $fields = []; - $fields[] = $form->field($model, 'desc')->widget(CKEditor::className(), [ - 'editorOptions' => [ - 'filebrowserBrowseUrl' => Url::to(['/elfinder/manager','filter' => 'image']), - ]]); - $fieldGroups[] = ['label' => Yii::t('catalog','Detailed Info'), 'content' => implode('', $fields)]; - - $fields = []; - $fields[] = $form->field($model, 'shipping_fee')->textInput(['maxlength' => 255]); - $fields[] = $form->field($model, 'is_show')->radioList(['No','Yes']); - $fields[] = $form->field($model, 'is_promote')->radioList(['No','Yes']); - $fields[] = $form->field($model, 'is_new')->radioList(['No','Yes']); - $fields[] = $form->field($model, 'is_hot')->radioList(['No','Yes']); - $fields[] = $form->field($model, 'is_best')->radioList(['No','Yes']); - - $fieldGroups[] = ['label' => Yii::t('catalog','Other Info'), 'content' => implode('', $fields)]; - - $fields = []; - $fields[] = $form->field($model, 'category_id')->dropDownList(Tree::getTreesByName('商品分类'),[ - 'data-url' => Url::to(['/catalog/core/item/item-props']), - 'data-item_id' => $model->item_id, - 'data-tree_id' => $model->category_id ? $model->category_id : key(Tree::getTreesByName('商品分类')), - ]); - $fields[] = $this->render('_form_prop',['model' => $model, 'tree_id' => $model->category_id ? $model->category_id : key(Tree::getTreesByName('商品分类'))]); - - $fieldGroups[] = ['label' => Yii::t('catalog','Product Info'), 'content' => implode('', $fields)]; - - $fields = []; - if($model->isNewRecord){ - $fields[] = $form->field($model, 'images[]')->widget(FileInput::classname(), [ - 'options' => ['accept' => 'image/*', 'multiple'=>true], - 'pluginOptions' => [ - 'allowedFileExtensions'=>['jpg','gif','png'] - ] +
+
+ + ['enctype' => 'multipart/form-data'] ]); - }else{ - $itemImages = $model->itemImgs; - $initialPreview = $initialPreviewConfig = []; - foreach($itemImages as $itemImage){ - $initialPreview[] = "pic."' class='file-preview-image'>"; - $initialPreviewConfig[] = [ - 'caption'=>$itemImage->title, - 'url'=>Url::to(['/catalog/core/item-img/delete','id'=>$itemImage->img_id]), - ]; - } - $fields[] = $form->field($model, 'images[]')->label(Yii::t('catalog','Image(If update,Please upload first)'))->widget(FileInput::classname(), [ - 'language' => 'zh', - 'options' => [ 'accept' => 'image/*', 'multiple'=>true], - 'pluginOptions' => [ - 'initialPreview'=>$initialPreview, - 'initialPreviewConfig'=>$initialPreviewConfig, - 'overwriteInitial'=>false, - 'uploadUrl' => Url::to(['/catalog/core/item-img/create']), - 'uploadExtraData' => [ - 'item_id' => $model->item_id, - 'position' => count($itemImages)//TODO: js - ], - 'maxFileCount' => 10, - 'allowedFileExtensions'=>['jpg','gif','png'] - ] + $fieldGroups = []; + $fields = []; + $fields[] = $form->field($model, 'title')->textInput(['maxlength' => 255]); + $currency = Currency::find()->all(); + $fields[] = $form->field($model, 'currency')->dropDownList(ArrayHelper::map($currency, 'currency_id', 'name')); + $language = Language::find()->all(); + $fields[] = $form->field($model, 'language')->dropDownList(ArrayHelper::map($language, 'language_id', 'name')); + $fieldGroups[] = ['label' => '' . Yii::t('catalog', 'Base Info'), 'content' => implode('', $fields)]; + + $fields = []; + $fields[] = $form->field($model, 'desc')->widget(CKEditor::className(), [ + 'editorOptions' => [ + 'filebrowserBrowseUrl' => Url::to(['/elfinder/manager', 'filter' => 'image']), + ]]); + $fieldGroups[] = ['label' => '' . Yii::t('catalog', 'Detailed Info'), 'content' => implode('', $fields)]; + + $fields = []; + $fields[] = $form->field($model, 'shipping_fee')->textInput(['maxlength' => 255]); + $fields[] = $form->field($model, 'is_show')->radioList(['No', 'Yes']); + $fields[] = $form->field($model, 'is_promote')->radioList(['No', 'Yes']); + $fields[] = $form->field($model, 'is_new')->radioList(['No', 'Yes']); + $fields[] = $form->field($model, 'is_hot')->radioList(['No', 'Yes']); + $fields[] = $form->field($model, 'is_best')->radioList(['No', 'Yes']); + + $fieldGroups[] = ['label' => '' . Yii::t('catalog', 'Other Info'), 'content' => implode('', $fields)]; + + $fields = []; + $fields[] = $form->field($model, 'category_id')->dropDownList(Tree::getTreesByName('商品分类'), [ + 'data-url' => Url::to(['/catalog/core/item/item-props']), + 'data-item_id' => $model->item_id, + 'data-tree_id' => $model->category_id ? $model->category_id : key(Tree::getTreesByName('商品分类')), ]); - } - $fieldGroups[] = ['label' => Yii::t('catalog','Product Image'), 'content' => implode('', $fields)]; - echo Tabs::widget(['items' => $fieldGroups]); - ?> + $fields[] = $this->render('_form_prop', ['model' => $model, 'tree_id' => $model->category_id ? $model->category_id : key(Tree::getTreesByName('商品分类'))]); + + $fieldGroups[] = ['label' => '' . Yii::t('catalog', 'Product Info'), 'content' => implode('', $fields)]; + + $fields = []; + if ($model->isNewRecord) { + $fields[] = $form->field($model, 'images[]')->widget(FileInput::classname(), [ + 'options' => ['accept' => 'image/*', 'multiple' => true], + 'pluginOptions' => [ + 'allowedFileExtensions' => ['jpg', 'gif', 'png'] + ] + ]); + } else { + $itemImages = $model->itemImgs; + $initialPreview = $initialPreviewConfig = []; + foreach ($itemImages as $itemImage) { + $initialPreview[] = "pic . "' class='file-preview-image'>"; + $initialPreviewConfig[] = [ + 'caption' => $itemImage->title, + 'url' => Url::to(['/catalog/core/item-img/delete', 'id' => $itemImage->img_id]), + ]; + } + + $fields[] = $form->field($model, 'images[]')->label(Yii::t('catalog', 'Image(If update,Please upload first)'))->widget(FileInput::classname(), [ + 'language' => 'zh', + 'options' => ['accept' => 'image/*', 'multiple' => true], + 'pluginOptions' => [ + 'initialPreview' => $initialPreview, + 'initialPreviewConfig' => $initialPreviewConfig, + 'overwriteInitial' => false, + 'uploadUrl' => Url::to(['/catalog/core/item-img/create']), + 'uploadExtraData' => [ + 'item_id' => $model->item_id, + 'position' => count($itemImages)//TODO: js + ], + 'maxFileCount' => 10, + 'allowedFileExtensions' => ['jpg', 'gif', 'png'] + ] + ]); + } + $fieldGroups[] = ['label' => '' . Yii::t('catalog', 'Product Image'), 'content' => implode('', $fields)]; + echo Tabs::widget(['items' => $fieldGroups, 'navType' => 'nav-tabs', 'encodeLabels' => false]); + ?> -
- isNewRecord ?Yii::t('catalog','Create') : Yii::t('catalog','Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
+
+
+ isNewRecord ? Yii::t('catalog', 'Create') : Yii::t('catalog', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+
- + +
diff --git a/star-themes/merchant/ultra/modules/system/views/core/setting/_form.php b/star-themes/merchant/ultra/modules/system/views/core/setting/_form.php index 2475215..22a410f 100644 --- a/star-themes/merchant/ultra/modules/system/views/core/setting/_form.php +++ b/star-themes/merchant/ultra/modules/system/views/core/setting/_form.php @@ -12,140 +12,143 @@ $this->registerJsFile($url . '/js/dynoTable.js', ['depends' => [\core\assets\AppAsset::className()]]); ?> +
+
+
-
- - - - field($model, 'menu_code')->textInput(['maxlength' => true]) ?> - - field($model, 'menu_label')->textInput(['maxlength' => true]) ?> - - field($model, 'group_code')->textInput(['maxlength' => true]) ?> - - field($model, 'group_label')->textInput(['maxlength' => true]) ?> - - field($model, 'menu_sort')->textInput() ?> - - field($model, 'group_sort')->textInput() ?> - -

添加属性值

- 如果选择type是 radio或者Checklist, value填入的值需要是json数组,例子:{"1":"激活","2":"未激活"} 默认选择放在最后的值 -
- 属性值 -
- - - - - - - - isNewRecord) { - ?> - - - - - - - settingFields; - - foreach ($SettingFields as $k => $SettingFieldsModel) { - ?> - - - - - - - - - - - - - - - -
移动属性值名称克隆删除
- click and drag to rearrange - - - getStatusArray()], ['id' => 'tf1']) ?> - - 'tf1']) ?> - - 'tf1']) ?> - - 'tf1']) ?> - - Clone Row - - Remove Row -
- click and drag to rearrange - - setting_fields_id) ?> - - type, [$SettingFieldsModel->getStatusArray()], ['id' => 'tf1']) ?> - - fields_code, ['id' => 'tf1']) ?> - - fields_label, ['id' => 'tf1']) ?> - - value, ['id' => 'tf1']) ?> - - Clone Row - - Remove Row -
- click and drag to rearrange - - - - getStatusArray()], ['id' => 'tf1']) ?> - - 'tf1']) ?> - - 'tf1']) ?> - - 'tf1']) ?> - - Clone Row - - Remove Row -
-
-
+ + field($model, 'menu_code')->textInput(['maxlength' => true]) ?> -
- isNewRecord ? Yii::t('system', 'Create') : Yii::t('system', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
+ field($model, 'menu_label')->textInput(['maxlength' => true]) ?> + + field($model, 'group_code')->textInput(['maxlength' => true]) ?> + + field($model, 'group_label')->textInput(['maxlength' => true]) ?> - + field($model, 'menu_sort')->textInput() ?> + field($model, 'group_sort')->textInput() ?> + +

添加属性值

+ 如果选择type是 radio或者Checklist, value填入的值需要是json数组,例子:{"1":"激活","2":"未激活"} 默认选择放在最后的值 +
+ 属性值 +
+ + + + + + + + isNewRecord) { + ?> + + + + + + + settingFields; + + foreach ($SettingFields as $k => $SettingFieldsModel) { + ?> + + + + + + + + + + + + + + + +
移动属性值名称克隆删除
+ click and drag to rearrange + + + getStatusArray()], ['id' => 'tf1']) ?> + + 'tf1']) ?> + + 'tf1']) ?> + + 'tf1']) ?> + + Clone Row + + Remove Row +
+ click and drag to rearrange + + setting_fields_id) ?> + + type, [$SettingFieldsModel->getStatusArray()], ['id' => 'tf1']) ?> + + fields_code, ['id' => 'tf1']) ?> + + fields_label, ['id' => 'tf1']) ?> + + value, ['id' => 'tf1']) ?> + + Clone Row + + Remove Row +
+ click and drag to rearrange + + + + getStatusArray()], ['id' => 'tf1']) ?> + + 'tf1']) ?> + + 'tf1']) ?> + + 'tf1']) ?> + + Clone Row + + Remove Row +
+
+
+ + +
+ isNewRecord ? Yii::t('system', 'Create') : Yii::t('system', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + + +
+
diff --git a/star-themes/merchant/ultra/modules/system/views/core/station/_form.php b/star-themes/merchant/ultra/modules/system/views/core/station/_form.php index c1c1136..75952d6 100644 --- a/star-themes/merchant/ultra/modules/system/views/core/station/_form.php +++ b/star-themes/merchant/ultra/modules/system/views/core/station/_form.php @@ -12,43 +12,47 @@ ?> -
- - - - field($model, 'name')->textInput(['maxlength' => 100]) ?> - - field($model, 'detail')->widget(\mihaildev\ckeditor\CKEditor::className(), [ - 'editorOptions' => [ - 'preset' => 'full', - 'inline' => false, - ], - ]) ?> - - field($model, 'enabled')->dropDownList(['0' => '不启用', '1' => '启用']) ?> - - field($model, 'start_date')->widget(\kartik\widgets\DatePicker::className(), [ - 'options' => ['placeholder' => 'Select operating time ...', 'value' => date('Y-m-d', time())], - 'convertFormat' => true, - 'pluginOptions' => [ - 'format' => 'yyyy-MM-dd', - 'todayHighlight' => true - ] - ]) ?> - - field($model, 'end_date')->widget(\kartik\widgets\DatePicker::className(), [ - 'options' => ['placeholder' => 'Select operating time ...', 'value' => date('Y-m-d', time() + 365 * 24 * 60 * 60)], - 'convertFormat' => true, - 'pluginOptions' => [ - 'format' => 'yyyy-MM-dd', - 'todayHighlight' => true - ] - ]) ?> - -
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+
+
+ + + + field($model, 'name')->textInput(['maxlength' => 100]) ?> + + field($model, 'detail')->widget(\mihaildev\ckeditor\CKEditor::className(), [ + 'editorOptions' => [ + 'preset' => 'full', + 'inline' => false, + ], + ]) ?> + + field($model, 'enabled')->dropDownList(['0' => '不启用', '1' => '启用']) ?> + + field($model, 'start_date')->widget(\kartik\widgets\DatePicker::className(), [ + 'options' => ['placeholder' => 'Select operating time ...', 'value' => date('Y-m-d', time())], + 'convertFormat' => true, + 'pluginOptions' => [ + 'format' => 'yyyy-MM-dd', + 'todayHighlight' => true + ] + ]) ?> + + field($model, 'end_date')->widget(\kartik\widgets\DatePicker::className(), [ + 'options' => ['placeholder' => 'Select operating time ...', 'value' => date('Y-m-d', time() + 365 * 24 * 60 * 60)], + 'convertFormat' => true, + 'pluginOptions' => [ + 'format' => 'yyyy-MM-dd', + 'todayHighlight' => true + ] + ]) ?> + +
+ isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + + +
- - - -
+
\ No newline at end of file diff --git a/star-themes/merchant/ultra/modules/system/views/core/station/index.php b/star-themes/merchant/ultra/modules/system/views/core/station/index.php index 16093b3..65e9c85 100644 --- a/star-themes/merchant/ultra/modules/system/views/core/station/index.php +++ b/star-themes/merchant/ultra/modules/system/views/core/station/index.php @@ -16,7 +16,6 @@ ?>
-

title) ?>

render('_search', ['model' => $searchModel]); ?> params['menu']['system'] = true; $this->params['sub-menu']['system'] = true; ?> -
- - ['class' => 'form-horizontal']]); - echo $setting->renderForm($form); - echo Html::submitButton(Yii::t('core_system', 'Save'), ['class' => 'btn btn-primary']); - $form->end(); - ?> +
+
+ + ['class' => 'form-horizontal']]); + echo $setting->renderForm($form); + ?> + +
+
+ 'btn btn-primary']); ?> +
+
+ +
From 6f37a41cdec774cd3e67bb2e834fb1325d6bf8f4 Mon Sep 17 00:00:00 2001 From: wucangzhou Date: Thu, 9 Jul 2015 21:01:08 +0800 Subject: [PATCH 03/12] cart nav translate --- star-themes/home/default/layouts/main.php | 14 +++++----- .../default/modules/cart/views/cart/index.php | 26 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/star-themes/home/default/layouts/main.php b/star-themes/home/default/layouts/main.php index cf9af0e..3f39181 100644 --- a/star-themes/home/default/layouts/main.php +++ b/star-themes/home/default/layouts/main.php @@ -49,8 +49,8 @@ user->isGuest) { ?> -

Welcome visitor can you Log In or - Create an Account

+

欢迎,您可以 登陆 或者 + 创建账号

@@ -62,11 +62,11 @@ $countWishlist = count(Wishlist::findAll(['user_id' => Yii::$app->user->id])); ?> diff --git a/star-themes/home/default/modules/cart/views/cart/index.php b/star-themes/home/default/modules/cart/views/cart/index.php index c6b5558..602b349 100644 --- a/star-themes/home/default/modules/cart/views/cart/index.php +++ b/star-themes/home/default/modules/cart/views/cart/index.php @@ -14,17 +14,17 @@
-

Cart

+

购物车

- + - - - + + + @@ -82,7 +82,7 @@ From 9bd845623e67edc572e356d14eeb4d5a658e5fe7 Mon Sep 17 00:00:00 2001 From: wucangzhou Date: Fri, 10 Jul 2015 14:32:56 +0800 Subject: [PATCH 04/12] refund view --- star-home/config/main.php | 3 ++ star-modules/refund/messages/zh/refund.php | 1 + star-themes/home/default/layouts/member.php | 5 ++ .../modules/order/views/home/order/list.php | 6 +-- .../refund/views/home/refund/_form.php | 47 +++++++++++++++++++ .../refund/views/home/refund/create.php | 24 ++++++++++ .../refund/views/home/refund/index.php | 45 ++++++++++++++++++ .../modules/refund/views/home/refund/view.php | 45 ++++++++++++++++++ 8 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 star-themes/home/default/modules/refund/views/home/refund/_form.php create mode 100644 star-themes/home/default/modules/refund/views/home/refund/create.php create mode 100644 star-themes/home/default/modules/refund/views/home/refund/index.php create mode 100644 star-themes/home/default/modules/refund/views/home/refund/view.php diff --git a/star-home/config/main.php b/star-home/config/main.php index b3c15d9..33bf6c2 100644 --- a/star-home/config/main.php +++ b/star-home/config/main.php @@ -44,6 +44,9 @@ 'payment' => [ 'class' =>'star\payment\Module', ], + 'refund' =>[ + 'class' =>'star\refund\Module', + ] ], 'components' => [ 'urlManager'=>[ diff --git a/star-modules/refund/messages/zh/refund.php b/star-modules/refund/messages/zh/refund.php index 35e26c7..34d2de6 100644 --- a/star-modules/refund/messages/zh/refund.php +++ b/star-modules/refund/messages/zh/refund.php @@ -24,4 +24,5 @@ 'Create At' => '创建时间', 'Update At' => '更新时间', 'Status' => '状态', + 'Refund Log' => '退货日志', ]; \ No newline at end of file diff --git a/star-themes/home/default/layouts/member.php b/star-themes/home/default/layouts/member.php index f6ec70a..442ce57 100644 --- a/star-themes/home/default/layouts/member.php +++ b/star-themes/home/default/layouts/member.php @@ -41,6 +41,11 @@ +
  • + + + +
  • diff --git a/star-themes/home/default/modules/order/views/home/order/list.php b/star-themes/home/default/modules/order/views/home/order/list.php index 233e046..69ad1a9 100644 --- a/star-themes/home/default/modules/order/views/home/order/list.php +++ b/star-themes/home/default/modules/order/views/home/order/list.php @@ -62,9 +62,9 @@
  • - - Reorder - + status == $orderModel::STATUS_WAIT_CONFIRM){ ?> + 退货 +
  • diff --git a/star-themes/home/default/modules/refund/views/home/refund/_form.php b/star-themes/home/default/modules/refund/views/home/refund/_form.php new file mode 100644 index 0000000..5e4f1af --- /dev/null +++ b/star-themes/home/default/modules/refund/views/home/refund/_form.php @@ -0,0 +1,47 @@ + $order_id]); +?> + +
    + + '', + 'options' => [ + 'class' => 'type_2', + 'enctype' => 'multipart/form-data' + ], + 'fieldConfig' => [ + 'labelOptions' => ['class' => 'required'], + 'template' => "
    {label}
    {input}
    \n
    {error}\n{hint}
    ", + ], + ]); ?> + + field($model, 'order_id')->textInput(['value' => $order_id, 'disabled' => 'disabled']) ?> + + field($model, 'refund_fee')->textInput(['maxlength' => 10, 'value' => $order->total_price]) ?> + + field($model, 'reason')->textInput(['maxlength' => 255]) ?> + + field($model, 'memo')->textInput(['maxlength' => 255]) ?> + + field($model, 'image')->fileInput() ?> + +
    +
    + isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
    +
    + + + +
    diff --git a/star-themes/home/default/modules/refund/views/home/refund/create.php b/star-themes/home/default/modules/refund/views/home/refund/create.php new file mode 100644 index 0000000..8f5b068 --- /dev/null +++ b/star-themes/home/default/modules/refund/views/home/refund/create.php @@ -0,0 +1,24 @@ +title = Yii::t('refund', '申请退货', [ + 'modelClass' => 'Refund', +]); +$this->params['breadcrumbs'][] = ['label' => Yii::t('refund', 'Refunds'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
    + +

    title) ?>

    + + render('_form', [ + 'model' => $model, + 'order_id' => $order_id, + ]) ?> + +
    diff --git a/star-themes/home/default/modules/refund/views/home/refund/index.php b/star-themes/home/default/modules/refund/views/home/refund/index.php new file mode 100644 index 0000000..3287273 --- /dev/null +++ b/star-themes/home/default/modules/refund/views/home/refund/index.php @@ -0,0 +1,45 @@ +title = Yii::t('refund', 'Refunds'); +$this->params['breadcrumbs'][] = $this->title; +$this->params['refund-list'] = true; +?> +
    + +

    title) ?>

    + + $dataProvider, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + +// 'refund_id', + 'order_id', + 'refund_fee', + 'reason', + 'memo', + 'create_at:date', + // 'update_at', + [ + 'attribute' => 'status', + 'label' => '审核状态', + 'value' => function($model){ + $statusList = [0 => '待审核', 1 => '审核中', 2 => '审核通过']; + return $statusList[$model->status]; + }, + ], + + [ + 'class' => 'yii\grid\ActionColumn', + 'template' => '
    {view} {delete}
    ' + ], + ], + ]); ?> + +
    diff --git a/star-themes/home/default/modules/refund/views/home/refund/view.php b/star-themes/home/default/modules/refund/views/home/refund/view.php new file mode 100644 index 0000000..d129d53 --- /dev/null +++ b/star-themes/home/default/modules/refund/views/home/refund/view.php @@ -0,0 +1,45 @@ +title = '查看退货'; +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Refunds'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +$this->params['refund-list'] = true; +?> +
    + +

    title) ?>

    + + '待审核', 1 => '审核中', 2 => '审核通过']; + $model->create_at = date("Y-m-d H:i",$model->create_at); + $model->status = $dataList[$model->status]; + ?> + $model, + 'attributes' => [ +// 'refund_id', + 'order_id', + 'refund_fee', + 'reason', + 'memo', + 'create_at', +// 'update_at', + 'status', + ], + ]) ?> + + No Image + +
    + + + +
    + +
    From 3fc2adfa8a7fa316007b65b7ea75e7bcaa52f60d Mon Sep 17 00:00:00 2001 From: wucangzhou Date: Mon, 13 Jul 2015 15:21:45 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E9=80=80=E8=B4=A7=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=8F=8A=E5=89=8D=E5=8F=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star-modules/order/messages/zh/order.php | 5 ++-- star-modules/order/models/Order.php | 8 +++--- .../controllers/core/RefundController.php | 25 ++++++++----------- .../controllers/home/RefundController.php | 4 +++ star-modules/refund/messages/zh/refund.php | 3 +++ star-modules/refund/models/Refund.php | 16 ++++++++++++ .../refund/views/core/refund/_form.php | 2 +- .../refund/views/core/refund/index.php | 11 ++++++-- .../refund/views/core/refund/view.php | 2 +- .../refund/views/home/refund/index.php | 15 +++++++---- 10 files changed, 62 insertions(+), 29 deletions(-) diff --git a/star-modules/order/messages/zh/order.php b/star-modules/order/messages/zh/order.php index f080868..fc9a436 100644 --- a/star-modules/order/messages/zh/order.php +++ b/star-modules/order/messages/zh/order.php @@ -30,8 +30,8 @@ 'Wait Confirm' => '待收货', 'Complete' => '订单完成', 'Wait Refund' => '退货中', - 'Refund Failed' => '退货未通过', - 'Refund Pass' => '退货通过', + 'Refund Failed' => '退货申请未通过', + 'Refund Pass' => '退货申请通过', 'Order No' => '订单号', 'Orders' => '订单', 'Order' => '订单', @@ -41,5 +41,6 @@ 'Picture' => '图片', 'Item Name' => '货物名称', 'Shipment' => '物流', + 'Wait Refund Checks' => '申请退货', ]; \ No newline at end of file diff --git a/star-modules/order/models/Order.php b/star-modules/order/models/Order.php index b5e08b4..db21e60 100644 --- a/star-modules/order/models/Order.php +++ b/star-modules/order/models/Order.php @@ -36,9 +36,10 @@ class Order extends \yii\db\ActiveRecord const STATUS_WAIT_SHIPMENT = 2; const STATUS_WAIT_CONFIRM = 3; const STATUS_COMPLETE = 4; - const STATUS_WAIT_REFUND = 5; - const STATUS_REFUND_FAILED = 6; - const STATUS_REFUND_PASS = 7; + const STATUS_WAIT_REFUND_CHECK = 5; + const STATUS_WAIT_REFUND = 6; + const STATUS_REFUND_FAILED = 7; + const STATUS_REFUND_PASS = 8; const EVENT_CHANGE_PRICE = 'changeOrderPrice'; @@ -48,6 +49,7 @@ public function getStatusArray(){ self::STATUS_WAIT_SHIPMENT => Yii::t('order','Wait Shipment'), self::STATUS_WAIT_CONFIRM => Yii::t('order','Wait Confirm'), self::STATUS_COMPLETE => Yii::t('order','Complete'), + self::STATUS_WAIT_REFUND_CHECK => Yii::t('order','Wait Refund Checks'), self::STATUS_WAIT_REFUND => Yii::t('order','Wait Refund'), self::STATUS_REFUND_FAILED => Yii::t('order','Refund Failed'), self::STATUS_REFUND_PASS => Yii::t('order','Refund Pass'), diff --git a/star-modules/refund/controllers/core/RefundController.php b/star-modules/refund/controllers/core/RefundController.php index 5fafc97..8a7c97b 100644 --- a/star-modules/refund/controllers/core/RefundController.php +++ b/star-modules/refund/controllers/core/RefundController.php @@ -89,21 +89,16 @@ public function actionUpdate($id) /** @var \star\order\models\Order $orderModel */ $order = Yii::createObject(Order::className()); $orderModel = $order::find()->where(['order_id'=>$model->order_id])->one(); - if($model->status==0){ - $orderModel->status = 6; - } - if($model->status==1){ - $orderModel->status = 8; - $orderItems = $orderModel->orderItems; - foreach($orderItems as $orderItem) { - /** @var \star\catalog\models\Sku $sku */ - $sku = Sku::findOne(['item_id' => $orderItem->item_id]); - $sku->quantity += $orderItem->qty; - $sku->update(); - } - } - if($model->status==3){ - $orderModel->status = 7; + switch($model->status){ + case $model::STATUS_WAIT_CHECK: + $orderModel->status = $orderModel::STATUS_WAIT_REFUND_CHECK; + break; + case $model::STATUS_PASS: + $orderModel->status = $orderModel::STATUS_REFUND_PASS; + break; + case $model::STATUS_FAILED: + $orderModel->status = $orderModel::STATUS_REFUND_FAILED; + break; } $orderModel->save(); return $this->redirect(['view', 'id' => $model->refund_id]); diff --git a/star-modules/refund/controllers/home/RefundController.php b/star-modules/refund/controllers/home/RefundController.php index aa21102..9d56f04 100644 --- a/star-modules/refund/controllers/home/RefundController.php +++ b/star-modules/refund/controllers/home/RefundController.php @@ -96,6 +96,10 @@ public function actionCreate() $model->image = Yii::$app->params['imageDomain'] . '/refund/' . $file->baseName . time() . '.' . $file->extension; } if ($model->save()) { + $order->status = $order::STATUS_WAIT_REFUND_CHECK; + if(!$order->save()){ + throw new Exception(404, Yii::t('app', 'order create error!')); + } return $this->redirect(['view', 'id' => $model->refund_id]); } } diff --git a/star-modules/refund/messages/zh/refund.php b/star-modules/refund/messages/zh/refund.php index 34d2de6..37356ac 100644 --- a/star-modules/refund/messages/zh/refund.php +++ b/star-modules/refund/messages/zh/refund.php @@ -25,4 +25,7 @@ 'Update At' => '更新时间', 'Status' => '状态', 'Refund Log' => '退货日志', + 'Wait Check' => '等待审核', + 'Pass' => '审核通过', + 'Failed' => '审核未通过', ]; \ No newline at end of file diff --git a/star-modules/refund/models/Refund.php b/star-modules/refund/models/Refund.php index 6b1f31b..a152ce4 100644 --- a/star-modules/refund/models/Refund.php +++ b/star-modules/refund/models/Refund.php @@ -9,6 +9,7 @@ namespace star\refund\models; +use star\order\models\Order; use yii\db\ActiveRecord; use Yii; use yii\behaviors\TimestampBehavior; @@ -30,6 +31,17 @@ */ class Refund extends ActiveRecord { + const STATUS_WAIT_CHECK = 0; + const STATUS_PASS = 1; + const STATUS_FAILED = 2; + + public function getStatusArray(){ + return [ + self::STATUS_WAIT_CHECK => Yii::t('refund','Wait Check'), + self::STATUS_PASS => Yii::t('refund','Pass'), + self::STATUS_FAILED => Yii::t('refund','Failed'), + ]; + } /** * @inheritdoc */ @@ -80,4 +92,8 @@ public function attributeLabels() 'status' => Yii::t('refund', 'Status'), ]; } + + public function getOrder(){ + return $this->hasOne(Order::className(),['order_id'=>'order_id']); + } } \ No newline at end of file diff --git a/star-modules/refund/views/core/refund/_form.php b/star-modules/refund/views/core/refund/_form.php index 1243439..bae5a9a 100644 --- a/star-modules/refund/views/core/refund/_form.php +++ b/star-modules/refund/views/core/refund/_form.php @@ -30,7 +30,7 @@ field($model, 'update_at')->textInput(['value' => date("Y-m-d H:i",$model->update_at), 'disabled' => TRUE]) ?> - field($model, 'status')->dropDownList([0 => '待审核', 1 => '审核中', 2 => '审核通过']) ?> + field($model, 'status')->dropDownList($model->getStatusArray()) ?>
    diff --git a/star-modules/refund/views/core/refund/index.php b/star-modules/refund/views/core/refund/index.php index 48fd183..dc8ee70 100644 --- a/star-modules/refund/views/core/refund/index.php +++ b/star-modules/refund/views/core/refund/index.php @@ -17,7 +17,14 @@ ['class' => 'yii\grid\SerialColumn'], 'refund_id', - 'order_id', + [ + 'attribute' => 'order_id', + 'label' => '订单号', + 'format' => 'raw', + 'value' => function($model){ + return Html::a($model->order->order_no,\yii\helpers\Url::to(['/order/home/order/view','id'=>$model->order_id])); + }, + ], 'refund_fee', 'reason', 'memo', @@ -27,7 +34,7 @@ 'attribute' => 'status', 'label' => '审核状态', 'value' => function($model){ - $statusList = [0 => '待审核', 1 => '审核中', 2 => '审核通过']; + $statusList = $model->getStatusArray(); return $statusList[$model->status]; }, ], diff --git a/star-modules/refund/views/core/refund/view.php b/star-modules/refund/views/core/refund/view.php index d846502..9cf1df3 100644 --- a/star-modules/refund/views/core/refund/view.php +++ b/star-modules/refund/views/core/refund/view.php @@ -26,7 +26,7 @@

    '待审核', 1 => '审核中', 2 => '审核通过']; + $dataList = $model->getStatusArray(); $model->create_at = date("Y-m-d H:i",$model->create_at); $model->status = $dataList[$model->status]; ?> diff --git a/star-themes/home/default/modules/refund/views/home/refund/index.php b/star-themes/home/default/modules/refund/views/home/refund/index.php index 3287273..03a8b36 100644 --- a/star-themes/home/default/modules/refund/views/home/refund/index.php +++ b/star-themes/home/default/modules/refund/views/home/refund/index.php @@ -19,18 +19,23 @@ 'columns' => [ ['class' => 'yii\grid\SerialColumn'], -// 'refund_id', - 'order_id', + [ + 'attribute' => 'order_id', + 'label' => '订单号', + 'format' => 'raw', + 'value' => function($model){ + return Html::a($model->order->order_no,\yii\helpers\Url::to(['/order/home/order/view','id'=>$model->order_id])); + }, + ], 'refund_fee', 'reason', 'memo', - 'create_at:date', - // 'update_at', + 'create_at:datetime', [ 'attribute' => 'status', 'label' => '审核状态', 'value' => function($model){ - $statusList = [0 => '待审核', 1 => '审核中', 2 => '审核通过']; + $statusList = $model->getStatusArray(); return $statusList[$model->status]; }, ], From 0527da0c49ae6d953df9ca48f4d4892c30f0ded3 Mon Sep 17 00:00:00 2001 From: wucangzhou Date: Mon, 13 Jul 2015 15:51:01 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config/main.php | 10 +++++++ star-modules/payment/messages/zh/payment.php | 27 +++++++++++++++++++ .../refund/views/core/refund/index.php | 2 +- .../shipment/messages/zh/shipment.php | 25 +++++++++++++++++ .../refund/views/home/refund/index.php | 2 +- 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 star-modules/payment/messages/zh/payment.php create mode 100644 star-modules/shipment/messages/zh/shipment.php diff --git a/common/config/main.php b/common/config/main.php index 4aca4fe..d2b40d4 100644 --- a/common/config/main.php +++ b/common/config/main.php @@ -65,6 +65,16 @@ 'sourceLanguage' => 'en-US', 'basePath' => '@star/member/messages', ], + 'payment' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'sourceLanguage' => 'en-US', + 'basePath' => '@star/payment/messages', + ], + 'shipment' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'sourceLanguage' => 'en-US', + 'basePath' => '@star/shipment/messages', + ], ], ], 'urlManager' => [ diff --git a/star-modules/payment/messages/zh/payment.php b/star-modules/payment/messages/zh/payment.php new file mode 100644 index 0000000..a5c8f9f --- /dev/null +++ b/star-modules/payment/messages/zh/payment.php @@ -0,0 +1,27 @@ + '支付方式', + 'Payment Fee' => '税', + 'Payment' => '支付', + 'Transcation No' => '交易号码', + 'Create At' => '创建时间', + 'Update At' => '更新时间', + +]; \ No newline at end of file diff --git a/star-modules/refund/views/core/refund/index.php b/star-modules/refund/views/core/refund/index.php index dc8ee70..ba127a1 100644 --- a/star-modules/refund/views/core/refund/index.php +++ b/star-modules/refund/views/core/refund/index.php @@ -22,7 +22,7 @@ 'label' => '订单号', 'format' => 'raw', 'value' => function($model){ - return Html::a($model->order->order_no,\yii\helpers\Url::to(['/order/home/order/view','id'=>$model->order_id])); + return Html::a($model->order->order_no,\yii\helpers\Url::to(['/order/core/order/update','id'=>$model->order_id])); }, ], 'refund_fee', diff --git a/star-modules/shipment/messages/zh/shipment.php b/star-modules/shipment/messages/zh/shipment.php new file mode 100644 index 0000000..1873dd3 --- /dev/null +++ b/star-modules/shipment/messages/zh/shipment.php @@ -0,0 +1,25 @@ + '运送方式', + 'Trace No' => '运单号', + 'Create At' => '创建时间', + 'Update At' => '更新时间', + +]; \ No newline at end of file diff --git a/star-themes/home/default/modules/refund/views/home/refund/index.php b/star-themes/home/default/modules/refund/views/home/refund/index.php index 03a8b36..9efe14f 100644 --- a/star-themes/home/default/modules/refund/views/home/refund/index.php +++ b/star-themes/home/default/modules/refund/views/home/refund/index.php @@ -42,7 +42,7 @@ [ 'class' => 'yii\grid\ActionColumn', - 'template' => '
    {view} {delete}
    ' + 'template' => '
    {view}
    ' ], ], ]); ?> From a7be318cdd3a496a8f81dc984d1ed79116c40a4b Mon Sep 17 00:00:00 2001 From: wucangzhou Date: Mon, 13 Jul 2015 16:51:12 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catalog/views/core/item/_form.php | 1 + star-modules/member/messages/zh-CN/member.php | 3 + .../member/models/DeliveryAddress.php | 20 +- star-modules/order/views/home/order/index.php | 2 +- star-themes/home/default/layouts/main.php | 166 --------------- .../default/modules/cart/views/cart/index.php | 4 +- .../modules/catalog/views/home/item/list.php | 14 +- .../modules/catalog/views/home/item/view.php | 40 ++-- star-themes/home/default/site/index.php | 196 +++++++++++++++++- 9 files changed, 230 insertions(+), 216 deletions(-) diff --git a/star-modules/catalog/views/core/item/_form.php b/star-modules/catalog/views/core/item/_form.php index 58dd355..1591376 100644 --- a/star-modules/catalog/views/core/item/_form.php +++ b/star-modules/catalog/views/core/item/_form.php @@ -27,6 +27,7 @@ $fieldGroups = []; $fields = []; $fields[] = $form->field($model, 'title')->textInput(['maxlength' => 255]); + $fields[] = $form->field($model, 'price')->textInput(['maxlength' => 255]); $currency = Currency::find()->all(); $fields[] = $form->field($model, 'currency')->dropDownList(ArrayHelper::map($currency, 'currency_id', 'name')); $language = Language::find()->all(); diff --git a/star-modules/member/messages/zh-CN/member.php b/star-modules/member/messages/zh-CN/member.php index 19a86f4..32a7c18 100644 --- a/star-modules/member/messages/zh-CN/member.php +++ b/star-modules/member/messages/zh-CN/member.php @@ -27,4 +27,7 @@ 'My Orders' => '摘要', 'Tags' => '标签', 'Title' => '标题', + 'Phone' => '手机号', + 'Is Default' => '默认地址', + 'Zip Code' => '邮政编码', ]; diff --git a/star-modules/member/models/DeliveryAddress.php b/star-modules/member/models/DeliveryAddress.php index d428bef..1b0d3ec 100644 --- a/star-modules/member/models/DeliveryAddress.php +++ b/star-modules/member/models/DeliveryAddress.php @@ -51,16 +51,16 @@ public function rules() public function attributeLabels() { return [ - 'delivery_address_id' => Yii::t('app', 'Delivery Address ID'), - 'user_id' => Yii::t('app', 'User ID'), - 'province' => Yii::t('app', 'Province'), - 'city' => Yii::t('app', 'City'), - 'district' => Yii::t('app', 'District'), - 'address' => Yii::t('app', 'Address'), - 'zip_code' => Yii::t('app', 'Zip Code'), - 'phone' => Yii::t('app', 'Phone'), - 'name' => Yii::t('app', 'Name'), - 'is_default' => Yii::t('app', 'Is Default'), + 'delivery_address_id' => Yii::t('member', 'Delivery Address ID'), + 'user_id' => Yii::t('member', 'User ID'), + 'province' => Yii::t('member', 'Province'), + 'city' => Yii::t('member', 'City'), + 'district' => Yii::t('member', 'District'), + 'address' => Yii::t('member', 'Address'), + 'zip_code' => Yii::t('member', 'Zip Code'), + 'phone' => Yii::t('member', 'Phone'), + 'name' => Yii::t('member', 'Name'), + 'is_default' => Yii::t('member', 'Is Default'), ]; } diff --git a/star-modules/order/views/home/order/index.php b/star-modules/order/views/home/order/index.php index ec6ddb7..6b17323 100644 --- a/star-modules/order/views/home/order/index.php +++ b/star-modules/order/views/home/order/index.php @@ -113,7 +113,7 @@

    给卖家留言:

    - +
    diff --git a/star-themes/home/default/layouts/main.php b/star-themes/home/default/layouts/main.php index 3f39181..2906449 100644 --- a/star-themes/home/default/layouts/main.php +++ b/star-themes/home/default/layouts/main.php @@ -578,173 +578,7 @@ class="tr_all_hover r_corners button_type_4 bg_dark_color bg_cs_hover color_ligh
    -
    Product Image & Name商品图片 & 名称 SKUPriceQuantitySubtotal价钱数量总价
    -

    Shipment Fee:

    +

    运费:

    $getShippingFee() ?>

    @@ -90,7 +90,7 @@
    -

    Tax Total:

    +

    税:

    $17.54

    @@ -101,13 +101,13 @@
    - 'button_type_4 r_corners bg_light_color_2 m_left_5 mw_0 tr_all_hover color_dark clear-all', 'data-url' => Url::to(['cart/clear-all'])]) ?> + 'button_type_4 r_corners bg_light_color_2 m_left_5 mw_0 tr_all_hover color_dark clear-all', 'data-url' => Url::to(['cart/clear-all'])]) ?> - 'button_type_4 r_corners bg_light_color_2 m_left_5 mw_0 tr_all_hover color_dark update-cart', 'data-url' => Url::to(['cart/update'])]) ?> + 'button_type_4 r_corners bg_light_color_2 m_left_5 mw_0 tr_all_hover color_dark update-cart', 'data-url' => Url::to(['cart/update'])]) ?>
    -

    Total:

    +

    总价:

    $getTotal() ?>

    @@ -118,12 +118,12 @@
    - - + +
    - 'button_type_6 bg_scheme_color f_size_large r_corners tr_all_hover color_light m_bottom_20']) ?> + 'button_type_6 bg_scheme_color f_size_large r_corners tr_all_hover color_light m_bottom_20']) ?>
    - - - - - - - - - - - - -
    Manufacturer:Chanel
    Availability:in stock 20 item(s)
    Product Code:PS06
    -
    Product Dimensions and Weight
    - - - - - - - - - -
    Product Length:10.0000M
    Product Weight:10.0000KG
    -
    -

    Ut tellus dolor, dapibus eget, elementum vel, cursus eleifend, elit. Aenean - auctor wisi et urna. Aliquam erat volutpat. Duis ac turpis. Donec sit amet eros. Lorem ipsum - dolor sit amet, consecvtetuer adipiscing elit.

    -
    -
    - $152.00$102.00 -
    - - - - - - - - - -
    Size: -
    -
    s
    -
      - -
      -
      Quantity: -
      - - - -
      -
      -
      - - - - -
      -
      -
      -
      - -
      商品图片 & 名称 - SKU + 属性 价钱 数量 总价 @@ -69,7 +69,7 @@
      diff --git a/star-themes/home/default/modules/catalog/views/home/item/list.php b/star-themes/home/default/modules/catalog/views/home/item/list.php index 6e5ebd2..d5f7d3f 100644 --- a/star-themes/home/default/modules/catalog/views/home/item/list.php +++ b/star-themes/home/default/modules/catalog/views/home/item/list.php @@ -1,4 +1,8 @@ $item->item_id])?>" class="d_block f_left relative pp_wrap m_right_30 m_xs_right_25"> - + getMainImage(), + 242, + 242, + EasyThumbnailImage::THUMBNAIL_OUTBOUND, + ['class'=>"tr_all_hover"] + )?> Quick View @@ -145,7 +155,7 @@ class="button_type_5 box_s_none color_light r_corners tr_all_hover d_xs_none">Qu

      price ?>



      - - + + - - - - - - - - -
      Manufacturer:Chanel库存: stock?>
      Availability:in stock stock?> item(s)
      Product Code:PS06
      -
      -

      Ut tellus dolor, dapibus eget, elementum vel, cursus eleifend, elit. Aenean auctor wisi et urna. Aliquam erat volutpat. Duis ac turpis. Donec sit amet eros. Lorem ipsum dolor sit amet, consecvtetuer adipiscing.

      -
      + +
      $152.00price ?>
      @@ -195,7 +185,7 @@ - Quantity: + 数量:
      @@ -207,12 +197,12 @@
      - - - - + + + +
      -

      Share this:

      +

      分享:

      @@ -234,9 +224,9 @@
      @@ -693,8 +683,6 @@ -
      -Back to: Woman
      + + \ No newline at end of file From 9635b7484e2e4ac7528490de9f957cc0dbe160b7 Mon Sep 17 00:00:00 2001 From: wucangzhou Date: Mon, 13 Jul 2015 19:00:50 +0800 Subject: [PATCH 08/12] shoppingcart --- star-modules/cart/models/ShoppingCart.php | 7 +++++++ star-modules/order/views/home/order/index.php | 3 ++- star-themes/home/default/layouts/main.php | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/star-modules/cart/models/ShoppingCart.php b/star-modules/cart/models/ShoppingCart.php index 23cdfe8..279db26 100644 --- a/star-modules/cart/models/ShoppingCart.php +++ b/star-modules/cart/models/ShoppingCart.php @@ -280,6 +280,13 @@ public function getTotal() return $this->getSubTotal() + $this->getShippingFee(); } + public function getTotalQty(){ + $qty = 0; + foreach($this->cartItems as $carItem) { + $qty += $carItem->qty; + } + return $qty; + } /** * serial cart * return array like cart['star_id']['sku_id'] = cartModel diff --git a/star-modules/order/views/home/order/index.php b/star-modules/order/views/home/order/index.php index 6b17323..456696f 100644 --- a/star-modules/order/views/home/order/index.php +++ b/star-modules/order/views/home/order/index.php @@ -113,7 +113,7 @@

      给卖家留言:

      - +
      @@ -125,5 +125,6 @@ 'style' => "line-height:20px;margin-right:150px;margin-bottom:30px;" ]) ?>
      +
      \ No newline at end of file diff --git a/star-themes/home/default/layouts/main.php b/star-themes/home/default/layouts/main.php index 2906449..1eb3a41 100644 --- a/star-themes/home/default/layouts/main.php +++ b/star-themes/home/default/layouts/main.php @@ -141,9 +141,9 @@ class="button_type_3 color_light bg_scheme_color d_block r_corners tr_delay_hove cartItems; - echo count($cartItems); + $shoppingCartModel = new \star\cart\models\ShoppingCart(); + + echo $shoppingCartModel->getTotalQty(); ?> $getTotal() ?> From 12d7878675ab45014323c51d4b5dd88ba300cc41 Mon Sep 17 00:00:00 2001 From: wucangzhou Date: Mon, 13 Jul 2015 20:57:37 +0800 Subject: [PATCH 09/12] bug --- star-modules/order/controllers/home/OrderController.php | 2 +- star-themes/home/default/modules/cart/views/cart/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/star-modules/order/controllers/home/OrderController.php b/star-modules/order/controllers/home/OrderController.php index 820c8b9..023726c 100644 --- a/star-modules/order/controllers/home/OrderController.php +++ b/star-modules/order/controllers/home/OrderController.php @@ -2,7 +2,7 @@ namespace star\order\controllers\home; -use cluster\modules\cart\models\ShoppingCart; +use star\cart\models\ShoppingCart; use star\order\models\Order; use star\catalog\models\Sku; use Yii; diff --git a/star-themes/home/default/modules/cart/views/cart/index.php b/star-themes/home/default/modules/cart/views/cart/index.php index 8800975..7cba992 100644 --- a/star-themes/home/default/modules/cart/views/cart/index.php +++ b/star-themes/home/default/modules/cart/views/cart/index.php @@ -6,7 +6,7 @@ /* @var $this yii\web\View */ /* @var $dataProvider yii\data\ActiveDataProvider */ -list($url,$link) = $this->getAssetManager()->publish('@home/modules/cart/web'); +list($url,$link) = $this->getAssetManager()->publish('@star/cart/web'); $this->registerJsFile($link . '/js/cart.js',['depends' => [\yii\web\JqueryAsset::className()]] ); $form = \yii\widgets\ActiveForm::begin(); From 345a98dff49e74be92df8042199294f474e3e39f Mon Sep 17 00:00:00 2001 From: wucangzhou Date: Tue, 14 Jul 2015 12:54:20 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star-themes/home/default/layouts/main.php | 232 +++---- star-themes/home/default/site/index.php | 738 ++++++++++++++-------- 2 files changed, 572 insertions(+), 398 deletions(-) diff --git a/star-themes/home/default/layouts/main.php b/star-themes/home/default/layouts/main.php index 1eb3a41..c7d742f 100644 --- a/star-themes/home/default/layouts/main.php +++ b/star-themes/home/default/layouts/main.php @@ -7,7 +7,7 @@ use yii\helpers\Url; use yii\widgets\Breadcrumbs; use star\member\models\Wishlist; - +use himiklab\thumbnail\EasyThumbnailImage; /* @var $this \yii\web\View */ /* @var $content string */ @@ -39,6 +39,51 @@ beginBody() ?> + +
      @@ -49,7 +94,7 @@ user->isGuest) { ?> -

      欢迎,您可以 登陆 或者 +

      欢迎,您可以 登陆 或者 创建账号

      @@ -78,7 +123,7 @@
      @@ -136,7 +181,7 @@ class="d_mxs_none">US Dollar
    • - @@ -149,91 +194,55 @@ class="button_type_3 color_light bg_scheme_color d_block r_corners tr_delay_hove $getTotal() ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
      +
      最近添加的商品
      +
        + cartItems; + foreach ($cartItems as $cartItem) { + /**@var star\catalog\models\Item $item * */ + $sku = $cartItem->sku; + $item = $sku->item; + ?> +
      • +
        + + getMainImage(), + 30, + 30, + EasyThumbnailImage::THUMBNAIL_OUTBOUND, + ['class'=>"f_left m_right_10"] + )?> + +
        + title?> +
        + +
        +
        + qty ?> x price?> +
        +
        +
        +
      • + +
      - - - - - - - - - - - - - - - - - +
        +
      • 运费: getShippingFee() ?>
      • +
      • 总价: getTotal() ?> +
      • +
      + +
    • @@ -252,7 +261,7 @@ class="button_type_3 color_light bg_scheme_color d_block r_corners tr_delay_hove
      - - diff --git a/star-themes/home/default/site/index.php b/star-themes/home/default/site/index.php index 095c9bc..9a29e65 100644 --- a/star-themes/home/default/site/index.php +++ b/star-themes/home/default/site/index.php @@ -7,295 +7,505 @@ $link = $this->getAssetManager()->getPublishedUrl('@theme/home/default/assets'); $this->registerJsFile($link . '/js/wishlist.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->registerJsFile($link . '/js/compare.js', ['depends' => [\yii\web\JqueryAsset::className()]]); + ?>
      - - - - - - - - - +
      +
      Meet New Theme
      +
      +
      Attractive + & Elegant
      HTML Theme
      +
      $15.00
      + Buy Now +
      - - - - - - - - - - +
      +
      New arrivals
      +
      +
      Spring/Summer 2014
      Ready-To-Wear
      + View + Collection +
      - - - - - - - - - +
      + + +
      up to 70% off
      + Shop + Now +
      +
      +
      +

      商品展示

      + +
        +
      • +
      • +
      • +
      • +
      • +
      - - limit(12)->all(); - if ($items) { - /** @var \star\catalog\models\Item $item */ - foreach ($items as $key => $item) { - ?> - - -
      -
      +
      +
      + +
      + -