.
@ -36,6 +36,7 @@ public class FlyConfig extends JFinalConfig {
|
||||
me.setBaseTemplatePath(PathKit.getWebRootPath());
|
||||
|
||||
me.addSharedFunction("/WEB-INF/_t/layout.html");
|
||||
me.addSharedObject("lxyKit", new LxyKit());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
123
src/main/java/com/lxyer/config/JsonBean.java
Normal file
@ -0,0 +1,123 @@
|
||||
package com.lxyer.config;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by Lxyer lxy208@126.com at 2016/8/4 0:13.
|
||||
*/
|
||||
public class JsonBean {
|
||||
public int code;//全局状态码: -1失败,1成功,2未登录
|
||||
public String msg;
|
||||
public Object obj;
|
||||
|
||||
public JsonBean(int code){
|
||||
this.code = code;
|
||||
if (code == 1)
|
||||
this.msg = "操作成功";
|
||||
if (code == -1)
|
||||
this.msg = "操作失败";
|
||||
if (code == 2)
|
||||
this.msg = "未登录,请前往登录";
|
||||
}
|
||||
|
||||
public JsonBean(int code, String msg){
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
public JsonBean(int code, String msg, Object obj){
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.obj = obj;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public JsonBean setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public JsonBean setCode(int code) {
|
||||
this.code = code;
|
||||
if (code == 1)
|
||||
this.msg = "操作成功";
|
||||
if (code == -1)
|
||||
this.msg = "操作失败";
|
||||
return this;
|
||||
}
|
||||
|
||||
public JsonBean setCode(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
public JsonBean setCode(int code, String msg, Object obj) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.obj = obj;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getObj() {
|
||||
return obj;
|
||||
}
|
||||
|
||||
public JsonBean setObj(Object obj) {
|
||||
this.obj = obj;
|
||||
return this;
|
||||
}
|
||||
public <K, V> JsonBean set(Object k, Object v){
|
||||
if (!(obj instanceof Map)){
|
||||
obj = new HashMap();
|
||||
}
|
||||
((Map) obj).put(k, v);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
下面的是一些快速创建JsonBean的方式,
|
||||
使用中可以使用new ,同时也可以直接使用
|
||||
*/
|
||||
public static JsonBean success(){
|
||||
return new JsonBean(1, "操作成功");
|
||||
}
|
||||
public static JsonBean success(Object obj){
|
||||
return new JsonBean(1, "操作成功",obj);
|
||||
}
|
||||
public static JsonBean success(int code, String msg){
|
||||
return new JsonBean(1, msg);
|
||||
}
|
||||
public static JsonBean success(int code, String msg, Object obj){
|
||||
return new JsonBean(1, msg, obj);
|
||||
}
|
||||
|
||||
public static JsonBean error(){
|
||||
return new JsonBean(-1, "操作失败");
|
||||
}
|
||||
public static JsonBean error(int code, String msg){
|
||||
return new JsonBean(code, msg);
|
||||
}
|
||||
public static JsonBean error(int code, String msg, Object obj){
|
||||
return new JsonBean(code, msg, obj);
|
||||
}
|
||||
public static JsonBean error(String msg){
|
||||
return new JsonBean(-1, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "JsonBean{" +
|
||||
"code=" + code +
|
||||
", msg='" + msg + '\'' +
|
||||
", obj=" + obj +
|
||||
'}';
|
||||
}
|
||||
}
|
33
src/main/java/com/lxyer/config/LxyKit.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.lxyer.config;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* Created by Lxy at 2017/11/29 15:17.
|
||||
*/
|
||||
public final class LxyKit {
|
||||
|
||||
public static String dateFmt(long time){
|
||||
/**
|
||||
* 刚刚 60秒内 60 * 1000
|
||||
* x分钟前 1小时候内 60 * 60*1000
|
||||
* x小时前 1天内 24 * 60*60*1000
|
||||
* x天前 1周内 7 * 24*60*60*1000
|
||||
* 年-月-日 1周前
|
||||
*/
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
long diff = now - time;
|
||||
if (diff < 60 * 1000)
|
||||
return "刚刚";
|
||||
else if (diff < 60 * 60 *1000)
|
||||
return Math.floorDiv(diff, 60 *1000) + "分钟前";
|
||||
else if (diff < 24 * 60*60*1000)
|
||||
return Math.floorDiv(diff, 60 *60*1000) + "小时前";
|
||||
else if (diff > 24 * 60*60*1000 && diff < 7 * 24*60*60*1000)
|
||||
return Math.floorDiv(diff, 24 * 60*60*1000) + "天前";
|
||||
else
|
||||
return new SimpleDateFormat("yyyy-MM-dd").format(time);
|
||||
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.lxyer.config.route;
|
||||
|
||||
import com.jfinal.config.Routes;
|
||||
import com.lxyer.controller.HomeController;
|
||||
import com.lxyer.controller.UserController;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 11:16.
|
||||
@ -12,5 +13,6 @@ public class SiteRoute extends Routes {
|
||||
setBaseViewPath("/WEB-INF/fly");
|
||||
|
||||
add("/", HomeController.class);
|
||||
add("/user", UserController.class);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 16:48.
|
||||
*/
|
||||
public class ContentController extends IController{
|
||||
|
||||
|
||||
}
|
9
src/main/java/com/lxyer/controller/FileController.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
/**
|
||||
* 文件管理
|
||||
* Created by JUECHENG at 2018/1/7 16:44.
|
||||
*/
|
||||
public class FileController extends IController{
|
||||
|
||||
}
|
@ -1,11 +1,9 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.SqlPara;
|
||||
import com.jfinal.plugin.ehcache.CacheInterceptor;
|
||||
import com.jfinal.plugin.redis.Cache;
|
||||
import com.jfinal.plugin.redis.Redis;
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.lxyer.model.Content;
|
||||
import com.lxyer.model.User;
|
||||
|
||||
import java.util.List;
|
||||
@ -14,36 +12,71 @@ import java.util.List;
|
||||
* Created by JUECHENG at 2018/1/7 14:40.
|
||||
*/
|
||||
public class HomeController extends IController {
|
||||
public static final Kv column = Kv.by("qz", 10).set("fx", 20).set("jy", 30).set("gg", 40).set("dt", 50);//栏目
|
||||
|
||||
public void index(){
|
||||
String para = getPara();
|
||||
|
||||
Cache cache = Redis.use();
|
||||
String cacheKey = "user-" + para;
|
||||
//置顶贴
|
||||
List<Content> top = Content.dao.findPage(1, 5, Kv.by("top", 1)).getList();
|
||||
|
||||
User user = cache.get(cacheKey);
|
||||
if (user == null)
|
||||
cache.setex(cacheKey, 10, user = User.dao.findById(para+""));
|
||||
//非置顶贴
|
||||
List<Content> contents = Content.dao.findPage(1, 30,Kv.by("top", 0)).getList();
|
||||
|
||||
if (user != null)
|
||||
System.out.println(user.toJson());
|
||||
//热帖
|
||||
|
||||
renderText("hello fly");
|
||||
//热议
|
||||
List<Content> hotReply = Content.dao.findPage(1, 8, Kv.by("order", "replyNum DESC")).getList();
|
||||
|
||||
//最新加入
|
||||
List<User> lastReg = User.dao.findPage(1, 8, Kv.by("order", "createTime DESC")).getList();
|
||||
|
||||
setAttr("top", top);
|
||||
setAttr("contents", contents);
|
||||
setAttr("hotReply", hotReply);
|
||||
setAttr("lastReg", lastReg);
|
||||
|
||||
render("index.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户
|
||||
* 帖子栏目列表
|
||||
*/
|
||||
@Before(CacheInterceptor.class)
|
||||
public void query_user(){
|
||||
public void column(){
|
||||
String para = getPara(0, "");
|
||||
int solved = getParaToInt("solved", -1);
|
||||
int wonderful = getParaToInt("wonderful", -1);
|
||||
|
||||
//User.dao.find("select * from user")
|
||||
Kv kv = Kv.by("type", column.get(para)).set("order", "top DESC,createTime DESC");
|
||||
Page<Content> contents = Content.dao.findPage(getPn(), getPs(3), kv);
|
||||
|
||||
SqlPara sqlPara = Db.getSqlPara("user.list");
|
||||
//热议
|
||||
List<Content> hotReply = Content.dao.findPage(1, 8, Kv.by("order", "replyNum DESC")).getList();
|
||||
|
||||
setAttrs(Kv.by("contents", contents).set("hotReply", hotReply)
|
||||
.set("solved", solved).set("wonderful", wonderful).set("column", para));
|
||||
|
||||
List<User> users = User.dao.find(sqlPara);
|
||||
|
||||
renderJson(users);
|
||||
render("jie/index.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 帖子详情
|
||||
*/
|
||||
public void jie(){
|
||||
int contentId = getParaToInt(0);
|
||||
|
||||
//ContentInfo content = contentService.contentInfo(sessionid, contentid);
|
||||
//Sheet<CommentInfo> comments = commentService.commentQuery(request.getSessionid(false) ,contentid, new Flipper().limit(30));
|
||||
|
||||
Record content = Content.dao.findFirst(Kv.by("contentId", contentId));
|
||||
|
||||
//热议
|
||||
List<Content> hotReply = Content.dao.findPage(1, 8, Kv.by("order", "replyNum DESC")).getList();
|
||||
|
||||
setAttr("bean", content);
|
||||
setAttr("hotReply", hotReply);
|
||||
|
||||
render("jie/detail.html");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package com.lxyer.controller;
|
||||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.*;
|
||||
import com.jfinal.plugin.redis.Cache;
|
||||
import com.jfinal.plugin.redis.Redis;
|
||||
import com.lxyer.config.E;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -15,6 +17,8 @@ import java.util.Map;
|
||||
*/
|
||||
public class IController extends Controller {
|
||||
|
||||
public static final Cache cache = Redis.use();
|
||||
|
||||
public Kv getParams(String... key) {
|
||||
Kv kv = Kv.create();
|
||||
for (String k : key) {
|
||||
|
28
src/main/java/com/lxyer/controller/UserController.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 16:40.
|
||||
*/
|
||||
public class UserController extends IController {
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public void create(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
public void login(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public void update(){
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,5 +7,10 @@ import com.lxyer.model.base.BaseContent;
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Content extends BaseContent<Content> {
|
||||
|
||||
public static final Content dao = new Content().dao();
|
||||
|
||||
@Override
|
||||
public String sqlSpace() {
|
||||
return "content";
|
||||
}
|
||||
}
|
||||
|
@ -8,5 +8,9 @@ import com.lxyer.model.base.BaseUser;
|
||||
@SuppressWarnings("serial")
|
||||
public class User extends BaseUser<User> {
|
||||
public static final User dao = new User().dao();
|
||||
|
||||
|
||||
@Override
|
||||
public String sqlSpace() {
|
||||
return "user";
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
@ -7,7 +8,7 @@ import com.jfinal.plugin.activerecord.IBean;
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseContent<M extends BaseContent<M>> extends Model<M> implements IBean {
|
||||
public abstract class BaseContent<M extends BaseContent<M>> extends Model<M> implements IBean,IModel<M> {
|
||||
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
|
@ -7,7 +7,7 @@ import com.jfinal.plugin.activerecord.IBean;
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseUser<M extends BaseUser<M>> extends Model<M> implements IBean {
|
||||
public abstract class BaseUser<M extends BaseUser<M>> extends Model<M> implements IBean,IModel<M> {
|
||||
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
|
36
src/main/java/com/lxyer/model/base/IModel.java
Normal file
@ -0,0 +1,36 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.jfinal.plugin.activerecord.SqlPara;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 16:52.
|
||||
*/
|
||||
public interface IModel<M extends IModel<M>> {
|
||||
|
||||
String sqlSpace();
|
||||
|
||||
default List<M> findList(Kv kv){
|
||||
SqlPara sqlPara = Db.getSqlPara(sqlSpace()+".list", kv);
|
||||
|
||||
return (List) Db.find(sqlPara);
|
||||
}
|
||||
|
||||
default Record findFirst(Kv kv){
|
||||
SqlPara sqlPara = Db.getSqlPara(sqlSpace()+".list", kv);
|
||||
|
||||
return Db.findFirst(sqlPara);
|
||||
}
|
||||
|
||||
default Page<M> findPage(int pn, int ps, Kv kv){
|
||||
SqlPara sqlPara = Db.getSqlPara(sqlSpace()+".list", kv);
|
||||
|
||||
return (Page) Db.paginate(pn, ps, sqlPara);
|
||||
}
|
||||
|
||||
}
|
9
src/main/java/com/lxyer/service/ContentService.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.lxyer.service;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 16:49.
|
||||
*/
|
||||
public class ContentService {
|
||||
|
||||
|
||||
}
|
21
src/main/resources/sql/content.sql
Normal file
@ -0,0 +1,21 @@
|
||||
#sql("content.list")
|
||||
SELECT c.*,u.nickname,u.avatar
|
||||
FROM content c LEFT JOIN user u ON c.userId=u.userId
|
||||
WHERE c.status != -1
|
||||
#if(type)
|
||||
AND c.`type`=#(type)
|
||||
#end
|
||||
#if(contentId)
|
||||
AND c.`contentId`=#(contentId)
|
||||
#end
|
||||
|
||||
#if(order)
|
||||
ORDER BY #(order)
|
||||
#elseif(top == 1)
|
||||
AND c.top > 0
|
||||
ORDER BY top DESC,createTime DESC
|
||||
#elseif(top == "0")
|
||||
AND c.top = 0
|
||||
ORDER BY createTime DESC
|
||||
#end
|
||||
#end
|
@ -1,11 +1,181 @@
|
||||
<!--- Created by JUECHENG at 2018/1/7 11:24. --->
|
||||
<!-- Created by Lxy at 2017/11/25 17:36. -->
|
||||
#define columned(e)
|
||||
#if(e == column??"") layui-this
|
||||
#end
|
||||
#end
|
||||
#define cateName(cate)
|
||||
#if(cate == 10) 求助
|
||||
#elseif(cate == 20) 分享
|
||||
#elseif(cate == 30) 讨论
|
||||
#elseif(cate == 40) 公告
|
||||
#elseif(cate == 50) 动态
|
||||
#else 其他
|
||||
#end
|
||||
#end
|
||||
#define dateFmt(time)
|
||||
#(lxyKit.dateFmt(time))
|
||||
#end
|
||||
|
||||
|
||||
#define layout()
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<meta charset="utf-8">
|
||||
<title>#if(title)#(title) - #end Redbbs社区</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<meta name="keywords" content="#(keywords??'redkale')">
|
||||
<meta name="description" content="#(description??'redkale框架,redkale社区')">
|
||||
<link rel="stylesheet" href="/res/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="/res/css/global.css">
|
||||
<!--background-color: #4a184c;-->
|
||||
<style>
|
||||
.layui-bg-black,.layui-btn,.layui-laypage .layui-laypage-curr .layui-laypage-em{background-image: linear-gradient(350deg, #330335, #AB5D7C);}
|
||||
.laypage-main{border:1px solid #a25677!important;}
|
||||
.laypage-main *{border-right:#a25677;border-bottom:#a25677;}
|
||||
.layui-nav *{font-size:16px}
|
||||
.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover
|
||||
{background-color:#4a184c;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="fly-header layui-bg-black">
|
||||
<div class="layui-container">
|
||||
<a class="fly-logo" href="/" style="font-size: 30px;color: #fff;">
|
||||
Redbbs
|
||||
<!--<img src="/res/images/logo.png" alt="优乐园社区">-->
|
||||
</a>
|
||||
<ul class="layui-nav fly-nav layui-hide-xs">
|
||||
<li class="layui-nav-item layui-this">
|
||||
<a href="/">社区</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="http://redkale.org/" target="_blank">Redkale框架</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="http://redkale.org/articles.html" target="_blank">技术文章</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="layui-nav fly-nav-user">
|
||||
#if(mine)<!-- 登入后的状态 -->
|
||||
<li class="layui-nav-item">
|
||||
<a class="fly-nav-avatar" href="javascript:;">
|
||||
<cite class="layui-hide-xs">#(mine.nickname)</cite>
|
||||
<!--
|
||||
<i class="iconfont icon-renzheng layui-hide-xs" title="认证信息:layui 作者"></i>
|
||||
<i class="layui-badge fly-badge-vip layui-hide-xs">VIP3</i>
|
||||
-->
|
||||
<img src="#(mine.avatar)">
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="/user/set"><i class="layui-icon"></i>基本设置</a></dd>
|
||||
<!--
|
||||
<dd><a href="/user/message"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
|
||||
-->
|
||||
<dd><a href="/user"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;"></i>我的主页</a></dd>
|
||||
<hr style="margin: 5px 0;">
|
||||
<dd><a href="javascript:;" class="logout" style="text-align: center;">退出</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
#else<!-- 未登入的状态 -->
|
||||
<li class="layui-nav-item">
|
||||
<a class="iconfont icon-touxiang layui-hide-xs" href="/user/login"></a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="/user/login.html">登入</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="/user/reg.html">注册</a>
|
||||
</li>
|
||||
<!--<li class="layui-nav-item layui-hide-xs">
|
||||
<a href="/app/qq/" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" title="QQ登入" class="iconfont icon-qq"></a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-hide-xs">
|
||||
<a href="/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" title="微博登入" class="iconfont icon-weibo"></a>
|
||||
</li>-->
|
||||
#end
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--main-->
|
||||
#@main?()
|
||||
|
||||
<div class="fly-footer">
|
||||
<p><a href="http://b.1216.top/" target="_blank">Redbbs</a> 2017 © <a href="http://1216.top/" target="_blank">http://1216.top</a></p>
|
||||
#define x()
|
||||
<p>
|
||||
<a href="http://fly.layui.com/jie/3147/" target="_blank">付费计划</a>
|
||||
<a href="http://fly.layui.com/jie/8157/" target="_blank">获取Fly社区模版</a>
|
||||
<a href="http://fly.layui.com/jie/2461/" target="_blank">微信公众号</a>
|
||||
</p>
|
||||
#end
|
||||
</div>
|
||||
<script src="/res/layui/layui.js"></script>
|
||||
#@js?()
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
#end
|
||||
|
||||
#define flyColumn()
|
||||
<div class="fly-panel fly-column">
|
||||
<div class="layui-container">
|
||||
<ul class="layui-clear">
|
||||
<li class="layui-hide-xs #@columned('')"><a href="/">全部</a></li>
|
||||
<li class="#@columned('qz')"><a href="/column/qz">求助</a></li>
|
||||
<li class="#@columned('fx')"><a href="/column/fx">分享<!--<span class="layui-badge-dot"></span>--></a></li>
|
||||
<!--
|
||||
<li class="#@columned('jy')"><a href="/column/jy">建议</a></li>
|
||||
<li class="#@columned('gg')"><a href="/column/gg">公告</a></li>
|
||||
-->
|
||||
<li class="#@columned('dt')"><a href="/column/dt">动态</a></li>
|
||||
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>
|
||||
|
||||
<!-- 用户登入后显示 -->
|
||||
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/user?#index">我发表的贴</a></li>
|
||||
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/user?#collection">我收藏的贴</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="fly-column-right layui-hide-xs">
|
||||
<span class="fly-search"><i class="layui-icon"></i></span>
|
||||
<a href="/jie/add" class="layui-btn">发表新帖</a>
|
||||
</div>
|
||||
<div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
|
||||
<a href="/jie/add" class="layui-btn">发表新帖</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
|
||||
#define user_side(e)
|
||||
<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
|
||||
<li class="layui-nav-item #if(e == '') layui-this #end">
|
||||
<a href="/user/#(mine.userId)">
|
||||
<i class="layui-icon"></i>
|
||||
我的主页
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item #if(e == 'index') layui-this #end">
|
||||
<a href="/user/">
|
||||
<i class="layui-icon"></i>
|
||||
用户中心
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item #if(e == 'set') layui-this #end">
|
||||
<a href="/user/set">
|
||||
<i class="layui-icon"></i>
|
||||
基本设置
|
||||
</a>
|
||||
</li>
|
||||
<!--<li class="layui-nav-item #if(e == 'message') layui-this #end">
|
||||
<a href="message.html">
|
||||
<i class="layui-icon"></i>
|
||||
我的消息
|
||||
</a>
|
||||
</li>-->
|
||||
</ul>
|
||||
#end
|
242
src/main/webapp/WEB-INF/fly/index.html
Normal file
@ -0,0 +1,242 @@
|
||||
#@layout()
|
||||
|
||||
#define main()
|
||||
#@flyColumn()
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8">
|
||||
<!--置顶-->
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title fly-filter">
|
||||
<a>置顶</a>
|
||||
<!--<a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a>-->
|
||||
</div>
|
||||
<ul class="fly-list">
|
||||
#for(x : top)
|
||||
<li>
|
||||
<a href="/user/#(x.userId)" class="fly-avatar">
|
||||
<img src="#(x.avatar)" alt="#(x.nickname)">
|
||||
</a>
|
||||
<h2>
|
||||
<a class="layui-badge">#@cateName(x.type)</a>
|
||||
<a href="/jie/#(x.contentId)">#(x.title)</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="/user/#(x.userId)" link>
|
||||
<cite>#(x.nickname)</cite>
|
||||
<!--<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
<i class="layui-badge fly-badge-vip">VIP3</i>-->
|
||||
</a>
|
||||
<span>#@dateFmt(x.createTime)</span>
|
||||
|
||||
<!--
|
||||
<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span>
|
||||
<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
|
||||
-->
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> #(x.replyNum??0)
|
||||
</span>
|
||||
</div>
|
||||
<div class="fly-list-badge">
|
||||
<!--
|
||||
<span class="layui-badge layui-bg-black">置顶</span>
|
||||
<span class="layui-badge layui-bg-red">精帖</span>
|
||||
-->
|
||||
</div>
|
||||
</li>
|
||||
#end
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
|
||||
<div class="fly-panel-title fly-filter">
|
||||
<a href="/column" class="layui-this">综合</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="/column?solved=0">未结</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="/column?solved=1">已结</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="/column?wonderful=1">精华</a>
|
||||
<span class="fly-filter-right layui-hide-xs">
|
||||
<a href="" class="layui-this">按最新</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="">按热议</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul class="fly-list">
|
||||
#for(x : contents??)
|
||||
<li>
|
||||
<a href="/user/home.html" class="fly-avatar">
|
||||
<img src="#(x.avatar)" alt="#(x.nickname)">
|
||||
</a>
|
||||
<h2>
|
||||
<a class="layui-badge">#@cateName(x.type)</a>
|
||||
<a href="/jie/#(x.contentId)">#(x.title)</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="/user/#(x.userId)" link>
|
||||
<cite>#(x.nickname)</cite>
|
||||
<!--
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
<i class="layui-badge fly-badge-vip">VIP3</i>
|
||||
-->
|
||||
</a>
|
||||
<span>#@dateFmt(x.createTime)</span>
|
||||
|
||||
<!--
|
||||
<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span>
|
||||
<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
|
||||
-->
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> #(x.replyNum??0)
|
||||
</span>
|
||||
</div>
|
||||
<div class="fly-list-badge">
|
||||
<!--<span class="layui-badge layui-bg-red">精帖</span>-->
|
||||
</div>
|
||||
</li>
|
||||
#end
|
||||
</ul>
|
||||
<div style="text-align: center">
|
||||
<div class="laypage-main">
|
||||
<a href="/column/" class="laypage-next">更多求解</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
|
||||
#define tuijian() 暂时不需要
|
||||
<div class="fly-panel">
|
||||
<h3 class="fly-panel-title">温馨通道</h3>
|
||||
<ul class="fly-panel-main fly-list-static">
|
||||
<li>
|
||||
<a href="http://fly.layui.com/jie/4281/" target="_blank">layui 的 GitHub 及 Gitee (码云) 仓库,欢迎Star</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://fly.layui.com/jie/5366/" target="_blank">
|
||||
layui 常见问题的处理和实用干货集锦
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://fly.layui.com/jie/4281/" target="_blank">layui 的 GitHub 及 Gitee (码云) 仓库,欢迎Star</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://fly.layui.com/jie/5366/" target="_blank">
|
||||
layui 常见问题的处理和实用干货集锦
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://fly.layui.com/jie/4281/" target="_blank">layui 的 GitHub 及 Gitee (码云) 仓库,欢迎Star</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
#end
|
||||
|
||||
#define xx()
|
||||
<div class="fly-panel fly-signin">
|
||||
<div class="fly-panel-title">
|
||||
签到
|
||||
<i class="fly-mid"></i>
|
||||
<a href="javascript:;" class="fly-link" id="LAY_signinHelp">说明</a>
|
||||
<i class="fly-mid"></i>
|
||||
<a href="javascript:;" class="fly-link" id="LAY_signinTop">活跃榜<span class="layui-badge-dot"></span></a>
|
||||
<span class="fly-signin-days">已连续签到<cite>16</cite>天</span>
|
||||
</div>
|
||||
<div class="fly-panel-main fly-signin-main">
|
||||
<button class="layui-btn layui-btn-danger" id="LAY_signin">今日签到</button>
|
||||
<span>可获得<cite>5</cite>飞吻</span>
|
||||
|
||||
<!-- 已签到状态 -->
|
||||
<!--
|
||||
<button class="layui-btn layui-btn-disabled">今日已签到</button>
|
||||
<span>获得了<cite>20</cite>飞吻</span>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
|
||||
<!--最新加入-->
|
||||
<div class="fly-panel fly-rank fly-rank-reply" id="LAY_replyRank">
|
||||
<h3 class="fly-panel-title">
|
||||
最新加入<!--|
|
||||
总用户:<span id="user_count">0</span>人-->
|
||||
</h3>
|
||||
<dl>
|
||||
<!--<i class="layui-icon fly-loading"></i>-->
|
||||
#for(x : lastReg??)
|
||||
<dd>
|
||||
<a href="/user/#(x.userId)">
|
||||
<img src="#(x.avatar)"><cite>#(x.nickname)</cite><i>#@dateFmt(x.createTime)</i>
|
||||
</a>
|
||||
</dd>
|
||||
#end
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!--热议-->
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">本周热议</dt>
|
||||
#for(x : hotReply)
|
||||
<dd>
|
||||
<a href="/jie/detail/#(x.contentId)">#(x.title)</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> #(x.replyNum)</span>
|
||||
</dd>
|
||||
#else
|
||||
<div class="fly-none">没有相关数据</div>
|
||||
#end
|
||||
</dl>
|
||||
|
||||
#define AD()
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">
|
||||
这里可作为广告区域
|
||||
</div>
|
||||
<div class="fly-panel-main">
|
||||
<a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #5FB878;">LayIM 3.0 - layui 旗舰之作</a>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
|
||||
#define link()
|
||||
<div class="fly-panel fly-link">
|
||||
<h3 class="fly-panel-title">友情链接</h3>
|
||||
<dl class="fly-panel-main">
|
||||
<dd><a href="http://www.layui.com/" target="_blank">layui</a><dd>
|
||||
<dd><a href="http://layim.layui.com/" target="_blank">WebIM</a><dd>
|
||||
<dd><a href="http://layer.layui.com/" target="_blank">layer</a><dd>
|
||||
<dd><a href="http://www.layui.com/laydate/" target="_blank">layDate</a><dd>
|
||||
<dd><a href="mailto:xianxin@layui-inc.com?subject=%E7%94%B3%E8%AF%B7Fly%E7%A4%BE%E5%8C%BA%E5%8F%8B%E9%93%BE" class="fly-link">申请友链</a><dd>
|
||||
</dl>
|
||||
</div>
|
||||
#end
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
|
||||
#define js()
|
||||
<script>
|
||||
layui.cache.page = '';
|
||||
layui.cache.user = {
|
||||
username: '游客'
|
||||
,uid: -1
|
||||
,avatar: '../res/images/avatar/00.jpg'
|
||||
,experience: 83
|
||||
,sex: '男'
|
||||
};
|
||||
layui.config({
|
||||
version: "3.0.0"
|
||||
,base: '../res/mods/' //这里实际使用时,建议改成绝对路径
|
||||
}).extend({
|
||||
fly: 'index'
|
||||
}).use('fly',function () {
|
||||
var fly = layui.fly;
|
||||
//fly.userstat();
|
||||
});
|
||||
</script>
|
||||
#end
|
129
src/main/webapp/WEB-INF/fly/jie/add.html
Normal file
@ -0,0 +1,129 @@
|
||||
#@layout()
|
||||
|
||||
#define main()
|
||||
#@flyColumn()
|
||||
<div class="layui-container fly-marginTop">
|
||||
<div class="fly-panel" pad20 style="padding-top: 5px;">
|
||||
<!--<div class="fly-none">没有权限</div>-->
|
||||
<div class="layui-form layui-form-pane">
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="user">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">发表新帖<!-- 编辑帖子 --></li>
|
||||
</ul>
|
||||
<div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<form action="" method="post">
|
||||
<div class="layui-row layui-col-space15 layui-form-item">
|
||||
<div class="layui-col-md3">
|
||||
<label class="layui-form-label">所在专栏</label>
|
||||
<div class="layui-input-block">
|
||||
<select lay-verify="required" name="type">
|
||||
<option></option>
|
||||
<!--[内容栏目]10求助,20分享,30建议,40公告,50动态-->
|
||||
<option value="10" #if(bean.type?? == 10) selected #end>求助</option>
|
||||
<option value="20" #if(bean.type?? == 20) selected #end>分享</option>
|
||||
<option value="30" #if(bean.type?? == 30) selected #end>讨论</option>
|
||||
<!--高级权限开放类别-->
|
||||
#if(mine.userId?? == 100001)
|
||||
<option value="40" #if(bean.type?? == 40) selected #end>公告</option>
|
||||
<option value="50" #if(bean.type?? == 50) selected #end>动态</option>
|
||||
#end
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md9">
|
||||
<label for="L_title" class="layui-form-label">标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="hidden" name="contentId" value="#(bean.contentId??)">
|
||||
<input type="text" id="L_title" name="title" value="#(bean.title??)" required lay-verify="required" autocomplete="off" class="layui-input">
|
||||
<!-- <input type="hidden" name="id" value="{{d.edit.id}}"> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row layui-col-space15 layui-form-item layui-hide" id="LAY_quiz">
|
||||
<div class="layui-col-md3">
|
||||
<label class="layui-form-label">所属产品</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="project">
|
||||
<option></option>
|
||||
<option value="layui">layui</option>
|
||||
<option value="独立版layer">独立版layer</option>
|
||||
<option value="独立版layDate">独立版layDate</option>
|
||||
<option value="LayIM">LayIM</option>
|
||||
<option value="Fly社区模板">Fly社区模板</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<label class="layui-form-label" for="L_version">版本号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="L_version" value="" name="version" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<label class="layui-form-label" for="L_browser">浏览器</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="L_browser" value="" name="browser" placeholder="浏览器名称及版本,如:IE 11" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<div class="layui-input-block">
|
||||
<textarea id="L_content" name="content" required lay-verify="required" placeholder="详细描述" class="layui-textarea fly-editor" style="height: 260px;">#(bean.content??)</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">悬赏飞吻</label>
|
||||
<div class="layui-input-inline" style="width: 190px;">
|
||||
<select name="experience">
|
||||
<option value="20">20</option>
|
||||
<option value="30">30</option>
|
||||
<option value="50">50</option>
|
||||
<option value="60">60</option>
|
||||
<option value="80">80</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">发表后无法更改飞吻</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="L_vercode" class="layui-form-label">人类验证</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="L_vercode" name="vercode" required lay-verify="required"
|
||||
placeholder="请回答后面的问题" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
<span style="color: #c00;">1+1=?</span>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-filter="jie-add" lay-submit>立即发布</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
|
||||
#define js()
|
||||
<script>
|
||||
layui.cache.page = 'jie';
|
||||
layui.cache.user = {
|
||||
username: '游客'
|
||||
, uid: -1
|
||||
, avatar: '../../res/images/avatar/00.jpg'
|
||||
, experience: 83
|
||||
, sex: '男'
|
||||
};
|
||||
layui.config({
|
||||
version: "2.0.0"
|
||||
, base: '../../res/mods/'
|
||||
}).extend({
|
||||
fly: 'index'
|
||||
}).use('fly');
|
||||
</script>
|
||||
#end
|
213
src/main/webapp/WEB-INF/fly/jie/detail.html
Normal file
@ -0,0 +1,213 @@
|
||||
#set(title=bean.title??)
|
||||
#set(keywords=bean.title??)
|
||||
#set(description=bean.title??)
|
||||
#@layout()
|
||||
|
||||
#define main()
|
||||
#@flyColumn()
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8 content detail">
|
||||
<!--内容-->
|
||||
<div class="fly-panel detail-box">
|
||||
<h1>#(bean.title)</h1>
|
||||
<div class="fly-detail-info">
|
||||
<!-- <span class="layui-badge">审核中</span> -->
|
||||
<span class="layui-badge layui-bg-green fly-detail-column">动态</span>
|
||||
|
||||
<span class="layui-badge" style="background-color: #999;">未结</span>
|
||||
<!-- <span class="layui-badge" style="background-color: #5FB878;">已结</span> -->
|
||||
#if(bean.top == 1)
|
||||
<span class="layui-badge layui-bg-black">置顶</span>
|
||||
#end
|
||||
#if(bean.wonderful == 1)
|
||||
<span class="layui-badge layui-bg-red">精帖</span>
|
||||
#end
|
||||
#if(mine.userId?? == 100001)
|
||||
<div class="fly-admin-box" data-id="#(bean.contentId)">
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="del">删除</span>
|
||||
#if(bean.top == 1)
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" v="0" style="background-color:#ccc;">取消置顶</span>
|
||||
#else
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" v="1">置顶</span>
|
||||
#end
|
||||
|
||||
#if(bean.wonderful == 1)
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="wonderful" v="0" style="background-color:#ccc;">取消加精</span>
|
||||
#else
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="wonderful" v="1">加精</span>
|
||||
#end
|
||||
</div>
|
||||
#end
|
||||
<span class="fly-list-nums">
|
||||
<a href="#comment"><i class="iconfont" title="回答"></i> #(bean.replyNum??0)</a>
|
||||
<i class="iconfont" title="人气"></i> #(bean.viewNum??1)
|
||||
</span>
|
||||
</div>
|
||||
<div class="detail-about">
|
||||
<a class="fly-avatar" href="/user/#(bean.userId)">
|
||||
<img src="#(bean.avatar)" alt="#(bean.nickname)">
|
||||
</a>
|
||||
<div class="fly-detail-user">
|
||||
<a href="/user/#(bean.userId)" class="fly-link">
|
||||
<cite>#(bean.nickname)</cite>
|
||||
<!--
|
||||
<i class="iconfont icon-renzheng" title="认证信息:{{ rows.user.approve }}"></i>
|
||||
<i class="layui-badge fly-badge-vip">VIP3</i>
|
||||
-->
|
||||
</a>
|
||||
<span>#(bean.createTime??)</span>
|
||||
</div>
|
||||
<div class="detail-hits" id="LAY_jieAdmin" data-id="123">
|
||||
<!--
|
||||
<span style="padding-right: 10px; color: #FF7200">悬赏:60飞吻</span>
|
||||
-->
|
||||
#if(bean.userId == mine.userId?? || mine.userId?? == 100001)
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="edit"><a href="/jie/add/#(bean.contentId)">编辑此贴</a></span>
|
||||
#end
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-body photos">
|
||||
#(bean.content??)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--评论-->
|
||||
<div class="fly-panel detail-box" id="flyReply">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
|
||||
<legend>回帖</legend>
|
||||
</fieldset>
|
||||
|
||||
<ul class="jieda" id="jieda">
|
||||
#for(x : comments.rows??)
|
||||
<li data-id="#(x.commentId)" class="jieda-daan">
|
||||
<a name="item-1111111111"></a>
|
||||
<div class="detail-about detail-about-reply">
|
||||
<a class="fly-avatar" href="/user/#(x.userId)">
|
||||
<img src="#(x.avatar)" alt="#(x.nickname)">
|
||||
</a>
|
||||
<div class="fly-detail-user">
|
||||
<a href="" class="fly-link">
|
||||
<cite>#(x.nickname)</cite>
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
<i class="layui-badge fly-badge-vip">VIP3</i>
|
||||
</a>
|
||||
#if(x.userId == bean.userId??)
|
||||
<span>(楼主)</span>
|
||||
#end
|
||||
<!--
|
||||
<span style="color:#5FB878">(管理员)</span>
|
||||
<span style="color:#FF9E3F">(社区之光)</span>
|
||||
<span style="color:#999">(该号已被封)</span>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<div class="detail-hits"><span>#(x.createTime??)</span></div>
|
||||
#if(1>2)
|
||||
<i class="iconfont icon-caina" title="最佳答案"></i>
|
||||
#end
|
||||
</div>
|
||||
<div class="detail-body jieda-body photos">
|
||||
#(x.content)
|
||||
</div>
|
||||
<div class="jieda-reply">
|
||||
#if(x.hadSupport == 1)
|
||||
<span class="jieda-zan zanok" type="zan"><i class="iconfont icon-zan"></i><em>#(x.supportNum)</em></span>
|
||||
#else
|
||||
<span class="jieda-zan" type="zan"><i class="iconfont icon-zan"></i><em>#(x.supportNum)</em></span>
|
||||
#end
|
||||
<span type="reply"><i class="iconfont icon-svgmoban53"></i>回复</span>
|
||||
<div class="jieda-admin">
|
||||
#if(x.userId == mine.userId?? && false)
|
||||
<span type="edit">编辑</span>
|
||||
<span type="del">删除</span>
|
||||
#end
|
||||
#if(bean.userId == mine.userId??)
|
||||
<span class="jieda-accept" type="accept">采纳</span>
|
||||
#end
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
#else
|
||||
<li class="fly-none">消灭零回复</li>
|
||||
#end
|
||||
</ul>
|
||||
|
||||
<div class="layui-form layui-form-pane">
|
||||
<form action="/jie/reply/" method="post">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<a name="comment"></a>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="L_content" name="content" required lay-verify="required" placeholder="请输入内容" class="layui-textarea fly-editor" style="height: 150px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input type="hidden" name="contentId" value="#(bean.contentId??)">
|
||||
<input type="hidden" name="pid" value="0">
|
||||
<button class="layui-btn" lay-filter="jie-reply" lay-submit>提交回复</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<!--热议-->
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">本周热议</dt>
|
||||
#for(x : hotReply)
|
||||
<dd>
|
||||
<a href="/jie/#(x.contentId)">#(x.title)</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> #(x.replyNum)</span>
|
||||
</dd>
|
||||
#else
|
||||
<div class="fly-none">没有相关数据</div>
|
||||
#end
|
||||
</dl>
|
||||
|
||||
#define xx()
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">
|
||||
这里可作为广告区域
|
||||
</div>
|
||||
<div class="fly-panel-main">
|
||||
<a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #5FB878;">LayIM 3.0 - layui 旗舰之作</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fly-panel" style="padding: 20px 0; text-align: center;">
|
||||
<img src="../../res/images/weixin.jpg" style="max-width: 100%;" alt="layui">
|
||||
<p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p>
|
||||
</div>
|
||||
#end
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
|
||||
#define js()
|
||||
<script>
|
||||
layui.cache.page = 'jie';
|
||||
layui.cache.user = {
|
||||
username: '游客'
|
||||
,uid: -1
|
||||
,avatar: '../../res/images/avatar/00.jpg'
|
||||
,experience: 83
|
||||
,sex: '男'
|
||||
};
|
||||
layui.config({
|
||||
version: false
|
||||
,base: '../../res/mods/'
|
||||
}).extend({
|
||||
fly: 'index'
|
||||
}).use('fly', function(){
|
||||
var $ = layui.jquery, fly = layui.fly;
|
||||
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
|
||||
$('.detail-body').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
othis.html(fly.content(html));
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
#end
|
144
src/main/webapp/WEB-INF/fly/jie/index.html
Normal file
@ -0,0 +1,144 @@
|
||||
#@layout()
|
||||
|
||||
#define checked(e)
|
||||
#if(e == "wj" && solved == 0) class="layui-this"
|
||||
#elseif(e == "yj" && solved == 1) class="layui-this"
|
||||
#elseif(e == "jh" && wonderful == 1) class="layui-this"
|
||||
#elseif(e == "zh" && solved == -1 && wonderful == -1) class="layui-this"
|
||||
#end
|
||||
#end
|
||||
|
||||
#define main()
|
||||
#@flyColumn()
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8">
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
<div class="fly-panel-title fly-filter">
|
||||
<a href="?" #@checked('zh')>综合</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="?solved=0" #@checked('wj')>未结</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="?solved=1" #@checked('yj')>已结</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="?wonderful=1" #@checked('jh')>精华</a>
|
||||
<span class="fly-filter-right layui-hide-xs">
|
||||
<a href="" class="layui-this">按最新</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="">按热议</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul class="fly-list">
|
||||
#for(x : contents.list??)
|
||||
<li>
|
||||
|
||||
<a href="/user/#(x.userId)" class="fly-avatar">
|
||||
<img src="#(x.avatar??)" alt="#(x.nickname)">
|
||||
</a>
|
||||
<h2>
|
||||
<a class="layui-badge">#@cateName(x.type)</a>
|
||||
<a href="/jie/#(x.contentId)">#(x.title)</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="user/#(x.userId)" link>
|
||||
<cite>#(x.nickname)</cite>
|
||||
<!--
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
<i class="layui-badge fly-badge-vip">VIP3</i>
|
||||
-->
|
||||
</a>
|
||||
<span>#@dateFmt(x.createTime)</span>
|
||||
|
||||
<!--
|
||||
<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span>
|
||||
<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
|
||||
-->
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> #(x.replyNum??0)
|
||||
</span>
|
||||
</div>
|
||||
<div class="fly-list-badge">
|
||||
#if(x.top > 0)
|
||||
<span class="layui-badge layui-bg-black">置顶</span>
|
||||
#end
|
||||
#if(x.wonderful == 1)
|
||||
<span class="layui-badge layui-bg-red">精帖</span>
|
||||
#end
|
||||
</div>
|
||||
</li>
|
||||
#else
|
||||
<div class="fly-none">没有相关数据</div>
|
||||
#end
|
||||
</ul>
|
||||
|
||||
<div style="text-align: center">
|
||||
<div id="jie-laypage" class=""> </div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">本周热议</dt>
|
||||
#for(x : hotReply)
|
||||
<dd>
|
||||
<a href="/jie/detail/#(x.contentId)">#(x.title)</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> #(x.replyNum)</span>
|
||||
</dd>
|
||||
#else
|
||||
<div class="fly-none">没有相关数据</div>
|
||||
#end
|
||||
</dl>
|
||||
|
||||
#define x()
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">
|
||||
这里可作为广告区域
|
||||
</div>
|
||||
<div class="fly-panel-main">
|
||||
<a href="" target="_blank" class="fly-zanzhu" style="background-color: #393D49;">虚席以待</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fly-panel fly-link">
|
||||
<h3 class="fly-panel-title">友情链接</h3>
|
||||
<dl class="fly-panel-main">
|
||||
<dd><a href="http://www.layui.com/" target="_blank">layui</a></dd>
|
||||
<dd><a href="http://layim.layui.com/" target="_blank">WebIM</a></dd>
|
||||
<dd><a href="http://layer.layui.com/" target="_blank">layer</a></dd>
|
||||
<dd><a href="http://www.layui.com/laydate/" target="_blank">layDate</a></dd>
|
||||
<dd>
|
||||
<a href="mailto:xianxin@layui-inc.com?subject=%E7%94%B3%E8%AF%B7Fly%E7%A4%BE%E5%8C%BA%E5%8F%8B%E9%93%BE"
|
||||
class="fly-link">申请友链</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
#end
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
|
||||
#define js()
|
||||
<script>
|
||||
layui.cache.page = 'jie';
|
||||
layui.cache.total = parseInt('#(contents.totalRow??0)');
|
||||
layui.cache.pn = parseInt('#(contents.pageNumber??1)');
|
||||
layui.cache.ps = parseInt('#(contents.pageSize??15)');
|
||||
|
||||
layui.cache.user = {
|
||||
username: '游客'
|
||||
, uid: -1
|
||||
, avatar: '../../res/images/avatar/00.jpg'
|
||||
, experience: 83
|
||||
, sex: '男'
|
||||
};
|
||||
layui.config({
|
||||
version: "2.0.0"
|
||||
, base: '../../res/mods/'
|
||||
}).extend({
|
||||
fly: 'index'
|
||||
}).use('fly');
|
||||
</script>
|
||||
#end
|
53
src/main/webapp/res/css/full.css
Normal file
@ -0,0 +1,53 @@
|
||||
/*! 默认风格 */
|
||||
|
||||
html body{margin-top:0; margin-left: 136px;}
|
||||
html .fly-full{margin-top: 0;}
|
||||
|
||||
.main{width:auto; margin:15px 24px 15px 24px;}
|
||||
.content{margin-right: 360px;}
|
||||
.jie-row li .jie-title{max-width:70%;}
|
||||
|
||||
/* 头部 */
|
||||
.header{width:136px; height:100%;}
|
||||
.header .main{position: static; width:auto;}
|
||||
.logo{top:20px; left:50%; width:86px; height:74px; margin-left:-43px; background:url(../images/logo-1.png);}
|
||||
.nav{position:relative; left:0; top:110px; border-top:1px solid #282C35;}
|
||||
.nav a{display:block; height:50px; line-height:50px; padding:0; text-align:center;}
|
||||
.nav a:first-child{border-top:1px solid #424857;}
|
||||
.nav-user span{margin-top: 10px;}
|
||||
|
||||
.icon-touxiang{font-size: 60px;}
|
||||
|
||||
.nav-user{top: auto; bottom:20px; left:0; width:100%;}
|
||||
.nav-user span,
|
||||
.nav-user .unlogin,
|
||||
.out-login,
|
||||
.avatar,
|
||||
.avatar cite,
|
||||
.nav-user .nav{display:block; *display:block; text-align:center;}
|
||||
.nav-user span{top: 0;}
|
||||
.nav-user span a{padding:0 6px;}
|
||||
.nav-user .unlogin{margin-right: 0;}
|
||||
.out-login{margin-left:0; margin-top:20px;}
|
||||
.out-login a{ padding:0 5px;}
|
||||
.nav-user .nav{position:relative; margin-left: 0; margin-top: 15px;}
|
||||
|
||||
.avatar img{width:60px; height:60px;}
|
||||
.avatar cite{margin-left: 0; margin-top:10px; }
|
||||
.avatar i{margin-left: 0;}
|
||||
|
||||
.nav-message{left: auto; right: 10px;}
|
||||
|
||||
/* 适配 */
|
||||
@media screen and (max-width: 1024px) {
|
||||
html body{margin-left: 140px;}
|
||||
.main{margin: 15px 10px;}
|
||||
.content{margin: 0;}
|
||||
.edge{display:none}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 750px) {
|
||||
html body{margin-left:0;}
|
||||
.header{left:-140px;}
|
||||
.edge{display: block;}
|
||||
}
|
562
src/main/webapp/res/css/global.css
Normal file
BIN
src/main/webapp/res/css/iconfont.eot
Normal file
204
src/main/webapp/res/css/iconfont.svg
Normal file
After Width: | Height: | Size: 142 KiB |
BIN
src/main/webapp/res/css/iconfont.ttf
Normal file
BIN
src/main/webapp/res/css/iconfont.woff
Normal file
BIN
src/main/webapp/res/images/avatar/0.jpg
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
src/main/webapp/res/images/avatar/1.jpg
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
src/main/webapp/res/images/avatar/10.jpg
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
src/main/webapp/res/images/avatar/11.jpg
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
src/main/webapp/res/images/avatar/12.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
src/main/webapp/res/images/avatar/13.jpg
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
src/main/webapp/res/images/avatar/14.jpg
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
src/main/webapp/res/images/avatar/15.jpg
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
src/main/webapp/res/images/avatar/16.jpg
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
src/main/webapp/res/images/avatar/17.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
src/main/webapp/res/images/avatar/18.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
src/main/webapp/res/images/avatar/19.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
src/main/webapp/res/images/avatar/2.jpg
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
src/main/webapp/res/images/avatar/20.jpg
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
src/main/webapp/res/images/avatar/3.jpg
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
src/main/webapp/res/images/avatar/4.jpg
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
src/main/webapp/res/images/avatar/5.jpg
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
src/main/webapp/res/images/avatar/6.jpg
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
src/main/webapp/res/images/avatar/7.jpg
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
src/main/webapp/res/images/avatar/8.jpg
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
src/main/webapp/res/images/avatar/9.jpg
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
src/main/webapp/res/images/fly.jpg
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
src/main/webapp/res/images/fork.gif
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
src/main/webapp/res/images/layim.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
src/main/webapp/res/images/loading.gif
Normal file
After Width: | Height: | Size: 166 B |
BIN
src/main/webapp/res/images/logo-1.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/webapp/res/images/logo.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
src/main/webapp/res/images/logo1.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
src/main/webapp/res/images/other/1437100018023.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
src/main/webapp/res/images/other/study-a.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
src/main/webapp/res/images/pay.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
2
src/main/webapp/res/layui/css/layui.css
Normal file
2
src/main/webapp/res/layui/css/layui.mobile.css
Normal file
2
src/main/webapp/res/layui/css/modules/code.css
Normal file
@ -0,0 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
BIN
src/main/webapp/res/layui/css/modules/laydate/icon.png
Normal file
After Width: | Height: | Size: 314 B |
BIN
src/main/webapp/res/layui/css/modules/layer/default/icon-ext.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
src/main/webapp/res/layui/css/modules/layer/default/icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 701 B |
After Width: | Height: | Size: 1.7 KiB |
BIN
src/main/webapp/res/layui/font/iconfont.eot
Normal file
447
src/main/webapp/res/layui/font/iconfont.svg
Normal file
After Width: | Height: | Size: 222 KiB |
BIN
src/main/webapp/res/layui/font/iconfont.ttf
Normal file
BIN
src/main/webapp/res/layui/font/iconfont.woff
Normal file
BIN
src/main/webapp/res/layui/images/face/0.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
src/main/webapp/res/layui/images/face/1.gif
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
src/main/webapp/res/layui/images/face/10.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
src/main/webapp/res/layui/images/face/11.gif
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
src/main/webapp/res/layui/images/face/12.gif
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
src/main/webapp/res/layui/images/face/13.gif
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
src/main/webapp/res/layui/images/face/14.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
src/main/webapp/res/layui/images/face/15.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
src/main/webapp/res/layui/images/face/16.gif
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
src/main/webapp/res/layui/images/face/17.gif
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
src/main/webapp/res/layui/images/face/18.gif
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
src/main/webapp/res/layui/images/face/19.gif
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src/main/webapp/res/layui/images/face/2.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/webapp/res/layui/images/face/20.gif
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
src/main/webapp/res/layui/images/face/21.gif
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
src/main/webapp/res/layui/images/face/22.gif
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
src/main/webapp/res/layui/images/face/23.gif
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
src/main/webapp/res/layui/images/face/24.gif
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
src/main/webapp/res/layui/images/face/25.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/webapp/res/layui/images/face/26.gif
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
src/main/webapp/res/layui/images/face/27.gif
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
src/main/webapp/res/layui/images/face/28.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
src/main/webapp/res/layui/images/face/29.gif
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
src/main/webapp/res/layui/images/face/3.gif
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
src/main/webapp/res/layui/images/face/30.gif
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
src/main/webapp/res/layui/images/face/31.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |