hrjy 2 år sedan
förälder
incheckning
d19bf6f234
32 ändrade filer med 2317 tillägg och 69 borttagningar
  1. 68 12
      app/admin/controller/auction/Auction.php
  2. 6 10
      app/admin/controller/auction/AuctionGu.php
  3. 8 2
      app/admin/controller/auction/AuctionOrder.php
  4. 45 2
      app/admin/controller/auction/AuctionProduct.php
  5. 5 0
      app/admin/model/auction/Auction.php
  6. 0 1
      app/admin/model/auction/AuctionGu.php
  7. 5 0
      app/admin/model/auction/AuctionOrder.php
  8. 1 1
      app/admin/model/finance/FinanceModel.php
  9. 44 9
      app/admin/model/user/User.php
  10. 942 0
      app/admin/view/auction/auction/fz.php
  11. 1 0
      app/admin/view/auction/auction/index.php
  12. 9 0
      app/admin/view/auction/auction/product.php
  13. 15 1
      app/admin/view/auction/auction/product_create.php
  14. 15 1
      app/admin/view/auction/auction/product_edit.php
  15. 2 2
      app/admin/view/auction/auction_order/index.php
  16. 15 1
      app/admin/view/auction/auction_product/create.php
  17. 15 2
      app/admin/view/auction/auction_product/edit.php
  18. 958 0
      app/admin/view/auction/auction_product/fz.php
  19. 7 0
      app/admin/view/auction/auction_product/index.php
  20. 4 4
      app/admin/view/user/user/index.php
  21. 1 1
      app/api/controller/auction/AuctionController.php
  22. 23 0
      app/api/controller/auction/AuctionOrderController.php
  23. 7 3
      app/api/controller/auction/AuctionProductController.php
  24. 1 0
      app/api/controller/wechat/WechatController.php
  25. 15 0
      app/http/middleware/AllowOriginMiddleware.php
  26. 5 0
      app/http/middleware/AuthTokenMiddleware.php
  27. 55 14
      app/models/auction/AuctionOrder.php
  28. 2 0
      app/models/auction/AuctionProduct.php
  29. 24 0
      app/models/user/User.php
  30. 2 3
      app/models/user/UserBill.php
  31. 16 0
      crmeb/subscribes/TaskSubscribe.php
  32. 1 0
      route/api/route.php

+ 68 - 12
app/admin/controller/auction/Auction.php

@@ -51,8 +51,14 @@ class Auction extends AuthController
             ['page', 1],
             ['limit', 20],
             ['auction'],
-            ['auction_id']
+            ['auction_id'],
+            ['uid']
         ]);
+        if ($this->adminInfo['roles'] == 8){
+            if ($this->adminInfo['uid']){
+                $where['uid'] = $this->adminInfo['uid'];
+            }
+        }
         $data = \app\admin\model\auction\Auction::list($where);
 
         return Json::successlayui($data);
@@ -66,10 +72,6 @@ class Auction extends AuthController
     public function create($id = 0)
     {
         $f = [];
-
-        $f[] = Form::select('addrs', '绑定场馆', [
-            'a' => 'a'
-        ])->col(12);
         $f[] = Form::input('nickname', '场次名称')->col(12);
         $f[] = Form::input('anticipate', '预约价格')->col(12);
         $f[] = Form::frameImageOne('image', '场次主图片(305*305px)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')))->icon('image')->width('100%')->height('500px');
@@ -88,7 +90,8 @@ class Auction extends AuthController
         $f[] = Form::dateTimes('radd_time', '入场时间');
         $f[] = Form::dateTimes('rend_time', '结束时间');
         $f[] = Form::input('sort', '排序', '0');
-        $f[] = Form::input('sort', '排序', '0');
+        $f[] = Form::input('sort', '排序', '0')->col(12);
+        $f[] = Form::input('goods_time', '放货时间(分钟)', '0')->col(12);
         $f[] =  Form::checkbox('site', '开场日期', [1,3,5])->options([
             ['value' => 1, 'label' => '周一'],
             ['value' => 2, 'label' => '周二'],
@@ -128,7 +131,8 @@ class Auction extends AuthController
             'info',
             'anticipate',
             'auction_gu_id',
-            'site'
+            'site',
+            'goods_time'
         ]);
         $validate = Validate::rule('nickname', 'require')->rule([
             'nickname' => 'require',
@@ -140,7 +144,8 @@ class Auction extends AuthController
             'radd_time' => 'require',
             'rend_time' => 'require',
             'auction_gu_id' => 'require',
-            'site' => 'require'
+            'site' => 'require',
+            'goods_time' => 'require|integer|>:0'
         ]);
         $validate->message([
             'nickname.require' => '名称不能为空',
@@ -153,7 +158,12 @@ class Auction extends AuthController
             'rend_time.require' => '请选择结束时间',
             'auction_gu_id.require' => '请选择绑定场馆',
             'site.require' => '请选择开场日期',
+            'goods_time.require' => '请输入放货时间',
+            'goods_time.integer' => '放货时间为整数',
+            'goods_time.gt' => '放货时间大于0',
+
         ]);
+
         $data['site'] = implode($data['site'], ',');
         if ($data['site'] == '1,3,5'  or  $data['site'] == '2,4,6') {
             if (!$validate->check($data)) {
@@ -234,8 +244,9 @@ class Auction extends AuthController
         $f[] = Form::dateTimes('end_time', '预约结束时间', $data->getData('end_time'));
         $f[] = Form::dateTimes('radd_time', '入场时间', $data->getData('radd_time'));
         $f[] = Form::dateTimes('rend_time', '结束时间', $data->getData('rend_time'));
-        $f[] = Form::input('sort', '排序', '0', $data->getData('sort'));
-        $f[] = Form::textarea('info', '介绍', $data->getData('info'))->col(12);
+        $f[] = Form::input('sort', '排序', '0', $data->getData('sort'))->col(12);
+        $f[] = Form::input('goods_time', '放货时间(分钟)', $data->getData('goods_time'))->col(12);
+
         $f[] =  Form::checkbox('site', '开场日期', explode(',', $data->getData('site')))->options([
             ['value' => 1, 'label' => '周一'],
             ['value' => 2, 'label' => '周二'],
@@ -276,7 +287,8 @@ class Auction extends AuthController
             'info',
             'anticipate',
             'auction_gu_id',
-            'site'
+            'site',
+            'goods_time'
         ]);
         $validate = Validate::rule('nickname', 'require')->rule([
             'nickname' => 'require',
@@ -288,7 +300,9 @@ class Auction extends AuthController
             'radd_time' => 'require',
             'rend_time' => 'require',
             'auction_gu_id' => 'require',
-            'site' => 'require'
+            'site' => 'require',
+            'goods_time' => 'require|integer|>:0'
+
         ]);
         $validate->message([
             'nickname.require' => '名称不能为空',
@@ -301,6 +315,9 @@ class Auction extends AuthController
             'rend_time.require' => '请选择结束时间',
             'auction_gu_id.require' => '请选择绑定场馆',
             'site.require' => '请选择开场日期',
+            'goods_time.require' => '请输入放货时间',
+            'goods_time.integer' => '时间为整数',
+            'goods_time.gt' => '放货时间大于0',
         ]);
         $data['site'] = implode($data['site'], ',');
         if ($data['site'] == '1,3,5'  or  $data['site'] == '2,4,6') {
@@ -394,6 +411,14 @@ class Auction extends AuthController
         return $this->fetch();
     }
 
+    public function fz($id, $auction_id)
+    {
+        if (!$id) Json::fail('数据不存在');
+
+        $this->assign(['id' => $id, 'auction_id' => $auction_id]);
+        return $this->fetch();
+    }
+
 
 
     public function product_save($id)
@@ -460,4 +485,35 @@ class Auction extends AuthController
 
     }
 
+    public function fzsp($id)
+    {
+        $data = Util::postMore([
+            'name',
+            'image',
+            'price',
+            'deduct',
+            'rise',
+            'info',
+            'sort',
+            'auction_id',
+            'hanging_price',
+            'slider_image',
+            'description',
+            'give'
+        ]);
+        $data['slider_image'] = json_encode($data['slider_image']);
+        $data['description'] = htmlspecialchars($data['description']);
+        $auction = \app\admin\model\auction\Auction::where('id' ,$data['auction_id'])->find();
+        $auction_gu = \app\admin\model\auction\AuctionGu::where('id' ,$auction['auction_gu_id'])->find();
+        $data['uid'] = $auction_gu['uid'];
+        $res = model::create($data);
+        if ($res){
+            return Json::success('修改成功!');
+        }else{
+            return Json::fail(\app\admin\model\auction\Auction::getErrorInfo());
+        }
+
+
+    }
+
 }

+ 6 - 10
app/admin/controller/auction/AuctionGu.php

@@ -14,9 +14,9 @@ use crmeb\services\{ExpressService,
     CacheService,
     UtilService as Util,
     JsonService as Json};
-use app\admin\model\system\{
-    SystemAttachment as SystemAttachmentModel, SystemAttachmentCategory as Category
-};
+use app\admin\model\system\{SystemAdmin,
+    SystemAttachment as SystemAttachmentModel,
+    SystemAttachmentCategory as Category};
 use think\Db;
 use think\facade\Route as Url;
 use think\facade\Validate;
@@ -48,13 +48,9 @@ class AuctionGu extends AuthController
             ['uid'],
             ['null']
         ]);
-
-        $admin  = \think\facade\Db::name('system_admin')->where('id', $this->adminId)->find();
-        if ($admin['roles'] > 1){
-            if ($admin['uid']){
-                $where['uid'] = $admin['uid'];
-            }else{
-                $where['null'] = 1;
+        if ($this->adminInfo['roles'] == 8){
+            if ($this->adminInfo['uid']){
+                $where['uid'] = $this->adminInfo['uid'];
             }
         }
 

+ 8 - 2
app/admin/controller/auction/AuctionOrder.php

@@ -60,8 +60,14 @@ class AuctionOrder extends AuthController
             ['gu_id', ''],
             ['product_name'],
             ['excel', 0],
-            ['is_gs', '']
+            ['is_gs', ''],
+            ['uid']
         ]);
+        if ($this->adminInfo['roles'] == 8){
+            if ($this->adminInfo['uid']){
+                $where['uid'] = $this->adminInfo['uid'];
+            }
+        }
         $data = model::list($where);
         foreach ($data['data'] as $key => $val){
             if ($data['data'][$key]['uid'] == 0) $data['data'][$key]['nickname'] = '管理';
@@ -278,7 +284,7 @@ class AuctionOrder extends AuthController
             }
 
         }
-        return Json::fail('已通过订单');
+        return Json::fail('该订单不能通过');
 
     }
 

+ 45 - 2
app/admin/controller/auction/AuctionProduct.php

@@ -92,7 +92,8 @@ class AuctionProduct extends AuthController
             'auction_id',
             'hanging_price',
             'slider_image',
-            'description'
+            'description',
+            'give'
         ]);
         $data['slider_image'] = json_encode($data['slider_image']);
         $data['description'] = htmlspecialchars($data['description']);
@@ -177,7 +178,8 @@ class AuctionProduct extends AuthController
             'auction_id',
             'hanging_price',
             'slider_image',
-            'description'
+            'description',
+            'give'
         ]);
         $data['slider_image'] = json_encode($data['slider_image']);
         $data['description'] = htmlspecialchars($data['description']);
@@ -234,4 +236,45 @@ class AuctionProduct extends AuthController
     }
 
 
+    public function fz($id)
+    {
+        if (!$id) Json::fail('数据不存在');
+        $data = \app\admin\model\auction\Auction::select()->toArray();
+
+        $this->assign(['id' => $id, 'list' => $data]);
+        return $this->fetch();
+    }
+
+    public function fzsp($id)
+    {
+        $data = Util::postMore([
+            'name',
+            'image',
+            'price',
+            'deduct',
+            'rise',
+            'info',
+            'sort',
+            'auction_id',
+            'hanging_price',
+            'slider_image',
+            'description',
+            'give'
+        ]);
+        $data['slider_image'] = json_encode($data['slider_image']);
+        $data['description'] = htmlspecialchars($data['description']);
+        $auction = \app\admin\model\auction\Auction::where('id' ,$data['auction_id'])->find();
+        $auction_gu = \app\admin\model\auction\AuctionGu::where('id' ,$auction['auction_gu_id'])->find();
+        $data['uid'] = $auction_gu['uid'];
+        $res = model::create($data);
+        if ($res){
+            return Json::success('修改成功!');
+        }else{
+            return Json::fail(\app\admin\model\auction\Auction::getErrorInfo());
+        }
+
+
+    }
+
+
 }

+ 5 - 0
app/admin/model/auction/Auction.php

