Skip to content

Commit adab823

Browse files
committed
Notice模块适配
1 parent 8ecc688 commit adab823

File tree

79 files changed

+30907
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+30907
-165
lines changed

config/module.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
'VisitStatistic' => [
3535
'enable' => true,
3636
],
37+
// 'Notice' => [
38+
// 'enable' => true,
39+
// ],
3740
// 'BlogAdminApi' => [
3841
// 'enable' => true,
3942
// ],

module/Banner/Admin/Controller/BannerController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ protected function crud(AdminCRUDBuilder $builder)
4040
->when(BannerType::VIDEO, function ($context) {
4141
/** @var HasFields $context */
4242
$context->video('video', '视频');
43-
})->required();
43+
})
44+
->defaultValue(BannerType::IMAGE)
45+
->required();
4446
$builder->color('backgroundColor', '背景色');
4547
$builder->link('link', '链接');
4648
$builder->display('created_at', L('Created At'))->listable(false);

module/Banner/Docs/release.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
## 1.8.0
1+
## 1.8.0 轮播图获取支持仅图片过滤方法,视频 Banner 概率不播放问题
22

3-
- 新增:轮播图获取支持近图片过滤方法
3+
- 新增:轮播图获取支持仅图片过滤方法
44
- 优化:视频 `Banner` 概率不播放问题
5+
- 优化:轮播类型添加修改是否为空判断
56

67
---
78

module/Banner/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"require": [
1212
"Vendor:>=3.0.0"
1313
],
14-
"modstartVersion": ">=2.6.0",
14+
"modstartVersion": ">=3.9.0",
1515
"title": "通用轮播",
1616
"version": "1.8.0",
1717
"author": "官方",
@@ -24,4 +24,4 @@
2424
]
2525
]
2626
}
27-
}
27+
}

module/Blog/Docs/release.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 3.5.0
22

3+
- 新增:系统公告模块适配,支持博客公告
34
- 优化:博客自动发布逻辑优化调整,支持定时发布
45
- 新增:博客分类支持二级分类,博客列表页面支持二级分类筛选
56
- 修复:博客编辑状态下可浏览,标签和博客分类数量计算数量异常

module/Blog/View/pc/blog/index.blade.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
{!! \Module\Banner\View\BannerView::basic('Blog',null,'5-2','5-3') !!}
1919
</div>
2020

21+
@if(modstart_module_enabled('Notice'))
22+
<div class="margin-bottom">
23+
{!! \Module\Notice\View\NoticeView::latest() !!}
24+
</div>
25+
@endif
26+
2127
<div class="ub-content-box margin-bottom">
2228
<div class="tw-p-3">
2329
@include('module::Blog.View.pc.blog.inc.blogItems')

module/Vendor/Provider/BizTrait.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ public static function listAllEnabled()
4646
return $records;
4747
}
4848

49+
public static function first()
50+
{
51+
foreach (self::listAll() as $item) {
52+
return $item;
53+
}
54+
return null;
55+
}
56+
57+
public static function firstName()
58+
{
59+
$item = self::first();
60+
return $item ? $item->name() : null;
61+
}
62+
4963
public static function getByName($name)
5064
{
5165
foreach (self::listAll() as $item) {

module/Vendor/Shell/include.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
include __DIR__ . '/../../../vendor/modstart/modstart/src/Core/Util/PlatformUtil.php';
44
include __DIR__ . '/../../../vendor/modstart/modstart/src/Core/Util/ReUtil.php';
5+
include __DIR__ . '/../../../vendor/modstart/modstart/src/Core/Util/FileUtil.php';
56

67
function shell_module_base()
78
{

module/Vendor/Util/UniappUtil.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Module\Vendor\Util;
55

6+
use ModStart\Core\Util\FileUtil;
67
use ModStart\Core\Util\PlatformUtil;
78
use ModStart\Core\Util\ReUtil;
89

@@ -72,10 +73,20 @@ public static function build($dir)
7273

7374
shell_echo_block("更新模块静态资源");
7475
shell_ensure_dir(shell_module_path($module, 'Asset'));
75-
shell_echo_info('清空目录');
76-
passthru("rm -rfv " . shell_module_path($module, 'Asset/static/'));
76+
$path = shell_module_path($module, 'Asset/static/');
77+
shell_echo_info('清空目录 ' . $path);
78+
FileUtil::rm($path);
7779
shell_echo_info('更新文件');
78-
passthru("cp -av dist/build/h5/static " . shell_module_path($module, 'Asset/static/'));
80+
$files = FileUtil::listAllFiles('dist/build/h5/static');
81+
foreach ($files as $file) {
82+
if (!$file['isFile']) {
83+
continue;
84+
}
85+
$content = file_get_contents($file['pathname']);
86+
$toPath = shell_module_path($module, 'Asset/static/' . $file['filename']);
87+
FileUtil::write($toPath, $content);
88+
shell_echo_info('复制 ' . $file['filename']);
89+
}
7990
shell_echo_success('打包完成');
8091

8192
shell_echo_block("温馨提示");

module/Vendor/View/quickRun/imageDesign/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="app" v-cloak></div>
22
<script>
3-
{!! \ModStart\Developer\LangUtil::langScriptPrepare([ "Select Local File" ]) !!};
3+
{!! \ModStart\ModStart::lang([ "Select Local File" ]) !!};
44
window.__selectorDialogServer = "{{$selectorDialogServer}}";
55
window._data = {
66
variables: {!! \ModStart\Core\Util\SerializeUtil::jsonEncode($variables) !!},

0 commit comments

Comments
 (0)