Browse Source

refactor: 合并后台分支

wechat_public_accounts
root 5 years ago
parent
commit
0dd6d123a1
  1. 6
      backend/config/main.php
  2. 2
      backend/controllers/ConfigController.php
  3. 70
      backend/controllers/ExpressTemplateController.php
  4. 9
      backend/controllers/OrderController.php
  5. 11
      backend/controllers/TakingSiteController.php
  6. 4
      backend/logic/file/FileManager.php
  7. 0
      backend/migrations/m130524_201442_init.php
  8. 0
      backend/migrations/m140506_102106_rbac_init.php
  9. 0
      backend/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php
  10. 0
      backend/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php
  11. 0
      backend/migrations/m190124_110200_add_verification_token_column_to_user_table.php
  12. 0
      backend/migrations/m190802_072830_add_category.php
  13. 0
      backend/migrations/m191111_101658_create_table_area.php
  14. 0
      backend/migrations/m191111_102644_create_table_province.php
  15. 0
      backend/migrations/m191111_102730_create_table_city.php
  16. 0
      backend/migrations/m191111_102925_create_table_cart.php
  17. 0
      backend/migrations/m191111_112559_create_table_address.php
  18. 0
      backend/migrations/m191111_113455_create_table_after_sale.php
  19. 0
      backend/migrations/m191112_005106_create_table_search_history.php
  20. 0
      backend/migrations/m191112_005545_create_table_collection.php
  21. 0
      backend/migrations/m191112_005702_create_table_comment.php
  22. 0
      backend/migrations/m191112_010421_create_table_order.php
  23. 0
      backend/migrations/m191112_011517_create_table_order_goods.php
  24. 0
      backend/migrations/m191112_012449_create_table_taking_site.php
  25. 9
      backend/migrations/m191112_014508_create_table_express_template.php
  26. 0
      backend/migrations/m191112_015939_create_table_delivery.php
  27. 0
      backend/migrations/m191112_020830_create_table_payment_log.php
  28. 0
      backend/migrations/m191112_021528_create_table_refund_log.php
  29. 0
      backend/migrations/m191112_022131_create_table_file.php
  30. 0
      backend/migrations/m191112_022532_create_table_tem_file.php
  31. 0
      backend/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php
  32. 0
      backend/migrations/m191203_022720_add_column_sku_id_in_table_ats_order_goods.php
  33. 6
      backend/migrations/m191203_030210_update_columns_province_city_area_in_table_ats_taking_site.php
  34. 2
      backend/migrations/m191203_030911_update_column_address_in_table_ats_taking_site.php
  35. 20
      backend/migrations/m191203_031446_drop_column_is_default_in_table_ats_taking_site.php
  36. 0
      backend/migrations/m191203_034004_add_column_address_in_table_ats_order.php
  37. 20
      backend/migrations/m191203_112307_add_data_to_table_city_and_area.php
  38. 20
      backend/migrations/m191203_114421_update_column_discount_description_in_table_order.php
  39. 22
      backend/migrations/m191204_004849_update_column_calculation_in_table_ats_express_template.php
  40. 26
      backend/migrations/m191204_012240_update_columns_basic_price_basic_amount_in_table_ats_express_template.php
  41. 0
      backend/migrations/schema-mysql.sql
  42. 0
      backend/migrations/sql/add_category.sql
  43. 8
      backend/migrations/sql/add_data.sql
  44. 0
      backend/migrations/sql/area.sql
  45. 0
      backend/migrations/sql/city.sql
  46. 0
      backend/migrations/sql/province.sql
  47. 2
      backend/models/ars/Address.php
  48. 2
      backend/models/ars/AfterSale.php
  49. 2
      backend/models/ars/Area.php
  50. 2
      backend/models/ars/Cart.php
  51. 2
      backend/models/ars/City.php
  52. 2
      backend/models/ars/Collection.php
  53. 2
      backend/models/ars/Comment.php
  54. 2
      backend/models/ars/Config.php
  55. 2
      backend/models/ars/Delivery.php
  56. 47
      backend/models/ars/ExpressTemplate.php
  57. 2
      backend/models/ars/File.php
  58. 6
      backend/models/ars/Order.php
  59. 2
      backend/models/ars/OrderGoods.php
  60. 2
      backend/models/ars/PaymentLog.php
  61. 2
      backend/models/ars/Province.php
  62. 2
      backend/models/ars/RefundLog.php
  63. 2
      backend/models/ars/SearchHistory.php
  64. 81
      backend/models/ars/TakingSite.php
  65. 2
      backend/models/ars/TemFile.php
  66. 34
      backend/models/searchs/ExpressTemplateSearch.php
  67. 12
      backend/models/searchs/OrderSearch.php
  68. 10
      backend/models/searchs/TakingSiteSearch.php
  69. 131
      backend/views/express-template/_form.php
  70. 2
      backend/views/express-template/_search.php
  71. 428
      backend/views/express-template/area.php
  72. 42
      backend/views/express-template/create.php
  73. 2
      backend/views/express-template/index.php
  74. 42
      backend/views/express-template/update.php
  75. 34
      backend/views/express-template/view.php
  76. 7
      backend/views/layouts/main.php
  77. 2
      backend/views/order/_form.php
  78. 2
      backend/views/order/_search.php
  79. 2
      backend/views/order/create.php
  80. 2
      backend/views/order/index.php
  81. 2
      backend/views/order/update.php
  82. 4
      backend/views/order/view.php
  83. 2
      backend/views/site/test.php
  84. 49
      backend/views/taking-site/_form.php
  85. 2
      backend/views/taking-site/_search.php
  86. 6
      backend/views/taking-site/create.php
  87. 4
      backend/views/taking-site/index.php
  88. 13
      backend/views/taking-site/update.php
  89. 3
      backend/views/taking-site/view.php
  90. 0
      backend/web/js/jquery.js
  91. 2966
      backend/web/js/jquery.min.js
  92. 2
      common/config/bootstrap.php
  93. 1
      common/config/main.php
  94. 4
      composer.json
  95. 41
      environments/skeleton/antgoods/config/main-local.php
  96. 3
      environments/skeleton/antgoods/config/params-local.php
  97. 24
      goods/Module.php
  98. 0
      goods/assets/custom/sku.49a56a9198d9c3ec233c.js
  99. 0
      goods/assets/custom/sku.52802ed907a316501cd7.js
  100. 0
      goods/assets/custom/sku.9a46222d01b3d601e5ad.js

6
backend/config/main.php

@ -10,8 +10,8 @@ return [
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
'modules' => [
'antgoods' => [
'class' => 'antgoods\goods\Module',
'goods' => [
'class' => 'goods\Module',
],
],
'components' => [
@ -59,7 +59,7 @@ return [
],
],
'file' => ['class' => 'backend\logic\file\FileManager'],
'goods' => ['class' => 'antgoods\goods\logic\goods\GoodsManager'],
'goods' => ['class' => 'goods\goods\logic\goods\GoodsManager'],
],
// 'as access' => [
// 'class' => 'iron\components\AccessControl',

2
backend/controllers/ConfigController.php

@ -3,7 +3,7 @@
namespace backend\controllers;
use Yii;
use common\models\ars\Category;
use backend\models\ars\Category;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

70
backend/controllers/ExpressTemplateController.php

@ -2,12 +2,17 @@
namespace backend\controllers;
use backend\models\ars\City;
use backend\models\ars\Province;
use Yii;
use common\models\ars\ExpressTemplate;
use common\models\searchs\ExpressTemplateSearch;
use backend\models\ars\ExpressTemplate;
use backend\models\searchs\ExpressTemplateSearch;
use yii\caching\Cache;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\web\Response;
use yii\widgets\ActiveForm;
/**
* ExpressTemplateController implements the CRUD actions for ExpressTemplate model.
@ -66,13 +71,43 @@ class ExpressTemplateController extends Controller
public function actionCreate()
{
$model = new ExpressTemplate();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
$model->calculation = ExpressTemplate::CALCULATION_NUMBER;
$model->basic_amount = 1;
$model->basic_price = '0.00';
if (Yii::$app->request->isPost) {
$data = Yii::$app->request->post('ExpressTemplate');
if (Yii::$app->request->isAjax) {
$model->load($data, '');
Yii::$app->response->format = Response::FORMAT_JSON;
$data = ActiveForm::validate($model);
$data['status'] = 2;
return $data;
}
if (Yii::$app->request->post('area') == null) {
return $this->redirect(Yii::$app->request->referrer . '?status=1');
}
$cityIds = array_keys(Yii::$app->request->post('area'));
$data['city'] = implode(',', $cityIds);
$model->load($data, '');
$model->save();
return $this->redirect('index');
}
$data = [];
$provinces = Province::find()->cache(0)->all();
foreach ($provinces as $k => $v) {
$data[$k]['province'] = $v->name;
$cities = City::find()->cache(0)
->where(['province_id' => $v->province_id])
->all();
foreach ($cities as $city) {
$data[$k]['city'][] = ['id' => $city->city_id, 'name' => $city->name];
}
}
return $this->render('create', [
'model' => $model,
'data' => $data
]);
}
@ -86,13 +121,30 @@ class ExpressTemplateController extends Controller
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect('index');
$data = Yii::$app->request->post('ExpressTemplate');
if ($data) {
if (Yii::$app->request->post('area') == null) {
return $this->redirect(Yii::$app->request->referrer . '&status=1');
}
$cityIds = array_keys(Yii::$app->request->post('area'));
$data['city'] = implode(',', $cityIds);
$model->load($data, '');
$model->save();
return $this->render('view', ['model' => ExpressTemplate::findOne($model->id)]);
}
$data = [];
$provinces = Province::find()->cache(0)->all();
foreach ($provinces as $k => $v) {
$data[$k]['province'] = $v->name;
$cities = City::find()->cache(0)
->where(['province_id' => $v->province_id])
->all();
foreach ($cities as $city) {
$data[$k]['city'][] = ['id' => $city->city_id, 'name' => $city->name];
}
}
return $this->render('update', [
'model' => $model,
'model' => $model, 'data' => $data, 'cities' => explode(',', $model->city)
]);
}

9
backend/controllers/OrderController.php

@ -2,11 +2,9 @@
namespace backend\controllers;
use antgoods\goods\models\ars\Goods;
use Yii;
use common\models\ars\Order;
use common\models\searchs\OrderSearch;
use yii\debug\components\search\matchers\GreaterThanOrEqual;
use backend\models\ars\Order;
use backend\models\searchs\OrderSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
@ -127,7 +125,6 @@ class OrderController extends Controller
throw new NotFoundHttpException('The requested page does not exist.');
}
/**
* @author iron
* 文件导出
@ -145,7 +142,7 @@ class OrderController extends Controller
'models' => $dataProvider->getModels(),
'format' => 'Xlsx',
'asAttachment' => true,
'fileName' => 'Orders' . "-" . date('Y-m-d H/i/s', time()),
'fileName' =>'Orders'. "-" .date('Y-m-d H/i/s', time()),
'columns' => $searchModel->columns()
]);
}

11
backend/controllers/TakingSiteController.php

@ -2,11 +2,11 @@
namespace backend\controllers;
use common\models\ars\Area;
use common\models\ars\City;
use backend\models\ars\Area;
use backend\models\ars\City;
use Yii;
use common\models\ars\TakingSite;
use common\models\searchs\TakingSiteSearch;
use backend\models\ars\TakingSite;
use backend\models\searchs\TakingSiteSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
@ -68,7 +68,6 @@ class TakingSiteController extends Controller
public function actionCreate()
{
$model = new TakingSite();
$model->is_default = TakingSite::IS_DEFAULT_NO;
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect('index');
@ -161,7 +160,7 @@ class TakingSiteController extends Controller
if ($parents != null) {
$provinceId = $parents[0];
$data = City::find()->select('city_id as id,name')->where(['province_id' => $provinceId])->asArray()->all();
return ['output' => $data, 'selected' => '441904'];
return ['output' => $data, 'selected' => ''];
} else {
return ['output' => '', 'selected' => ''];
}

4
backend/logic/file/FileManager.php

@ -3,8 +3,8 @@
namespace backend\logic\file;
use common\models\ars\File;
use common\models\ars\TemFile;
use backend\models\ars\File;
use backend\models\ars\TemFile;
class FileManager
{

console/migrations/m130524_201442_init.php → backend/migrations/m130524_201442_init.php

console/migrations/m140506_102106_rbac_init.php → backend/migrations/m140506_102106_rbac_init.php

console/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php → backend/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php

console/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php → backend/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php

console/migrations/m190124_110200_add_verification_token_column_to_user_table.php → backend/migrations/m190124_110200_add_verification_token_column_to_user_table.php

console/migrations/m190802_072830_add_category.php → backend/migrations/m190802_072830_add_category.php

console/migrations/m191111_101658_create_table_area.php → backend/migrations/m191111_101658_create_table_area.php

console/migrations/m191111_102644_create_table_province.php → backend/migrations/m191111_102644_create_table_province.php

console/migrations/m191111_102730_create_table_city.php → backend/migrations/m191111_102730_create_table_city.php

console/migrations/m191111_102925_create_table_cart.php → backend/migrations/m191111_102925_create_table_cart.php

console/migrations/m191111_112559_create_table_address.php → backend/migrations/m191111_112559_create_table_address.php

console/migrations/m191111_113455_create_table_after_sale.php → backend/migrations/m191111_113455_create_table_after_sale.php

console/migrations/m191112_005106_create_table_search_history.php → backend/migrations/m191112_005106_create_table_search_history.php

console/migrations/m191112_005545_create_table_collection.php → backend/migrations/m191112_005545_create_table_collection.php

console/migrations/m191112_005702_create_table_comment.php → backend/migrations/m191112_005702_create_table_comment.php

console/migrations/m191112_010421_create_table_order.php → backend/migrations/m191112_010421_create_table_order.php

console/migrations/m191112_011517_create_table_order_goods.php → backend/migrations/m191112_011517_create_table_order_goods.php

console/migrations/m191112_012449_create_table_taking_site.php → backend/migrations/m191112_012449_create_table_taking_site.php

console/migrations/m191112_014508_create_table_express_template.php → backend/migrations/m191112_014508_create_table_express_template.php

console/migrations/m191112_015939_create_table_delivery.php → backend/migrations/m191112_015939_create_table_delivery.php

console/migrations/m191112_020830_create_table_payment_log.php → backend/migrations/m191112_020830_create_table_payment_log.php

console/migrations/m191112_021528_create_table_refund_log.php → backend/migrations/m191112_021528_create_table_refund_log.php

console/migrations/m191112_022131_create_table_file.php → backend/migrations/m191112_022131_create_table_file.php

console/migrations/m191112_022532_create_table_tem_file.php → backend/migrations/m191112_022532_create_table_tem_file.php

console/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php → backend/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php

console/migrations/m191203_022720_add_column_sku_id_in_table_ats_order_goods.php → backend/migrations/m191203_022720_add_column_sku_id_in_table_ats_order_goods.php

console/migrations/m191203_030210_update_columns_province_city_area_in_table_ats_taking_site.php → backend/migrations/m191203_030210_update_columns_province_city_area_in_table_ats_taking_site.php

console/migrations/m191203_030911_update_column_address_in_table_ats_taking_site.php → backend/migrations/m191203_030911_update_column_address_in_table_ats_taking_site.php

20
backend/migrations/m191203_031446_drop_column_is_default_in_table_ats_taking_site.php

@ -0,0 +1,20 @@
<?php
use yii\db\Migration;
/**
* Class m191203_031446_drop_column_is_default_in_table_ats_taking_site
*/
class m191203_031446_drop_column_is_default_in_table_ats_taking_site extends Migration
{
public function up()
{
$this->dropColumn('ats_taking_site', 'is_default');
}
public function down()
{
$this->addColumn('ats_taking_site', 'is_default', $this->tinyInteger(1)->defaultValue(0)->comment('是否为默认,1为默认'));
return true;
}
}

console/migrations/m191203_034004_add_column_address_in_table_ats_order.php → backend/migrations/m191203_034004_add_column_address_in_table_ats_order.php

20
backend/migrations/m191203_112307_add_data_to_table_city_and_area.php

@ -0,0 +1,20 @@
<?php
use yii\db\Migration;
/**
* Class m191203_112307_add_data_to_table_city_and_area
*/
class m191203_112307_add_data_to_table_city_and_area extends Migration
{
public function up()
{
$sql = file_get_contents(__DIR__."/sql/add_data.sql");
$this->execute($sql);
}
public function down()
{
return true;
}
}

20
backend/migrations/m191203_114421_update_column_discount_description_in_table_order.php

@ -0,0 +1,20 @@
<?php
use yii\db\Migration;
/**
* Class m191203_114421_update_column_discount_description_in_table_order
*/
class m191203_114421_update_column_discount_description_in_table_order extends Migration
{
public function up()
{
$this->dropColumn('ats_order', 'discount_decription');
$this->addColumn('ats_order', 'discount_description', $this->text()->comment('折扣说明'));
}
public function down()
{
return true;
}
}

22
backend/migrations/m191204_004849_update_column_calculation_in_table_ats_express_template.php

@ -0,0 +1,22 @@
<?php
use yii\db\Migration;
/**
* Class m191204_004849_update_column_calculation_in_table_ats_express_template
*/
class m191204_004849_update_column_calculation_in_table_ats_express_template extends Migration
{
public function up()
{
$this->dropColumn('ats_express_template', 'calculation');
$this->addColumn('ats_express_template', 'calculation', $this->tinyInteger(2)->defaultValue(0)->notNull()->comment('计算方式'));
}
public function down()
{
$this->dropColumn('ats_express_template', 'calculation');
$this->addColumn('ats_express_template', 'calculation', $this->tinyInteger(2)->defaultValue(0)->comment('计算方式'));
return true;
}
}

26
backend/migrations/m191204_012240_update_columns_basic_price_basic_amount_in_table_ats_express_template.php

@ -0,0 +1,26 @@
<?php
use yii\db\Migration;
/**
* Class m191204_012240_update_columns_basic_price_basic_amount_in_table_ats_express_template
*/
class m191204_012240_update_columns_basic_price_basic_amount_in_table_ats_express_template extends Migration
{
public function up()
{
$this->dropColumn('ats_express_template', 'basic_price');
$this->dropColumn('ats_express_template', 'basic_amount');
$this->addColumn('ats_express_template', 'basic_price', $this->integer(20)->unsigned()->defaultValue(0)->notNull()->comment('基本运费'));
$this->addColumn('ats_express_template', 'basic_amount', $this->integer(20)->unsigned()->defaultValue(1)->notNull()->comment('基本数量'));
}
public function down()
{
$this->dropColumn('ats_express_template', 'basic_price');
$this->dropColumn('ats_express_template', 'basic_amount');
$this->addColumn('ats_express_template', 'basic_price', $this->integer(20)->defaultValue(0)->comment('基本运费'));
$this->addColumn('ats_express_template', 'basic_amount', $this->integer(20)->defaultValue(0)->comment('基本数量'));
return true;
}
}

console/migrations/schema-mysql.sql → backend/migrations/schema-mysql.sql

console/migrations/sql/add_category.sql → backend/migrations/sql/add_category.sql

8
backend/migrations/sql/add_data.sql

@ -0,0 +1,8 @@
INSERT INTO `city` VALUES ('348', '710000', '台湾', '710000');
INSERT INTO `city` VALUES ('349', '810000', '香港特别行政区', '810000');
INSERT INTO `city` VALUES ('350', '820000', '澳门特别行政区', '820000');
INSERT INTO `area` VALUES ('3193', '台湾', '710000', '710000');
INSERT INTO `area` VALUES ('3194', '香港特别行政区', '810000', '810000');
INSERT INTO `area` VALUES ('3195', '澳门特别行政区', '820000', '820000');

console/migrations/sql/area.sql → backend/migrations/sql/area.sql

console/migrations/sql/city.sql → backend/migrations/sql/city.sql

console/migrations/sql/province.sql → backend/migrations/sql/province.sql

common/models/ars/Address.php → backend/models/ars/Address.php

common/models/ars/AfterSale.php → backend/models/ars/AfterSale.php

common/models/ars/Area.php → backend/models/ars/Area.php

common/models/ars/Cart.php → backend/models/ars/Cart.php

common/models/ars/City.php → backend/models/ars/City.php

common/models/ars/Collection.php → backend/models/ars/Collection.php

common/models/ars/Comment.php → backend/models/ars/Comment.php

common/models/ars/Config.php → backend/models/ars/Config.php

common/models/ars/Delivery.php → backend/models/ars/Delivery.php

common/models/ars/ExpressTemplate.php → backend/models/ars/ExpressTemplate.php

common/models/ars/File.php → backend/models/ars/File.php

common/models/ars/Order.php → backend/models/ars/Order.php

common/models/ars/OrderGoods.php → backend/models/ars/OrderGoods.php

common/models/ars/PaymentLog.php → backend/models/ars/PaymentLog.php

common/models/ars/Province.php → backend/models/ars/Province.php

common/models/ars/RefundLog.php → backend/models/ars/RefundLog.php

common/models/ars/SearchHistory.php → backend/models/ars/SearchHistory.php

81
backend/models/ars/TakingSite.php

@ -0,0 +1,81 @@
<?php
namespace backend\models\ars;
use Yii;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "ats_taking_site".
*
* @property int $id
* @property string $name 名称
* @property int $updated_at 更新时间
* @property int $created_at 创建时间
* @property string $province 省份
* @property string $city 城市
* @property string $area 区域
* @property string $address 地址
*/
class TakingSite extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'ats_taking_site';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['name', 'province', 'city', 'area', 'address'], 'required'],
[['address'], 'string'],
[['name'], 'string', 'max' => 120],
[['province', 'city', 'area'], 'string', 'max' => 64],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'id',
'name' => '名称',
'updated_at' => '更新时间',
'created_at' => '创建时间',
'province' => '省份',
'city' => '城市',
'area' => '区域',
'address' => '地址',
];
}
/**
* @author linyao
* @email 602604991@qq.com
* @created Nov 8, 2019
*
* 行为存储创建时间和更新时间
*/
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'created_at',
'updatedAtAttribute' => 'updated_at',
'value' => function() {
return time();
},
],
];
}
}

common/models/ars/TemFile.php → backend/models/ars/TemFile.php

common/models/searchs/ExpressTemplateSearch.php → backend/models/searchs/ExpressTemplateSearch.php

common/models/searchs/OrderSearch.php → backend/models/searchs/OrderSearch.php

common/models/searchs/TakingSiteSearch.php → backend/models/searchs/TakingSiteSearch.php

131
backend/views/express-template/_form.php

@ -1,46 +1,113 @@
<?php
use yii\helpers\Html;
use yii\bootstrap4\ActiveForm;
use blobt\widgets\Icheck;
use backend\models\ars\ExpressTemplate;
/* @var $this yii\web\View */
/* @var $model common\models\ars\ExpressTemplate */
/* @var $model backend\models\ars\ExpressTemplate */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="express-template-form">
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'calculation')->widget(Icheck::className(), ["items" => ExpressTemplate::$calculation, 'type' => "radio"]) ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'basic_amount')->textInput() ?>
<?= $form->field($model, 'province')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'basic_price')->textInput() ?>
<?= $form->field($model, 'city')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'extra_amount')->textInput() ?>
<?= $form->field($model, 'area')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'extra_price')->textInput() ?>
<?= $form->field($model, 'billing_type')->textInput() ?>
<?= $form->field($model, 'extra_weight_type')->textInput() ?>
<?= $form->field($model, 'exemption_type')->textInput() ?>
<?= $form->field($model, 'basic_price')->textInput() ?>
<?= $form->field($model, 'extra_price')->textInput() ?>
<?= $form->field($model, 'exemption_amount')->textInput() ?>
<?= $form->field($model, 'support_taking')->textInput() ?>
<?= $form->field($model, 'taking_site')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
</div>
<?php ActiveForm::end(); ?>
<?php
$js=<<<JS
const formList = [//切换时,class对应的标题
{
"field-expresstemplate-basic_amount":"基本重量(KG)",
"field-expresstemplate-basic_price":"基本运费(元)",
"field-expresstemplate-extra_amount":"续重重量(KG)",
"field-expresstemplate-extra_price":"续重运费(元)"
},
{
"field-expresstemplate-basic_amount":"基本数量(件)",
"field-expresstemplate-basic_price":"基本运费(元)",
"field-expresstemplate-extra_amount":"续重数量(件)",
"field-expresstemplate-extra_price":"续重运费(元)"
}
]
const udfVal = [//初始值
[0.1,"0.00"],
[1,"0.00"]
]
var calType = 1;//初始的计算方式0:计重 1:计件
function changeCalType(type){//当切换计算方式
$.each(formList[type],function(index,value){ //更改文字标题
$("." + index).children("label").html(value)
});
$(".form-control").eq(1).val(udfVal[type][0])//重置初始值
$(".form-control").eq(2).val(udfVal[type][1])
calType = type;
}
$(document).ready(function(){
$(".form-control").eq(1).blur(function(){
if (calType == 0) {
if($(this).val() < 0.1){
$(this).val(0.1)
}
var basicAmount = $(this).val();
$(this).val(Math.floor(basicAmount * 10) / 10);
} else{
if($(this).val() < 1){
$(this).val(1)
}
var basicAmount = $(this).val();
$(this).val(Math.floor(basicAmount * 1) / 1);
}
})
$(".form-control").eq(2).blur(function(){
if($(this).val() < 0){
$(this).val("0.00")
}
var basicPrice = $(this).val();
$(this).val(basicPrice.toString().match(/^\d+(?:\.\d{0,2})?/));
})
$(".form-control").eq(3).blur(function(){
if (calType == 0) {
if($(this).val() < 0){
$(this).val(0)
}
var basicAmount = $(this).val();
$(this).val(Math.floor(basicAmount * 10) / 10);
} else{
if($(this).val() < 0){
$(this).val(0)
}
var basicAmount = $(this).val();
$(this).val(Math.floor(basicAmount * 1) / 1);
}
})
$(".form-control").eq(4).blur(function(){
if($(this).val() < 0){
$(this).val("0.00")
}
var basicPrice = $(this).val();
$(this).val(basicPrice.toString().match(/^\d+(?:\.\d{0,2})?/));
})
$("input:radio[name='ExpressTemplate[calculation]']").on('ifChecked', function(event){
changeCalType($(this).val()-1)
})
changeCalType(calType)
})
JS;
$this->registerJs($js)
</div>
?>

2
backend/views/express-template/_search.php

@ -5,7 +5,7 @@ use yii\widgets\ActiveForm;
use \blobt\widgets\DateRangePicker;
/* @var $this yii\web\View */
/* @var $model common\models\searchs\ExpressTemplateSearch */
/* @var $model backend\models\searchs\ExpressTemplateSearch */
/* @var $form yii\widgets\ActiveForm */
?>

428
backend/views/express-template/area.php

@ -0,0 +1,428 @@
<?php
use yii\helpers\Html;
use antkaz\vue\VueAsset;
use xj\babel\BrowserAsset;
VueAsset::register($this); // register VueAsset
xj\babel\BrowserAsset::register($this);
?>
<style>
.goods-create {
overflow: visible!important;
}
.city--list.popup {
top: 35px;
max-height: 480px;
overflow: auto;
}
#app label {
display: flex;
margin: 0;
}
#app label span {
flex-shrink: 0;
}
#app label input {
width: unset!important;
}
.fade-enter-active, .fade-leave-active {
transition: opacity .5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
.list-complete-item {
transition: all 1s;
display: inline-block;
margin-right: 10px;
}
.list-complete-enter, .list-complete-leave-to
/* .list-complete-leave-active for below version 2.1.8 */ {
opacity: 0;
transform: translateY(30px);
}
.list-complete-leave-active {
position: absolute;
}
div,p{margin:0;padding:0; line-height:1.5;}
.checks{ padding-left:20px;}
.province--list, .city--list {
display: flex;
flex-wrap: wrap;
padding-left: 10px;
list-style-type: none;
}
.province--list > li {
display: inline-flex;
align-items: center;
flex-shrink: 0;
position: relative;
margin-right: 10px;
padding: 5px 10px;
}
.province--list > li .city--list {
position: absolute;
padding: 10px;
background: #fff;
z-index: 10000;
box-shadow: 0 0 40px 10px rgba(0, 0, 0, .1);
border-radius: 10px;
/*opacity: 0;*/
/*transition: all .2s;*/
}
/*.province--list > li.active {*/
/*box-shadow: 0 0 40px 10px rgba(0, 0, 0, .1);*/
/*}*/
.province--list > li.active {
color: #259c24;
}
.province--list > li.active .city--list {
opacity: 1;
}
.province--list > li ul li {
display: block;
width: 200px;
padding: 0;
}
input[type="checkbox"] {
margin-right: 5px;
}
.glyphicon {
padding: 5px;
transition: all .2s;
cursor: pointer;
}
.glyphicon.glyphicon-menu-down.switch--popup {
position: relative;
top: -1px;
}
.province--list > li.active .glyphicon {
transform: rotate(180deg);
}
.shade {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
}
label {
font-weight: normal;
}
.display-checked ul li {
position: relative;
display: inline-block;
padding: 5px 10px;
margin: 5px;
border-radius: 5px;
list-style-type: none;
background: #00a65a;
color: #fff;
}
.display-checked ul li ul {
position: absolute;
left: 50%;
width: 200px;
padding: 10px;
opacity: 0;
background: #fff;
z-index: 10000;
box-shadow: 0 0 40px 10px rgba(0, 0, 0, .1);
border-radius: 10px;
transform: translateX(-50%);
transition: all .2s;
}
.display-checked ul li:hover ul {
opacity: 1;
}
.display-checked .close {
float: none!important;
padding: 0;
font-size: 1em;
color: #fff;
opacity: 1;
transition: all .2s;
}
.display-checked .close:active {
transform: scale(.6);
}
</style>
<div id="app" class="vue">
<div class="display-checked">
<p>已选:</p>
<ul>
<li
v-for="province in area.filter(i => i.city.find(j => j.checked))"
:key="province.id"
class="list-complete-item"
>
<div
class="close glyphicon glyphicon-remove"
title="删除"
@click="province.checked = false; province.city.forEach(i => i.checked = false)"
></div>
<span>{{province.province}}</span>
<!-- <ul>-->
<!-- <li>-->
<!-- <div class="close glyphicon glyphicon-remove" title="删除"></div>-->
<!-- <span>广东省</span>-->
<!-- </li>-->
<!-- </ul>-->
</li>
</ul>
</div>
<div class="J_CheckWrap">
<div v-if="activeProvince >= 0" @click="activeProvince = -1" class="shade" id="shade-layer"></div>
<label class="check-all"><input type="checkbox" v-model="isCheckAll" /><span>全选</span></label>
<div class="checks">
<ul class="province--list">
<li data-role="province" v-for="(province, index) in area">
<label data-type="province">
<input
type="checkbox"
v-model="province.checked"
@change="province.city.forEach(i => i.checked = province.checked)"
/>
<span>{{province.province}}</span>
</label>
<div
class="fa fa-angle-down switch--popup"
@click="activeProvince = index"
></div>
<transition name="fade">
<ul v-show="activeProvince === index" class="city--list popup">
<li class="checks" v-for="city in province.city">
<label>
<input
type="checkbox"
:name="`area[${city.id}]`"
<?php // in_array($city->city_id,$cities)?'checked':'' ?>
value="city.id"
v-model="city.checked"
@change="province.id = area[area.length - 1].id + 1; province.checked = province.city.every(i => i.checked)"
/>{{city.name}}</label>
</li>
</ul>
</transition>
</li>
</ul>
</div>
</div>
</div>
<script>
var app = new Vue({
el: '#app',
data: {
area: (<?= json_encode($data) ?>).map(i => {
return {
...i,
city: i.city.map(j => {return {...j, checked: false}}),
checked: false
}
}),
checkedAreaIds: (<?= json_encode($cities) ?>),
activeProvince: -1
},
computed: {
isCheckAll: {
get() {
return this.area.every(i => i.checked)
},
set(value) {
this.area.forEach(i => {
i.checked = value;
i.city.forEach(j => j.checked = value)
})
}
}
},
methods: {
clickProvince(index) {
for (let city in this.area[index].city) {
city.checked = this.area[index].checked
}
},
reverseMessage: function () {
this.message = this.message.split('').reverse().join('')
}
},
created() {
this.checkedAreaIds.length > 0 && this.area.forEach(province => {
let count = 0;
province.city.forEach(city => {
if (this.checkedAreaIds.indexOf(city.id.toString()) >= 0) {
city.checked = true;
count++;
}
});
if (count >= province.city.length) {
province.checked = true;
}
})
// document.body.addEventListener('click', e => {
// let isSwitch = e.target.classList.contains('switch--popup');
// let isCheckbox = e.target.type === 'checkbox';
// let isLabel = e.target.dataset.type === 'province';
//
// if (this.activeProvince >= 0 && !isCheckbox && !isSwitch && !isLabel) {
// this.activeProvince = -1;
// e.stopPropagation();
// }
// })
}
});
</script>
<div>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<!--<script >-->
<!--//-->
<!--// (function (win, doc, $) {-->
<!--// $.fn.extend({-->
<!--// checktree : function () {-->
<!--// this.click(function (evt) {-->
<!--// var evtEle = $(evt.target).closest("input:checkbox");-->
<!--// if (!evtEle[0]) {-->
<!--// return;-->
<!--// }-->
<!--// //check child all-->
<!--// evtEle.parent().next(".checks").find("input:checkbox").attr("checked", evtEle[0].checked);-->
<!--//-->
<!--// //check parent-->
<!--// if (evtEle.is("input:checked")) {-->
<!--// // evtEle.parents(".checks").each(function () {-->
<!--// // !$(this).children("p").children("input:checkbox").filter(function () {-->
<!--// // return !this.checked;-->
<!--// // })[0] && $(this).prev().children("input:checkbox").attr("checked", "checked");-->
<!--// // });-->
<!--// } else {-->
<!--// evtEle.parents(".checks").prev().children("input:checkbox").attr("checked", false);-->
<!--// }-->
<!--// });-->
<!--// }-->
<!--// });-->
<!--//// document.querySelector('.container-fluid.form-vertical').addEventListener('submit', function (e) {-->
<!--////-->
<!--//// alert('ggg');-->
<!--//// e.preventDefault();-->
<!--//// return false;-->
<!--//// })-->
<!--// })(window, document, jQuery);-->
<!---->
<!-- function $(query) {-->
<!-- return document.querySelector(query);-->
<!-- }-->
<!---->
<!-- function $$(query) {-->
<!-- return document.querySelectorAll(query);-->
<!-- }-->
<!---->
<!-- var activeProvince = null;-->
<!---->
<!-- window.addEventListener('click', function (e) {-->
<!-- function $(query) {-->
<!-- return document.querySelector(query);-->
<!-- }-->
<!---->
<!-- if (e.target.type === 'checkbox') {-->
<!-- var parent = e.target.parentElement;-->
<!---->
<!-- if (parent.dataset.type === 'province') {-->
<!-- // 点击省复选框-->
<!-- // parent.parentElement.className = e.target.checked ? 'active' : '';-->
<!---->
<!-- var ul = parent.nextElementSibling;-->
<!-- var inputList = ul.querySelectorAll('input[type="checkbox"]');-->
<!---->
<!-- for (var i = 0, input; input = inputList[i++];) {-->
<!-- input.checked = e.target.checked;-->
<!-- }-->
<!---->
<!-- var isCheckedAllProvince = Array.prototype.every.call($$('.checkbox-province'), i => i.checked);-->
<!---->
<!-- $('#check-all-province').checked = isCheckedAllProvince;-->
<!-- } else {-->
<!-- // 点击城市复选框-->
<!-- var parentUL = e.target.parentElement.parentElement.parentElement;-->
<!-- var inputList = parentUL.querySelectorAll('input');-->
<!-- var parentInput = parentUL.previousElementSibling.querySelector('input');-->
<!-- var isCheckedAllCity = Array.prototype.every.call(inputList, i => i.checked);-->
<!-- parentInput.checked = isCheckedAllCity;-->
<!-- var isCheckedAllProvince = Array.prototype.every.call($$('.checkbox-province'), i => i.checked);-->
<!-- $('#check-all-province').checked = isCheckedAllProvince;-->
<!-- }-->
<!-- }-->
<!-- if (e.target.className === 'glyphicon glyphicon-menu-down switch--popup') {-->
<!-- var parentLi = e.target.parentElement;-->
<!---->
<!-- if (parentLi.classList.contains('active')) {-->
<!-- parentLi.classList.remove('active');-->
<!-- activeProvince = null;-->
<!-- $('#shade-layer').className = ''-->
<!-- } else {-->
<!-- activeProvince && (activeProvince.className = '');-->
<!-- parentLi.classList.add('active');-->
<!-- activeProvince = parentLi;-->
<!-- // $('#shade-layer').className = 'shade'-->
<!-- }-->
<!-- } else {-->
<!-- function $(query) {-->
<!-- return document.querySelector(query);-->
<!-- }-->
<!-- activeProvince && (activeProvince.className = '');-->
<!-- activeProvince = null;-->
<!-- $('#shade-layer').className = '';-->
<!-- }-->
<!-- });-->
<!---->
<!-- $('#check-all-province').addEventListener('change', function (e) {-->
<!-- Array.prototype.forEach.call($$('.checkbox-province'), function (input) {-->
<!-- input.checked = e.target.checked;-->
<!-- var parent = input.parentElement;-->
<!---->
<!-- var ul = parent.nextElementSibling;-->
<!-- var inputList = ul.querySelectorAll('input[type="checkbox"]');-->
<!---->
<!-- for (var i = 0, item; item = inputList[i++];) {-->
<!-- item.checked = e.target.checked;-->
<!-- }-->
<!-- })-->
<!-- });-->
<!---->
<!-- // $('#shade-layer').addEventListener('click', function () {-->
<!-- // function $(query) {-->
<!-- // return document.querySelector(query);-->
<!-- // }-->
<!-- // activeProvince && (activeProvince.className = '');-->
<!-- // activeProvince = null;-->
<!-- // $('#shade-layer').className = '';-->
<!-- // });-->
<!---->
<!--</script>-->
<!--<script>-->
<!-- $(".J_CheckWrap").checktree();-->
<!--</script>-->
</div>

42
backend/views/express-template/create.php

@ -1,18 +1,50 @@
<?php
use yii\helpers\Html;
use yii\bootstrap4\Html;
use yii\bootstrap4\ActiveForm;
use kartik\tabs\TabsX;
/* @var $this yii\web\View */
/* @var $model common\models\ars\ExpressTemplate */
/* @var $model backend\models\ars\ExpressTemplate */
$this->title = '创建 Express Template';
$this->title = '创建运费模板';
$this->params['breadcrumbs'][] = ['label' => 'Express Templates', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->params['bsVersion'] = '4.x';
?>
<div class="express-template-create">
<div class="express-template-form">
<?= $this->render('_form', [
<?php
$form = ActiveForm::begin(['options' => ['class' => 'container-fluid']]);
echo TabsX::widget([
'bordered' => true,
'items' => [
[
'label' => '<i class="fas fa-user"></i> 基本信息',
'content' => $this->render('_form', [
'model' => $model,
]) ?>
'form' => $form,
]),
],
[
'label' => '<i class="fas fa-globe"></i> 选择配送区域',
'content' => $this->render('area', ['data' => $data, 'form' => $form, 'cities' => []
]),
],
],
'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>
</div>

2
backend/views/express-template/index.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\ExpressTemplateSearch */
/* @var $searchModel backend\models\searchs\ExpressTemplateSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '运费模板';

42
backend/views/express-template/update.php

@ -1,19 +1,51 @@
<?php
use yii\helpers\Html;
use yii\bootstrap4\Html;
use yii\bootstrap4\ActiveForm;
use kartik\tabs\TabsX;
/* @var $this yii\web\View */
/* @var $model common\models\ars\ExpressTemplate */
/* @var $model backend\models\ars\ExpressTemplate */
$this->title = '编辑 Express Template: ' . $model->name;
$this->title = '编辑运费模板: ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Express Templates', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update ';
Yii::$app->params['bsVersion'] = '4.x';
?>
<div class="express-template-update">
<div class="express-template-form">
<?= $this->render('_form', [
<?php
$form = ActiveForm::begin(['options' => ['class' => 'container-fluid']]);
echo TabsX::widget([
'bordered' => true,
'items' => [
[
'label' => '<i class="fas fa-user"></i> 基本信息',
'content' => $this->render('_form', [
'model' => $model,
]) ?>
'form' => $form,
]),
],
[
'label' => '<i class="fas fa-globe"></i> 选择配送区域',
'content' => $this->render('area', ['data' => $data, 'form' => $form, 'cities' => $cities
]),
],
],
'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>
</div>

34
backend/views/express-template/view.php

@ -2,9 +2,10 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use backend\models\ars\ExpressTemplate;
/* @var $this yii\web\View */
/* @var $model common\models\ars\ExpressTemplate */
/* @var $model backend\models\ars\ExpressTemplate */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Express Templates', 'url' => ['index']];
@ -22,19 +23,28 @@ $this->params['breadcrumbs'][] = $this->title;
'attributes' => [
'id',
'name',
'province:ntext',
'city:ntext',
'area:ntext',
'billing_type',
'extra_weight_type',
'exemption_type',
[
'attribute' => 'calculation',
'value' => function ($model) {
return ExpressTemplate::$calculation[$model->calculation];
}
],
'basic_price',
'basic_amount',
'extra_price',
'exemption_amount',
'support_taking',
'taking_site:ntext',
'updated_at',
'created_at',
'extra_amount',
'updated_at:datetime',
'created_at:datetime',
['attribute' => 'city',
'value' => function ($model) {
$array = explode(',', $model->city);
$cities = [];
foreach (\backend\models\ars\City::find()->andWhere(['in', 'city_id', $array])->all() as $city) {
$cities[] = $city->name;
}
return implode(' // ', $cities);
},
],
],
]) ?>

7
backend/views/layouts/main.php

@ -19,6 +19,13 @@ AppAsset::register($this);
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<?php $this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php if (YII_ENV == 'dev'){?>
<!-- 开发环境版本,包含了有帮助的命令行警告 -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<?php } else {?>
<!-- 生产环境版本,优化了尺寸和速度 -->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<?php } ?>
<?php $this->head() ?>
</head>
<body class="hold-transition skin-blue-light sidebar-mini">

2
backend/views/order/_form.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $model backend\models\ars\Order */
/* @var $form yii\widgets\ActiveForm */
?>

2
backend/views/order/_search.php

@ -5,7 +5,7 @@ use yii\widgets\ActiveForm;
use \blobt\widgets\DateRangePicker;
/* @var $this yii\web\View */
/* @var $model common\models\searchs\OrderSearch */
/* @var $model backend\models\searchs\OrderSearch */
/* @var $form yii\widgets\ActiveForm */
?>

2
backend/views/order/create.php

@ -3,7 +3,7 @@
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $model backend\models\ars\Order */
$this->title = '创建 Order';
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];

2
backend/views/order/index.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\OrderSearch */
/* @var $searchModel backend\models\searchs\OrderSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Orders';

2
backend/views/order/update.php

@ -3,7 +3,7 @@
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $model backend\models\ars\Order */
$this->title = '编辑 Order: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];

4
backend/views/order/view.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $model backend\models\ars\Order */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];
@ -43,7 +43,7 @@ $this->params['breadcrumbs'][] = $this->title;
'receivables',
'remarks',
'discount_amount',
'discount_decription:ntext',
'discount_description:ntext',
'updated_at',
'created_at',
],

2
backend/views/site/test.php

@ -9,7 +9,7 @@ $this->params['subtitle'] = '这是一个小小的测试';
$this->params['breadcrumbs'][] = $this->title;
/* @var $this yii\web\View */
/* @var $model common\models\CategorySearch */
/* @var $model backend\models\CategorySearch */
/* @var $form yii\widgets\ActiveForm */
?>

49
backend/views/taking-site/_form.php

@ -1,11 +1,19 @@
<?php
use yii\helpers\Html;
use yii\bootstrap4\Html;
use yii\bootstrap4\ActiveForm;
use blobt\widgets\Icheck;
use kartik\depdrop\DepDrop;
use backend\models\ars\Province;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model common\models\ars\TakingSite */
/* @var $model backend\models\ars\TakingSite */
/* @var $form yii\widgets\ActiveForm */
$provinces = Province::find()->select('province_id as id,name')->asArray()->all();
$data = ArrayHelper::map($provinces, 'id', 'name');
Yii::$app->params['bsVersion'] = '4.x';
?>
<div class="taking-site-form">
@ -14,15 +22,40 @@ use yii\bootstrap4\ActiveForm;
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'province')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'city')->textInput(['maxlength' => true]) ?>
<div class="row">
<div class="col-lg-4">
<?= $form->field($model, 'province')->dropDownList($data, ['id' => 'province-id', 'prompt' => '请选择']); ?>
</div>
<div class="col-lg-4">
<?= $form->field($model, 'city')->widget(DepDrop::classname(), [
'options' => ['id' => 'city-id', 'prompt' => $model->city],
'data' => $cityList,
'pluginOptions' => [
'depends' => ['province-id'],
'placeholder' => '请选择成市',
'url' => Url::to(['/taking-site/city'])
],
'pluginEvents' => [
"depdrop:change" => "function(event, id, value, count) { log(id); log(value); log(count); }",
]
<?= $form->field($model, 'area')->textInput(['maxlength' => true]) ?>
]) ?>
</div>
<div class="col-lg-4">
<?= $form->field($model, 'area')->widget(DepDrop::classname(), [
'options' => ['prompt' => $model->area],
'data' => $areaList,
'pluginOptions' => [
'depends' => ['city-id'],
'placeholder' => '请选择县区',
'url' => Url::to(['/taking-site/area'])
<?= $form->field($model, 'address')->textarea(['rows' => 6]) ?>
]
]) ?>
</div>
</div>
<?= $form->field($model, 'is_default')->textInput() ?>
<?= $form->field($model, 'address')->textarea(['rows' => 2]) ?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>

2
backend/views/taking-site/_search.php

@ -5,7 +5,7 @@ use yii\widgets\ActiveForm;
use \blobt\widgets\DateRangePicker;
/* @var $this yii\web\View */
/* @var $model common\models\searchs\TakingSiteSearch */
/* @var $model backend\models\searchs\TakingSiteSearch */
/* @var $form yii\widgets\ActiveForm */
?>

6
backend/views/taking-site/create.php

@ -1,9 +1,9 @@
<?php
use yii\helpers\Html;
use yii\bootstrap4\Html;
/* @var $this yii\web\View */
/* @var $model common\models\ars\TakingSite */
/* @var $model backend\models\ars\TakingSite */
$this->title = '创建 Taking Site';
$this->params['breadcrumbs'][] = ['label' => 'Taking Sites', 'url' => ['index']];
@ -13,6 +13,8 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $this->render('_form', [
'model' => $model,
'cityList'=>[],
'areaList'=>[]
]) ?>
</div>

4
backend/views/taking-site/index.php

@ -4,10 +4,10 @@ use yii\helpers\Html;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\TakingSiteSearch */
/* @var $searchModel backend\models\searchs\TakingSiteSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Taking Sites';
$this->title = '上门自提';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">

13
backend/views/taking-site/update.php

@ -1,19 +1,28 @@
<?php
use yii\helpers\Html;
use backend\models\ars\City;
use backend\models\ars\Area;
/* @var $this yii\web\View */
/* @var $model common\models\ars\TakingSite */
/* @var $model backend\models\ars\TakingSite */
$this->title = '编辑 Taking Site: ' . $model->name;
$this->title = '编辑: ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Taking Sites', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update ';
$cities = City::find()->select('city_id as id,name')->where(['province_id' => $model->province])->asArray()->all();
$cityList = \yii\helpers\ArrayHelper::map($cities, 'id', 'name');
$areas = Area::find()->select('area_id as id,name')->where(['city_id' => $model->city])->asArray()->all();
$areaList = \yii\helpers\ArrayHelper::map($areas, 'id', 'name');
?>
<div class="taking-site-update">
<?= $this->render('_form', [
'model' => $model,
'cityList' => $cityList,
'areaList' => $areaList
]) ?>
</div>

3
backend/views/taking-site/view.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\ars\TakingSite */
/* @var $model backend\models\ars\TakingSite */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Taking Sites', 'url' => ['index']];
@ -26,7 +26,6 @@ $this->params['breadcrumbs'][] = $this->title;
'city',
'area',
'address:ntext',
'is_default',
'updated_at',
'created_at',
],

vendor/antgoods/goods/src/assets/js/jquery.js → backend/web/js/jquery.js

2966
backend/web/js/jquery.min.js
File diff suppressed because it is too large
View File

2
common/config/bootstrap.php

@ -2,4 +2,4 @@
Yii::setAlias('@common', dirname(__DIR__));
Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console');
Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('@api', dirname(dirname(__DIR__)) . '/api');
Yii::setAlias('@goods', dirname(dirname(__DIR__)) . '/goods');

1
common/config/main.php

@ -7,7 +7,6 @@ return [
'@blobt' => '@vendor/blobt',
'@iron' => '@vendor/iron',
'@linyao' => '@vendor/linyao',
'@antgoods' => '@vendor/antgoods',
],
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'timeZone' => 'Asia/Shanghai',

4
composer.json

@ -20,7 +20,9 @@
"moonlandsoft/yii2-phpexcel": "*",
"kartik-v/yii2-tabs-x": "^1.2@dev",
"kartik-v/yii2-editable": "^1.7@dev",
"kartik-v/yii2-widget-depdrop": "dev-master"
"kartik-v/yii2-widget-depdrop": "dev-master",
"antkaz/yii2-vue": "dev-master",
"xj/yii2-babel": "dev-master"
},
"repositories": {
"asset_packagist": {

41
environments/skeleton/antgoods/config/main-local.php

@ -0,0 +1,41 @@
<?php
$config = [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '',
],
],
];
if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs' => ['127.0.0.1'],
'generators' => [
'crud' => [
'class' => 'iron\generators\crud\Generator',
'templates' => [
'blobtCrud' => '@blobt/generators/crud/default',
'ironCrud' => '@iron/generators/crud/default',
]
],
'model' => [
'class' => 'iron\generators\model\Generator',
'templates' => [
'ironModel' => '@iron/generators/model/default',
]
]
],
];
}
return $config;

3
environments/skeleton/antgoods/config/params-local.php

@ -0,0 +1,3 @@
<?php
return [
];

24
goods/Module.php

@ -0,0 +1,24 @@
<?php
namespace goods;
/**
* goods module definition class
*/
class Module extends \yii\base\Module
{
/**
* {@inheritdoc}
*/
public $controllerNamespace = 'goods\controllers';
/**
* {@inheritdoc}
*/
public function init()
{
parent::init();
// custom initialization code goes here
}
}

vendor/antgoods/goods/src/assets/custom/sku.49a56a9198d9c3ec233c.js → goods/assets/custom/sku.49a56a9198d9c3ec233c.js

vendor/antgoods/goods/src/assets/custom/sku.52802ed907a316501cd7.js → goods/assets/custom/sku.52802ed907a316501cd7.js

vendor/antgoods/goods/src/assets/custom/sku.9a46222d01b3d601e5ad.js → goods/assets/custom/sku.9a46222d01b3d601e5ad.js

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save