Explorar o código

Merge branch 'feature/york-1377-1378-hebing-0517' into new-version

root %!s(int64=3) %!d(string=hai) anos
pai
achega
5429629401

+ 5 - 1
backendApi/modules/v1/controllers/ShopController.php

@@ -213,6 +213,10 @@ class ShopController extends BaseController {
             'AMOUNT'=> 'DP.AMOUNT',
             'PV'=> 'DP.PV',
             'STATUS'=> 'DP.STATUS',
+            'STORE_NUMS'=>'DP.STORE_NUMS',
+            'STATUS_DATE'=>'DP.STATUS_DATE',
+            'PACKAGE_DATE'=>'DP.PACKAGE_DATE',
+            'PACKAGE_STATUS_DATE'=>'DP.PACKAGE_STATUS_DATE'
         ]);
         $condition = $filter['condition'];
         $params = $filter['params'];
@@ -249,7 +253,7 @@ class ShopController extends BaseController {
             });
         }
         $package = DeclarationPackage::findOneAsArray('ID=:ID', [':ID' => $id]);
-        return static::notice(['id' => $package['ID'], 'packageName' => $package['PACKAGE_NAME'],'packageNo' => $package['PACKAGE_NO'], 'amount' => $package['AMOUNT'], 'amountPv' => $package['PV'], 'levelId' => $package['LEVEL_ID'], 'packageContent' => $package['PACKAGE_CONTENT']]);
+        return static::notice(['id' => $package['ID'], 'packageName' => $package['PACKAGE_NAME'],'packageNo' => $package['PACKAGE_NO'], 'amount' => $package['AMOUNT'], 'amountPv' => $package['PV'], 'levelId' => $package['LEVEL_ID'], 'packageContent' => $package['PACKAGE_CONTENT'],'storenums' => $package['STORE_NUMS'],'statusdate'=>$package['STATUS_DATE'],'packagedate'=>$package['PACKAGE_DATE'],'packagestatusdate'=>$package['PACKAGE_STATUS_DATE']]);
     }
 
     /**

+ 43 - 0
backendApi/modules/v1/models/lists/shop/GoodsList.php

@@ -5,6 +5,8 @@ use common\helpers\Tool;
 use common\libs\dataList\DataListInterface;
 use common\models\ShopGoods;
 use common\libs\dataList\column\DateTime;
+use common\libs\dataList\column\YesNo;
+
 
 class GoodsList extends \common\libs\dataList\DataList implements DataListInterface
 {
@@ -147,6 +149,47 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                     'headerOther' => ['width' => '190'],
                 ],
+                'STATUS_DATE' => [
+                    'header' => '是否开启限时',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['STATUS_DATE'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['STATUS_DATE']) && $row['STATUS_DATE'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'GOODS_STATUS_DATE' => [
+                    'header' => '限时状态',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function ($row) {
+                        return $row['GOODS_STATUS_DATE'] == 1 ? '上架' : '下架';
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type'=>(isset($row['GOODS_STATUS_DATE']) && $row['GOODS_STATUS_DATE'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'GOODS_DATE' => [
+                    'header' => '限时时间',
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => ($row['GOODS_DATE']),
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
             ];
         }
         return $this->columns;

+ 55 - 0
backendApi/modules/v1/models/lists/shop/PackageList.php

@@ -3,6 +3,7 @@ namespace backendApi\modules\v1\models\lists\shop;
 
 use common\helpers\Tool;
 use common\libs\dataList\column\DateTime;
+use common\libs\dataList\column\YesNo;
 use common\libs\dataList\DataListInterface;
 use common\models\DeclarationLevel;
 use common\models\DeclarationPackage;
@@ -54,6 +55,10 @@ class PackageList extends \common\libs\dataList\DataList implements DataListInte
                     'header' => '所属报单级别',
                     'headerOther' => ['width' => '200'],
                 ],
+                'STORE_NUMS' => [
+                    'header' => '库存',
+                    'headerOther' => ['width' => '200'],
+                ],
                 'AMOUNT' => [
                     'header' => '套餐金额',
                     'headerOther' => [
@@ -91,6 +96,47 @@ class PackageList extends \common\libs\dataList\DataList implements DataListInte
                         'width' => '110',
                     ],
                 ],
+                'STATUS_DATE' => [
+                    'header' => '是否开启限时',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['STATUS_DATE'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['STATUS_DATE']) && $row['STATUS_DATE'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'PACKAGE_STATUS_DATE' => [
+                    'header' => '限时状态',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function ($row) {
+                        return $row['PACKAGE_STATUS_DATE'] == 1 ? '上架' : '下架';
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type'=>(isset($row['PACKAGE_STATUS_DATE']) && $row['PACKAGE_STATUS_DATE'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'PACKAGE_DATE' => [
+                    'header' => '限时时间',
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => ($row['PACKAGE_DATE']),
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
                 'PACKAGE_CONTENT' => [
                     'header' => '套餐内容',
                     'headerOther' => ['width' => '290'],
@@ -104,6 +150,15 @@ class PackageList extends \common\libs\dataList\DataList implements DataListInte
                     },
                     'headerOther' => ['width' => '190'],
                 ],
+                'UPDATED_AT' => [
+                    'header' => '更新时间',
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => $row['UPDATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
             ];
         }
         return $this->columns;

+ 2 - 3
backendEle/src/utils/config_development_example.js

@@ -1,5 +1,5 @@
 const APP_NAME = '奖金结算系统'
-const SERVER_API_DOMAIN = '127.0.0.1:3030'
+const SERVER_API_DOMAIN = '16.163.228.151:8012'
 const SERVER_API_HTTP_TYPE = 'http://'
 const SERVER_API_PORT = ''  // ':8102'
 const SERVER_API_VERSION = 'v1'
@@ -11,7 +11,7 @@ const ACCESS_TOKEN_PREFIX = 'Bearer '
 const CDN_BASE_URL = 'http://16.163.228.151:8016'
 const CDN_IMG_URL = `${CDN_BASE_URL}/cdn/`
 const PRICE_IS_ROUND = true
-const FRONTEND_SERVER = 'http://127.0.0.1:8086'
+const FRONTEND_SERVER = 'http://16.163.228.151:8015'
 const REGION_URL = `${CDN_BASE_URL}/cdn/jsdata/ar_region_data.js?ver=0.1`
 
 export {
@@ -31,4 +31,3 @@ export {
   FRONTEND_SERVER,
   REGION_URL
 }
-

+ 1 - 1
backendEle/src/utils/config_production_example.js

@@ -11,7 +11,7 @@ const ACCESS_TOKEN_PREFIX = 'Bearer '
 const CDN_BASE_URL = 'http://16.163.228.151:8016'
 const CDN_IMG_URL = `${CDN_BASE_URL}/cdn/`
 const PRICE_IS_ROUND = true
-const FRONTEND_SERVER = 'http://16.163.228.151:8012'
+const FRONTEND_SERVER = 'http://16.163.228.151:8015'
 const REGION_URL = 'http://16.163.228.151:8016/cdn/jsdata/ar_region_data.js?ver=0.1'
 
 export {

+ 130 - 2
backendEle/src/views/shop/index.vue

@@ -29,6 +29,7 @@
                                 </el-dropdown-item>
                                 <el-dropdown-item command="goods-edit" @click.native="handleGoodUp(scope.row.ID)">商品上架 </el-dropdown-item>
                                  <el-dropdown-item command="goods-edit" @click.native="handleGoodDown(scope.row.ID)">商品下架 </el-dropdown-item>
+                                <el-dropdown-item command="goods-edit" @click.native="handleEditShowGoodsTimes(scope.row)">商品限时 </el-dropdown-item>
                             </el-dropdown-menu>
                         </el-dropdown>
                     </template>
@@ -95,7 +96,7 @@
                     <el-form-item label="市场价格">
                         <el-input v-model="form.marketPrice"></el-input>
                     </el-form-item>
-                    <el-form-item label="销售价格" p>
+                    <el-form-item label="销售价格" >
                         <el-input v-model="form.sellPrice"></el-input>
                     </el-form-item>
                     <el-form-item label="价格PV	">
@@ -139,6 +140,47 @@
                 <el-button type="primary" @click.native="handleEdit">修 改</el-button>
             </div>
         </el-dialog>
+
+        <el-dialog title="商品限时" :visible.sync="dialogEditFormVisibleGoodsTimes">
+            <el-form :model="form" label-width="250px" class="form-dialog" v-loading="dialogEditLoadingGoodsTimes">
+
+
+                    <el-form-item label="是否限时">
+                          <el-switch
+                            v-model="form.statusdate"
+                            active-value="1"
+                            inactive-value="0">
+                          </el-switch>
+                    </el-form-item>
+                    <transition name="el-zoom-in-top">
+                    <el-form-item label="限时时间" v-show='form.statusdate==1?true:false'>
+                            <el-date-picker
+                              v-model="form.goodsdate"
+                              type="datetime"
+                              placeholder="选择日期时间"
+                              value-format="timestamp"
+                              popper-class='goodsdate'>
+                            </el-date-picker>
+							
+		
+
+                    </el-form-item>
+                    </transition>
+                    <transition name="el-zoom-in-top">
+                    <el-form-item label="限时类型" v-show='form.statusdate==1?true:false'>
+
+                         <el-radio v-model="form.goodsstatusdate" label="0" border>下架</el-radio>
+                         <el-radio v-model="form.goodsstatusdate" label="1" border>上架</el-radio>
+                    </el-form-item>
+                    </transition>
+
+
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click="dialogEditFormVisibleGoodsTimes = false">取 消</el-button>
+                <el-button type="primary" @click.native="handleEdit">修 改</el-button>
+            </div>
+        </el-dialog>
     </div>
 </template>
 
@@ -183,6 +225,8 @@
                 selectedIds:'',
                 dialogEditFormVisible: false,
                 dialogEditLoading: false,
+                dialogEditFormVisibleGoodsTimes: false,
+                dialogEditLoadingGoodsTimes: false,
                 form:{
                     sellType:[],
                     goodsName:'',
@@ -201,6 +245,9 @@
                     cover:'',
                     textarea:'',
                     sellDiscount:'',
+                    statusdate:'',
+                    goodsstatusdate:'',
+                    goodsdate:'',
                 },
                 submitButtonStat: false,
                 goodsType:[],
@@ -209,7 +256,8 @@
                 img_show:true
             }
         },
-        methods: {
+        methods: {
+
             handleSelectionChange(val) {
                 this.multipleSelection = val
             },
@@ -289,6 +337,9 @@
                     vueObj.form.sort=response.goodsInfo.SORT
                     vueObj.form.id=response.goodsInfo.ID
                     vueObj.form.cover=response.goodsInfo.COVER
+                    vueObj.form.statusdate=response.goodsInfo.STATUS_DATE
+                    vueObj.form.goodsstatusdate=response.goodsInfo.GOODS_STATUS_DATE
+                    vueObj.form.goodsdate=response.goodsInfo.GOODS_DATE * 1000
                     // vueObj.form.sellType=vueObj.form.sellType.map((item,index)=>{
                     //   return response.goodsInfo.SELL_TYPE.some(val=>(index+1).toString()==val)
                     //   })
@@ -297,8 +348,78 @@
 
                 })
             },
+            /**
+             * 2022-05-09
+             * York
+             * 限时商品
+             */
+            handleEditShowGoodsTimes(row) {
+                this.dialogEditLoadingGoodsTimes = true
+                this.auditId = row.ID
+                this.dialogEditFormVisibleGoodsTimes = true
+                let vueObj = this
+                network.getData('shop/goods-edit', {id: this.auditId}).then(response => {
+                    vueObj.dialogEditLoadingGoodsTimes = false
+                    vueObj.goodsType=response.goodsType
+
+                    let gift=response.goodsInfo.GIFT_TYPE;
+                    let gift_type=response.giftType;
+
+                    let giftType=[];
+                    if(gift.length>0){
+                        for(let i in gift_type){
+                            giftType.push({key:i,name:gift_type[i].name,checked:false})
+                            gift.map((v,k)=>{
+                                if(v==i){
+                                    giftType[i-1].checked=true;
+                                }
+                            })
+                        }
+                    }
+                    vueObj.GiftTypeArr=giftType
+
+                    let sell=response.goodsInfo.SELL_TYPE;
+                    let sell_type=response.sellType;
+                    let sellType=[];
+                    if(sell.length>0){
+                        for(let i in sell_type){
+                            sellType.push({key:i,name:sell_type[i].name,checked:false})
+                            sell.map((item,index)=>{
+                                if(item==i){
+                                    sellType[i-1].checked=true;
+                                }
+                            })
+                        }
+                    }
+                    vueObj.sell_type=sellType;
+
+                    vueObj.form.goodsName=response.goodsInfo.GOODS_NAME
+                    vueObj.form.sellDiscount=response.goodsInfo.SELL_DISCOUNT
+                    vueObj.form.goodsNo=response.goodsInfo.GOODS_NO
+                    vueObj.form.type=response.goodsInfo.TYPE
+                    vueObj.form.unit=response.goodsInfo.UNIT
+                    vueObj.form.marketPrice=response.goodsInfo.MARKET_PRICE
+                    vueObj.form.sellPrice=response.goodsInfo.SELL_PRICE
+                    vueObj.form.pricePv=response.goodsInfo.PRICE_PV
+                    vueObj.form.point=response.goodsInfo.POINT
+                    vueObj.form.storeNums=response.goodsInfo.STORE_NUMS
+                    vueObj.form.content=response.goodsInfo.CONTENT
+                    vueObj.form.sort=response.goodsInfo.SORT
+                    vueObj.form.id=response.goodsInfo.ID
+                    vueObj.form.cover=response.goodsInfo.COVER
+                    vueObj.form.statusdate=response.goodsInfo.STATUS_DATE
+                    vueObj.form.goodsstatusdate=response.goodsInfo.GOODS_STATUS_DATE
+                    vueObj.form.goodsdate=response.goodsInfo.GOODS_DATE * 1000
+
+
+                    this.$forceUpdate()
+
+                })
+            },
+
             handleEdit() {
                 this.dialogEditFormVisible = false
+                this.dialogEditFormVisibleGoodsTimes = false
                 this.$message({
                     message: '正在修改数据',
                     type: 'info'
@@ -423,4 +544,11 @@
         margin-right: 0;
         margin-bottom: 0;
     }
+
 </style>
+
+<!-- <style>
+  .goodsdate{
+      top: 286px !important;
+  }
+</style> -->

+ 7 - 2
backendEle/src/views/shop/package-add.vue

@@ -24,6 +24,9 @@
                 <el-form-item label="套餐内容">
                     <el-input v-model="form.packageContent"></el-input>
                 </el-form-item>
+                <el-form-item label="套餐库存">
+                    <el-input oninput="value=value.replace(/[^\d]/g,'')" v-model="form.storenums"></el-input>
+                </el-form-item>
 
 
                 <el-form-item>
@@ -52,7 +55,8 @@
                     amount:'',
                     amountPv:'',
                     levelId:'',
-                    packageContent:''
+                    packageContent:'',
+                    storenums:''
                 },
                 submitButtonStat: false,
                 allDecLevel: baseInfo.decLevels(),
@@ -70,6 +74,7 @@
                     amountPv: this.form.amountPv,
                     levelId: this.form.levelId,
                     packageContent: this.form.packageContent,
+                    storenums:this.form.storenums,
 
                 }
 
@@ -107,4 +112,4 @@
 
 <style scoped>
 
-</style>
+</style>

+ 64 - 2
backendEle/src/views/shop/package.vue

@@ -32,6 +32,8 @@
                                 </el-dropdown-item>
                                 <el-dropdown-item command="goods-edit" @click.native="handleGoodUp(scope.row.ID)">商品上架 </el-dropdown-item>
                                 <el-dropdown-item command="goods-edit" @click.native="handleGoodDown(scope.row.ID)">商品下架 </el-dropdown-item>
+                                <el-dropdown-item command="package-get" @click.native="handleEditShowGoodsTimes(scope.row)">套餐限时
+                                </el-dropdown-item>
                             </el-dropdown-menu>
                         </el-dropdown>
                     </template>
@@ -70,12 +72,53 @@
                 <el-form-item label="套餐内容">
                     <el-input v-model="form.packageContent"></el-input>
                 </el-form-item>
+                <el-form-item label="套餐库存">
+                    <el-input oninput="value=value.replace(/[^\d]/g,'')" v-model="form.storenums"></el-input>
+                </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-button @click="dialogEditFormVisible = false">取 消</el-button>
                 <el-button type="primary" @click.native="handleEdit">修 改</el-button>
             </div>
         </el-dialog>
+
+        <el-dialog title="限时套餐" :visible.sync="dialogEditFormVisibleGoodsTimes">
+            <el-form :model="form" label-width="250px" class="form-dialog" v-loading="dialogEditLoadingGoodsTimes">
+
+               <el-form-item label="是否限时">
+                     <el-switch
+                       v-model="form.statusdate"
+                       active-value="1"
+                       inactive-value="0">
+                     </el-switch>
+               </el-form-item>
+               <transition name="el-zoom-in-top">
+               <el-form-item label="限时时间" v-show='form.statusdate==1?true:false'>
+                       <el-date-picker
+                         v-model="form.packagedate"
+                         type="datetime"
+                         placeholder="选择日期时间"
+                         value-format="timestamp"
+                         popper-class='goodsdate'>
+                       </el-date-picker>
+               </el-form-item>
+               </transition>
+               <transition name="el-zoom-in-top">
+               <el-form-item label="限时类型" v-show='form.statusdate==1?true:false'>
+
+                    <el-radio v-model="form.packagestatusdate" label="0" border>下架</el-radio>
+                    <el-radio v-model="form.packagestatusdate" label="1" border>上架</el-radio>
+               </el-form-item>
+               </transition>
+
+
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click="dialogEditFormVisibleGoodsTimes = false">取 消</el-button>
+                <el-button type="primary" @click.native="handleEdit">修 改</el-button>
+            </div>
+        </el-dialog>
+
     </div>
 </template>
 
@@ -117,12 +160,15 @@
                 filterData: null,
                 dialogEditFormVisible: false,
                 dialogEditLoading: false,
+                dialogEditFormVisibleGoodsTimes: false,
+                dialogEditLoadingGoodsTimes: false,
                 allDecLevel: baseInfo.decLevels(),
                 form: {
                     selectedIds: [],
                     statusValue: [],
                     sendType: null,
                     remark: null,
+
                 },
             }
         },
@@ -152,17 +198,32 @@
                 network.getData('shop/package-get', {id: this.auditId}).then(response => {
                     console.log(response)
                     vueObj.dialogEditLoading = false
-                    vueObj.form = response
+                    vueObj.form = response
+					vueObj.form.packagedate = response.packagedate*1000
+                })
+            },
+            handleEditShowGoodsTimes(row) {
+                this.dialogEditLoadingGoodsTimes = true
+                this.auditId = row.ID
+                this.dialogEditFormVisibleGoodsTimes = true
+                let vueObj = this
+                network.getData('shop/package-get', {id: this.auditId}).then(response => {
+                    console.log(response.packagedate*1000)
+                    vueObj.dialogEditLoadingGoodsTimes = false
+                    vueObj.form = response
+					vueObj.form.packagedate = response.packagedate*1000
                 })
             },
             handleEdit() {
                 this.dialogEditFormVisible = false
+                this.dialogEditFormVisibleGoodsTimes = false
                 this.$message({
                     message: '正在修改数据',
                     type: 'info'
                 })
                 let path = 'shop/package-get'
                 network.postData(path, this.form).then(response => {
+
                     this.$message({
                         message: response,
                         type: 'success'
@@ -203,7 +264,8 @@
             getData(page, pageSize) {
                 let filterData = this.filterModel
                 network.getPageData(this, 'shop/package', page, pageSize, filterData, response => {
-                    console.log(response)
+                    console.log('response')
+                    console.log(response);
                     this.filterTypes = response.filterTypes
                     this.allData = response
                 })

+ 1 - 0
common/components/ActiveRecord.php

@@ -444,4 +444,5 @@ class ActiveRecord extends \yii\db\ActiveRecord {
         unset($limit, $sql, $affectRow);
         return true;
     }
+
 }

+ 2 - 0
common/components/SwooleAsyncTimer.php

@@ -23,6 +23,7 @@ use common\models\UserInfo;
 use Yii;
 use anlity\swooleAsyncTimer\SwooleAsyncTimerController;
 use common\helpers\bonus\PreparePerfCalc;
+use common\helpers\goods\GoodsTimes;
 use yii\base\Exception;
 use yii\helpers\Json;
 
@@ -50,6 +51,7 @@ class SwooleAsyncTimer extends SwooleAsyncTimerComponent implements SocketInterf
         // 自动封期
         PreparePerfCalc::instance()->calcStep(); // 预计算月业绩
         AutoClosePeriod::instance()->autoClose();
+        GoodsTimes::instance()->goodstime();
         // 自动执行任务队列中的任务
         Queue::instance()->consumeTask();
 

+ 67 - 0
common/helpers/goods/GoodsTimes.php

@@ -0,0 +1,67 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: leo
+ * Date: 2018/5/18
+ * Time: 下午4:53
+ */
+
+namespace common\helpers\goods;
+
+
+use common\helpers\Cache;
+use common\helpers\Date;
+use common\models\DeclarationPackage;
+use common\models\forms\PeriodForm;
+use common\models\Period;
+use common\models\ShopGoods;
+use yii\base\BaseObject;
+use yii\base\StaticInstanceTrait;
+
+class GoodsTimes extends BaseObject
+{
+    use StaticInstanceTrait;
+
+    public function goodstime(){
+       $goods = ShopGoods::findAllAsArray('STATUS_DATE=1');
+
+       foreach ($goods as $k => $v){
+           $goodsdata = ShopGoods::find()->where(['ID' => $goods[$k]['ID']])->one();
+           if (Date::nowTime()>=($goodsdata->GOODS_DATE/1000)){
+               if ($goodsdata->GOODS_STATUS_DATE == 0){
+                   $goodsdata->STATUS = 0;
+                   $goodsdata->UPDATED_AT = Date::nowTime();
+                   $goodsdata->STATUS_DATE = 0;
+                   $goodsdata->update();
+               }else{
+                   $goodsdata->STATUS = 1;
+                   $goodsdata->UPDATED_AT = Date::nowTime();
+                   $goodsdata->STATUS_DATE = 0;
+                   $goodsdata->update();
+               }
+           }
+       }
+            $package = DeclarationPackage::findAllAsArray('STATUS_DATE=1');
+       foreach ($package as $a => $b){
+           $packagedata = DeclarationPackage::find()->where(['ID' => $package[$a]['ID']])->one();
+           if (Date::nowTime()>=($packagedata->PACKAGE_DATE/1000)){
+                if ($packagedata->PACKAGE_STATUS_DATE == 0){
+                    $packagedata->STATUS = 0;
+                    $packagedata->UPDATED_AT = Date::nowTime();
+                    $packagedata->STATUS_DATE = 0;
+                    $packagedata->update();
+                }else{
+                    $packagedata->STATUS = 1;
+                    $packagedata->UPDATED_AT = Date::nowTime();
+                    $packagedata->STATUS_DATE = 0;
+                    $packagedata->update();
+                }
+           }
+       }
+
+
+    }
+
+
+
+}

+ 6 - 1
common/models/DeclarationPackage.php

@@ -12,6 +12,7 @@ namespace common\models;
  * @property string $AMOUNT 套餐金额
  * @property string $PV 套餐PV
  * @property string $PACKAGE_CONTENT 套餐内容
+ * @property string $STORE_NUMS 套餐库存
  * @property string $CREATED_AT 创建时间
  * @property string $CREATE_ADMIN 创建人
  * @property string $UPDATE_ADMIN 更新人
@@ -19,6 +20,9 @@ namespace common\models;
  * @property int $IS_DEL 是否删除
  * @property int $STATUS 状态
  * @property int $DELETED_AT 删除时间
+ * @property int $STATUS_DATE 是否开启限时
+ * @property int $PACKAGE_STATUS_DATE 限时状态
+ * @property int $PACKAGE_DATE 限时执行时间
  */
 class DeclarationPackage extends \common\components\ActiveRecord
 {
@@ -46,7 +50,7 @@ class DeclarationPackage extends \common\components\ActiveRecord
             [['ID','LEVEL_ID','CREATE_ADMIN', 'UPDATE_ADMIN'], 'string', 'max' => 32],
             [['PACKAGE_NAME'], 'string', 'max' => 48],
             [['PACKAGE_NAME'], 'unique'],
-            [['AMOUNT', 'PV'], 'number'],
+            [['AMOUNT', 'PV','STORE_NUMS'], 'number'],
             [['ID'], 'unique'],
         ];
     }
@@ -71,6 +75,7 @@ class DeclarationPackage extends \common\components\ActiveRecord
             'IS_DEL' => '是否删除',
             'STATUS' => '是否上架',
             'DELETED_AT' => '删除时间',
+            'STORE_NUMS' => '套餐库存',
         ];
     }
 

+ 13 - 2
common/models/forms/DecPackageForm.php

@@ -21,6 +21,10 @@ class DecPackageForm extends Model
     public $levelId;
     public $packageContent;
     public $status;
+    public $storenums;
+    public $statusdate;
+    public $packagedate;
+    public $packagestatusdate;
 
     /**
      * @inheritdoc
@@ -34,6 +38,8 @@ class DecPackageForm extends Model
             [['id'], 'exist', 'targetClass'=>DeclarationPackage::class, 'targetAttribute'=>'ID'],
             [['amount','amountPv'], 'price'],
             [['selectedIds'], 'isSelected'],
+            [['storenums'],'number'],
+            [['statusdate'],'match','pattern'=>'/^[0-1]{1,1}$/']
         ];
     }
 
@@ -48,6 +54,7 @@ class DecPackageForm extends Model
             'amountPv' => '套餐PV',
             'levelId' => '所属报单级别',
             'packageContent' => '套餐详情',
+            'storenums' => '套餐库存',
         ];
     }
 
@@ -59,8 +66,8 @@ class DecPackageForm extends Model
     {
         $parentScenarios =  parent::scenarios();
         $customScenarios = [
-            'add' => ['packageName','packageNo','amount','amountPv','levelId', 'packageContent'],
-            'edit' => ['id','packageName','packageNo','amount','amountPv', 'levelId', 'packageContent'],
+            'add' => ['packageName','packageNo','amount','amountPv','levelId', 'packageContent','storenums'],
+            'edit' => ['id','packageName','packageNo','amount','amountPv', 'levelId', 'packageContent','storenums','statusdate','packagedate','packagestatusdate'],
             'changeStatus' => ['selectedIds', 'status'],
         ];
         return array_merge($parentScenarios, $customScenarios);
@@ -105,6 +112,10 @@ class DecPackageForm extends Model
         $model->PV = $this->amountPv;
         $model->LEVEL_ID = $this->levelId;
         $model->PACKAGE_CONTENT = $this->packageContent;
+        $model->STORE_NUMS = $this->storenums;
+        $model->STATUS_DATE = $this->statusdate;
+        $model->PACKAGE_STATUS_DATE = $this->packagestatusdate;
+        $model->PACKAGE_DATE = $this->packagedate / 1000;
         if($model->save()){
             return $model;
         } else {

+ 83 - 0
common/models/forms/DeclarationLoopForm.php

@@ -6,6 +6,9 @@ use common\helpers\Form;
 use common\models\UserBind;
 use yii\base\Exception;
 use yii\helpers\Json;
+use common\models\DeclarationPackage;
+use common\helpers\Date;
+use common\models\ShopGoods;
 
 /**
  * Login form
@@ -109,9 +112,84 @@ class DeclarationLoopForm extends Model
             $allZcUserIds = [];
             $zcUserIdCard = null;
             $model = new DeclarationForm();
+//            var_dump('$model');
+//            var_dump($model);
+//            var_dump('----------------------------$model--------------------------------');
             $model->scenario = $this->scenario;
+//            var_dump('$model-scenario');
+//            var_dump($model->scenario);
+//            var_dump('----------------------------$model->scenario----------------------');
             $model->allData = $this->data;
+//            var_dump('$model->allData');
+//            var_dump($model->allData);
+//            var_dump('----------------------------$model->allData-----------------------');
             foreach ($this->data as $value){
+//                var_dump('goodsId');
+//                var_dump($value['goodsId']);
+//                var_dump('goodsNum');
+
+
+
+                /**
+                 * 2022-04-29
+                 * York
+                 * 获取商品套餐信息
+                 */
+                if (isset($value['packageId']) && $value['packageId']){
+
+
+                    $packagedata = DeclarationPackage::findOneAsArray('ID=:ID', [':ID' => $value['packageId']]);
+                    //var_dump($packagedata['ID']);
+                    if($packagedata['STORE_NUMS']>0){
+                        $data =  DeclarationPackage::find()->where(['ID'=> $packagedata['ID'] ])->one();
+                        $goods_store_nums = $data->STORE_NUMS - 1;
+                        $data->STORE_NUMS = $goods_store_nums;
+                        $data->update();
+//                        var_dump('输出一下数量');
+//                        var_dump($goods_store_nums);
+                        //库存为0下架套餐
+                        if ($goods_store_nums <= 0){
+                            $data->STATUS = 0;
+                            $data->UPDATED_AT = Date::nowTime();
+//                            var_dump('购买后套餐库存为0 下架拉');
+                        }
+
+                    }else{
+                        throw new Exception($packagedata['PACKAGE_NAME'].'库存不足');
+                    }
+
+
+                }
+
+                if (count($value['goodsId']) > 0 && (count($value['goodsId']) == count($value['goodsNum']))){
+                    for ($i=0;$i<count($value['goodsId']);$i++){
+                        $goods = ShopGoods::findOneAsArray('ID=:ID',[':ID'=> $value['goodsId'][$i]]);
+                        if ($goods['STATUS'] == 1 ){
+                            if($goods['STORE_NUMS'] >= $value['goodsNum'][$i]){
+                                $data = ShopGoods::find()->where(['ID' => $value['goodsId'][$i]])->one();
+                                $goods_store_nums = $data->STORE_NUMS - $value['goodsNum'][$i];
+                                $data->STORE_NUMS = $goods_store_nums;
+                                $data->update();
+                                if($goods_store_nums <= 0){
+                                    $data->STATUS = 0;
+                                    $data->UPDATED_AT = Date::nowTime();
+                                    $data->update();
+                                }
+                            }else{
+                                throw new Exception($goods['GOODS_NAME'].'商品库存不足');
+                            }
+
+                        }else{
+                            throw new Exception($goods['GOODS_NAME'].'商品已下架');
+                        }
+
+                    }
+
+                }
+
+
+
+
                 if(is_array($value)){
                     foreach($value as $key=>$decFormData){
                         $model->$key = $decFormData;
@@ -130,6 +208,11 @@ class DeclarationLoopForm extends Model
                     if(!$model->add($this->data)){
                         throw new Exception(Form::formatErrorsForApi($model->getErrors()));
                     }
+
+
+
+
+
 //                    $model->type = null;
 //                    $model->decSn = null;
 //                    $model->userId = null;

+ 32 - 0
common/models/forms/DeclarationUpgradeForm.php

@@ -273,6 +273,38 @@ class DeclarationUpgradeForm extends Model
                 $transaction->rollBack();
                 throw new Exception(Form::formatErrorsForApi($orderModel->getErrors()));
             }
+
+            /**
+             * 2022-05-10
+             * York
+             */
+            foreach ($this->goodsNum as $k => $v) {
+                if ($v) {
+                    $goods = ShopGoods::findOneAsArray('ID=:ID',[':ID'=> $this->goodsId[$k]]);
+
+                    $storenums = $goods['STORE_NUMS'] - $this->goodsNum[$k];
+                    if($goods['STATUS']==1){
+                       if($goods['STORE_NUMS'] >=$this->goodsNum[$k]){
+                           $data = ShopGoods::find()->where(['ID' => $this->goodsId[$k]])->one();
+                           $data->STORE_NUMS = $storenums;
+                           $data->update();
+                           if ($storenums==0){
+                               $data->STATUS = 0;
+                               $data->UPDATED_AT = Date::nowTime();
+                               $data->update();
+                           }
+                       }else{
+                           throw new Exception("商品".$goods['GOODS_NAME']."库存不足");
+                       }
+                    }else{
+                        throw new Exception("商品".$goods['GOODS_NAME']."已下架");
+                    }
+                }
+            }
+           // exit();
+
+
+
             // 加入商品到订单商品表
             foreach($this->_orderGoods as $key=>$value){
                 $this->_orderGoods[$key]['ORDER_SN'] = $orderModel->SN;

+ 62 - 0
common/models/forms/OrderForm.php

@@ -349,6 +349,36 @@ class OrderForm extends Model
                     throw new Exception('复消积分不足,无法购买商品');
                 }
             }
+
+            /**
+             * 2022-04-28
+             * York
+             * 支付后减少库存
+             */
+            foreach ($this->goodsNum as $k => $v){
+                if ($v){
+                    $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
+                    if ($goods['STORE_NUMS'] >= $this->goodsNum[$k]){
+                        $data = ShopGoods::find()->where(['ID' => $ids[$k]])->one();
+                        $goods_store_nums = $data->STORE_NUMS - $this->goodsNum[$k];
+                        $data->STORE_NUMS = $goods_store_nums;
+                        $data->update();
+                        //下单后库存小于等于0 商品下架
+                        if($goods_store_nums <= 0){
+                            $data->STATUS = 0;
+                            $data->UPDATED_AT = Date::nowTime();
+                            $data->update();
+
+                        }
+                    }else{
+                        throw new Exception($goods['GOODS_NAME'].'库存不足,无法购买商品');
+
+                    }
+
+
+                }
+            }
+//                exit();
             //写入订单
             if (!$orderResult = $this->addOrder()) {
                 throw new Exception(Form::formatErrorsForApi($orderResult->getErrors()));
@@ -504,6 +534,38 @@ class OrderForm extends Model
                     throw new Exception('复消积分不足,无法购买商品');
                 }
             }
+
+
+            /**
+             * 2022-04-28
+             * York
+             * 支付后减少库存
+             */
+            foreach ($this->goodsNum as $k => $v){
+                if ($v){
+                    $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
+                    if ($goods['STORE_NUMS'] >= $this->goodsNum[$k]){
+                        $data = ShopGoods::find()->where(['ID' => $ids[$k]])->one();
+                        $goods_store_nums = $data->STORE_NUMS - $this->goodsNum[$k];
+                        $data->STORE_NUMS = $goods_store_nums;
+                        $data->update();
+                        //下单后库存小于等于0 商品下架
+                        if($goods_store_nums <= 0){
+                            $data->STATUS = 0;
+                            $data->UPDATED_AT = Date::nowTime();
+                            $data->update();
+
+                        }
+                    }else{
+                        throw new Exception($goods['GOODS_NAME'].'库存不足,无法购买商品');
+
+                    }
+
+
+                }
+            }
+//                exit();
+
             //写入订单
             if (!$orderResult = $this->addUserOrder()) {
                 throw new Exception(Form::formatErrorsForApi($orderResult->getErrors()));

+ 9 - 2
common/models/forms/ShopGoodsForm.php

@@ -31,6 +31,9 @@ class ShopGoodsForm extends Model
     public $content;
     public $sort;
     public $status;
+    public $statusdate;
+    public $goodsstatusdate;
+    public $goodsdate;
 
     private $_model;
 
@@ -55,7 +58,8 @@ class ShopGoodsForm extends Model
             [['id'], 'initModel'],
             [['selectedIds'], 'isSelected'],
             [['sort'], 'isSort'],
-            [['sellDiscount'], 'isDiscount']
+            [['sellDiscount'], 'isDiscount'],
+            [['statusdate','goodsstatusdate'],'match','pattern'=>'/^[0-1]{1,1}$/']
         ];
     }
 
@@ -90,7 +94,7 @@ class ShopGoodsForm extends Model
         $parentScenarios =  parent::scenarios();
         $customScenarios = [
             'add' => ['goodsName','sellDiscount','giftType', 'sellType','goodsNo','unit','sellPrice','marketPrice','pricePv','storeNums', 'content','sort','cover'],
-            'edit' => ['id','goodsName','sellDiscount','giftType', 'sellType','goodsNo','unit','sellPrice','marketPrice','pricePv', 'storeNums', 'content','sort','cover'],
+            'edit' => ['id','goodsName','sellDiscount','giftType', 'sellType','goodsNo','unit','sellPrice','marketPrice','pricePv', 'storeNums', 'content','sort','cover','statusdate','goodsstatusdate','goodsdate'],
             'changeStatus' => ['selectedIds', 'status'],
         ];
         return array_merge($parentScenarios, $customScenarios);
@@ -209,6 +213,9 @@ class ShopGoodsForm extends Model
             $model->STORE_NUMS = $this->storeNums;
             $model->SORT = $this->sort;
             $model->UPDATED_AT = Date::nowTime();
+            $model->STATUS_DATE = $this->statusdate;
+            $model->GOODS_STATUS_DATE = $this->goodsstatusdate;
+            $model->GOODS_DATE = $this->goodsdate / 1000;
             if (!$model->save()) {
                 throw new Exception(Form::formatErrorsForApi($model->getErrors()));
             }

+ 546 - 0
index.js

@@ -0,0 +1,546 @@
+import Vue from 'vue'
+import Router from 'vue-router'
+import layout from '../views/layout/layout'
+
+const _import = require('./_import_' + process.env.NODE_ENV)
+
+if(Router.version >= '3.1.0'){
+  const originalPush = Router.prototype.push
+  Router.prototype.push = function push(location) {
+    return originalPush.call(this, location).catch(err => err)
+  }
+}
+
+Vue.use(Router)
+
+export const constantRouterMap = [
+  {path: '/', redirect: '/login'},
+  {path: '/login', component: _import('login/index'), name: 'login'},
+  {path: '/login-by-backend', component: _import('login/login-by-backend'), name: 'login-by-backend'},
+  {path: '/modify-password/:username', component: _import('login/modify-password'), name: 'modify-password'},
+  // { path: '/authredirect', component: _import('login/authredirect'), hidden: true },
+  // { path: '/404', component: _import('errorPage/404'), hidden: true },
+  // { path: '/401', component: _import('errorPage/401'), hidden: true },
+  {
+    path: '/dashboard/index',
+    component: layout,
+    redirect: '/dashboard/index',
+    children: [{
+      path: '/dashboard/index',
+      component: _import('dashboard/index'),
+      name: 'dashboard_index',
+      meta: {
+        title: '控制台',
+        breadcrumb: [
+          {title: '首页', path: '/dashboard/index'},
+        ],
+      },
+    }]
+  },
+  {
+        path: '/shop',
+        component: layout,
+        redirect: '/shop/dec-order-list',
+        children: [
+            {
+                path: '/shop/dec-order-list',
+                component: _import('shop/dec-order-list'),
+                name: 'shop_dec-order-list',
+                meta: {
+                    title: '报单列表',
+                    breadcrumb: [
+                        {title: '首页', path: '/dashboard/index'},
+                        {title: '商城管理', path: '/shop/dec-order-list'},
+                    ],
+                },
+            },
+            {
+                path: '/shop/order-list',
+                component: _import('shop/order-list'),
+                name: 'shop_order-list',
+                meta: {
+                    title: '订单列表',
+                    breadcrumb: [
+                        {title: '首页', path: '/dashboard/index'},
+                        {title: '商城管理', path: '/shop/dec-order-list'},
+                    ],
+                },
+            },
+            {
+                path: '/shop/index',
+                component: _import('shop/index'),
+                name: 'shop_index',
+                meta: {
+                    title: '商品列表',
+                    breadcrumb: [
+                        {title: '首页', path: '/dashboard/index'},
+                        {title: '商城管理', path: '/shop/dec-order-list'},
+                    ],
+                },
+            },
+            {
+                path: '/shop/order',
+                component: _import('shop/order'),
+                name: 'shop_order',
+                meta: {
+                    title: '商品结算',
+                    breadcrumb: [
+                        {title: '首页', path: '/dashboard/index'},
+                        {title: '商城管理', path: '/shop/dec-order-list'}
+                    ],
+                },
+            },
+            {
+                path: '/shop/goods-detail/:id',
+                component: _import('shop/goods-detail'),
+                name: 'shop_goods-detail',
+                meta: {
+                    title: '商品详情',
+                    breadcrumb: [
+                        {title: '首页', path: '/dashboard/index'},
+                        {title: '商城管理', path: '/shop/dec-order-list'},
+                    ],
+                },
+            },
+            {
+                path: '/shop/reconsume',
+                component: _import('shop/reconsume'),
+                name: 'shop_reconsume',
+                meta: {
+                    title: '复消商品',
+                    breadcrumb: [
+                        {title: '首页', path: '/dashboard/index'},
+                        {title: '商城管理', path: '/shop/dec-order-list'},
+                    ],
+                },
+            },
+            {
+                path: '/shop/reconsume-order',
+                component: _import('shop/reconsume-order'),
+                name: 'reconsume-order',
+                meta: {
+                    title: '复消商品结算',
+                    breadcrumb: [
+                        {title: '首页', path: '/dashboard/index'},
+                        {title: '商城管理', path: '/shop/dec-order-list'}
+                    ],
+                },
+            },
+        ],
+    },
+  {
+    path: '/user',
+    component: layout,
+    redirect: '/user/index',
+    children: [
+      {
+        path: '/user/index',
+        component: _import('user/index'),
+        name: 'user_index',
+        meta: {
+          title: '个人资料',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+          path: '/user/password',
+          component: _import('user/password'),
+          name: 'user_password',
+          meta: {
+              title: '重置密码',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '会员管理', path: '/user/index'},
+              ],
+          },
+      },
+      {
+        path: '/user/id-card',
+        component: _import('user/id-card'),
+        name: 'user_id-card',
+        meta: {
+          title: '上传身份证',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/rec-user',
+        component: _import('user/rec-user'),
+        name: 'user_rec-user',
+        meta: {
+          title: '开拓会员列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/bind',
+        component: _import('user/bind'),
+        name: 'user_bind',
+        meta: {
+          title: '点位绑定列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/bind-edit/:id',
+        component: _import('user/bind-edit'),
+        name: 'user_bind-edit',
+        meta: {
+          title: '点位绑定编辑',
+          highLight: '/user/bind',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '点位绑定列表', path: '/user/bind'},
+          ],
+        },
+      },
+      {
+        path: '/user/dec',
+        component: _import('user/dec'),
+        name: 'user_dec',
+        meta: {
+          title: '报单管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+    ]
+  },
+    {
+        path: '/atlas',
+        component: layout,
+        redirect: '/atlas/network',
+        children: [
+            {
+                path: '/atlas/network',
+                component: _import('atlas/network'),
+                name: 'atlas_network',
+                meta: {
+                    title: '安置网络',
+                    breadcrumb: [
+                        {title: '首页', path: '/dashboard/index'},
+                        {title: '网络图谱', path: '/atlas/network'},
+                    ],
+                },
+            },
+        ]
+    },
+  {
+    path: '/bonus',
+    component: layout,
+    redirect: '/bonus/index',
+    children: [
+      {
+        path: '/bonus/index',
+        component: _import('bonus/index'),
+        name: 'bonus_index',
+        meta: {
+          title: '我的账户',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/index'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/new',
+        component: _import('bonus/new'),
+        name: 'bonus_new',
+        meta: {
+          title: '最新奖金',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/index'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/other',
+        component: _import('bonus/other'),
+        name: 'bonus_other',
+        meta: {
+          title: '往期奖金',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/index'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/real-time-perf',
+        component: _import('bonus/real-time-perf'),
+        name: 'bonus_real-time-perf',
+        meta: {
+          title: '实时业绩',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/index'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/fc-point',
+        component: _import('bonus/fc-point'),
+        name: 'bonus_fc-point',
+        meta: {
+          title: '房产积分',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/index'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/teams',
+        component: _import('bonus/teams'),
+        name: 'bonus_teams',
+        meta: {
+          title: '团队查询',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/index'},
+          ],
+        },
+      },
+
+    ]
+  },
+  {
+    path: '/article',
+    component: layout,
+    redirect: '/article/list',
+    children: [
+      {
+        path: '/article/list/:cid',
+        component: _import('article/list'),
+        name: 'article_list',
+        meta: {
+          title: '文章列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '文章管理', path: '/article/list'},
+          ],
+        },
+      },
+      {
+        path: '/article/detail/:id',
+        component: _import('article/detail'),
+        name: 'article_detail',
+        meta: {
+          title: '文章详情',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '文章管理', path: '/article/list'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/message',
+    component: layout,
+    redirect: '/message/list',
+    children: [
+      {
+        path: '/message/list',
+        component: _import('message/list'),
+        name: 'message_list',
+        meta: {
+          title: '站内信列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '站内信', path: '/message/list'},
+          ],
+        },
+      },
+      {
+        path: '/message/detail/:id',
+        component: _import('message/detail'),
+        name: 'message_detail',
+        meta: {
+          title: '站内信详情',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '站内信', path: '/message/list'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/finance',
+    component: layout,
+    redirect: '/finance/withdraw',
+    children: [
+      {
+        path: '/finance/reconsume-pool-flow',
+        component: _import('finance/reconsume-pool-flow'),
+        name: 'finance_reconsume-pool-flow',
+        meta: {
+          title: '会员复销池余额流水',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/withdraw'},
+          ],
+        },
+      },
+      {
+        path: '/finance/withdraw',
+        component: _import('finance/withdraw'),
+        name: 'finance_withdraw',
+        meta: {
+          title: '提现明细',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/index'},
+          ],
+        },
+      },
+      {
+        path: '/finance/withdraw-add',
+        component: _import('finance/withdraw-add'),
+        name: 'finance_withdraw-add',
+        meta: {
+          title: '我要提现',
+          highLight: '/finance/withdraw',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/index'},
+            {title: '提现明细', path: '/finance/withdraw'},
+          ],
+        },
+      },
+      {
+        path: '/finance/dec-list',
+        component: _import('finance/dec-list'),
+        name: 'finance_dec-list',
+        meta: {
+          title: '报单订货单列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/index'},
+          ],
+        },
+      },
+      {
+        path: '/finance/transfer-list',
+        component: _import('finance/transfer-list'),
+        name: 'finance_transfer-list',
+        meta: {
+          title: '转账记录',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/index'},
+          ],
+        },
+      },
+      {
+        path: '/finance/transfer-add',
+        component: _import('finance/transfer-add'),
+        name: 'finance_transfer-add',
+        meta: {
+          title: '我要转账',
+          highLight: '/finance/transfer-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/index'},
+            {title: '转账记录', path: '/finance/transfer-list'},
+          ],
+        },
+      },
+        {
+            path: '/finance/recharge',
+            component: _import('finance/recharge'),
+            name: 'finance_recharge',
+            meta: {
+                title: '充值明细',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '财务管理', path: '/finance/index'},
+                ],
+            },
+        },
+        {
+            path: '/finance/recharge-add',
+            component: _import('finance/recharge-add'),
+            name: 'finance_recharge-add',
+            meta: {
+                title: '我要充值',
+                highLight: '/finance/recharge',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '财务管理', path: '/finance/index'},
+                    {title: '提现明细', path: '/finance/withdraw'},
+                ],
+            },
+        },
+    ]
+  },
+  {
+    path: '/config',
+    component: layout,
+    redirect: '/config/base',
+    children: [
+      {
+        path: '/config/receive-address-list',
+        component: _import('config/receive-address-list'),
+        name: 'config_receive-address-list',
+        meta: {
+          title: '收货地址管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '设置', path: '/config/base'},
+          ],
+        },
+      },
+      {
+        path: '/config/receive-address-add',
+        component: _import('config/receive-address-edit'),
+        name: 'config_receive-address-add',
+        meta: {
+          title: '添加收货地址',
+          highLight: '/config/receive-address-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '设置', path: '/config/base'},
+            {title: '收货地址管理', path: '/config/receive-address-list'},
+          ],
+        },
+      },
+      {
+        path: '/config/receive-address-edit/:id',
+        component: _import('config/receive-address-edit'),
+        name: 'config_receive-address-edit',
+        meta: {
+          title: '编辑收货地址',
+          highLight: '/config/receive-address-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '设置', path: '/config/base'},
+            {title: '收货地址管理', path: '/config/receive-address-list'},
+          ],
+        },
+      },
+
+    ]
+  },
+]
+
+export default new Router({
+  routes: constantRouterMap
+})