用户头像 |
用户昵称 |
- 所在地区 |
- 用户性别 |
用户角色 |
+ 课程 |
+ 文章 |
+ 收藏 |
活跃时间 |
注册时间 |
操作 |
@@ -54,15 +56,24 @@
|
- {{ item.name }}({{ item.id }}){{ status_info(item) }} |
- {{ item.area }} |
- {{ gender_info(item.gender) }} |
+
+
+ {{ item.name }}({{ item.id }}){{ status_info(item) }}
+
+
+ 性别:{{ gender_info(item.gender) }}
+ 地区:{{ item.area|default('N/A') }}
+
+ |
教学:{{ edu_role_info(item.edu_role) }}
后台:{{ admin_role_info(item.admin_role) }}
|
- {{ date('Y-m-d H:i:s',item.active_time) }} |
- {{ date('Y-m-d H:i:s',item.create_time) }} |
+ {{ item.course_count }} |
+ {{ item.article_count }} |
+ {{ item.favorite_count }} |
+ {{ date('Y-m-d',item.active_time) }} |
+ {{ date('Y-m-d',item.create_time) }} |
diff --git a/app/Http/Home/Controllers/CommentController.php b/app/Http/Home/Controllers/CommentController.php
new file mode 100644
index 00000000..4d11ee38
--- /dev/null
+++ b/app/Http/Home/Controllers/CommentController.php
@@ -0,0 +1,144 @@
+handle();
+
+ $pager->target = 'comment-list';
+
+ $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
+
+ $this->view->setVar('pager', $pager);
+ }
+
+ /**
+ * @Get("/{id:[0-9]+}/replies", name="home.comment.replies")
+ */
+ public function repliesAction($id)
+ {
+ $service = new ReplyListService();
+
+ $pager = $service->handle($id);
+
+ $pager->target = "reply-list-{$id}";
+
+ $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
+
+ $this->view->setVar('pager', $pager);
+ }
+
+ /**
+ * @Get("/{id:[0-9]+}/info", name="home.comment.info")
+ */
+ public function infoAction($id)
+ {
+ $service = new CommentInfoService();
+
+ $comment = $service->handle($id);
+
+ $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
+
+ $this->view->setVar('comment', $comment);
+ }
+
+ /**
+ * @Get("/add", name="home.comment.add")
+ */
+ public function addAction()
+ {
+
+ }
+
+ /**
+ * @Get("/{id:[0-9]+}/reply", name="home.comment.reply")
+ */
+ public function replyAction($id)
+ {
+ $service = new CommentInfoService();
+
+ $comment = $service->handle($id);
+
+ $this->view->setVar('comment', $comment);
+ }
+
+ /**
+ * @Post("/create", name="home.comment.create")
+ */
+ public function createAction()
+ {
+ $service = new CommentCreateService();
+
+ $comment = $service->handle();
+
+ $service = new CommentInfoService();
+
+ $comment = $service->handle($comment->id);
+
+ return $this->jsonSuccess(['comment' => $comment]);
+ }
+
+ /**
+ * @Post("/{id:[0-9]+}/reply", name="home.comment.create_reply")
+ */
+ public function createReplyAction($id)
+ {
+ $service = new CommentReplyService();
+
+ $comment = $service->handle($id);
+
+ $service = new CommentInfoService();
+
+ $comment = $service->handle($comment->id);
+
+ return $this->jsonSuccess(['comment' => $comment]);
+ }
+
+ /**
+ * @Post("/{id:[0-9]+}/like", name="home.comment.like")
+ */
+ public function likeAction($id)
+ {
+ $service = new CommentLikeService();
+
+ $data = $service->handle($id);
+
+ $msg = $data['action'] == 'do' ? '点赞成功' : '取消点赞成功';
+
+ return $this->jsonSuccess(['data' => $data, 'msg' => $msg]);
+ }
+
+ /**
+ * @Post("/{id:[0-9]+}/delete", name="home.comment.delete")
+ */
+ public function deleteAction($id)
+ {
+ $service = new CommentDeleteService();
+
+ $service->handle($id);
+
+ return $this->jsonSuccess(['msg' => '删除评论成功']);
+ }
+
+}
diff --git a/app/Http/Home/Controllers/PackageController.php b/app/Http/Home/Controllers/PackageController.php
index 12a7f513..a879cde6 100644
--- a/app/Http/Home/Controllers/PackageController.php
+++ b/app/Http/Home/Controllers/PackageController.php
@@ -12,6 +12,20 @@ use Phalcon\Mvc\View;
class PackageController extends Controller
{
+ /**
+ * @Get("/{id:[0-9]+}", name="home.package.show")
+ */
+ public function showAction($id)
+ {
+ $service = new PackageInfoService();
+
+ $package = $service->handle($id);
+
+ $this->seo->prependTitle(['套餐', $package['title']]);
+
+ $this->view->setVar('package', $package);
+ }
+
/**
* @Get("/{id:[0-9]+}/info", name="home.package.info")
*/
diff --git a/app/Http/Home/Controllers/PublicController.php b/app/Http/Home/Controllers/PublicController.php
index c37faf2f..e1363c8e 100644
--- a/app/Http/Home/Controllers/PublicController.php
+++ b/app/Http/Home/Controllers/PublicController.php
@@ -2,6 +2,7 @@
namespace App\Http\Home\Controllers;
+use App\Http\Home\Services\ShareUrl as ShareUrlService;
use App\Library\CsrfToken as CsrfTokenService;
use App\Repos\Upload as UploadRepo;
use App\Services\LiveNotify as LiveNotifyService;
@@ -43,6 +44,22 @@ class PublicController extends \Phalcon\Mvc\Controller
}
}
+ /**
+ * @Get("/share", name="home.share")
+ */
+ public function shareAction()
+ {
+ $id = $this->request->getQuery('id', 'int', 0);
+ $type = $this->request->getQuery('type', 'string', 'course');
+ $referer = $this->request->getQuery('referer', 'int', 0);
+
+ $service = new ShareUrlService();
+
+ $location = $service->handle($id, $type, $referer);
+
+ return $this->response->redirect($location, true);
+ }
+
/**
* @Get("/qrcode", name="home.qrcode")
*/
diff --git a/app/Http/Home/Services/ShareUrl.php b/app/Http/Home/Services/ShareUrl.php
new file mode 100644
index 00000000..134f0989
--- /dev/null
+++ b/app/Http/Home/Services/ShareUrl.php
@@ -0,0 +1,159 @@
+webBaseUrl = $this->getWebBaseUrl();
+ $this->h5BaseUrl = $this->getH5BaseUrl();
+ }
+
+ public function handle($id, $type, $referer = 0)
+ {
+ if ($type == 'article') {
+ $result = $this->getArticleUrl($id, $referer);
+ } elseif ($type == 'course') {
+ $result = $this->getCourseUrl($id, $referer);
+ } elseif ($type == 'chapter') {
+ $result = $this->getChapterUrl($id, $referer);
+ } elseif ($type == 'package') {
+ $result = $this->getPackageUrl($id, $referer);
+ } elseif ($type == 'vip') {
+ $result = $this->getVipUrl($id, $referer);
+ } elseif ($type == 'user') {
+ $result = $this->getUserUrl($id, $referer);
+ } else {
+ $result = $this->getHomeUrl($referer);
+ }
+
+ return $this->h5Enabled() ? $result['h5'] : $result['web'];
+ }
+
+ public function getHomeUrl($referer = 0)
+ {
+ $webUrl = sprintf('%s?referer=%s', $this->webBaseUrl, $referer);
+
+ $h5Url = sprintf('%s?referer=%s', $this->h5BaseUrl, $referer);
+
+ return ['web' => $webUrl, 'h5' => $h5Url];
+ }
+
+ public function getArticleUrl($id, $referer = 0)
+ {
+ $route = $this->url->get(
+ ['for' => 'home.article.show', 'id' => $id],
+ ['referer' => $referer]
+ );
+
+ $webUrl = $this->webBaseUrl . $route;
+
+ $h5Url = sprintf('%s/article/info?id=%s&referer=%s', $this->h5BaseUrl, $id, $referer);
+
+ return ['web' => $webUrl, 'h5' => $h5Url];
+ }
+
+ public function getCourseUrl($id, $referer = 0)
+ {
+ $route = $this->url->get(
+ ['for' => 'home.course.show', 'id' => $id],
+ ['referer' => $referer]
+ );
+
+ $webUrl = $this->webBaseUrl . $route;
+
+ $h5Url = sprintf('%s/course/info?id=%s&referer=%s', $this->h5BaseUrl, $id, $referer);
+
+ return ['web' => $webUrl, 'h5' => $h5Url];
+ }
+
+ public function getChapterUrl($id, $referer = 0)
+ {
+ $route = $this->url->get(
+ ['for' => 'home.chapter.show', 'id' => $id],
+ ['referer' => $referer]
+ );
+
+ $webUrl = $this->webBaseUrl . $route;
+
+ $h5Url = sprintf('%s/chapter/info?id=%s&referer=%s', $this->h5BaseUrl, $id, $referer);
+
+ return ['web' => $webUrl, 'h5' => $h5Url];
+ }
+
+ public function getPackageUrl($id, $referer = 0)
+ {
+ $route = $this->url->get(
+ ['for' => 'home.package.show', 'id' => $id],
+ ['referer' => $referer]
+ );
+
+ $webUrl = $this->webBaseUrl . $route;
+
+ $h5Url = sprintf('%s/package/info?id=%s&referer=%s', $this->h5BaseUrl, $id, $referer);
+
+ return ['web' => $webUrl, 'h5' => $h5Url];
+ }
+
+ public function getUserUrl($id, $referer = 0)
+ {
+ $route = $this->url->get(
+ ['for' => 'home.user.show', 'id' => $id],
+ ['referer' => $referer]
+ );
+
+ $webUrl = $this->webBaseUrl . $route;
+
+ $h5Url = sprintf('%s/user/index?id=%s&referer=%s', $this->h5BaseUrl, $id, $referer);
+
+ return ['web' => $webUrl, 'h5' => $h5Url];
+ }
+
+ public function getVipUrl($id, $referer = 0)
+ {
+ $route = $this->url->get(
+ ['for' => 'home.vip.index'],
+ ['id' => $id, 'referer' => $referer]
+ );
+
+ $webUrl = $this->webBaseUrl . $route;
+
+ $h5Url = sprintf('%s/vip/index?id=%s&referer=%s', $this->h5BaseUrl, $id, $referer);
+
+ return ['web' => $webUrl, 'h5' => $h5Url];
+ }
+
+ protected function h5Enabled()
+ {
+ $file = public_path('h5/index.html');
+
+ return file_exists($file);
+ }
+
+ protected function getWebBaseUrl()
+ {
+ return kg_site_url();
+ }
+
+ protected function getH5BaseUrl()
+ {
+ return sprintf('%s/h5/#/pages', kg_site_url());
+ }
+
+}
diff --git a/app/Http/Home/Views/article/comment.volt b/app/Http/Home/Views/article/comment.volt
new file mode 100644
index 00000000..91731085
--- /dev/null
+++ b/app/Http/Home/Views/article/comment.volt
@@ -0,0 +1,21 @@
+{% set item_type = 2 %}
+{% set comment_list_url = url({'for':'home.comment.list'},{'item_id':article.id,'item_type':item_type}) %}
+{% set comment_create_url = url({'for':'home.comment.create'}) %}
+{% set submit_class = auth_user.id > 0 ? 'layui-btn layui-btn-sm' : 'layui-btn layui-btn-sm layui-btn-disabled' %}
+
+
+
+
\ No newline at end of file
diff --git a/app/Http/Home/Views/article/show.volt b/app/Http/Home/Views/article/show.volt
index 90027ca8..97de06a6 100644
--- a/app/Http/Home/Views/article/show.volt
+++ b/app/Http/Home/Views/article/show.volt
@@ -4,52 +4,27 @@
{{ partial('macros/article') }}
- {% set list_url = url({'for':'home.article.list'}) %}
- {% set category_url = url({'for':'home.article.list'},{'category_id':article.category.id}) %}
+ {% set article_list_url = url({'for':'home.article.list'}) %}
+ {% set related_article_url = url({'for':'home.article.related','id':article.id}) %}
{% set owner_url = url({'for':'home.user.show','id':article.owner.id}) %}
- {% set favorite_url = url({'for':'home.article.favorite','id':article.id}) %}
- {% set like_url = url({'for':'home.article.like','id':article.id}) %}
- {% set favorited_class = article.me.favorited ? 'layui-icon-star-fill' : 'layui-icon-star' %}
- {% set liked_class = article.me.liked ? 'active' : '' %}
- {% set article.owner.title = article.owner.title ? article.owner.title : '默默无名' %}
-
-
-
-
-
-
- {{ article.like_count }}
-
-
-
-
-
- {{ article.comment_count }}
-
-
-
-
-
- {{ article.favorite_count }}
-
+
+ {{ partial('article/sticky') }}
-
{{ article.title }}
@@ -60,7 +35,7 @@
{{ article.view_count }} 阅读
{{ article.word_count }} 字数
- {{ article.create_time|time_ago }}
+ {{ article.create_time|time_ago }}
{{ article.content }}
{% if article.tags %}
@@ -79,18 +54,15 @@
{% endif %}
-
-
- {% set related_article_url = url({'for':'home.article.related','id':article.id}) %}
-
@@ -112,10 +84,9 @@
-
- {% set share_url = full_url({'for':'home.article.show','id':article.id}) %}
+ {% set share_url = full_url({'for':'home.share'},{'id':article.id,'type':'article','referer':auth_user.id}) %}
{% set qrcode_url = url({'for':'home.qrcode'},{'text':share_url}) %}
@@ -137,5 +108,6 @@
{{ js_include('home/js/article.show.js') }}
{{ js_include('home/js/article.share.js') }}
+ {{ js_include('home/js/comment.js') }}
{% endblock %}
\ No newline at end of file
diff --git a/app/Http/Home/Views/article/sticky.volt b/app/Http/Home/Views/article/sticky.volt
new file mode 100644
index 00000000..50be63ab
--- /dev/null
+++ b/app/Http/Home/Views/article/sticky.volt
@@ -0,0 +1,27 @@
+{% set favorite_url = url({'for':'home.article.favorite','id':article.id}) %}
+{% set like_url = url({'for':'home.article.like','id':article.id}) %}
+{% set favorite_title = article.me.favorited == 1 ? '取消收藏' : '收藏文章' %}
+{% set like_title = article.me.liked == 1 ? '取消点赞' : '点赞支持' %}
+{% set favorite_class = article.me.favorited == 1 ? 'layui-icon-star-fill' : 'layui-icon-star' %}
+{% set like_class = article.me.liked == 1 ? 'active' : '' %}
+
+
\ No newline at end of file
diff --git a/app/Http/Home/Views/chapter/comment.volt b/app/Http/Home/Views/chapter/comment.volt
new file mode 100644
index 00000000..35a0f786
--- /dev/null
+++ b/app/Http/Home/Views/chapter/comment.volt
@@ -0,0 +1,20 @@
+{% set item_type = 1 %}
+{% set comment_list_url = url({'for':'home.comment.list'},{'item_id':chapter.id,'item_type':item_type}) %}
+{% set comment_create_url = url({'for':'home.comment.create'}) %}
+
+
+
+
\ No newline at end of file
diff --git a/app/Http/Home/Views/chapter/live/active.volt b/app/Http/Home/Views/chapter/live/active.volt
index 26a8f398..da9fb90a 100644
--- a/app/Http/Home/Views/chapter/live/active.volt
+++ b/app/Http/Home/Views/chapter/live/active.volt
@@ -2,16 +2,12 @@
{% block content %}
- {% set full_chapter_url = full_url({'for':'home.chapter.show','id':chapter.id}) %}
{% set course_url = url({'for':'home.course.show','id':chapter.course.id}) %}
- {% set resources_url = url({'for':'home.chapter.resources','id':chapter.id}) %}
{% set learning_url = url({'for':'home.chapter.learning','id':chapter.id}) %}
{% set live_chats_url = url({'for':'home.live.chats','id':chapter.id}) %}
{% set live_stats_url = url({'for':'home.live.stats','id':chapter.id}) %}
{% set send_msg_url = url({'for':'home.live.send_msg','id':chapter.id}) %}
{% set bind_user_url = url({'for':'home.live.bind_user','id':chapter.id}) %}
- {% set like_url = url({'for':'home.chapter.like','id':chapter.id}) %}
- {% set qrcode_url = url({'for':'home.qrcode'},{'text':full_chapter_url}) %}
+
+ {{ partial('chapter/live/sticky') }}
+
+ {% set share_url = full_url({'for':'home.share'},{'id':chapter.id,'type':'chapter','referer':auth_user.id}) %}
+ {% set qrcode_url = url({'for':'home.qrcode'},{'text':share_url}) %}
+
-
+
@@ -77,7 +74,7 @@
{{ js_include('https://imgcache.qq.com/open/qcloud/video/vcplayer/TcPlayer-2.3.3.js', false) }}
{{ js_include('home/js/chapter.live.player.js') }}
{{ js_include('home/js/chapter.live.chat.js') }}
- {{ js_include('home/js/chapter.action.js') }}
+ {{ js_include('home/js/chapter.show.js') }}
{{ js_include('home/js/course.share.js') }}
{% endblock %}
\ No newline at end of file
diff --git a/app/Http/Home/Views/chapter/live/sticky.volt b/app/Http/Home/Views/chapter/live/sticky.volt
new file mode 100644
index 00000000..52479690
--- /dev/null
+++ b/app/Http/Home/Views/chapter/live/sticky.volt
@@ -0,0 +1,27 @@
+{% set download_url = url({'for':'home.chapter.resources','id':chapter.id}) %}
+{% set like_url = url({'for':'home.chapter.like','id':chapter.id}) %}
+{% set like_title = chapter.me.liked == 1 ? '取消点赞' : '点赞支持' %}
+{% set like_class = chapter.me.liked == 1 ? 'active' : '' %}
+
+
\ No newline at end of file
diff --git a/app/Http/Home/Views/chapter/read.volt b/app/Http/Home/Views/chapter/read.volt
index ee858df5..81d10d44 100644
--- a/app/Http/Home/Views/chapter/read.volt
+++ b/app/Http/Home/Views/chapter/read.volt
@@ -2,13 +2,8 @@
{% block content %}
- {% set full_chapter_url = full_url({'for':'home.chapter.show','id':chapter.id}) %}
{% set course_url = url({'for':'home.course.show','id':chapter.course.id}) %}
- {% set resources_url = url({'for':'home.chapter.resources','id':chapter.id}) %}
{% set learning_url = url({'for':'home.chapter.learning','id':chapter.id}) %}
- {% set like_url = url({'for':'home.chapter.like','id':chapter.id}) %}
- {% set consult_url = url({'for':'home.consult.add'},{'chapter_id':chapter.id}) %}
- {% set qrcode_url = url({'for':'home.qrcode'},{'text':full_chapter_url}) %}
+
+ {{ partial('chapter/sticky') }}
+
{{ chapter.content }}
+
+
+ {% set share_url = full_url({'for':'home.share'},{'id':chapter.id,'type':'chapter','referer':auth_user.id}) %}
+ {% set qrcode_url = url({'for':'home.qrcode'},{'text':share_url}) %}
+
-
+
@@ -66,6 +63,7 @@
{{ js_include('home/js/markdown.preview.js') }}
{{ js_include('home/js/course.share.js') }}
{{ js_include('home/js/chapter.read.js') }}
- {{ js_include('home/js/chapter.action.js') }}
+ {{ js_include('home/js/chapter.show.js') }}
+ {{ js_include('home/js/comment.js') }}
{% endblock %}
\ No newline at end of file
diff --git a/app/Http/Home/Views/chapter/sticky.volt b/app/Http/Home/Views/chapter/sticky.volt
new file mode 100644
index 00000000..cc4c20b3
--- /dev/null
+++ b/app/Http/Home/Views/chapter/sticky.volt
@@ -0,0 +1,42 @@
+{% set download_url = url({'for':'home.chapter.resources','id':chapter.id}) %}
+{% set consult_url = url({'for':'home.consult.add'},{'chapter_id':chapter.id}) %}
+{% set like_url = url({'for':'home.chapter.like','id':chapter.id}) %}
+{% set like_title = chapter.me.liked == 1 ? '取消点赞' : '点赞支持' %}
+{% set like_class = chapter.me.liked == 1 ? 'active' : '' %}
+
+
\ No newline at end of file
diff --git a/app/Http/Home/Views/chapter/vod.volt b/app/Http/Home/Views/chapter/vod.volt
index 4e10cb46..10e69f46 100644
--- a/app/Http/Home/Views/chapter/vod.volt
+++ b/app/Http/Home/Views/chapter/vod.volt
@@ -2,14 +2,8 @@
{% block content %}
- {% set full_chapter_url = full_url({'for':'home.chapter.show','id':chapter.id}) %}
{% set course_url = url({'for':'home.course.show','id':chapter.course.id}) %}
- {% set resources_url = url({'for':'home.chapter.resources','id':chapter.id}) %}
{% set learning_url = url({'for':'home.chapter.learning','id':chapter.id}) %}
- {% set like_url = url({'for':'home.chapter.like','id':chapter.id}) %}
- {% set qrcode_url = url({'for':'home.qrcode'},{'text':full_chapter_url}) %}
- {% set consult_url = url({'for':'home.consult.add'},{'chapter_id':chapter.id}) %}
- {% set liked_class = chapter.me.liked ? 'active' : '' %}
+
+ {{ partial('chapter/sticky') }}
+
+ {% set share_url = full_url({'for':'home.share'},{'id':chapter.id,'type':'chapter','referer':auth_user.id}) %}
+ {% set qrcode_url = url({'for':'home.qrcode'},{'text':share_url}) %}
+
-
+
@@ -63,7 +59,8 @@
{{ js_include('https://imgcache.qq.com/open/qcloud/video/vcplayer/TcPlayer-2.3.3.js', false) }}
{{ js_include('home/js/course.share.js') }}
- {{ js_include('home/js/chapter.action.js') }}
+ {{ js_include('home/js/chapter.show.js') }}
{{ js_include('home/js/chapter.vod.player.js') }}
+ {{ js_include('home/js/comment.js') }}
{% endblock %}
\ No newline at end of file
diff --git a/app/Http/Home/Views/comment/info.volt b/app/Http/Home/Views/comment/info.volt
new file mode 100644
index 00000000..f64a65fd
--- /dev/null
+++ b/app/Http/Home/Views/comment/info.volt
@@ -0,0 +1,63 @@
+{% set owner_url = url({'for':'home.user.show','id':comment.owner.id}) %}
+{% set delete_url = url({'for':'home.comment.delete','id':comment.id}) %}
+
+{% if comment.parent_id == 0 %}
+
+{% endif %}
+
+{% if comment.parent_id > 0 %}
+
+{% endif %}
diff --git a/app/Http/Home/Views/comment/list.volt b/app/Http/Home/Views/comment/list.volt
new file mode 100644
index 00000000..15f853bb
--- /dev/null
+++ b/app/Http/Home/Views/comment/list.volt
@@ -0,0 +1,70 @@
+{% if pager.total_pages > 0 %}
+ {% for item in pager.items %}
+ {% set owner_url = url({'for':'home.user.show','id':item.owner.id}) %}
+ {% set like_url = url({'for':'home.comment.like','id':item.id}) %}
+ {% set delete_url = url({'for':'home.comment.delete','id':item.id}) %}
+ {% set reply_create_url = url({'for':'home.comment.create_reply','id':item.id}) %}
+ {% set reply_list_url = url({'for':'home.comment.replies','id':item.id},{'limit':5}) %}
+
+ {% endfor %}
+ {{ partial('partials/pager_ajax') }}
+{% endif %}
\ No newline at end of file
diff --git a/app/Http/Home/Views/comment/replies.volt b/app/Http/Home/Views/comment/replies.volt
new file mode 100644
index 00000000..4b05ab1b
--- /dev/null
+++ b/app/Http/Home/Views/comment/replies.volt
@@ -0,0 +1,69 @@
+{% if pager.total_pages > 0 %}
+ {% for item in pager.items %}
+ {% set owner_url = url({'for':'home.user.show','id':item.owner.id}) %}
+ {% set like_url = url({'for':'home.comment.like','id':item.id}) %}
+ {% set delete_url = url({'for':'home.comment.delete','id':item.id}) %}
+ {% set reply_create_url = url({'for':'home.comment.create_reply','id':item.id}) %}
+
+ {% endfor %}
+ {{ partial('partials/pager_ajax') }}
+{% endif %}
\ No newline at end of file
diff --git a/app/Http/Home/Views/comment/reply.volt b/app/Http/Home/Views/comment/reply.volt
new file mode 100644
index 00000000..6143f829
--- /dev/null
+++ b/app/Http/Home/Views/comment/reply.volt
@@ -0,0 +1,19 @@
+{% extends 'templates/layer.volt' %}
+
+{% block content %}
+
+{% endblock %}
+
+{% block include_js %}
+
+ {{ js_include('home/js/comment.js') }}
+
+{% endblock %}
\ No newline at end of file
diff --git a/app/Http/Home/Views/course/consults.volt b/app/Http/Home/Views/course/consults.volt
index e1806cb4..9043c915 100644
--- a/app/Http/Home/Views/course/consults.volt
+++ b/app/Http/Home/Views/course/consults.volt
@@ -5,7 +5,7 @@
{% set owner_url = url({'for':'home.user.show','id':item.owner.id}) %}
{% set consult_url = url({'for':'home.consult.show','id':item.id}) %}
{% set like_url = url({'for':'home.consult.like','id':item.id}) %}
-
+
diff --git a/app/Http/Home/Views/course/reviews.volt b/app/Http/Home/Views/course/reviews.volt
index 31b24ebb..52235a7f 100644
--- a/app/Http/Home/Views/course/reviews.volt
+++ b/app/Http/Home/Views/course/reviews.volt
@@ -5,7 +5,7 @@
{% for item in pager.items %}
{% set owner_url = url({'for':'home.user.show','id':item.owner.id}) %}
{% set like_url = url({'for':'home.review.like','id':item.id}) %}
-
+
diff --git a/app/Http/Home/Views/course/show.volt b/app/Http/Home/Views/course/show.volt
index e10584ed..0c65df54 100644
--- a/app/Http/Home/Views/course/show.volt
+++ b/app/Http/Home/Views/course/show.volt
@@ -4,13 +4,6 @@
{{ partial('macros/course') }}
- {% set favorite_title = course.me.favorited ? '取消收藏' : '收藏课程' %}
- {% set favorite_star = course.me.favorited ? 'layui-icon-star-fill' : 'layui-icon-star' %}
- {% set full_course_url = full_url({'for':'home.course.show','id':course.id}) %}
- {% set favorite_url = url({'for':'home.course.favorite','id':course.id}) %}
- {% set consult_url = url({'for':'home.consult.add'},{'course_id':course.id}) %}
- {% set qrcode_url = url({'for':'home.qrcode'},{'text':full_course_url}) %}
-
首页
@@ -18,11 +11,7 @@
{{ course.title }}
-
- {% if course.market_price > 0 %}
-
- {% endif %}
-
+
@@ -32,6 +21,10 @@
+
+ {{ partial('course/sticky') }}
+
+
{% set show_tab_chapters = course.lesson_count > 0 %}
{% set show_tab_packages = course.package_count > 0 %}
{% set show_tab_consults = course.consult_count > 0 %}
@@ -101,10 +94,13 @@
+ {% set share_url = full_url({'for':'home.share'},{'id':course.id,'type':'course','referer':auth_user.id}) %}
+ {% set qrcode_url = url({'for':'home.qrcode'},{'text':share_url}) %}
+
-
+
diff --git a/app/Http/Home/Views/course/show_teacher.volt b/app/Http/Home/Views/course/show_teacher.volt
index 8f1872d2..0f4db10e 100644
--- a/app/Http/Home/Views/course/show_teacher.volt
+++ b/app/Http/Home/Views/course/show_teacher.volt
@@ -5,7 +5,6 @@
{% for teacher in course.teachers %}
{% set teacher_url = url({'for':'home.user.show','id':teacher.id}) %}
- {% set teacher.title = teacher.title ? teacher.title : '小小教书匠' %}
{% endfor %}
diff --git a/app/Http/Home/Views/course/sticky.volt b/app/Http/Home/Views/course/sticky.volt
new file mode 100644
index 00000000..8cc9e637
--- /dev/null
+++ b/app/Http/Home/Views/course/sticky.volt
@@ -0,0 +1,33 @@
+{% set consult_url = url({'for':'home.consult.add'},{'course_id':course.id}) %}
+{% set favorite_url = url({'for':'home.course.favorite','id':course.id}) %}
+{% set favorite_title = course.me.favorited == 1 ? '取消收藏' : '收藏课程' %}
+{% set favorite_class = course.me.favorited == 1 ? 'layui-icon-star-fill' : 'layui-icon-star' %}
+
+
\ No newline at end of file
diff --git a/app/Http/Home/Views/im/group/active_users.volt b/app/Http/Home/Views/im/group/active_users.volt
index a9250629..683f6cb7 100644
--- a/app/Http/Home/Views/im/group/active_users.volt
+++ b/app/Http/Home/Views/im/group/active_users.volt
@@ -4,7 +4,6 @@
{% for user in users %}
{% set user_url = url({'for':'home.user.show','id':user.id}) %}
- {% set user.title = user.title ? user.title : '暂露头角' %}
{% endfor %}
diff --git a/app/Http/Home/Views/im/group/manage_users.volt b/app/Http/Home/Views/im/group/manage_users.volt
index d84cb390..8da3b8a2 100644
--- a/app/Http/Home/Views/im/group/manage_users.volt
+++ b/app/Http/Home/Views/im/group/manage_users.volt
@@ -28,7 +28,6 @@
{% for item in pager.items %}
{% set user_url = url({'for':'home.user.show','id':item.user.id}) %}
{% set delete_url = url({'for':'home.im_group_user.delete'},{'group_id':group.id,'user_id':item.user.id}) %}
- {% set is_owner = item.user.id == group.owner.id ? 1 : 0 %}
@@ -38,7 +37,7 @@
| {{ gender_info(item.user.gender) }} |
{{ date('Y-m-d H:i:s',item.create_time) }} |
- {% if is_owner == 0 %}
+ {% if item.user.id == group.owner.id %}
{% else %}
diff --git a/app/Http/Home/Views/im/group/pager.volt b/app/Http/Home/Views/im/group/pager.volt
index d6027450..aa1f6209 100644
--- a/app/Http/Home/Views/im/group/pager.volt
+++ b/app/Http/Home/Views/im/group/pager.volt
@@ -5,7 +5,6 @@
{% for item in pager.items %}
{% set group_url = url({'for':'home.im_group.show','id':item.id}) %}
- {% set item.about = item.about ? item.about : '这家伙真懒,什么都没留下!' %}
{{ type_info(item.type) }}
diff --git a/app/Http/Home/Views/im/group/show.volt b/app/Http/Home/Views/im/group/show.volt
index dd3dcde0..845db2c2 100644
--- a/app/Http/Home/Views/im/group/show.volt
+++ b/app/Http/Home/Views/im/group/show.volt
@@ -2,7 +2,6 @@
{% block content %}
- {% set group.about = group.about ? group.about : '这个家伙真懒,什么都没有留下~' %}
{% set users_url = url({'for':'home.im_group.users','id':group.id}) %}
{% set active_users_url = url({'for':'home.im_group.active_users','id':group.id}) %}
@@ -18,7 +17,7 @@
- {{ group.about }}
+ {{ group.about|default('这个家伙真懒,什么都没有留下') }}
diff --git a/app/Http/Home/Views/im/group/show_owner.volt b/app/Http/Home/Views/im/group/show_owner.volt
index 937cf80b..743bb5a5 100644
--- a/app/Http/Home/Views/im/group/show_owner.volt
+++ b/app/Http/Home/Views/im/group/show_owner.volt
@@ -1,5 +1,4 @@
{% set owner_url = url({'for':'home.user.show','id':group.owner.id}) %}
-{% set group.owner.title = group.owner.title ? group.owner.title : '暂无头衔' %}
@@ -12,7 +11,7 @@
- {{ group.owner.title }}
+ {{ group.owner.title|default('暂露头角') }}
diff --git a/app/Http/Home/Views/im/group/users.volt b/app/Http/Home/Views/im/group/users.volt
index 02c3c0ed..7bbb42c1 100644
--- a/app/Http/Home/Views/im/group/users.volt
+++ b/app/Http/Home/Views/im/group/users.volt
@@ -2,7 +2,6 @@
{% for item in pager.items %}
{% set user_url = url({'for':'home.user.show','id':item.id}) %}
- {% set item.user.title = item.user.title ? item.user.title : '暂露头角' %}
{% set avatar_class = item.user.vip == 1 ? 'avatar vip' : 'avatar' %}
@@ -14,7 +13,7 @@
- {{ item.user.title }}
+ {{ item.user.title|default('暂露头角') }}
添加好友
diff --git a/app/Http/Home/Views/im/index_groups.volt b/app/Http/Home/Views/im/index_groups.volt
index 1ffe1b6e..e3eb3bc8 100644
--- a/app/Http/Home/Views/im/index_groups.volt
+++ b/app/Http/Home/Views/im/index_groups.volt
@@ -2,7 +2,6 @@
{% for group in groups %}
{% set group_url = url({'for':'home.im_group.show','id':group.id}) %}
- {% set group.about = group.about ? group.about : '这家伙真懒,什么都没留下!' %}
{{ type_info(group.type) }}
diff --git a/app/Http/Home/Views/im/index_users.volt b/app/Http/Home/Views/im/index_users.volt
index 9d97281c..0734435a 100644
--- a/app/Http/Home/Views/im/index_users.volt
+++ b/app/Http/Home/Views/im/index_users.volt
@@ -1,8 +1,6 @@
{% for user in users %}
- {% set user.title = user.title ? user.title : '暂露头角' %}
- {% set user.about = user.about ? user.about : '这个人很懒,什么都没留下' %}
{% set user_url = url({'for':'home.user.show','id':user.id}) %}
{% set avatar_class = user.vip == 1 ? 'avatar vip' : 'avatar' %}
@@ -15,7 +13,7 @@
- {{ user.title }}
+ {{ user.title|default('暂露头角') }}
添加好友
diff --git a/app/Http/Home/Views/search/article.volt b/app/Http/Home/Views/search/article.volt
index 5776259a..a363d625 100644
--- a/app/Http/Home/Views/search/article.volt
+++ b/app/Http/Home/Views/search/article.volt
@@ -11,7 +11,7 @@
| |