@@ -42,6 +42,11 @@ class Auction extends BaseModel
         }else{
             $model->page(20, 1);
         }
+        if ($where['uid']){
+            $auctionGu = AuctionGu::where('uid', $where['uid'])->column('id');
+            $model->where('a.auction_gu_id', 'in', $auctionGu);
+        }
+
 
         $data['count'] = $model->count();
         $list = $model->select()->toArray();

+ 0 - 1
app/admin/model/auction/AuctionGu.php

@@ -50,7 +50,6 @@ class AuctionGu extends BaseModel
 
 
         $list = $model->select();
-
         $list = count($list) ? $list->toArray() : [];
 
         $data['data'] = $list;

+ 5 - 0
app/admin/model/auction/AuctionOrder.php

@@ -53,6 +53,11 @@ class AuctionOrder extends BaseModel
         if (trim($where['gu_id']) != '') $model->where('gu.id', $where['gu_id']);
         if (trim($where['product_name']) != '') $model->where('p.name', $where['product_name']);
         if (trim($where['data']) != '') $model = self::getModelTime($where, $model,  'a.create_time');
+        if ($where['uid']){
+            $auctionGu = AuctionGu::where('uid', $where['uid'])->column('id');
+            $auction = Auction::where('auction_gu_id', 'in', $auctionGu)->column('id');
+            $model->where('a.auction_id', 'in', $auction);
+        }
         if ($where['is_gs'] == 2){
             $model->where('a.is_gs', 0);
         }else if($where['is_gs'] == 1){

+ 1 - 1
app/admin/model/finance/FinanceModel.php

@@ -72,7 +72,7 @@ class FinanceModel extends BaseModel
     {
         $whereModel = self::setWhereList($where);
         $data = ($data = $whereModel->page((int)$where['page'], (int)$where['limit'])->select()) && count($data) ? $data->toArray() : [];
-        $count = $whereModel->count();
+        $count = self::count();
         return compact('data', 'count');
     }
 

+ 44 - 9
app/admin/model/user/User.php

@@ -7,8 +7,10 @@
 namespace app\admin\model\user;
 
 use app\admin\model\auction\AuctionGu;
+use app\admin\model\auction\AuctionProduct;
 use app\admin\model\order\StoreOrder;
 use app\admin\model\system\SystemUserLevel;
+use app\models\auction\AuctionPay;
 use crmeb\traits\ModelTrait;
 use crmeb\basic\BaseModel;
 use app\admin\model\wechat\WechatUser;
@@ -210,6 +212,7 @@ class User extends BaseModel
                     else if (time() > $levelinfo['valid_time']) $item['vip_name'] = SystemUserLevel::where('id', $levelinfo['level_id'])->value('name');
                 }
                 $auction  = AuctionGu::where('uid', $item['uid'])->find();
+
                 if ($auction){
                     $item['vip_name'] = '馆长';
                 }
@@ -223,11 +226,14 @@ class User extends BaseModel
     }
 
 
-    /*
-    * 保存并下载excel
-    * $list array
-    * return
-    */
+    /**
+     * excel
+     * @param $list
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
     public static function SaveExcel($list)
     {
         $export = [];
@@ -239,19 +245,48 @@ class User extends BaseModel
             }elseif ($item['is_auth'] == 2){
                 $is_auth ='已实名';
             }
+            $nickname = \app\models\user\User::where('uid', $item['spread_uid'])->value('nickname');
+            $product = AuctionProduct::where('uid', $item['uid'])->count();
+            $pay = AuctionPay::where('uid', $item['uid'])->where('type', 3)->find(); // 银行卡
+            $wx = AuctionPay::where('uid', $item['uid'])->where('type', 1)->find(); // 微信
+            $zfb = AuctionPay::where('uid', $item['uid'])->where('type', 2)->find(); // 支付宝
+            if (empty($item['phone'])){
+                if ($pay){
+                    $item['phone'] = $pay['phone'];
+                }
+                if ($wx){
+                    $item['phone'] = $wx['phone'];
+                }
+                if ($zfb){
+                    $item['phone'] = $zfb['phone'];
+                }
+            }
+            $auction = AuctionGu::where('uid', $item['uid'])->find();
+            if ($auction){
+                $level = '馆长';
+            }else{
+                $level = '草民';
+            }
             $export[] = [
                 $item['uid'],
                 $item['account'],
                 $item['nickname'],
-                $item['phone'],
+                !empty($item['phone'])? $item['phone'] : '未绑定手机号',
+                $level,
                 $item['real_name'],
-                $item['card_id'],
-                self::where('uid',$item['uid'])->find()['now_money'],
+                ' '.$item['card_id'],
+                self::where('uid',$item['uid'])->value('now_money'),
                 $item['anticipate'],
+                !empty($nickname)? $nickname : '没有上级',
+                $product == 0? 0 : $product,
+                !empty($pay) ? ' '.$pay['payment'] : '未绑定银行卡',
+                !empty($wx) ? ' '.$wx['payment'] : '未绑定微信',
+                !empty($zfb) ? ' '.$zfb['payment'] : '未绑定支付宝',
                 $is_auth,
             ];
         }
-        PHPExcelService::setExcelHeader(['ID', '账号', '昵称', '手机号', '真实姓名', '身份证号', '余额','艺金券', '实名认证'])
+        PHPExcelService::setExcelHeader(['ID', '账号', '昵称', '手机号','等级', '真实姓名', '身份证号', '余额','艺金券', '推广人',
+            '商品持仓数量','银行卡', '微信', '支付宝','实名认证'])
             ->setExcelTile('用户导出' . date('YmdHis', time()), '订单信息' . time(), ' 生成时间:' . date('Y-m-d H:i:s', time()))
             ->setExcelContent($export)
             ->ExcelSave();

+ 942 - 0
app/admin/view/auction/auction/fz.php

@@ -0,0 +1,942 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <link href="{__FRAME_PATH}css/font-awesome.min.css" rel="stylesheet">
+    <link href="{__ADMIN_PATH}plug/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
+    <script type="text/javascript" src="{__ADMIN_PATH}plug/umeditor/third-party/jquery.min.js"></script>
+    <script type="text/javascript" src="{__ADMIN_PATH}plug/umeditor/third-party/template.min.js"></script>
+    <script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH}plug/umeditor/umeditor.config.js"></script>
+    <script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH}plug/umeditor/umeditor.min.js"></script>
+    <script type="text/javascript" src="{__ADMIN_PATH}plug/umeditor/lang/zh-cn/zh-cn.js"></script>
+    <link rel="stylesheet" href="/static/plug/layui/css/layui.css">
+    <script src="/static/plug/layui/layui.js"></script>
+    <script src="{__PLUG_PATH}vue/dist/vue.min.js"></script>
+    <script src="/static/plug/axios.min.js"></script>
+    <script src="{__MODULE_PATH}widget/aliyun-oss-sdk-4.4.4.min.js"></script>
+    <script src="{__MODULE_PATH}widget/cos-js-sdk-v5.min.js"></script>
+    <script src="{__MODULE_PATH}widget/qiniu-js-sdk-2.5.5.js"></script>
+    <script src="{__MODULE_PATH}widget/plupload.full.min.js"></script>
+    <script src="{__MODULE_PATH}widget/videoUpload.js"></script>
+    <style>
+        .layui-form-item {
+            margin-bottom: 0px;
+        }
+
+        .pictrueBox {
+            display: inline-block !important;
+        }
+
+        .pictrue {
+            width: 60px;
+            height: 60px;
+            border: 1px dotted rgba(0, 0, 0, 0.1);
+            margin-right: 15px;
+            display: inline-block;
+            position: relative;
+            cursor: pointer;
+        }
+
+        .pictrue img {
+            width: 100%;
+            height: 100%;
+        }
+
+        .upLoad {
+            width: 58px;
+            height: 58px;
+            line-height: 58px;
+            border: 1px dotted rgba(0, 0, 0, 0.1);
+            border-radius: 4px;
+            background: rgba(0, 0, 0, 0.02);
+            cursor: pointer;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+        }
+
+        .rulesBox {
+            display: flex;
+            flex-wrap: wrap;
+            margin-left: 10px;
+        }
+
+        .layui-tab-content {
+            margin-top: 15px;
+        }
+
+        .ml110 {
+            margin: 18px 0 4px 110px;
+        }
+
+        .rules {
+            display: flex;
+        }
+
+        .rules-btn-sm {
+            height: 30px;
+            line-height: 30px;
+            font-size: 12px;
+            width: 109px;
+        }
+
+        .rules-btn-sm input {
+            width: 79% !important;
+            height: 84% !important;
+            padding: 0 10px;
+        }
+
+        .ml10 {
+            margin-left: 10px !important;
+        }
+
+        .ml40 {
+            margin-left: 40px !important;
+        }
+
+        .closes {
+            position: absolute;
+            left: 86%;
+            top: -18%;
+        }
+        .red {
+            color: red;
+        }
+        .layui-input-block .layui-video-box{
+            width: 22%;
+            height: 180px;
+            border-radius: 10px;
+            background-color: #707070;
+            margin-top: 10px;
+            position: relative;
+            overflow: hidden;
+        }
+        .layui-input-block .layui-video-box i{
+            color: #fff;
+            line-height: 180px;
+            margin: 0 auto;
+            width: 50px;
+            height: 50px;
+            display: inherit;
+            font-size: 50px;
+        }
+        .layui-input-block .layui-video-box .mark{
+            position: absolute;
+            width: 100%;
+            height: 30px;
+            top: 0;
+            background-color: rgba(0,0,0,.5);
+            text-align: center;
+        }
+        .store_box{
+            display: flex;
+        }
+        .info{
+            color: #c9c9c9;
+            padding-left: 10px;
+            line-height: 30px;
+        }
+    </style>
+</head>
+<body>
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15"  id="app" v-cloak="">
+        <div class="layui-card">
+            <div class="layui-card-header">
+                <span class="">竞拍添加</span>
+                <button style="margin-left: 20px" type="button" class="layui-btn layui-btn-primary layui-btn-xs" @click="goBack">返回列表</button>
+            </div>
+            <div class="layui-card-body">
+                <form class="layui-form" action="" v-cloak="">
+                    <div class="layui-tab layui-tab-brief" lay-filter="docTabBrief">
+                        <div class="layui-tab-content">
+                            <div class="layui-tab-item layui-show">
+                                <div class="layui-row layui-col-space15">
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">商品名称<i class="red">*</i></label>
+                                                <div class="layui-input-block">
+                                                    <input type="text" name="name" lay-verify="title" autocomplete="off"
+                                                           placeholder="场馆名称" class="layui-input" v-model="formData.name" maxlength="100">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">商品图片<i class="red">*</i></label>
+                                                <div class="pictrueBox">
+                                                    <div class="pictrue" v-if="formData.image" @click="uploadImage('image')">
+                                                        <img :src="formData.image"></div>
+                                                    <div class="upLoad" @click="uploadImage('image')" v-else>
+                                                        <i class="layui-icon layui-icon-camera" class="iconfont"
+                                                           style="font-size: 26px;"></i>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">商品轮播图<i class="red">*</i></label>
+                                                <div class="pictrueBox pictrue" v-for="(item,index) in formData.slider_image">
+                                                    <img :src="item">
+                                                    <i class="layui-icon closes" @click="deleteImage('slider_image',index)">&#x1007</i>
+                                                </div>
+                                                <div class="pictrueBox">
+                                                    <div class="upLoad" @click="uploadImage('slider_image')"
+                                                         v-if="formData.slider_image.length <= rule.slider_image.maxLength">
+                                                        <i class="layui-icon layui-icon-camera" class="iconfont"
+                                                           style="font-size: 26px;"></i>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">价格<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="price" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.price" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">挂售价格<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="hanging_price" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.hanging_price" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">涨幅<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="rise" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.rise" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">扣除<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="deduct" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.deduct" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">赠送<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="give" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.give" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item layui-form-text">
+                                                <label class="layui-form-label">商品介绍</label>
+                                                <div class="layui-input-block">
+                                                    <textarea name="info" v-model="formData.info"
+                                                              placeholder="请输入商品简介" class="layui-textarea"></textarea>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">排序</label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="sort" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.sort" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <label class="layui-form-label" style="left: +1%">商品详情:</label>
+                                    <div class="layui-row layui-col-space15">
+                                        <textarea type="text/plain" name="description" id="myEditor" style="width:100%;">{{formData.description}}</textarea>
+                                    </div>
+
+                                </div>
+
+                            </div>
+                            <div class="layui-tab-content">
+                                <div class="layui-row layui-col-space15">
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <button class="layui-btn layui-btn-normal layui-btn-sm" id="submit" type="button" @click="handleSubmit()">提交</button>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+
+    var id = {$id};
+    var auction_id = {$auction_id};
+    layui.use('laydate', function(){
+        var laydate = layui.laydate;
+
+        laydate.render({
+            elem: '#time'
+            ,type: 'time'
+            ,range: true
+        });
+        laydate.render({
+            elem: '#rtime'
+            ,type: 'time'
+            ,range: true
+        });
+    })
+
+    new Vue({
+        el: '#app',
+        data: {
+            id:id,
+            //分类列表
+            cateList: [],
+            //运费模板
+            tempList: [],
+            upload:{
+                videoIng:false
+            },
+            formData: {
+                description: '',
+                name: '',
+                image:'',
+                price:'',
+                deduct: '',
+                rise: '',
+                info: '',
+                sort: '',
+                auction_id: auction_id,
+                hanging_price: '',
+                slider_image: [],
+                give: 0
+
+            },
+            rule: { //多图选择规则
+                slider_image: {
+                    maxLength: 5
+                }
+            },
+            attr: [],//临时属性
+            newRule: false,//是否添加新规则
+            radioRule: ['status'],//radio 当选规则
+            ruleList:[],
+            ruleIndex:-1,
+            progress: 0,
+            um: null,//编译器实例化
+            form: null,//layui.form
+            layTabId: 1,
+            ruleBool: id ? true : false,
+        },
+        watch:{
+            'formData.is_sub':function (n) {
+                if (n == 1) {
+                    this.formHeader.push({title:'一级返佣(元)'});
+                    this.formHeader.push({title:'二级级返佣(元)'});
+                } else {
+                    this.formHeader.pop();
+                    this.formHeader.pop();
+                }
+            },
+            'formData.spec_type':function (n) {
+                if (n) {
+                    this.render();
+                }
+            },
+            // 'formData.image':function (n) {
+            //     if(!this.batchAttr.pic){
+            //         this.batchAttr.pic = n;
+            //     }
+            //     if(!this.formData.attr.pic){
+            //         this.formData.attr.pic = n;
+            //     }
+            // }
+        },
+        methods: {
+            back:function(){
+                var that = this;
+                layui.use(['element'], function () {
+                    layui.element.tabChange('docTabBrief', that.layTabId == 1 ? 1 : parseInt(that.layTabId) - 1);
+                });
+            },
+            next:function(){
+                var that = this;
+                layui.use(['element'], function () {
+                    layui.element.tabChange('docTabBrief', that.layTabId == 3 ? 3 : parseInt(that.layTabId) + 1);
+                });
+            },
+            goBack:function(){
+                location.href = this.U({c:'auction.auction',a:'product?id='+auction_id});
+            },
+            U: function (opt) {
+                var m = opt.m || 'admin', c = opt.c || window.controlle || '', a = opt.a || 'index', q = opt.q || '',
+                    p = opt.p || {};
+                var params = Object. keys(p).map(function (key) {
+                    return key + '/' + p[key];
+                }).join('/');
+                var gets = Object.keys(q).map(function (key) {
+                    return key+'='+ q[key];
+                }).join('&');
+
+                return '/' + m + '/' + c + '/' + a + (params == '' ? '' : '/' + params) + (gets == '' ? '' : '?' + gets);
+            },
+            /**
+             * 提示
+             * */
+            showMsg: function (msg, success) {
+                $('#submit').removeAttr('disabled').text('提交');
+                layui.use(['layer'], function () {
+                    layui.layer.msg(msg, success);
+                });
+            },
+            addBrokerage:function(){
+                if (this.brokerage.brokerage >= 0 && this.brokerage.brokerage_two >= 0){
+                    var that = this;
+                    this.$set(this.formData,'attrs',this.formData.attrs.map(function (item) {
+                        item.brokerage = that.brokerage.brokerage;
+                        item.brokerage_two = that.brokerage.brokerage_two;
+                        return item;
+                    }));
+                } else {
+                    return this.showMsg('请填写返佣金额在进行批量添加');
+                }
+            },
+            batchClear:function(){
+                this.$set(this,'batchAttr',{
+                    pic: '',
+                    price: 0,
+                    cost: 0,
+                    ot_price: 0,
+                    stock: 0,
+                    bar_code: '',
+                    weight: 0,
+                    volume: 0,
+                });
+            },
+            /**
+             * 批量添加
+             * */
+            batchAdd:function(){
+                var that = this;
+                this.$set(this.formData,'attrs',this.formData.attrs.map(function (item) {
+                    if (that.batchAttr.pic) {
+                        item.pic = that.batchAttr.pic;
+                    }
+                    if (that.batchAttr.price > 0){
+                        item.price = that.batchAttr.price;
+                    }
+                    if (that.batchAttr.cost > 0){
+                        item.cost = that.batchAttr.cost;
+                    }
+                    if (that.batchAttr.ot_price > 0){
+                        item.ot_price = that.batchAttr.ot_price;
+                    }
+                    if (that.batchAttr.stock > 0){
+                        item.stock = that.batchAttr.stock;
+                    }
+                    if (that.batchAttr.bar_code != ''){
+                        item.bar_code = that.batchAttr.bar_code;
+                    }
+                    if (that.batchAttr.weight > 0){
+                        item.weight = that.batchAttr.weight;
+                    }
+                    if (that.batchAttr.volume > 0){
+                        item.volume = that.batchAttr.volume;
+                    }
+                    return item;
+                }));
+
+            },
+            /**
+             * 获取商品信息
+             * */
+            getProductInfo: function () {
+                var that = this;
+                that.requestGet(that.U({c:"auction.auction_product",a:'get_list',q:{id:that.id}})).then(function (res) {
+                    var productInfo = res.data.productInfo || {};
+                    if(productInfo.id && that.id){
+                        that.$set(that,'formData',productInfo);
+                        that.generate();
+                    }
+                    that.getRuleList();
+                    that.init();
+                }).catch(function (res) {
+                    that.showMsg(res.msg);
+                })
+            },
+            /**
+             * 给某个属性添加属性值
+             * @param item
+             * */
+            addDetail: function (item) {
+                if (!item.detailValue) return false;
+                if (item.detail.find(function (val) {
+                    if(item.detailValue == val){
+                        return true;
+                    }
+                })) {
+                    return this.showMsg('添加的属性值重复');
+                }
+                item.detail.push(item.detailValue);
+                item.detailValue = '';
+            },
+            /**
+             * 删除某个属性值
+             * @param item 父级循环集合
+             * @param inx 子集index
+             * */
+            deleteValue: function (item, inx) {
+                if (item.detail.length > 1) {
+                    item.detail.splice(inx, 1);
+                } else {
+                    return this.showMsg('请设置至少一个属性');
+                }
+            },
+            /**
+             * 删除某条属性
+             * @param index
+             * */
+            deleteItem: function (index) {
+                this.formData.items.splice(index, 1);
+            },
+            /**
+             * 删除某条属性
+             * @param index
+             * */
+            deleteAttrs: function (index) {
+                var that = this;
+                if(that.id > 0){
+                    that.requestGet(that.U({c:"store.StoreProduct",a:'check_activity',q:{id:that.id}})).then(function (res) {
+                        that.showMsg(res.msg);
+                    }).catch(function (res) {
+                        if (that.formData.attrs.length > 1) {
+                            that.formData.attrs.splice(index, 1);
+                        } else {
+                            return that.showMsg('请设置至少一个规则');
+                        }
+                    })
+                }else{
+                    if (that.formData.attrs.length > 1) {
+                        that.formData.attrs.splice(index, 1);
+                    } else {
+                        return that.showMsg('请设置至少一个规则');
+                    }
+                }
+            },
+            /**
+             * 创建属性
+             * */
+            createAttrName: function () {
+                if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
+                    if (this.formData.items.find(function (val) {
+                        if (val.value == this.formDynamic.attrsName) {
+                            return true;
+                        }
+                    }.bind(this))) {
+                        return this.showMsg('添加的属性重复');
+                    }
+                    this.formData.items.push({
+                        value: this.formDynamic.attrsName,
+                        detailValue: '',
+                        attrHidden: false,
+                        detail: [this.formDynamic.attrsVal]
+                    });
+                    this.formDynamic.attrsName = '';
+                    this.formDynamic.attrsVal = '';
+                    this.newRule = false;
+                } else {
+                    return this.showMsg('请添加完整的规格!');
+                }
+            },
+            /**
+             * 删除图片
+             * */
+            deleteImage: function (key, index) {
+                var that = this;
+                if (index != undefined) {
+                    that.formData[key].splice(index, 1);
+                    that.$set(that.formData, key, that.formData[key]);
+                } else {
+                    that.$set(that.formData, key, '');
+                }
+            },
+            createFrame: function (title, src, opt) {
+                opt === undefined && (opt = {});
+                var h = 0;
+                if (window.innerHeight < 800 && window.innerHeight >= 700) {
+                    h = window.innerHeight - 50;
+                } else if (window.innerHeight < 900 && window.innerHeight >= 800) {
+                    h = window.innerHeight - 100;
+                } else if (window.innerHeight < 1000 && window.innerHeight >= 900) {
+                    h = window.innerHeight - 150;
+                } else if (window.innerHeight >= 1000) {
+                    h = window.innerHeight - 200;
+                } else {
+                    h = window.innerHeight;
+                }
+                var area = [(opt.w || window.innerWidth / 2) + 'px', (!opt.h || opt.h > h ? h : opt.h) + 'px'];
+                layui.use('layer',function () {
+                    return layer.open({
+                        type: 2,
+                        title: title,
+                        area: area,
+                        fixed: false, //不固定
+                        maxmin: true,
+                        moveOut: false,//true  可以拖出窗外  false 只能在窗内拖
+                        anim: 5,//出场动画 isOutAnim bool 关闭动画
+                        offset: 'auto',//['100px','100px'],//'auto',//初始位置  ['100px','100px'] t[ 上 左]
+                        shade: 0,//遮罩
+                        resize: true,//是否允许拉伸
+                        content: src,//内容
+                        move: '.layui-layer-title'
+                    });
+                });
+            },
+            changeIMG: function (name, value) {
+                if (this.getRule(name).maxLength !== undefined) {
+                    var that = this;
+                    value.map(function (v) {
+                        that.formData[name].push(v);
+                    });
+                    this.$set(this.formData, name, this.formData[name]);
+                } else {
+                    if(name == 'batchAttr.pic'){
+                        this.batchAttr.pic = value;
+                    } else {
+                        if (name.indexOf('.') !== -1) {
+                            var key = name.split('.');
+                            if (key.length == 2){
+                                this.formData[key[0]][key[1]] = value;
+                            } else if(key.length == 3){
+                                this.formData[key[0]][key[1]][key[2]] = value;
+                            } else if(key.length == 4){
+                                this.$set(this.formData[key[0]][key[1]][key[2]],key[3],value)
+                            }
+                        } else {
+                            this.formData[name] = value;
+                        }
+                    }
+                }
+            },
+            getRule: function (name) {
+                return this.rule[name] || {};
+            },
+            uploadImage: function (name) {
+                return this.createFrame('选择图片',this.U({c:"widget.images",a:'index',p:{fodder:name}}),{h:545,w:900});
+            },
+            uploadVideo: function () {
+                if (this.videoLink) {
+                    this.formData.video_link = this.videoLink;
+                } else {
+                    $(this.$refs.filElem).click();
+                }
+            },
+            delVideo: function () {
+                var that = this;
+                that.$set(that.formData, 'video_link', '');
+            },
+            insertEditor: function (list) {
+                this.um.execCommand('insertimage', list);
+            },
+            insertEditorVideo: function (src) {
+                this.um.setContent('<div><video style="width: 99%" src="'+src+'" class="video-ue" controls="controls" width="100"><source src="'+src+'"></source></video></div><br>',true);
+            },
+            getContent: function () {
+                return this.um.getContent();
+            },
+            /**
+             * 监听radio字段
+             */
+            eeventRadio: function () {
+                var that = this;
+                that.radioRule.map(function (val) {
+                    that.form.on('radio(' + val + ')', function (res) {
+                        that.formData[val] = res.value;
+                    });
+                })
+            },
+            init: function () {
+                var that = this;
+                window.UMEDITOR_CONFIG.toolbar = [
+                    // 加入一个 test
+                    'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
+                    'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize',
+                    '| justifyleft justifycenter justifyright justifyjustify |',
+                    'link unlink | emotion selectimgs video  | map',
+                    '| horizontal print preview fullscreen', 'drafts', 'formula'
+                ];
+                UM.registerUI('selectimgs', function (name) {
+                    var me = this;
+                    var $btn = $.eduibutton({
+                        icon: 'image',
+                        click: function () {
+                            that.createFrame('选择图片', "{:Url('widget.images/index',['fodder'=>'editor'])}");
+                        },
+                        title: '选择图片'
+                    });
+
+                    this.addListener('selectionchange', function () {
+                        //切换为不可编辑时,把自己变灰
+                        var state = this.queryCommandState(name);
+                        $btn.edui().disabled(state == -1).active(state == 1)
+                    });
+                    return $btn;
+
+                });
+                UM.registerUI('video', function (name) {
+                    var me = this;
+                    var $btn = $.eduibutton({
+                        icon: 'video',
+                        click: function () {
+                            that.createFrame('选择视频', "{:Url('widget.video/index',['fodder'=>'video'])}");
+                        },
+                        title: '选择视频'
+                    });
+
+                    this.addListener('selectionchange', function () {
+                        //切换为不可编辑时,把自己变灰
+                        var state = this.queryCommandState(name);
+                        $btn.edui().disabled(state == -1).active(state == 1)
+                    });
+                    return $btn;
+
+                });
+                //实例化编辑器
+                this.um = UM.getEditor('myEditor', {initialFrameWidth: '99%', initialFrameHeight: 400});
+                this.um.setContent(that.formData.description);
+                that.$nextTick(function () {
+                    layui.use(['form','element'], function () {
+                        that.form = layui.form;
+                        that.form.render();
+                        that.form.on('select(temp_id)', function (data) {
+                            that.$set(that.formData, 'temp_id', data.value);
+                        });
+                        that.form.on('select(rule_index)', function (data) {
+                            that.ruleIndex = data.value;
+                        });
+                        layui.element.on('tab(docTabBrief)', function(){
+                            that.layTabId = this.getAttribute('lay-id');
+                        });
+                        that.eeventRadio();
+                    });
+
+                })
+            },
+            requestPost: function (url, data) {
+                return new Promise(function (resolve, reject) {
+                    axios.post(url, data).then(function (res) {
+                        if (res.status == 200 && res.data.code == 200) {
+                            resolve(res.data)
+                        } else {
+                            reject(res.data);
+                        }
+                    }).catch(function (err) {
+                        reject({msg:err})
+                    });
+                })
+            },
+            requestGet: function (url) {
+                return new Promise(function (resolve, reject) {
+                    axios.get(url).then(function (res) {
+                        if (res.status == 200 && res.data.code == 200) {
+                            resolve(res.data)
+                        } else {
+                            reject(res.data);
+                        }
+                    }).catch(function (err) {
+                        reject({msg:err})
+                    });
+                })
+            },
+            generates: function () {
+                var that = this;
+                that.generate(1);
+            },
+            generate: function (type = 0) {
+                var that = this;
+                this.requestPost(that.U({c:"store.StoreProduct",a:'is_format_attr',p:{id:that.id,type:type}}), {attrs:this.formData.items}).then(function (res) {
+                    that.$set(that.formData, 'attrs', res.data.value);
+                    that.$set(that, 'formHeader', res.data.header);
+                    if (that.id && that.formData.is_sub == 1 && that.formData.spec_type == 1) {
+                        that.formHeader.push({title:'一级返佣(元)'});
+                        that.formHeader.push({title:'二级级返佣(元)'});
+                    }
+                }).catch(function (res) {
+                    return that.showMsg(res.msg);
+                });
+            },
+            handleSubmit:function () {
+                var that = this;
+                if (that.formData.name === ''){
+                    return that.showMsg('请输入商品名称');
+                }
+                if (that.formData.image === ''){
+                    return that.showMsg('请输入上传图片');
+                }
+                if (that.formData.price <= 0){
+                    return that.showMsg('请输入价格');
+                }
+                if (that.formData.rise <= 0){
+                    return that.showMsg('涨幅不能为空');
+                }
+                if (that.formData.deduct <= 0){
+                    return that.showMsg('扣除不能为空');
+                }
+                if (that.formData.give <= 0){
+                    return that.showMsg('赠送不能为空');
+                }
+
+                that.formData.description = that.getContent();
+                that.requestPost(that.U({c:'auction.auctionProduct',a:'fzsp',p:{id:that.id}}),that.formData).then(function (res) {
+                    that.confirm();
+                }).catch(function (res) {
+                    that.showMsg(res.msg);
+                });
+
+            },
+            confirm: function(){
+                var that = this;
+                layui.use(['layer'], function () {
+                    var layer = layui.layer;
+                    layer.confirm(that.id ? '修改成功是否返回产品列表' : '添加成功是否返回产品列表', {
+                        btn: ['返回列表',that.id ? '继续修改' : '继续添加'] //按钮
+                    }, function(){
+                        location.href = that.U({c:'auction.auction',a:'product?id='+auction_id});
+                    }, function(){
+                        location.reload();
+                    });
+                });
+            },
+            render:function(){
+                this.$nextTick(function(){
+                    layui.use(['form'], function () {
+                        layui.form.render('select');
+                    });
+                })
+            },
+            // 移动
+            handleDragStart (e, item) {
+                this.dragging = item;
+            },
+            handleDragEnd (e, item) {
+                this.dragging = null
+            },
+            handleDragOver (e) {
+                e.dataTransfer.dropEffect = 'move'
+            },
+            handleDragEnter (e, item) {
+                e.dataTransfer.effectAllowed = 'move'
+                if (item === this.dragging) {
+                    return
+                }
+                var newItems = [...this.formData.activity];
+                var src = newItems.indexOf(this.dragging);
+                var dst = newItems.indexOf(item);
+                newItems.splice(dst, 0, ...newItems.splice(src, 1))
+                this.formData.activity = newItems;
+            },
+            getRuleList:function (type) {
+                var that = this;
+                that.requestGet(that.U({c:'store.StoreProduct',a:'get_rule'})).then(function (res) {
+                    that.$set(that,'ruleList',res.data);
+                    if(type !== undefined){
+                        that.render();
+                    }
+                });
+            },
+            addRule:function(){
+                return this.createFrame('添加商品规则',this.U({c:'store.StoreProductRule',a:'create'}));
+            },
+            allRule:function () {
+                if (this.ruleIndex != -1) {
+                    var rule = this.ruleList[this.ruleIndex];
+                    if (rule) {
+                        this.ruleBool = true;
+                        var rule_value = rule.rule_value.map(function (item) {
+                            return item;
+                        });
+                        this.$set(this.formData,'items',rule_value);
+                        this.$set(this.formData,'attrs',[]);
+                        this.$set(this,'formHeader',[]);
+                        return true;
+                    }
+                }
+                this.showMsg('选择的属性无效');
+            }
+        },
+        mounted: function () {
+            var that = this;
+            axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
+            that.getProductInfo();
+            window.$vm = that;
+            window.changeIMG = that.changeIMG;
+            window.insertEditor = that.insertEditor;
+            window.insertEditorVideo = that.insertEditorVideo;
+            window.successFun = function(){
+                that.getRuleList(1);
+            }
+            $(that.$refs.filElem).change(function () {
+                var inputFile = this.files[0];
+                that.requestPost(that.U({c:"widget.video",a:'get_signature'})).then(function (res) {
+                    AdminUpload.upload(res.data.uploadType,{
+                        token: res.data.uploadToken || '',
+                        file: inputFile,
+                        accessKeyId: res.data.accessKey || '',
+                        accessKeySecret: res.data.secretKey || '',
+                        bucketName: res.data.storageName || '',
+                        region: res.data.storageRegion || '',
+                        domain: res.data.domain || '',
+                        uploadIng:function (progress) {
+                            that.upload.videoIng = true;
+                            that.progress = progress;
+                        }
+                    }).then(function (res) {
+                        //成功
+                        that.$set(that.formData, 'video_link', res.url);
+                        that.progress = 0;
+                        that.upload.videoIng = false;
+                        return that.showMsg('上传成功');
+                    }).catch(function (err) {
+                        //失败
+                        console.info(err);
+                        return that.showMsg('上传错误请检查您的配置');
+                    });
+                }).catch(function (res) {
+                    return that.showMsg(res.msg || '获取密钥失败,请检查您的配置');
+                });
+            })
+        }
+
+    });
+</script>
+</body>
+</html>
+<script>
+    import Layout from "../../../../../public/static/plug/iview/dist/iview";
+    export default {
+        components: {Layout}
+    }
+</script>

+ 1 - 0
app/admin/view/auction/auction/index.php

@@ -123,6 +123,7 @@
             {field: 'anticipate', title: '预约价格', templet: '#anticipate',  align: 'center',style : 'color: #DC143C;'},
             {field: 'image', title: '封面', templet: '#image', align: 'center', width: '5%'},
             {field: 'status', title: '状态', templet: '#status', align: 'center'},
+            {field: 'goods_time', title: '自动放货(分钟)', templet: '#status', align: 'center'},
             {field: 'add_time', title: '预约开始', templet: '#add_time',  align: 'center'},
             {field: 'end_time', title: '预约结束', templet: '#end_time', align: 'center'},
             {field: 'radd_time', title: '入场开始', templet: '#radd_time',  align: 'center'},

+ 9 - 0
app/admin/view/auction/auction/product.php

@@ -93,6 +93,9 @@
                         <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>
                             编辑
                         </button>
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='fz'>
+                            复制
+                        </button>
                         <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
                             删除
                         </button>
@@ -123,6 +126,7 @@
             {field: 'is_show', title: '状态', templet: '#is_show', align: 'center'},
             {field: 'rise', title: '涨幅%', templet: '#rise', align: 'center'},
             {field: 'deduct', title: '扣除%', templet: '#deduct', align: 'center'},
+            {field: 'give', title: '赠送%', templet: '#deduct', align: 'center'},
             {field: 'sort', title: '排序', templet: '#sort', align: 'center'},
             {field: 'time', title: '挂售时间', templet: '#time', align: 'center'},
             {field: 'create_time', title: '创建时间', templet: '#create_time', align: 'center'},
@@ -154,6 +158,11 @@
             case 'edit':
                 location.href = layList.U({a:'product_edit',q:{id:data.id,auction_id:{$id}}});
                 break;
+            case 'fz':
+                location.href = layList.U({a:'fz',q:{id:data.id,auction_id:{$id}}});
+                break;
+
+
         }
     })
 

+ 15 - 1
app/admin/view/auction/auction/product_create.php

@@ -253,6 +253,16 @@
                                             </div>
                                         </div>
                                     </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">赠送<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="give" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.give" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
                                     <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
                                         <div class="grid-demo grid-demo-bg1">
                                             <div class="layui-form-item layui-form-text">
@@ -338,7 +348,8 @@
                 sort: 0,
                 auction_id: id,
                 hanging_price: '',
-                slider_image: []
+                slider_image: [],
+                give: 0
 
             },
             rule: { //多图选择规则
@@ -813,6 +824,9 @@
                 if (that.formData.deduct <= 0){
                     return that.showMsg('扣除不能为空');
                 }
+                if (that.formData.give <= 0){
+                    return that.showMsg('赠送不能为空');
+                }
                 that.formData.description = that.getContent();
                 that.requestPost(that.U({c:'auction.auction',a:'product_save',p:{id:that.id}}),that.formData).then(function (res) {
                     that.confirm();

+ 15 - 1
app/admin/view/auction/auction/product_edit.php

@@ -238,6 +238,16 @@
                                             </div>
                                         </div>
                                     </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">赠送<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="give" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.give" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
                                     <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
                                         <div class="grid-demo grid-demo-bg1">
                                             <div class="layui-form-item layui-form-text">
@@ -321,7 +331,8 @@
                 sort: '',
                 auction_id: auction_id,
                 hanging_price: '',
-                slider_image: []
+                slider_image: [],
+                give: 0
 
             },
             rule: { //多图选择规则
@@ -794,6 +805,9 @@
                 if (that.formData.deduct <= 0){
                     return that.showMsg('扣除不能为空');
                 }
+                if (that.formData.give <= 0){
+                    return that.showMsg('赠送不能为空');
+                }
 
                 that.formData.description = that.getContent();
                 that.requestPost(that.U({c:'auction.auctionProduct',a:'update',p:{id:that.id}}),that.formData).then(function (res) {

+ 2 - 2
app/admin/view/auction/auction_order/index.php

@@ -183,7 +183,7 @@
                     <script type="text/html" id="upload_image">
                         {{#  if(d.upload_image  ===  ''){ }}
                         <button type="button" name="status" class="layui-btn-disabled layui-btn-xs" id="">
-                            未上传打款凭证
+                            未上传
                         </button>
                         {{#  } else { }}
                             <img style="cursor: pointer" lay-event="open_upload_image" src="{{d.upload_image}}" style="cursor: pointer">
@@ -255,7 +255,7 @@
             {field: 'status', title: '状态', templet: '#status', align: 'center'},
             {field: 'appeal', title: '申诉状态', templet: '#appeal', align: 'center'},
             {field: 'is_gs', title: '挂售状态', templet: '#is_gs', align: 'center'},
-            {field: 'create_time', title: '预约时间', templet: '#date', align: 'center'},
+            {field: 'create_time', title: '购买时间', templet: '#date', align: 'center'},
             {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
         ];
     });

+ 15 - 1
app/admin/view/auction/auction_product/create.php

@@ -265,6 +265,16 @@
                                             </div>
                                         </div>
                                     </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">赠送<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="give" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.give" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
                                     <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
                                         <div class="grid-demo grid-demo-bg1">
                                             <div class="layui-form-item layui-form-text">
@@ -350,7 +360,8 @@
                 sort: 0,
                 auction_id: '',
                 hanging_price: '',
-                slider_image: []
+                slider_image: [],
+                give: 0
 
             },
             rule: { //多图选择规则
@@ -830,6 +841,9 @@
                 if (that.formData.deduct <= 0){
                     return that.showMsg('扣除不能为空');
                 }
+                if (that.formData.give <= 0){
+                    return that.showMsg('赠送不能为空');
+                }
 
                 that.formData.auction_id = auction_id;
                 that.formData.description = that.getContent();

+ 15 - 2
app/admin/view/auction/auction_product/edit.php

@@ -250,6 +250,16 @@
                                             </div>
                                         </div>
                                     </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">赠送<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="give" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.give" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
                                     <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
                                         <div class="grid-demo grid-demo-bg1">
                                             <div class="layui-form-item layui-form-text">
@@ -332,7 +342,8 @@
                 sort: '',
                 auction_id: '',
                 hanging_price: '',
-                slider_image: []
+                slider_image: [],
+                give: 0
 
             },
             rule: { //多图选择规则
@@ -809,7 +820,9 @@
                 if (that.formData.deduct <= 0){
                     return that.showMsg('扣除不能为空');
                 }
-
+                if (that.formData.give <= 0){
+                    return that.showMsg('赠送不能为空');
+                }
                 that.formData.auction_id = auction_id;
                 that.formData.description = that.getContent();
                 that.requestPost(that.U({c:'auction.auctionProduct',a:'update',p:{id:that.id}}),that.formData).then(function (res) {

+ 958 - 0
app/admin/view/auction/auction_product/fz.php

@@ -0,0 +1,958 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <link href="{__FRAME_PATH}css/font-awesome.min.css" rel="stylesheet">
+    <link href="{__ADMIN_PATH}plug/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
+    <script type="text/javascript" src="{__ADMIN_PATH}plug/umeditor/third-party/jquery.min.js"></script>
+    <script type="text/javascript" src="{__ADMIN_PATH}plug/umeditor/third-party/template.min.js"></script>
+    <script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH}plug/umeditor/umeditor.config.js"></script>
+    <script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH}plug/umeditor/umeditor.min.js"></script>
+    <script type="text/javascript" src="{__ADMIN_PATH}plug/umeditor/lang/zh-cn/zh-cn.js"></script>
+    <link rel="stylesheet" href="/static/plug/layui/css/layui.css">
+    <script src="/static/plug/layui/layui.js"></script>
+    <script src="{__PLUG_PATH}vue/dist/vue.min.js"></script>
+    <script src="/static/plug/axios.min.js"></script>
+    <script src="{__MODULE_PATH}widget/aliyun-oss-sdk-4.4.4.min.js"></script>
+    <script src="{__MODULE_PATH}widget/cos-js-sdk-v5.min.js"></script>
+    <script src="{__MODULE_PATH}widget/qiniu-js-sdk-2.5.5.js"></script>
+    <script src="{__MODULE_PATH}widget/plupload.full.min.js"></script>
+    <script src="{__MODULE_PATH}widget/videoUpload.js"></script>
+    <style>
+        .layui-form-item {
+            margin-bottom: 0px;
+        }
+
+        .pictrueBox {
+            display: inline-block !important;
+        }
+
+        .pictrue {
+            width: 60px;
+            height: 60px;
+            border: 1px dotted rgba(0, 0, 0, 0.1);
+            margin-right: 15px;
+            display: inline-block;
+            position: relative;
+            cursor: pointer;
+        }
+
+        .pictrue img {
+            width: 100%;
+            height: 100%;
+        }
+
+        .upLoad {
+            width: 58px;
+            height: 58px;
+            line-height: 58px;
+            border: 1px dotted rgba(0, 0, 0, 0.1);
+            border-radius: 4px;
+            background: rgba(0, 0, 0, 0.02);
+            cursor: pointer;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+        }
+
+        .rulesBox {
+            display: flex;
+            flex-wrap: wrap;
+            margin-left: 10px;
+        }
+
+        .layui-tab-content {
+            margin-top: 15px;
+        }
+
+        .ml110 {
+            margin: 18px 0 4px 110px;
+        }
+
+        .rules {
+            display: flex;
+        }
+
+        .rules-btn-sm {
+            height: 30px;
+            line-height: 30px;
+            font-size: 12px;
+            width: 109px;
+        }
+
+        .rules-btn-sm input {
+            width: 79% !important;
+            height: 84% !important;
+            padding: 0 10px;
+        }
+
+        .ml10 {
+            margin-left: 10px !important;
+        }
+
+        .ml40 {
+            margin-left: 40px !important;
+        }
+
+        .closes {
+            position: absolute;
+            left: 86%;
+            top: -18%;
+        }
+        .red {
+            color: red;
+        }
+        .layui-input-block .layui-video-box{
+            width: 22%;
+            height: 180px;
+            border-radius: 10px;
+            background-color: #707070;
+            margin-top: 10px;
+            position: relative;
+            overflow: hidden;
+        }
+        .layui-input-block .layui-video-box i{
+            color: #fff;
+            line-height: 180px;
+            margin: 0 auto;
+            width: 50px;
+            height: 50px;
+            display: inherit;
+            font-size: 50px;
+        }
+        .layui-input-block .layui-video-box .mark{
+            position: absolute;
+            width: 100%;
+            height: 30px;
+            top: 0;
+            background-color: rgba(0,0,0,.5);
+            text-align: center;
+        }
+        .store_box{
+            display: flex;
+        }
+        .info{
+            color: #c9c9c9;
+            padding-left: 10px;
+            line-height: 30px;
+        }
+    </style>
+</head>
+<body>
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15"  id="app" v-cloak="">
+        <div class="layui-card">
+            <div class="layui-card-header">
+                <span class="">竞拍添加</span>
+                <button style="margin-left: 20px" type="button" class="layui-btn layui-btn-primary layui-btn-xs" @click="goBack">返回列表</button>
+            </div>
+            <div class="layui-card-body">
+                <form class="layui-form" action="" v-cloak="">
+                    <div class="layui-tab layui-tab-brief" lay-filter="docTabBrief">
+                        <div class="layui-tab-content">
+                            <div class="layui-tab-item layui-show">
+                                <div class="layui-row layui-col-space15">
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">商品名称<i class="red">*</i></label>
+                                                <div class="layui-input-block">
+                                                    <input type="text" name="name" lay-verify="title" autocomplete="off"
+                                                           placeholder="场馆名称" class="layui-input" v-model="formData.name" maxlength="100">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">商品图片<i class="red">*</i></label>
+                                                <div class="pictrueBox">
+                                                    <div class="pictrue" v-if="formData.image" @click="uploadImage('image')">
+                                                        <img :src="formData.image"></div>
+                                                    <div class="upLoad" @click="uploadImage('image')" v-else>
+                                                        <i class="layui-icon layui-icon-camera" class="iconfont"
+                                                           style="font-size: 26px;"></i>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">商品轮播图<i class="red">*</i></label>
+                                                <div class="pictrueBox pictrue" v-for="(item,index) in formData.slider_image">
+                                                    <img :src="item">
+                                                    <i class="layui-icon closes" @click="deleteImage('slider_image',index)">&#x1007</i>
+                                                </div>
+                                                <div class="pictrueBox">
+                                                    <div class="upLoad" @click="uploadImage('slider_image')"
+                                                         v-if="formData.slider_image.length <= rule.slider_image.maxLength">
+                                                        <i class="layui-icon layui-icon-camera" class="iconfont"
+                                                           style="font-size: 26px;"></i>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+
+                                    <div class="layui-form-item">
+                                        <label class="layui-form-label">场馆</label>
+                                        <div class="layui-input-inline">
+                                            <select id="auction_id" name="auction_id" lay-verify="title" v-model=" formData.auction_id">
+                                                <option value="">请选择场馆</option>
+                                                {foreach $list as $key=>$vo }
+                                                <option value="{$vo.id}">{$vo.nickname}<option>
+                                                    {/foreach}
+                                            </select>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">价格<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="price" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.price" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">挂售价格<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="hanging_price" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.hanging_price" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">涨幅<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="rise" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.rise" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">扣除<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="deduct" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.deduct" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">赠送<i class="red">*</i></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="give" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.give" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item layui-form-text">
+                                                <label class="layui-form-label">商品介绍</label>
+                                                <div class="layui-input-block">
+                                                    <textarea name="info" v-model="formData.info"
+                                                              placeholder="请输入商品简介" class="layui-textarea"></textarea>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <div class="grid-demo grid-demo-bg1">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">排序</label>
+                                                <div class="layui-input-inline">
+                                                    <input type="number" name="sort" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.sort" maxlength="100" value="0">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <label class="layui-form-label" style="left: +1%">商品详情:</label>
+                                    <div class="layui-row layui-col-space15">
+                                        <textarea type="text/plain" name="description" id="myEditor" style="width:100%;">{{formData.description}}</textarea>
+                                    </div>
+
+                                </div>
+
+                            </div>
+                            <div class="layui-tab-content">
+                                <div class="layui-row layui-col-space15">
+                                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+                                        <button class="layui-btn layui-btn-normal layui-btn-sm" id="submit" type="button" @click="handleSubmit()">提交</button>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+
+    var id = {$id};
+    layui.use('laydate', function(){
+        var laydate = layui.laydate;
+
+        laydate.render({
+            elem: '#time'
+            ,type: 'time'
+            ,range: true
+        });
+        laydate.render({
+            elem: '#rtime'
+            ,type: 'time'
+            ,range: true
+        });
+    })
+
+    new Vue({
+        el: '#app',
+        data: {
+            id:id,
+            //分类列表
+            cateList: [],
+            //运费模板
+            tempList: [],
+            upload:{
+                videoIng:false
+            },
+            formData: {
+                description: '',
+                name: '',
+                image:'',
+                price:'',
+                deduct: '',
+                rise: '',
+                info: '',
+                sort: '',
+                auction_id: '',
+                hanging_price: '',
+                slider_image: [],
+                give: 0
+
+            },
+            rule: { //多图选择规则
+                slider_image: {
+                    maxLength: 5
+                }
+            },
+            attr: [],//临时属性
+            newRule: false,//是否添加新规则
+            radioRule: ['status'],//radio 当选规则
+            ruleList:[],
+            ruleIndex:-1,
+            progress: 0,
+            um: null,//编译器实例化
+            form: null,//layui.form
+            layTabId: 1,
+            ruleBool: id ? true : false,
+        },
+        watch:{
+            'formData.is_sub':function (n) {
+                if (n == 1) {
+                    this.formHeader.push({title:'一级返佣(元)'});
+                    this.formHeader.push({title:'二级级返佣(元)'});
+                } else {
+                    this.formHeader.pop();
+                    this.formHeader.pop();
+                }
+            },
+            'formData.spec_type':function (n) {
+                if (n) {
+                    this.render();
+                }
+            },
+            // 'formData.image':function (n) {
+            //     if(!this.batchAttr.pic){
+            //         this.batchAttr.pic = n;
+            //     }
+            //     if(!this.formData.attr.pic){
+            //         this.formData.attr.pic = n;
+            //     }
+            // }
+        },
+        methods: {
+            back:function(){
+                var that = this;
+                layui.use(['element'], function () {
+                    layui.element.tabChange('docTabBrief', that.layTabId == 1 ? 1 : parseInt(that.layTabId) - 1);
+                });
+            },
+            next:function(){
+                var that = this;
+                layui.use(['element'], function () {
+                    layui.element.tabChange('docTabBrief', that.layTabId == 3 ? 3 : parseInt(that.layTabId) + 1);
+                });
+            },
+            goBack:function(){
+                location.href = this.U({c:'auction.auction_product',a:'index'});
+            },
+            U: function (opt) {
+                var m = opt.m || 'admin', c = opt.c || window.controlle || '', a = opt.a || 'index', q = opt.q || '',
+                    p = opt.p || {};
+                var params = Object. keys(p).map(function (key) {
+                    return key + '/' + p[key];
+                }).join('/');
+                var gets = Object.keys(q).map(function (key) {
+                    return key+'='+ q[key];
+                }).join('&');
+
+                return '/' + m + '/' + c + '/' + a + (params == '' ? '' : '/' + params) + (gets == '' ? '' : '?' + gets);
+            },
+            /**
+             * 提示
+             * */
+            showMsg: function (msg, success) {
+                $('#submit').removeAttr('disabled').text('提交');
+                layui.use(['layer'], function () {
+                    layui.layer.msg(msg, success);
+                });
+            },
+            addBrokerage:function(){
+                if (this.brokerage.brokerage >= 0 && this.brokerage.brokerage_two >= 0){
+                    var that = this;
+                    this.$set(this.formData,'attrs',this.formData.attrs.map(function (item) {
+                        item.brokerage = that.brokerage.brokerage;
+                        item.brokerage_two = that.brokerage.brokerage_two;
+                        return item;
+                    }));
+                } else {
+                    return this.showMsg('请填写返佣金额在进行批量添加');
+                }
+            },
+            batchClear:function(){
+                this.$set(this,'batchAttr',{
+                    pic: '',
+                    price: 0,
+                    cost: 0,
+                    ot_price: 0,
+                    stock: 0,
+                    bar_code: '',
+                    weight: 0,
+                    volume: 0,
+                });
+            },
+            /**
+             * 批量添加
+             * */
+            batchAdd:function(){
+                var that = this;
+                this.$set(this.formData,'attrs',this.formData.attrs.map(function (item) {
+                    if (that.batchAttr.pic) {
+                        item.pic = that.batchAttr.pic;
+                    }
+                    if (that.batchAttr.price > 0){
+                        item.price = that.batchAttr.price;
+                    }
+                    if (that.batchAttr.cost > 0){
+                        item.cost = that.batchAttr.cost;
+                    }
+                    if (that.batchAttr.ot_price > 0){
+                        item.ot_price = that.batchAttr.ot_price;
+                    }
+                    if (that.batchAttr.stock > 0){
+                        item.stock = that.batchAttr.stock;
+                    }
+                    if (that.batchAttr.bar_code != ''){
+                        item.bar_code = that.batchAttr.bar_code;
+                    }
+                    if (that.batchAttr.weight > 0){
+                        item.weight = that.batchAttr.weight;
+                    }
+                    if (that.batchAttr.volume > 0){
+                        item.volume = that.batchAttr.volume;
+                    }
+                    return item;
+                }));
+
+            },
+            /**
+             * 获取商品信息
+             * */
+            getProductInfo: function () {
+                var that = this;
+                that.requestGet(that.U({c:"auction.auction_product",a:'get_list',q:{id:that.id}})).then(function (res) {
+                    var productInfo = res.data.productInfo || {};
+                    if(productInfo.id && that.id){
+                        that.$set(that,'formData',productInfo);
+                        that.generate();
+                    }
+                    that.getRuleList();
+                    that.init();
+                }).catch(function (res) {
+                    that.showMsg(res.msg);
+                })
+            },
+            /**
+             * 给某个属性添加属性值
+             * @param item
+             * */
+            addDetail: function (item) {
+                if (!item.detailValue) return false;
+                if (item.detail.find(function (val) {
+                    if(item.detailValue == val){
+                        return true;
+                    }
+                })) {
+                    return this.showMsg('添加的属性值重复');
+                }
+                item.detail.push(item.detailValue);
+                item.detailValue = '';
+            },
+            /**
+             * 删除某个属性值
+             * @param item 父级循环集合
+             * @param inx 子集index
+             * */
+            deleteValue: function (item, inx) {
+                if (item.detail.length > 1) {
+                    item.detail.splice(inx, 1);
+                } else {
+                    return this.showMsg('请设置至少一个属性');
+                }
+            },
+            /**
+             * 删除某条属性
+             * @param index
+             * */
+            deleteItem: function (index) {
+                this.formData.items.splice(index, 1);
+            },
+            /**
+             * 删除某条属性
+             * @param index
+             * */
+            deleteAttrs: function (index) {
+                var that = this;
+                if(that.id > 0){
+                    that.requestGet(that.U({c:"store.StoreProduct",a:'check_activity',q:{id:that.id}})).then(function (res) {
+                        that.showMsg(res.msg);
+                    }).catch(function (res) {
+                        if (that.formData.attrs.length > 1) {
+                            that.formData.attrs.splice(index, 1);
+                        } else {
+                            return that.showMsg('请设置至少一个规则');
+                        }
+                    })
+                }else{
+                    if (that.formData.attrs.length > 1) {
+                        that.formData.attrs.splice(index, 1);
+                    } else {
+                        return that.showMsg('请设置至少一个规则');
+                    }
+                }
+            },
+            /**
+             * 创建属性
+             * */
+            createAttrName: function () {
+                if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
+                    if (this.formData.items.find(function (val) {
+                        if (val.value == this.formDynamic.attrsName) {
+                            return true;
+                        }
+                    }.bind(this))) {
+                        return this.showMsg('添加的属性重复');
+                    }
+                    this.formData.items.push({
+                        value: this.formDynamic.attrsName,
+                        detailValue: '',
+                        attrHidden: false,
+                        detail: [this.formDynamic.attrsVal]
+                    });
+                    this.formDynamic.attrsName = '';
+                    this.formDynamic.attrsVal = '';
+                    this.newRule = false;
+                } else {
+                    return this.showMsg('请添加完整的规格!');
+                }
+            },
+            /**
+             * 删除图片
+             * */
+            deleteImage: function (key, index) {
+                var that = this;
+                if (index != undefined) {
+                    that.formData[key].splice(index, 1);
+                    that.$set(that.formData, key, that.formData[key]);
+                } else {
+                    that.$set(that.formData, key, '');
+                }
+            },
+            createFrame: function (title, src, opt) {
+                opt === undefined && (opt = {});
+                var h = 0;
+                if (window.innerHeight < 800 && window.innerHeight >= 700) {
+                    h = window.innerHeight - 50;
+                } else if (window.innerHeight < 900 && window.innerHeight >= 800) {
+                    h = window.innerHeight - 100;
+                } else if (window.innerHeight < 1000 && window.innerHeight >= 900) {
+                    h = window.innerHeight - 150;
+                } else if (window.innerHeight >= 1000) {
+                    h = window.innerHeight - 200;
+                } else {
+                    h = window.innerHeight;
+                }
+                var area = [(opt.w || window.innerWidth / 2) + 'px', (!opt.h || opt.h > h ? h : opt.h) + 'px'];
+                layui.use('layer',function () {
+                    return layer.open({
+                        type: 2,
+                        title: title,
+                        area: area,
+                        fixed: false, //不固定
+                        maxmin: true,
+                        moveOut: false,//true  可以拖出窗外  false 只能在窗内拖
+                        anim: 5,//出场动画 isOutAnim bool 关闭动画
+                        offset: 'auto',//['100px','100px'],//'auto',//初始位置  ['100px','100px'] t[ 上 左]
+                        shade: 0,//遮罩
+                        resize: true,//是否允许拉伸
+                        content: src,//内容
+                        move: '.layui-layer-title'
+                    });
+                });
+            },
+            changeIMG: function (name, value) {
+                if (this.getRule(name).maxLength !== undefined) {
+                    var that = this;
+                    value.map(function (v) {
+                        that.formData[name].push(v);
+                    });
+                    this.$set(this.formData, name, this.formData[name]);
+                } else {
+                    if(name == 'batchAttr.pic'){
+                        this.batchAttr.pic = value;
+                    } else {
+                        if (name.indexOf('.') !== -1) {
+                            var key = name.split('.');
+                            if (key.length == 2){
+                                this.formData[key[0]][key[1]] = value;
+                            } else if(key.length == 3){
+                                this.formData[key[0]][key[1]][key[2]] = value;
+                            } else if(key.length == 4){
+                                this.$set(this.formData[key[0]][key[1]][key[2]],key[3],value)
+                            }
+                        } else {
+                            this.formData[name] = value;
+                        }
+                    }
+                }
+            },
+            getRule: function (name) {
+                return this.rule[name] || {};
+            },
+            uploadImage: function (name) {
+                return this.createFrame('选择图片',this.U({c:"widget.images",a:'index',p:{fodder:name}}),{h:545,w:900});
+            },
+            uploadVideo: function () {
+                if (this.videoLink) {
+                    this.formData.video_link = this.videoLink;
+                } else {
+                    $(this.$refs.filElem).click();
+                }
+            },
+            delVideo: function () {
+                var that = this;
+                that.$set(that.formData, 'video_link', '');
+            },
+            insertEditor: function (list) {
+                this.um.execCommand('insertimage', list);
+            },
+            insertEditorVideo: function (src) {
+                this.um.setContent('<div><video style="width: 99%" src="'+src+'" class="video-ue" controls="controls" width="100"><source src="'+src+'"></source></video></div><br>',true);
+            },
+            getContent: function () {
+                return this.um.getContent();
+            },
+            /**
+             * 监听radio字段
+             */
+            eeventRadio: function () {
+                var that = this;
+                that.radioRule.map(function (val) {
+                    that.form.on('radio(' + val + ')', function (res) {
+                        that.formData[val] = res.value;
+                    });
+                })
+            },
+            init: function () {
+                var that = this;
+                window.UMEDITOR_CONFIG.toolbar = [
+                    // 加入一个 test
+                    'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
+                    'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize',
+                    '| justifyleft justifycenter justifyright justifyjustify |',
+                    'link unlink | emotion selectimgs video  | map',
+                    '| horizontal print preview fullscreen', 'drafts', 'formula'
+                ];
+                UM.registerUI('selectimgs', function (name) {
+                    var me = this;
+                    var $btn = $.eduibutton({
+                        icon: 'image',
+                        click: function () {
+                            that.createFrame('选择图片', "{:Url('widget.images/index',['fodder'=>'editor'])}");
+                        },
+                        title: '选择图片'
+                    });
+
+                    this.addListener('selectionchange', function () {
+                        //切换为不可编辑时,把自己变灰
+                        var state = this.queryCommandState(name);
+                        $btn.edui().disabled(state == -1).active(state == 1)
+                    });
+                    return $btn;
+
+                });
+                UM.registerUI('video', function (name) {
+                    var me = this;
+                    var $btn = $.eduibutton({
+                        icon: 'video',
+                        click: function () {
+                            that.createFrame('选择视频', "{:Url('widget.video/index',['fodder'=>'video'])}");
+                        },
+                        title: '选择视频'
+                    });
+
+                    this.addListener('selectionchange', function () {
+                        //切换为不可编辑时,把自己变灰
+                        var state = this.queryCommandState(name);
+                        $btn.edui().disabled(state == -1).active(state == 1)
+                    });
+                    return $btn;
+
+                });
+                //实例化编辑器
+                this.um = UM.getEditor('myEditor', {initialFrameWidth: '99%', initialFrameHeight: 400});
+                this.um.setContent(that.formData.description);
+                that.$nextTick(function () {
+                    layui.use(['form','element'], function () {
+                        that.form = layui.form;
+                        that.form.render();
+                        that.form.on('select(temp_id)', function (data) {
+                            that.$set(that.formData, 'temp_id', data.value);
+                        });
+                        that.form.on('select(rule_index)', function (data) {
+                            that.ruleIndex = data.value;
+                        });
+                        layui.element.on('tab(docTabBrief)', function(){
+                            that.layTabId = this.getAttribute('lay-id');
+                        });
+                        that.eeventRadio();
+                    });
+
+                })
+            },
+            requestPost: function (url, data) {
+                return new Promise(function (resolve, reject) {
+                    axios.post(url, data).then(function (res) {
+                        if (res.status == 200 && res.data.code == 200) {
+                            resolve(res.data)
+                        } else {
+                            reject(res.data);
+                        }
+                    }).catch(function (err) {
+                        reject({msg:err})
+                    });
+                })
+            },
+            requestGet: function (url) {
+                return new Promise(function (resolve, reject) {
+                    axios.get(url).then(function (res) {
+                        if (res.status == 200 && res.data.code == 200) {
+                            resolve(res.data)
+                        } else {
+                            reject(res.data);
+                        }
+                    }).catch(function (err) {
+                        reject({msg:err})
+                    });
+                })
+            },
+            generates: function () {
+                var that = this;
+                that.generate(1);
+            },
+            generate: function (type = 0) {
+                var that = this;
+                this.requestPost(that.U({c:"store.StoreProduct",a:'is_format_attr',p:{id:that.id,type:type}}), {attrs:this.formData.items}).then(function (res) {
+                    that.$set(that.formData, 'attrs', res.data.value);
+                    that.$set(that, 'formHeader', res.data.header);
+                    if (that.id && that.formData.is_sub == 1 && that.formData.spec_type == 1) {
+                        that.formHeader.push({title:'一级返佣(元)'});
+                        that.formHeader.push({title:'二级级返佣(元)'});
+                    }
+                }).catch(function (res) {
+                    return that.showMsg(res.msg);
+                });
+            },
+            handleSubmit:function () {
+                var that = this;
+                var auction_id = $('#auction_id').val();
+                if (that.formData.name === ''){
+                    return that.showMsg('请输入商品名称');
+                }
+                if (auction_id <= 0){
+                    return that.showMsg('请选择场馆');
+                }
+                if (that.formData.image === ''){
+                    return that.showMsg('请输入上传图片');
+                }
+                if (that.formData.price <= 0){
+                    return that.showMsg('请输入价格');
+                }
+                if (that.formData.rise <= 0){
+                    return that.showMsg('涨幅不能为空');
+                }
+                if (that.formData.deduct <= 0){
+                    return that.showMsg('扣除不能为空');
+                }
+                if (that.formData.give <= 0){
+                    return that.showMsg('赠送不能为空');
+                }
+                that.formData.auction_id = auction_id;
+                that.formData.description = that.getContent();
+                that.requestPost(that.U({c:'auction.auctionProduct',a:'update',p:{id:that.id}}),that.formData).then(function (res) {
+                    that.confirm();
+                }).catch(function (res) {
+                    that.showMsg(res.msg);
+                });
+
+            },
+            confirm: function(){
+                var that = this;
+                var index = parent.layer.getFrameIndex(window.name);
+                layui.use(['layer'], function () {
+                    var layer = layui.layer;
+                    layer.confirm(that.id ? '修改成功是否返回产品列表' : '添加成功是否返回产品列表', {
+                        btn: ['返回列表',that.id ? '继续修改' : '继续添加'] //按钮
+                    }, function(){
+                        parent.layer.close(index);
+                    }, function(){
+                        location.reload();
+                    });
+                });
+            },
+            render:function(){
+                this.$nextTick(function(){
+                    layui.use(['form'], function () {
+                        layui.form.render('select');
+                    });
+                })
+            },
+            // 移动
+            handleDragStart (e, item) {
+                this.dragging = item;
+            },
+            handleDragEnd (e, item) {
+                this.dragging = null
+            },
+            handleDragOver (e) {
+                e.dataTransfer.dropEffect = 'move'
+            },
+            handleDragEnter (e, item) {
+                e.dataTransfer.effectAllowed = 'move'
+                if (item === this.dragging) {
+                    return
+                }
+                var newItems = [...this.formData.activity];
+                var src = newItems.indexOf(this.dragging);
+                var dst = newItems.indexOf(item);
+                newItems.splice(dst, 0, ...newItems.splice(src, 1))
+                this.formData.activity = newItems;
+            },
+            getRuleList:function (type) {
+                var that = this;
+                that.requestGet(that.U({c:'store.StoreProduct',a:'get_rule'})).then(function (res) {
+                    that.$set(that,'ruleList',res.data);
+                    if(type !== undefined){
+                        that.render();
+                    }
+                });
+            },
+            addRule:function(){
+                return this.createFrame('添加商品规则',this.U({c:'store.StoreProductRule',a:'create'}));
+            },
+            allRule:function () {
+                if (this.ruleIndex != -1) {
+                    var rule = this.ruleList[this.ruleIndex];
+                    if (rule) {
+                        this.ruleBool = true;
+                        var rule_value = rule.rule_value.map(function (item) {
+                            return item;
+                        });
+                        this.$set(this.formData,'items',rule_value);
+                        this.$set(this.formData,'attrs',[]);
+                        this.$set(this,'formHeader',[]);
+                        return true;
+                    }
+                }
+                this.showMsg('选择的属性无效');
+            }
+        },
+        mounted: function () {
+            var that = this;
+            axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
+            that.getProductInfo();
+            window.$vm = that;
+            window.changeIMG = that.changeIMG;
+            window.insertEditor = that.insertEditor;
+            window.insertEditorVideo = that.insertEditorVideo;
+            window.successFun = function(){
+                that.getRuleList(1);
+            }
+            $(that.$refs.filElem).change(function () {
+                var inputFile = this.files[0];
+                that.requestPost(that.U({c:"widget.video",a:'get_signature'})).then(function (res) {
+                    AdminUpload.upload(res.data.uploadType,{
+                        token: res.data.uploadToken || '',
+                        file: inputFile,
+                        accessKeyId: res.data.accessKey || '',
+                        accessKeySecret: res.data.secretKey || '',
+                        bucketName: res.data.storageName || '',
+                        region: res.data.storageRegion || '',
+                        domain: res.data.domain || '',
+                        uploadIng:function (progress) {
+                            that.upload.videoIng = true;
+                            that.progress = progress;
+                        }
+                    }).then(function (res) {
+                        //成功
+                        that.$set(that.formData, 'video_link', res.url);
+                        that.progress = 0;
+                        that.upload.videoIng = false;
+                        return that.showMsg('上传成功');
+                    }).catch(function (err) {
+                        //失败
+                        console.info(err);
+                        return that.showMsg('上传错误请检查您的配置');
+                    });
+                }).catch(function (res) {
+                    return that.showMsg(res.msg || '获取密钥失败,请检查您的配置');
+                });
+            })
+        }
+
+    });
+</script>
+</body>
+</html>
+<script>
+    import Layout from "../../../../../public/static/plug/iview/dist/iview";
+    export default {
+        components: {Layout}
+    }
+</script>

+ 7 - 0
app/admin/view/auction/auction_product/index.php

@@ -113,6 +113,9 @@
                         <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('修改所属人','{:Url('belonging')}?id={{d.id}}',{h:500,w:500})">
                             所属
                         </button>
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='fz'>
+                            复制
+                        </button>
                         <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>
                             编辑
                         </button>
@@ -146,6 +149,7 @@
             {field: 'is_show', title: '状态', templet: '#is_show', align: 'center'},
             {field: 'rise', title: '涨幅%', templet: '#rise', align: 'center'},
             {field: 'deduct', title: '扣除%', templet: '#deduct', align: 'center'},
+            {field: 'give', title: '赠送%', templet: '#deduct', align: 'center'},
             {field: 'sort', title: '排序', templet: '#sort', align: 'center'},
             {field: 'time', title: '挂售时间', templet: '#time', align: 'center'},
             {field: 'frozen', title: '冻结状态', templet: '#frozen', align: 'center'},
@@ -178,6 +182,9 @@
             case 'edit':
                 layList.createModalFrame(data.name+'-修改',layList.U({a:'edit',q:{id:data.id}}),{h:750,w:1300})
                 break;
+            case 'fz':
+                layList.createModalFrame(data.name+'-复制',layList.U({a:'fz',q:{id:data.id}}),{h:750,w:1300})
+                break;
         }
     })
 

+ 4 - 4
app/admin/view/user/user/index.php

@@ -222,7 +222,7 @@
                     <script type="text/html" id="nickname">
                         {{d.nickname}}
                         {{# if(d.vip_name){ }}
-<!--                        <p style="color:#dab176">{{d.vip_name}}</p>-->
+                        <p style="color:#dab176">{{d.vip_name}}</p>
                         {{# } }}
                     </script>
                     <script type="text/html" id="data_time">
@@ -230,7 +230,7 @@
                         <div >最近:{{d.last_time}}</div>
                     </script>
                     <script type="text/html" id="checkboxstatus">
-                        <input type='checkbox' name='status' lay-skin='switch' value="{{d.uid}}" lay-filter='status' lay-text='正常|禁止'  {{ d.status == 1 ? 'checked' : '' }}>
+                        <input type='checkbox' name='status' lay-skin='switch' value="{{d.uid}}" lay-filter='status' lay-text='正常|冻结'  {{ d.status == 1 ? 'checked' : '' }}>
                     </script>
                     <script type="text/html" id="barDemo">
                         <button type="button" class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</button>
@@ -313,7 +313,7 @@
             {type:'checkbox'},
             {field: 'uid', title: '编号',event:'uid',width:'4%',align:'center'},
             {field: 'avatar', title: '头像', event:'open_image', width: '6%',align:'center', templet: '<p lay-event="open_image"><img class="avatar" style="cursor: pointer" class="open_image" data-image="{{d.avatar}}" src="{{d.avatar}}" alt="{{d.nickname}}"></p>'},
-            {field: 'nickname', title: '姓名',templet:'#nickname',align:'center'},
+            {field: 'nickname', title: '姓名',templet:'#nickname',align:'center',width: '10%'},
             {field: 'group_name', title: '分组',templet:'#group_name',align:'center'},
             {field: 'phone', title: '手机号',align:'center',width:'8%'},
             {field: 'now_money', title: '余额',width:'6%',sort:true,event:'now_money',align:'center'},
@@ -324,7 +324,7 @@
             {field: 'spread_uid_nickname', title: '推荐人',align:'center'},
             {field: 'sex', title: '性别',width:'4%',align:'center'},
             {field: 'data_time', title: '访问日期',align:'center',width:'12%',templet:'#data_time'},
-            // {field: 'status', title: '状态',templet:"#checkboxstatus",width:'6%',align:'center'},
+            {field: 'status', title: '状态',templet:"#checkboxstatus",width:'6%',align:'center'},
             {field: 'user_type', title: '用户类型',width:'6%',align:'center'},
             {field: 'operate', title: '操作', width: '10%', align: 'center', toolbar: '#barDemo'}
         ];

+ 1 - 1
app/api/controller/auction/AuctionController.php

@@ -193,7 +193,7 @@ class AuctionController
         try {
             Db::startTrans();
             UserBill::expend('艺金券减少',$user['uid'], 'anticipate', 'reduce_anticipate', $data['anticipate'], 0, $user['anticipate'], '转账给('.$me['nickname'].'-'.$me['uid'].')'.$data['anticipate'].'预约卷');
-            UserBill::income('艺金券增加',$me['uid'], 'anticipate', 'add_anticipate', $data['anticipate'], 0, $me['anticipate'], '接收('.$user['nickname'].'-'.$user['uid'].')转账'.$data['anticipate'].'预约卷');
+            UserBill::income('艺金券增加',$me['uid'], 'anticipate', 'add_anticipate', $data['anticipate'], 0, $me['anticipate'], '接收('.$user['nickname'].'-'.$user['uid'].')'.$data['anticipate'].'预约卷');
             $user->save();
             $me->save();
 

+ 23 - 0
app/api/controller/auction/AuctionOrderController.php

@@ -84,6 +84,29 @@ class AuctionOrderController
 
     }
 
+    /**
+     * 修改支付凭证
+     * @param Request $request
+     * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function edit_voucher(Request $request)
+    {
+
+        $data = UtilService::postMore([
+            'order_id',
+            'image'
+        ]);
+        $order = AuctionOrder::where('order_id', $data['order_id'])->find();
+        if (!$order) return app('json')->fail('没有此订单');// 失败
+        $order['upload_image'] = $data['image'];
+        $res = $order->save();
+        if (!$res)  return app('json')->fail('修改失败');// 失败
+        return app('json')->success('修改成功');// 失败
+    }
+
 
 
 

+ 7 - 3
app/api/controller/auction/AuctionProductController.php

@@ -183,6 +183,7 @@ class AuctionProductController
         if ($order['status'] != 1)  return app('json')->fail('当前订单状态无法上传凭证');
         $order['upload_image'] = $data['image'];
         $order['status'] = 2;
+        $order['voucher_time'] = time();
 
         if ($order->save()){
             return app('json')->successful('上传成功');
@@ -347,6 +348,7 @@ class AuctionProductController
         if ($product['is_show'] == 1) return app('json')->fail('商品已挂售');
 
         $datas = AuctionProduct::bs($data['id']);// 获取挂售详情
+
         if ($user['anticipate'] < $datas['anticipate']) return app('json')->fail('预约券不足');
 
         $product['price'] = $product['hanging_price'];
@@ -354,6 +356,7 @@ class AuctionProductController
         $product['is_show'] = 1; // 上架
         $product['is_admin'] = 2;
         $user['anticipate'] -= $datas['anticipate']; // 扣除预约券
+        $user['anticipate'] += $datas['give'];
         try {
             Db::startTrans();
             // 新增挂售时间段
@@ -367,7 +370,8 @@ class AuctionProductController
             $product->save();
             $user->save();
             AuctionOrder::where([['uid', '=', $request->uid()], ['product_id', '=', $product['id']], ['is_gs', '=', 0]])->update(['is_gs' => 1]);// 修改订单挂售
-            UserBill::expend('挂售扣除预约券', $user['uid'], 'anticipate', 'reduce_anticipate', $datas['anticipate'], $user['spread_uid'], $user['anticipate'], '挂售商品扣除预约券');
+            UserBill::expend('挂售扣除预约券', $user['uid'], 'anticipate', 'gs_anticipate', $datas['anticipate'], $user['spread_uid'], $user['anticipate'], '挂售扣除预约券');
+            UserBill::income('赠送预约券', $user['uid'], 'anticipate', 'gs_anticipate', $datas['give'], $user['spread_uid'], $user['anticipate'], '挂售赠送预约券');
 
             Db::commit();
             return app('json')->successful('挂售成功');
@@ -403,7 +407,7 @@ class AuctionProductController
         $anticipate = round($details['price'] * $details['deduct']/100, 2);
         $details['hanging_price'] = $details['price']; // 价格变=回未挂售前;
         $details['is_show'] = 0; // 价格变=回未挂售前;
-        $user['anticipate'] += $anticipate;// 退回挂售扣除的预约预约券
+        $user['anticipate'] += $anticipate*2;// 退回挂售扣除的预约预约券
 
 
         try {
@@ -411,7 +415,7 @@ class AuctionProductController
             $details->save();
             $user->save();
             AuctionOrder::where('order_id', $details['order'])->save(['is_gs' => 0]);
-            UserBill::income('取消挂售退回预约券', $request->uid(), 'anticipate', 'add_anticipate', $anticipate, 0, $user['anticipate'], '取消挂售退回预约券');
+            UserBill::income('取消挂售退回预约券', $request->uid(), 'anticipate', 'gsth_anticipate', $anticipate*2, 0, $user['anticipate'], '取消挂售退回预约券');
             AuctionTime::where([['uid', '=', $request->uid()], ['product_id', '=', $data['id']]])->delete(); // 删除上架时间
             Db::commit();
 

+ 1 - 0
app/api/controller/wechat/WechatController.php

@@ -90,6 +90,7 @@ class WechatController
             $token = UserToken::createToken($h5UserInfo, 'wechat');
         else
             $token = UserToken::createToken($user, 'wechat');
+        if ($user['status'] == 0) return app('json')->fail('用户已被冻结24小时,请联系管理员解除');
         // 设置推广关系
         User::setSpread(intval($spreadId), $user->uid);
         if ($token) {

+ 15 - 0
app/http/middleware/AllowOriginMiddleware.php

@@ -9,6 +9,7 @@ use app\models\auction\AuctionOrder;
 use app\models\auction\AuctionProduct;
 use app\models\auction\AuctionTime;
 use app\models\store\StoreOrder;
+use app\models\user\User;
 use app\Request;
 use crmeb\interfaces\MiddlewareInterface;
 use think\facade\Config;
@@ -76,6 +77,20 @@ class AllowOriginMiddleware implements MiddlewareInterface
         } catch (\Exception $e) {
             Db::rollback();
         }
+        try {
+            Db::startTrans();
+            AuctionOrder::goods();//自动放货
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+        }
+        try {
+            Db::startTrans();
+            User::thaw();//解冻
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+        }
         return $response;
     }
 }

+ 5 - 0
app/http/middleware/AuthTokenMiddleware.php

@@ -32,6 +32,11 @@ class AuthTokenMiddleware implements MiddlewareInterface
            if ($force)
                return app('json')->make($e->getCode(), $e->getMessage());
        }
+       if ($authInfo['user']){
+           if ($authInfo['user']['status'] == 0) {
+               return app('json')->fail('用户已被冻结24小时,请联系管理员解除');
+           }
+       }
 
         if (!is_null($authInfo)) {
             Request::macro('user', function () use (&$authInfo) {

+ 55 - 14
app/models/auction/AuctionOrder.php

@@ -88,7 +88,7 @@ class AuctionOrder extends BaseModel
                     }
                 }
             }else{
-                $list = self::where([['uid', '=', $uid], ['status', '<', 1]])->page($data['page'], $data['limit'])->select(); //过期订单
+                $list = self::where([['uid', '=', $uid]])->page($data['page'], $data['limit'])->select(); //过期订单
             }
         }
 
@@ -131,13 +131,24 @@ class AuctionOrder extends BaseModel
                     ->leftJoin('auction au', 'au.id = a.auction_id')
                     ->select();
             }else{
-                $list = self::alias('a')
-                    ->field('a.*,u.nickname,u.avatar,u.uid as user_id')
-                    ->leftJoin('user u', 'a.uid = u.uid')
-                    ->order('id DESC')
-                    ->where([['a.collection_id', '=', $uid], ['a.status', '=', $status]])
-                    ->page($data['page'], $data['limit'])
-                    ->select(); //待上传订单
+                if ($status == 0){
+                    $list = self::alias('a')
+                        ->field('a.*,u.nickname,u.avatar,u.uid as user_id')
+                        ->leftJoin('user u', 'a.uid = u.uid')
+                        ->order('id DESC')
+                        ->where([['a.collection_id', '=', $uid]])
+                        ->page($data['page'], $data['limit'])
+                        ->select(); //待上传订单
+                }else{
+                    $list = self::alias('a')
+                        ->field('a.*,u.nickname,u.avatar,u.uid as user_id')
+                        ->leftJoin('user u', 'a.uid = u.uid')
+                        ->order('id DESC')
+                        ->where([['a.collection_id', '=', $uid], ['a.status', '=', $status]])
+                        ->page($data['page'], $data['limit'])
+                        ->select(); //待上传订单
+                }
+
             }
 
         }
@@ -275,22 +286,25 @@ class AuctionOrder extends BaseModel
                             $user = \app\models\user\User::where('uid', $v['collection_id'])->find();
                             $user['anticipate'] = $user['anticipate'] + $booking['anticipate']/2; // 卖家增加预约卷
                             $booking['deduction'] = $booking['anticipate']/2;
-                            UserBill::income('增加艺金券', $v['collection_id'], 'anticipate', 'ad_anticipate',  $booking['anticipate']/2, $v['uid'], $user['anticipate'], '买家未上传支付凭证,增加'.($booking['anticipate']/2).'艺金券');
-                            UserBill::expend('扣除艺金券', $v['uid'], 'anticipate', 'dec_anticipate',  $booking['anticipate']/2, $v['uid'], $booking['anticipate']/2, '未上传支付凭证,扣除冻结'.($booking['anticipate']/2).'艺金券');
+                            UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate',  $booking['anticipate']/2, $v['uid'], $user['anticipate'], '('.$user['nickname'].'-'.$user['uid'].')超时付款');
+                            UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate',  $booking['anticipate']/2, $v['uid'], $booking['anticipate']/2, '超时付款,扣除冻结'.($booking['anticipate']/2).'艺金券');
                             $booking->save();
                             $user->save();
                         }
                     }
                 }elseif (strtotime($v['create_time']) <= $time){
                     if ($booking) {
-                        $user = \app\models\user\User::where('uid', $v['collection_id'])->find();
+                        $user = \app\models\user\User::where('uid', $v['collection_id'])->find(); //卖家
                         $dedu = $booking['anticipate'] - $booking['deduction'];
                         $user['anticipate'] += $dedu; // 卖家增加预约卷
                         $booking['deduction'] = $booking['anticipate'];
-                        UserBill::income('增加艺金券', $v['collection_id'], 'anticipate', 'ad_anticipate', $dedu, $v['uid'], $user['anticipate'], '买家未上传支付凭证,增加' .$dedu. '艺金券');
-                        UserBill::expend('扣除艺金券', $v['uid'], 'anticipate', 'dec_anticipate',  $dedu, $v['uid'], 0, '未上传支付凭证,扣除冻结'.$dedu.'艺金券');
-                        $booking->save();
+
                         $user->save();
+                        \app\models\user\User::where('uid', $v['uid'])->update(['status' => 0,'freeze_time' => strtotime('+1 day')]); // 冻结用户
+                        UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $dedu, $v['uid'], $user['anticipate'], '('.$user['nickname'].'-'.$user['uid'].')超时付款');
+                        UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate',  $dedu, $v['uid'], 0, '超时付款,扣除冻结'.$dedu.'艺金券');
+                        $booking->save();
+
                         AuctionBooking::where('id', $booking['id'])->update(['status' => 2]); // 修改预约订单状态 为扣除
                         AuctionOrder::where('create_time', '<', $hour)->where('status', '=', 1)->update(['status' => 0]); // 修改为已过期订单
                     }
@@ -336,6 +350,33 @@ class AuctionOrder extends BaseModel
     }
 
 
+    public static function goods()
+    {
+        $order = AuctionOrder::where('status', 2)->select();
+        if ($order){
+            foreach ($order as &$item)
+            {
+                $auction = Auction::where('id', $item['auction_id'])->value('goods_time');
+                $time = $item['voucher_time'] + ($auction * 60); // 自动放货时间
+                if (time() > $time){
+                    // 如果当前时间已经过了
+                    $product = AuctionProduct::where('id', $item['product_id'])->find();
+                    $product['uid'] = $item['uid'];// 商品拥有人更新
+                    $product['add_time'] = time();
+                    $product['order'] = $item['order_id'];
+
+                    self::where('id', $item['id'])->update(['status' => 3]);
+                    self::earn($item['uid'],$item['price'], $product);
+                    self::return($item['id']);
+                    $product->save();
+                }
+
+            }
+        }
+
+    }
+
+
 
 
 

+ 2 - 0
app/models/auction/AuctionProduct.php

@@ -186,10 +186,12 @@ class AuctionProduct extends BaseModel
 
         $hanging_price = round($product['hanging_price'] * $product['rise']/100, 2); //  溢价
         $anticipate = round($product['hanging_price'] * $product['deduct']/100, 2); // 扣除
+        $give = round($product['hanging_price'] * $product['give']/100);// 赠送趣豆
 
         $data['price'] = $product['hanging_price'];
         $data['hanging_price'] = (int)$product['hanging_price'] + ($hanging_price * $bs);
         $data['anticipate'] = $anticipate*2;
+        $data['give'] = $give;
 
 
         return $data;

+ 24 - 0
app/models/user/User.php

@@ -697,4 +697,28 @@ class User extends BaseModel
         $rs = self::order('uid DESC')->find();
         return $rs['uid']+1;
     }
+
+
+    /**
+     * 解冻
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public static function thaw()
+    {
+        $user = self::where('status', 0)->select();
+        if ($user){
+            foreach ($user as $item)
+            {
+                if ($item['freeze_time'] > 0){
+                    if (time() > $item['freeze_time']) {
+                        self::where('uid', $item['uid'])->update(['status' => 1]);
+                    }
+                }
+
+            }
+        }
+    }
 }

+ 2 - 3
app/models/user/UserBill.php

@@ -122,16 +122,15 @@ class UserBill extends BaseModel
         $data['kc'] = [];
         $data['sr'] = 0;
         $data['zc'] = 0;
-        $list = count($list) ? $list->toArray() : [];
+        $data['data'] = [];
+        $data['data'] = count($list) ? $list->toArray() : [];
         foreach ($list as &$v) {
             $v['add_time'] = date('Y/m/d H:i', $v['add_time']);
             $v['number'] = floatval($v['number']);
             if ($v['pm'] == 1) {
-                $data['zj'][] = $v;
                 $data['sr'] += $v['number'];
             }
             if ($v['pm'] == 0){
-                $data['kc'][] = $v;
                 $data['zc'] += $v['number'];
             }
 

+ 16 - 0
crmeb/subscribes/TaskSubscribe.php

@@ -10,6 +10,7 @@ use app\models\auction\AuctionTime;
 use app\models\store\StoreBargainUser;
 use app\models\store\StoreOrder;
 use app\models\store\StorePink;
+use app\models\user\User;
 use app\models\user\UserToken;
 use think\facade\Db;
 
@@ -97,6 +98,21 @@ class TaskSubscribe
             Db::rollback();
         }
 //        Auction::is_new(); // 更新新人
+
+        try {
+            Db::startTrans();
+            AuctionOrder::goods();//自动放货
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+        }
+        try {
+            Db::startTrans();
+            User::thaw();//解冻
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+        }
     }
 
     /**

+ 1 - 0
route/api/route.php

@@ -199,6 +199,7 @@ Route::group(function () {
 
     Route::get('is_pas', 'user.UserController/is_pas')->name('is_pas');// 是否设定支付密码
     Route::post('set_payment', 'user.UserController/set_payment')->name('set_payment');// 支付密码
+    Route::post('edit_voucher', 'auction.AuctionOrderController/edit_voucher')->name('edit_voucher');// 修改支付凭证
 
 })->middleware(\app\http\middleware\AllowOriginMiddleware::class)->middleware(\app\http\middleware\AuthTokenMiddleware::class, true);
 //未授权接口