From a69b9df86bcdb217fdbcbdf2b82068ed22fc8f73 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Sat, 5 Sep 2020 20:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E6=97=A0=E7=94=A8=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- app/Http/Admin/Views/setting/live_pull.volt | 75 ++++++++++--------- app/Http/Admin/Views/setting/storage.volt | 39 +++++++--- .../Desktop/Views/course/list_filter.volt | 11 +-- app/Http/Desktop/Views/course/show_meta.volt | 8 +- app/Http/Desktop/Views/macros/consult.volt | 9 +++ app/Http/Desktop/Views/macros/group.volt | 6 +- app/Http/Desktop/Views/my/consults.volt | 4 +- app/Http/Desktop/Views/my/favorites.volt | 2 +- app/Http/Desktop/Views/my/friends.volt | 2 +- app/Http/Desktop/Views/my/groups.volt | 8 +- app/Http/Desktop/Views/my/groups_joined.volt | 3 +- app/Http/Desktop/Views/my/reviews.volt | 6 +- app/Http/Desktop/Views/teaching/consults.volt | 4 +- app/Http/Desktop/Views/teaching/courses.volt | 2 +- app/Models/Consult.php | 7 ++ app/Services/Frontend/Consult/ConsultInfo.php | 2 +- .../20200827112717_insert_setting_data.php | 20 ++--- public/static/desktop/css/common.css | 1 + 19 files changed, 122 insertions(+), 91 deletions(-) create mode 100644 app/Http/Desktop/Views/macros/consult.volt diff --git a/README.md b/README.md index a746008a..58b0251f 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ PS:**系统后台已禁止提交并隐藏私人配置** #### 会推出商业服务吗? - 如果不符合您对“开源”的认知,请移步其它同类产品,毕竟同类“免费”产品也很多。 -- 如果“开源”版本不能满足您的需求,或者您更希望有更好的支持,商业服务是不错的选择。 +- 如果“开源”版本不能满足您的需求,或者您希望有更好的支持,商业服务是不错的选择。 我们为用户提供的服务包括: @@ -57,7 +57,7 @@ PS:**系统后台已禁止提交并隐藏私人配置** #### 通过这个项目能学到什么? 1. 项目规划,phalcon实战,缓存,JWT,即时通讯,全文检索 -2. docker操作,docker服务编排,supervisor,devOps +2. docker操作,docker服务编排,supervisor,devops 3. git,linux,php,mysql,redis,nginx #### 开发计划 diff --git a/app/Http/Admin/Views/setting/live_pull.volt b/app/Http/Admin/Views/setting/live_pull.volt index 85299f4f..4b73e7be 100644 --- a/app/Http/Admin/Views/setting/live_pull.volt +++ b/app/Http/Admin/Views/setting/live_pull.volt @@ -53,43 +53,44 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
模板名称模板描述视频码率(kbps)视频高度(px)
fd流畅500540
sd标清1000720
hd高清20001080
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
模板名称模板描述视频码率(kbps)视频高度(px)
fd流畅500540
sd标清1000720
hd高清20001080
+
diff --git a/app/Http/Admin/Views/setting/storage.volt b/app/Http/Admin/Views/setting/storage.volt index ab95b869..650b68d9 100644 --- a/app/Http/Admin/Views/setting/storage.volt +++ b/app/Http/Admin/Views/setting/storage.volt @@ -32,20 +32,35 @@
- 数据万象 + 图片处理样式
- -
- - -
-
-
- -
- -
+ + + + + + + + + + + + + + + + + + + + + + + + + +
样式名称样式描述
avatar_160imageMogr2/thumbnail/160x/interlace/0
cover_270mageMogr2/thumbnail/270x/interlace/0
carousel_1100imageMogr2/thumbnail/1100x/interlace/0
diff --git a/app/Http/Desktop/Views/course/list_filter.volt b/app/Http/Desktop/Views/course/list_filter.volt index 7461edfd..4f919e64 100644 --- a/app/Http/Desktop/Views/course/list_filter.volt +++ b/app/Http/Desktop/Views/course/list_filter.volt @@ -1,3 +1,9 @@ +{% set tc_val = request.get('tc','int','all') %} +{% set sc_val = request.get('sc','int','all') %} +{% set model_val = request.get('model','trim','all') %} +{% set level_val = request.get('level','trim','all') %} +{% set sort_val = request.get('sort','trim','score') %} +
@@ -6,7 +12,6 @@
方向
- {% set tc_val = request.get('tc','int','all') %} {% for category in top_categories %} {% set class = tc_val == category.id ? 'layui-btn layui-btn-xs' : 'none' %} {{ category.name }} @@ -17,7 +22,6 @@
分类
- {% set sc_val = request.get('sc','int','all') %} {% for category in sub_categories %} {% set class = sc_val == category.id ? 'layui-btn layui-btn-xs' : 'none' %} {{ category.name }} @@ -28,7 +32,6 @@
类型
- {% set model_val = request.get('model','trim','all') %} {% for model in models %} {% set class = model_val == model.id ? 'layui-btn layui-btn-xs' : 'none' %} {{ model.name }} @@ -38,7 +41,6 @@
难度
- {% set level_val = request.get('level','trim','all') %} {% for level in levels %} {% set class = level_val == level.id ? 'layui-btn layui-btn-xs' : 'none' %} {{ level.name }} @@ -48,7 +50,6 @@
- {% set sort_val = request.get('sort','trim','score') %} {% for sort in sorts %} {% set class = sort_val == sort.id ? 'layui-btn layui-btn-xs' : 'none' %} {{ sort.name }} diff --git a/app/Http/Desktop/Views/course/show_meta.volt b/app/Http/Desktop/Views/course/show_meta.volt index e33e996d..45d73bdf 100644 --- a/app/Http/Desktop/Views/course/show_meta.volt +++ b/app/Http/Desktop/Views/course/show_meta.volt @@ -33,24 +33,24 @@

难度级别{{ level_info(course.level) }} 学习人次{{ course.user_count }} - 综合评分{{ course.ratings.rating }} + 综合评分{{ "%0.1f"|format(course.ratings.rating) }}

内容实用 {{ star_info(course.ratings.rating1) }} - {{ course.ratings.rating1 }}分 + {{ "%0.1f"|format(course.ratings.rating1) }}分

简洁易懂 {{ star_info(course.ratings.rating2) }} - {{ course.ratings.rating2 }}分 + {{ "%0.1f"|format(course.ratings.rating2) }}分

逻辑清晰 {{ star_info(course.ratings.rating3) }} - {{ course.ratings.rating3 }}分 + {{ "%0.1f"|format(course.ratings.rating3) }}分

\ No newline at end of file diff --git a/app/Http/Desktop/Views/macros/consult.volt b/app/Http/Desktop/Views/macros/consult.volt new file mode 100644 index 00000000..fea654b5 --- /dev/null +++ b/app/Http/Desktop/Views/macros/consult.volt @@ -0,0 +1,9 @@ +{%- macro priority_info(value) %} + {% if value == 10 %} + + {% elseif value == 20 %} + + {% elseif value == 30 %} + + {% endif %} +{%- endmacro %} \ No newline at end of file diff --git a/app/Http/Desktop/Views/macros/group.volt b/app/Http/Desktop/Views/macros/group.volt index f4ca289b..33fa8905 100644 --- a/app/Http/Desktop/Views/macros/group.volt +++ b/app/Http/Desktop/Views/macros/group.volt @@ -1,9 +1,9 @@ {%- macro type_info(value) %} - {% if value == '1' %} + {% if value == 1 %} - {% elseif value == '2' %} + {% elseif value == 2 %} - {% elseif value == '3' %} + {% elseif value == 3 %} {% endif %} {%- endmacro %} \ No newline at end of file diff --git a/app/Http/Desktop/Views/my/consults.volt b/app/Http/Desktop/Views/my/consults.volt index 2ca3ba83..e77447f7 100644 --- a/app/Http/Desktop/Views/my/consults.volt +++ b/app/Http/Desktop/Views/my/consults.volt @@ -33,8 +33,8 @@ {% set delete_url = url({'for':'desktop.consult.delete','id':item.id}) %} -

提问:{{ item.question }}

-

回复:{{ item.answer }}

+

提问:{{ item.question }}

+

回复:{{ item.answer }}

{{ date('Y-m-d',item.create_time) }} diff --git a/app/Http/Desktop/Views/my/favorites.volt b/app/Http/Desktop/Views/my/favorites.volt index 6753e3c6..38019bb4 100644 --- a/app/Http/Desktop/Views/my/favorites.volt +++ b/app/Http/Desktop/Views/my/favorites.volt @@ -37,7 +37,7 @@ {{ item.title }} {{ model_info(item.model) }} {{ item.user_count }} {{ item.favorite_count }} - {{ item.rating }} + {{ "%0.1f"|format(item.rating) }} diff --git a/app/Http/Desktop/Views/my/friends.volt b/app/Http/Desktop/Views/my/friends.volt index adcc3b31..9b99c5de 100644 --- a/app/Http/Desktop/Views/my/friends.volt +++ b/app/Http/Desktop/Views/my/friends.volt @@ -44,7 +44,7 @@ {{ item.name }} {{ gender_info(item.gender) }} - {{ item.location }} + {{ item.area }} {{ item.active_time|time_ago }} diff --git a/app/Http/Desktop/Views/my/groups.volt b/app/Http/Desktop/Views/my/groups.volt index 4ccb47f6..f5e3a6f4 100644 --- a/app/Http/Desktop/Views/my/groups.volt +++ b/app/Http/Desktop/Views/my/groups.volt @@ -2,13 +2,7 @@ {% block content %} - {%- macro type_info(value) %} - {% if value == 'course' %} - - {% elseif value == 'chat' %} - - {% endif %} - {%- endmacro %} + {{ partial('macros/group') }} {% set joined_url = url({'for':'desktop.my.groups'},{'type':'joined'}) %} {% set owned_url = url({'for':'desktop.my.groups'},{'type':'owned'}) %} diff --git a/app/Http/Desktop/Views/my/groups_joined.volt b/app/Http/Desktop/Views/my/groups_joined.volt index aec66dac..fbe983fa 100644 --- a/app/Http/Desktop/Views/my/groups_joined.volt +++ b/app/Http/Desktop/Views/my/groups_joined.volt @@ -16,10 +16,11 @@ {% for item in pager.items %} + {% set show_url = url({'for':'desktop.group.show','id':item.id}) %} {% set owner_url = url({'for':'desktop.user.show','id':item.owner.id}) %} {% set delete_url = url({'for':'desktop.im.quit_group','id':item.id}) %} - {{ item.name }} {{ type_info(item.type) }} + {{ item.name }} {{ type_info(item.type) }} {{ item.owner.name }} {{ item.user_count }} diff --git a/app/Http/Desktop/Views/my/reviews.volt b/app/Http/Desktop/Views/my/reviews.volt index 799c5afb..544e65ca 100644 --- a/app/Http/Desktop/Views/my/reviews.volt +++ b/app/Http/Desktop/Views/my/reviews.volt @@ -36,9 +36,9 @@

评价:{{ item.content }}

-

内容实用:{{ item.rating1 }}

-

通俗易懂:{{ item.rating2 }}

-

逻辑清晰:{{ item.rating3 }}

+

内容实用:{{ "%0.1f"|format(item.rating1) }}

+

通俗易懂:{{ "%0.1f"|format(item.rating2) }}

+

逻辑清晰:{{ "%0.1f"|format(item.rating3) }}

diff --git a/app/Http/Desktop/Views/teaching/consults.volt b/app/Http/Desktop/Views/teaching/consults.volt index 1e7a72a8..811c0628 100644 --- a/app/Http/Desktop/Views/teaching/consults.volt +++ b/app/Http/Desktop/Views/teaching/consults.volt @@ -2,6 +2,8 @@ {% block content %} + {{ partial('macros/consult') }} + {% set status_types = {'all':'全部','pending':'待回复','replied':'已回复'} %} {% set status = request.get('status','trim','all') %} @@ -45,7 +47,7 @@

提问:{{ item.question }}

回复:{{ answer }}

- {{ item.priority }} + {{ priority_info(item.priority) }} {{ date('Y-m-d',item.create_time) }} diff --git a/app/Http/Desktop/Views/teaching/courses.volt b/app/Http/Desktop/Views/teaching/courses.volt index 4b696999..71b55dd0 100644 --- a/app/Http/Desktop/Views/teaching/courses.volt +++ b/app/Http/Desktop/Views/teaching/courses.volt @@ -37,7 +37,7 @@ {{ item.lesson_count }} {{ item.user_count }} {{ item.favorite_count }} - {{ item.rating }} + {{ "%0.1f"|format(item.rating) }} {% endfor %} diff --git a/app/Models/Consult.php b/app/Models/Consult.php index affeddaf..a790c650 100644 --- a/app/Models/Consult.php +++ b/app/Models/Consult.php @@ -56,6 +56,13 @@ class Consult extends Model */ public $answer; + /** + * 评分 + * + * @var int + */ + public $rating; + /** * 优先级 * diff --git a/app/Services/Frontend/Consult/ConsultInfo.php b/app/Services/Frontend/Consult/ConsultInfo.php index 3f889a04..bf6b00c2 100644 --- a/app/Services/Frontend/Consult/ConsultInfo.php +++ b/app/Services/Frontend/Consult/ConsultInfo.php @@ -27,8 +27,8 @@ class ConsultInfo extends FrontendService 'id' => $consult->id, 'question' => $consult->question, 'answer' => $consult->answer, - 'private' => $consult->private, 'rating' => $consult->rating, + 'private' => $consult->private, 'like_count' => $consult->like_count, 'create_time' => $consult->create_time, 'update_time' => $consult->update_time, diff --git a/db/migrations/20200827112717_insert_setting_data.php b/db/migrations/20200827112717_insert_setting_data.php index 955feb10..2f677fca 100644 --- a/db/migrations/20200827112717_insert_setting_data.php +++ b/db/migrations/20200827112717_insert_setting_data.php @@ -82,52 +82,52 @@ final class InsertSettingData extends AbstractMigration ], [ 'section' => 'live.push', - 'item_key' => 'push_auth_enabled', + 'item_key' => 'auth_enabled', 'item_value' => '1', ], [ 'section' => 'live.push', - 'item_key' => 'push_auth_key', + 'item_key' => 'auth_key', 'item_value' => '', ], [ 'section' => 'live.push', - 'item_key' => 'push_auth_delta', + 'item_key' => 'auth_delta', 'item_value' => '18000', ], [ 'section' => 'live.pull', - 'item_key' => 'pull_protocol', + 'item_key' => 'protocol', 'item_value' => 'http', ], [ 'section' => 'live.pull', - 'item_key' => 'pull_domain', + 'item_key' => 'domain', 'item_value' => '', ], [ 'section' => 'live.pull', - 'item_key' => 'pull_trans_enabled', + 'item_key' => 'trans_enabled', 'item_value' => '0', ], [ 'section' => 'live.pull', - 'item_key' => 'pull_auth_enabled', + 'item_key' => 'auth_enabled', 'item_value' => '1', ], [ 'section' => 'live.pull', - 'item_key' => 'pull_auth_key', + 'item_key' => 'auth_key', 'item_value' => '', ], [ 'section' => 'live.pull', - 'item_key' => 'pull_auth_delta', + 'item_key' => 'auth_delta', 'item_value' => '18000', ], [ 'section' => 'live.notify', - 'item_key' => 'pull_auth_key', + 'item_key' => 'auth_key', 'item_value' => '', ], [ diff --git a/public/static/desktop/css/common.css b/public/static/desktop/css/common.css index 25a59b98..7454b7f8 100644 --- a/public/static/desktop/css/common.css +++ b/public/static/desktop/css/common.css @@ -73,6 +73,7 @@ } .pager { + margin-top: 20px; text-align: center; }