Merge branch 'main' of http://git.njrzwl.cn:3000/wangmingchuan/yanzong
commit
37500a6da7
@ -0,0 +1,39 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\common\model; |
||||
|
||||
use cores\BaseModel; |
||||
use think\model\relation\BelongsTo; |
||||
|
||||
/** |
||||
* 文件库分组模型 |
||||
* Class UploadGroup |
||||
* @package app\common\model |
||||
*/ |
||||
class Maintenance extends BaseModel |
||||
{ |
||||
// 定义表名 |
||||
protected $name = 'maintenance'; |
||||
|
||||
|
||||
public static function detail(int $articleId, array $with = []) |
||||
{ |
||||
return self::get($articleId, $with); |
||||
} |
||||
|
||||
public function category(): BelongsTo |
||||
{ |
||||
$module = self::getCalledModule(); |
||||
return $this->BelongsTo("app\\{$module}\\model\\MaintenanceCategory", 'category_id'); |
||||
} |
||||
} |
@ -0,0 +1,54 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\common\model; |
||||
|
||||
use cores\BaseModel; |
||||
use think\model\relation\HasOne; |
||||
|
||||
/** |
||||
* 文章分类模型 |
||||
* Class Category |
||||
* @package app\common\model |
||||
*/ |
||||
class MaintenanceCategory extends BaseModel |
||||
{ |
||||
// 定义表名 |
||||
protected $name = 'maintenance_category'; |
||||
|
||||
|
||||
/** |
||||
* 分类详情 |
||||
* @param int $categoryId |
||||
* @return static|array|null |
||||
*/ |
||||
public static function detail(int $categoryId) |
||||
{ |
||||
return static::get($categoryId); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获取列表 |
||||
* @param array $where |
||||
* @return \think\Collection |
||||
* @throws \think\db\exception\DataNotFoundException |
||||
* @throws \think\db\exception\DbException |
||||
* @throws \think\db\exception\ModelNotFoundException |
||||
*/ |
||||
public function getList(array $where = []): \think\Collection |
||||
{ |
||||
return $this->where($where) |
||||
->order(['sort', $this->getPk()]) |
||||
->select(); |
||||
} |
||||
} |
@ -0,0 +1,82 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\store\controller\content; |
||||
|
||||
use think\response\Json; |
||||
use app\store\controller\Controller; |
||||
use app\store\model\Maintenance as MaintenanceModel; |
||||
|
||||
/** |
||||
* 文章管理控制器 |
||||
* Class article |
||||
* @package app\store\controller\content |
||||
*/ |
||||
class Maintenance extends Controller |
||||
{ |
||||
/** |
||||
* 文章列表 |
||||
* @return Json |
||||
* @throws \think\db\exception\DbException |
||||
*/ |
||||
public function list(): Json |
||||
{ |
||||
$model = new MaintenanceModel; |
||||
$list = $model->getList($this->request->param()); |
||||
return $this->renderSuccess(compact('list')); |
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* @return Json |
||||
*/ |
||||
public function add(): Json |
||||
{ |
||||
// 新增记录 |
||||
$model = new MaintenanceModel; |
||||
if ($model->add($this->postForm())) { |
||||
return $this->renderSuccess('添加成功'); |
||||
} |
||||
return $this->renderError($model->getError() ?: '添加失败'); |
||||
} |
||||
|
||||
/** |
||||
* @param int $articleId |
||||
* @return Json |
||||
*/ |
||||
public function edit(int $articleId): Json |
||||
{ |
||||
// 文章详情 |
||||
$model = MaintenanceModel::detail($articleId); |
||||
// 更新记录 |
||||
if ($model->edit($this->postForm())) { |
||||
return $this->renderSuccess('更新成功'); |
||||
} |
||||
return $this->renderError($model->getError() ?: '更新失败'); |
||||
} |
||||
|
||||
/** |
||||
* 删除文章 |
||||
* @param int $articleId |
||||
* @return Json |
||||
*/ |
||||
public function delete(int $articleId): Json |
||||
{ |
||||
// 文章详情 |
||||
$model = MaintenanceModel::detail($articleId); |
||||
if (!$model->setDelete()) { |
||||
return $this->renderError($model->getError() ?: '删除失败'); |
||||
} |
||||
return $this->renderSuccess('删除成功'); |
||||
} |
||||
} |
@ -0,0 +1,83 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\store\controller\content; |
||||
|
||||
use think\response\Json; |
||||
use app\store\controller\Controller; |
||||
use app\store\model\MaintenanceCategory as MaintenanceCategoryModel; |
||||
|
||||
/** |
||||
* 文章分类 |
||||
* Class Category |
||||
* @package app\store\controller\content\article |
||||
*/ |
||||
class MaintenanceCategory extends Controller |
||||
{ |
||||
/** |
||||
* 文章分类列表 |
||||
* @return Json |
||||
* @throws \think\db\exception\DataNotFoundException |
||||
* @throws \think\db\exception\DbException |
||||
* @throws \think\db\exception\ModelNotFoundException |
||||
*/ |
||||
public function list(): Json |
||||
{ |
||||
$model = new MaintenanceCategoryModel; |
||||
$list = $model->getList(); |
||||
return $this->renderSuccess(compact('list')); |
||||
} |
||||
|
||||
/** |
||||
* 添加文章分类 |
||||
* @return Json |
||||
*/ |
||||
public function add(): Json |
||||
{ |
||||
// 新增记录 |
||||
$model = new MaintenanceCategoryModel; |
||||
if ($model->add($this->postForm())) { |
||||
return $this->renderSuccess('添加成功'); |
||||
} |
||||
return $this->renderError($model->getError() ?: '添加失败'); |
||||
} |
||||
|
||||
/** |
||||
* 编辑文章分类 |
||||
* @param int $categoryId |
||||
* @return Json |
||||
*/ |
||||
public function edit(int $categoryId): Json |
||||
{ |
||||
// 分类详情 |
||||
$model = MaintenanceCategoryModel::detail($categoryId); |
||||
// 更新记录 |
||||
if ($model->edit($this->postForm())) { |
||||
return $this->renderSuccess('更新成功'); |
||||
} |
||||
return $this->renderError($model->getError() ?: '更新失败'); |
||||
} |
||||
|
||||
/** |
||||
* 删除文章分类 |
||||
* @param int $categoryId |
||||
* @return Json |
||||
*/ |
||||
public function delete(int $categoryId): Json |
||||
{ |
||||
$model = MaintenanceCategoryModel::detail($categoryId); |
||||
if (!$model->remove($categoryId)) { |
||||
return $this->renderError($model->getError() ?: '删除失败'); |
||||
} |
||||
return $this->renderSuccess('删除成功'); |
||||
} |
||||
} |
@ -0,0 +1,107 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\store\model; |
||||
|
||||
use app\common\model\Maintenance as MaintenanceModel; |
||||
|
||||
/** |
||||
* 文章模型 |
||||
* Class Article |
||||
* @package app\store\model |
||||
*/ |
||||
class Maintenance extends MaintenanceModel |
||||
{ |
||||
/** |
||||
* 获取列表 |
||||
* @param array $param |
||||
* @return \think\Paginator |
||||
* @throws \think\db\exception\DbException |
||||
*/ |
||||
public function getList(array $param = []): \think\Paginator |
||||
{ |
||||
// 查询参数 |
||||
$params = $this->setQueryDefaultValue($param, [ |
||||
'name' => '', |
||||
'categoryId' => 0, |
||||
'status' => -1, |
||||
]); |
||||
// 检索查询条件 |
||||
$filter = []; |
||||
!empty($params['name']) && $filter[] = ['name', 'like', "%{$params['title']}%"]; |
||||
$params['status'] > -1 && $filter[] = ['status', '=', $params['status']]; |
||||
$params['categoryId'] > 0 && $filter[] = ['category_id', '=', $params['categoryId']]; |
||||
// 查询列表数据 |
||||
$data = $this->where($filter) |
||||
->where('is_delete', '=', 0) |
||||
->order(['sort' => 'asc', 'create_time' => 'desc']) |
||||
->paginate(15); |
||||
|
||||
return self::preload($data, ['category']); |
||||
} |
||||
|
||||
/** |
||||
* 新增记录 |
||||
* @param array $data |
||||
* @return bool |
||||
*/ |
||||
public function add(array $data): bool |
||||
{ |
||||
|
||||
if (empty($data['name'])) { |
||||
$this->error = '请输入保修名称'; |
||||
return false; |
||||
} |
||||
|
||||
if (($data['parent_id']) != 0) { |
||||
if (empty($data['url'])) { |
||||
$this->error = '请输地址'; |
||||
return false; |
||||
} |
||||
|
||||
} |
||||
$data['store_id'] = self::$storeId; |
||||
return $this->save($data); |
||||
} |
||||
|
||||
/** |
||||
* 更新记录 |
||||
* @param array $data |
||||
* @return bool |
||||
*/ |
||||
public function edit(array $data): bool |
||||
{ |
||||
if (empty($data['name'])) { |
||||
$this->error = '请输入保修名称'; |
||||
return false; |
||||
} |
||||
if (empty($data['url'])) { |
||||
$this->error = '请输入地址'; |
||||
return false; |
||||
} |
||||
return $this->save($data) !== false; |
||||
} |
||||
|
||||
/** |
||||
* 软删除 |
||||
* @return bool |
||||
*/ |
||||
public function setDelete(): bool |
||||
{ |
||||
return $this->save(['is_delete' => 1]); |
||||
} |
||||
|
||||
public static function getTotal(array $where = []): int |
||||
{ |
||||
return (new static)->where($where)->where('is_delete', '=', 0)->count(); |
||||
} |
||||
} |
@ -0,0 +1,68 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\store\model; |
||||
|
||||
use app\store\model\Maintenance as MaintenanceModel; |
||||
use app\common\model\MaintenanceCategory as MaintenanceCategoryModel; |
||||
|
||||
/** |
||||
* 文章分类模型 |
||||
* Class Category |
||||
* @package app\store\model\article |
||||
*/ |
||||
class MaintenanceCategory extends MaintenanceCategoryModel |
||||
{ |
||||
/** |
||||
* 添加新记录 |
||||
* @param array $data |
||||
* @return bool |
||||
*/ |
||||
public function add(array $data): bool |
||||
{ |
||||
// 保存记录 |
||||
$data['store_id'] = self::$storeId; |
||||
return $this->save($data); |
||||
} |
||||
|
||||
/** |
||||
* 编辑记录 |
||||
* @param array $data |
||||
* @return bool |
||||
*/ |
||||
public function edit(array $data): bool |
||||
{ |
||||
// 保存记录 |
||||
return $this->save($data); |
||||
} |
||||
|
||||
/** |
||||
* 删除商品分类 |
||||
* @param int $categoryId |
||||
* @return bool |
||||
*/ |
||||
public function remove(int $categoryId): bool |
||||
{ |
||||
// 判断是否存在文章 |
||||
$articleCount = MaintenanceModel::getTotal(['category_id' => $categoryId]); |
||||
if ($articleCount > 0) { |
||||
$this->error = '该分类下存在' . $articleCount . '个报修,不允许删除'; |
||||
return false; |
||||
} |
||||
// 删除记录 |
||||
return $this->delete(); |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
||||
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>商家管理中心</title><style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="css/bargain.aaf513d0.css" rel="prefetch"><link href="css/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.8e8dd5a1.css" rel="prefetch"><link href="css/client.a6cbdfac.css" rel="prefetch"><link href="css/collector.b0b45274.css" rel="prefetch"><link href="css/content.949483f8.css" rel="prefetch"><link href="css/dealer.33c053df.css" rel="prefetch"><link href="css/eorder.af369ba5.css" rel="prefetch"><link href="css/goods.4f0db976.css" rel="prefetch"><link href="css/groupon.d7e493ca.css" rel="prefetch"><link href="css/index.65686232.css" rel="prefetch"><link href="css/market.44138760.css" rel="prefetch"><link href="css/order.474528f8.css" rel="prefetch"><link href="css/page.5cf12993.css" rel="prefetch"><link href="css/passport.27257d2f.css" rel="prefetch"><link href="css/server.e80e6d3d.css" rel="prefetch"><link href="css/setting.be935862.css" rel="prefetch"><link href="css/sharp.0237f2d1.css" rel="prefetch"><link href="css/statistics.6d805d57.css" rel="prefetch"><link href="css/store.b31f3a03.css" rel="prefetch"><link href="css/user.d41c82eb.css" rel="prefetch"><link href="js/bargain.027c2e96.js" rel="prefetch"><link href="js/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.f7e902c4.js" rel="prefetch"><link href="js/client.f9b450e7.js" rel="prefetch"><link href="js/collector.5afe6707.js" rel="prefetch"><link href="js/content.15044279.js" rel="prefetch"><link href="js/dealer.46441193.js" rel="prefetch"><link href="js/dealer~page~store.c1e7aeb9.js" rel="prefetch"><link href="js/eorder.6901a2af.js" rel="prefetch"><link href="js/exception.4f918b59.js" rel="prefetch"><link href="js/goods.324a2b4f.js" rel="prefetch"><link href="js/groupon.ca1a1258.js" rel="prefetch"><link href="js/index.bb016803.js" rel="prefetch"><link href="js/index~statistics.5ed2ab05.js" rel="prefetch"><link href="js/lang-zh-CN.8c571402.js" rel="prefetch"><link href="js/live.ab3fb0ef.js" rel="prefetch"><link href="js/manage.80527b44.js" rel="prefetch"><link href="js/market.f56b3cad.js" rel="prefetch"><link href="js/order.88013682.js" rel="prefetch"><link href="js/page.e2ad1a4a.js" rel="prefetch"><link href="js/passport.54223076.js" rel="prefetch"><link href="js/server.d2acb4bc.js" rel="prefetch"><link href="js/setting.8281d8f9.js" rel="prefetch"><link href="js/sharp.bd4c7d3f.js" rel="prefetch"><link href="js/statistics.5cc66089.js" rel="prefetch"><link href="js/store.55c7feba.js" rel="prefetch"><link href="js/user.5056b55d.js" rel="prefetch"><link href="css/app.0bf46b1d.css" rel="preload" as="style"><link href="css/chunk-vendors.35626c22.css" rel="preload" as="style"><link href="js/app.f6458931.js" rel="preload" as="script"><link href="js/chunk-vendors.87848c69.js" rel="preload" as="script"><link href="css/chunk-vendors.35626c22.css" rel="stylesheet"><link href="css/app.0bf46b1d.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div id="loading-mask"><div class="loading-wrapper"><span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span></div></div></div><script src="config.js"></script><script src="js/chunk-vendors.87848c69.js"></script><script src="js/app.f6458931.js"></script></body></html> |
||||
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>商家管理中心</title><style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="css/bargain.aaf513d0.css" rel="prefetch"><link href="css/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.e5cd2ba6.css" rel="prefetch"><link href="css/client.a6cbdfac.css" rel="prefetch"><link href="css/collector.b0b45274.css" rel="prefetch"><link href="css/content.949483f8.css" rel="prefetch"><link href="css/dealer.33c053df.css" rel="prefetch"><link href="css/eorder.af369ba5.css" rel="prefetch"><link href="css/goods.4f0db976.css" rel="prefetch"><link href="css/groupon.d7e493ca.css" rel="prefetch"><link href="css/index.65686232.css" rel="prefetch"><link href="css/market.44138760.css" rel="prefetch"><link href="css/order.474528f8.css" rel="prefetch"><link href="css/page.5cf12993.css" rel="prefetch"><link href="css/passport.27257d2f.css" rel="prefetch"><link href="css/server.e80e6d3d.css" rel="prefetch"><link href="css/setting.be935862.css" rel="prefetch"><link href="css/sharp.0237f2d1.css" rel="prefetch"><link href="css/statistics.6d805d57.css" rel="prefetch"><link href="css/store.b31f3a03.css" rel="prefetch"><link href="css/user.d41c82eb.css" rel="prefetch"><link href="js/bargain.ce2e287a.js" rel="prefetch"><link href="js/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.2d03af5c.js" rel="prefetch"><link href="js/client.4e5ed592.js" rel="prefetch"><link href="js/collector.deb6a2df.js" rel="prefetch"><link href="js/content.d4915794.js" rel="prefetch"><link href="js/dealer.f2e31461.js" rel="prefetch"><link href="js/dealer~page~store.c1e7aeb9.js" rel="prefetch"><link href="js/eorder.f684d737.js" rel="prefetch"><link href="js/exception.4f918b59.js" rel="prefetch"><link href="js/goods.e03c4dbe.js" rel="prefetch"><link href="js/groupon.85d22a0c.js" rel="prefetch"><link href="js/index.bb016803.js" rel="prefetch"><link href="js/index~statistics.5ed2ab05.js" rel="prefetch"><link href="js/lang-zh-CN.8c571402.js" rel="prefetch"><link href="js/live.64164cf5.js" rel="prefetch"><link href="js/manage.fb8a2579.js" rel="prefetch"><link href="js/market.ddc6b9ee.js" rel="prefetch"><link href="js/order.075ec9d7.js" rel="prefetch"><link href="js/page.7cd39bb3.js" rel="prefetch"><link href="js/passport.54223076.js" rel="prefetch"><link href="js/server.1e576bf5.js" rel="prefetch"><link href="js/setting.2e35f932.js" rel="prefetch"><link href="js/sharp.b1fee57e.js" rel="prefetch"><link href="js/statistics.5cc66089.js" rel="prefetch"><link href="js/store.5b3bac9a.js" rel="prefetch"><link href="js/user.3a7a8cc1.js" rel="prefetch"><link href="css/app.0bf46b1d.css" rel="preload" as="style"><link href="css/chunk-vendors.35626c22.css" rel="preload" as="style"><link href="js/app.6b3dcd3d.js" rel="preload" as="script"><link href="js/chunk-vendors.87848c69.js" rel="preload" as="script"><link href="css/chunk-vendors.35626c22.css" rel="stylesheet"><link href="css/app.0bf46b1d.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div id="loading-mask"><div class="loading-wrapper"><span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span></div></div></div><script src="config.js"></script><script src="js/chunk-vendors.87848c69.js"></script><script src="js/app.6b3dcd3d.js"></script></body></html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["live"],{ea2d:function(e,t,a){"use strict";a.r(t);a("ac1f"),a("841c"),a("b0c0");var n=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-alert",{staticClass:"mb-15",attrs:{showIcon:!0,message:"微信小程序直播操作说明",banner:""}},[t("template",{slot:"description"},[t("p",[e._v(" 1. 登录 "),t("a",{attrs:{href:"https://mp.weixin.qq.com/",target:"_blank"}},[e._v("微信小程序运营平台")]),e._v(",点击左侧菜单栏 “直播”,点击 “创建直播间” 按钮。 ")]),t("p",[e._v('2. 点击本页面中的 "同步直播间" 按钮,将直播间列表导入商城系统中。')])])],2),t("div",{staticClass:"table-operator"},[t("a-row",[t("a-col",{attrs:{span:5}},[t("a-button",{directives:[{name:"action",rawName:"v-action:sync",arg:"sync"}],attrs:{type:"primary",icon:"sync"},on:{click:function(t){return e.handleSync()}}},[e._v("同步直播间")])],1),t("a-col",{staticClass:"flex flex-x-end",attrs:{span:11,offset:8}},[t("a-input-search",{staticStyle:{"max-width":"300px","min-width":"150px"},attrs:{placeholder:"请输入直播间名称/主播昵称"},on:{search:e.onSearch},model:{value:e.queryParam.search,callback:function(t){e.$set(e.queryParam,"search",t)},expression:"queryParam.search"}})],1)],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"time",fn:function(a){return[t("p",[e._v("开始:"+e._s(a.start_time))]),t("p",[e._v("结束:"+e._s(a.end_time))])]}},{key:"live_status",fn:function(a){return[t("a-tag",{attrs:{color:e.LiveStatusColorEnum[a]}},[e._v(e._s(e.LiveStatusEnum[a].name))])]}},{key:"is_top",fn:function(a,n){return[t("a-tag",{staticClass:"cur-p",attrs:{color:a?"green":""},on:{click:function(t){return e.handleSetTop(n,a?0:1)}}},[e._v(e._s(a?"是":"否"))])]}}])})],1)},s=[],r=a("5530"),o=(a("d3b7"),a("2af9")),i=a("b775"),c={list:"/live.room/list",sync:"/live.room/sync",setTop:"/live.room/setTop"};function l(e){return Object(i["b"])({url:c.list,method:"get",params:e})}function u(e){return Object(i["b"])({url:c.sync,method:"post",data:e})}function d(e,t){return Object(i["b"])({url:c.setTop,method:"post",data:{id:e,isTop:t}})}var m=a("5c06"),h=new m["a"]([{key:101,name:"直播中",value:101},{key:102,name:"未开始",value:102},{key:103,name:"已结束",value:103},{key:104,name:"禁播",value:104},{key:105,name:"暂停中",value:105},{key:106,name:"异常",value:106},{key:107,name:"已过期",value:107}]),f={101:"green",102:"green",103:"red",104:"red",105:"orange",106:"red",107:"red"},p={name:"Index",components:{STable:o["d"]},data:function(){var e=this;return{queryParam:{search:void 0},isLoading:!1,LiveStatusEnum:h,LiveStatusColorEnum:f,columns:[{title:"直播间ID",dataIndex:"id"},{title:"直播间名称",dataIndex:"room_name"},{title:"主播昵称",dataIndex:"anchor_name",scopedSlots:{customRender:"anchor_name"}},{title:"直播时间",scopedSlots:{customRender:"time"}},{title:"直播状态",dataIndex:"live_status",scopedSlots:{customRender:"live_status"}},{title:"是否置顶",dataIndex:"is_top",scopedSlots:{customRender:"is_top"}},{title:"更新时间",dataIndex:"update_time"}],loadData:function(t){return l(Object(r["a"])(Object(r["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleSync:function(){var e=this;e.isLoading=!0,u().then((function(t){e.$message.success(t.message,1.5),e.queryParam.search=void 0,e.handleRefresh(!0)})).finally((function(){return e.isLoading=!1}))},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleSetTop:function(e,t){var a=this;if(!this.$auth("/apps/live/room/index.setTop"))return!1;var n=t?"":"取消",s=this.$confirm({title:"您确定要".concat(n,"置顶该直播间吗?"),onOk:function(){return d(e.id,t).then((function(e){a.$message.success(e.message,1.5),a.handleRefresh()})).finally((function(){return s.destroy()}))}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},onSearch:function(){this.handleRefresh(!0)}}},v=p,y=a("2877"),_=Object(y["a"])(v,n,s,!1,null,null,null);t["default"]=_.exports}}]); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue