Compare commits

...

15 Commits

Author SHA1 Message Date
xiongxiaoyang
7004f55fc9 Update README.md 2025-02-20 12:20:10 +08:00
xiongxiaoyang
a59704ae42 feat: 实现AI写作功能 2025-02-19 23:46:53 +08:00
xiongxiaoyang
e680672048 build: 3.4.0 发布 2023-04-25 19:49:17 +08:00
xiongxiaoyang
5b9298aaad feat: 作家后台-小说章节更新 2023-04-25 19:20:53 +08:00
xiongxiaoyang
2dd106c41e feat: 作家后台-小说章节删除 2023-04-25 17:44:32 +08:00
xiongxiaoyang
e14541134a perf: 小说列表样式优化 2023-04-25 13:47:48 +08:00
xiongxiaoyang
6d60a133a9 去掉无效链接 2023-04-25 13:33:46 +08:00
xiongxiaoyang
c56fdbf03b Update README.md 2023-04-25 13:18:50 +08:00
xiongxiaoyang
e690ced5f8 feat: 会员中心-我的评论 2023-04-25 13:11:42 +08:00
xiongxiaoyang
86735c309a Merge github.com:201206030/novel-front-web 2022-08-05 06:33:53 +08:00
xiongxiaoyang
992e3dcf3b chore: 更新生产环境配置 2022-08-05 06:33:03 +08:00
xxy
bbdf59264a
Update README.md 2022-07-15 06:22:04 +08:00
201206030
668d1255da
Update README.md 2022-07-10 18:29:01 +08:00
201206030
2ce28a38ee
Update README.md 2022-07-10 18:28:22 +08:00
201206030
0cf6f33bc5
Update README.md 2022-06-21 07:51:54 +08:00
15 changed files with 2453 additions and 82 deletions

View File

@ -1,5 +1,5 @@
# 生产环境配置
ENV = 'production'
VUE_APP_BASE_API_URL = 'http://47.106.243.172:8888/api/front'
VUE_APP_BASE_IMG_URL = 'http://127.0.0.1:8888'
VUE_APP_BASE_API_URL = 'http://api.test.baidu.com/api'
VUE_APP_BASE_IMG_URL = 'http://api.test.baidu.com'

View File

@ -1,48 +1,73 @@
[![index]( https://s1.ax1x.com/2022/05/17/O5tgbR.png )]( https://curl.qcloud.com/kgMaOjoq )
[![index]( https://youdoc.github.io/img/tencent.jpg )]( https://cloud.tencent.com/act/cps/redirect?redirect=2446&cps_key=736e609d66e0ac4e57813316cec6fd0b&from=console )
<p align="center">
<a href='https://github.com/201206030/novel'><img alt="Github stars" src="https://img.shields.io/github/stars/201206030/novel?logo=github"></a>
<a href='https://github.com/201206030/novel'><img alt="Github forks" src="https://img.shields.io/github/forks/201206030/novel?logo=github"></a>
<a href='https://gitee.com/novel_dev_team/novel'><img alt="Gitee stars" src="https://gitee.com/novel_dev_team/novel/badge/star.svg?theme=gitee"></a>
<a href='https://gitee.com/novel_dev_team/novel'><img alt="Gitee forks" src="https://gitee.com/novel_dev_team/novel/badge/fork.svg?theme=gitee"></a>
</p>
[![Github stars](https://img.shields.io/github/stars/201206030/novel?logo=github)](https://github.com/201206030/novel)
[![Github forks](https://img.shields.io/github/forks/201206030/novel?logo=github)](https://github.com/201206030/novel)
[![Gitee star](https://gitee.com/novel_dev_team/novel/badge/star.svg?theme=gitee)](https://gitee.com/novel_dev_team/novel)
[![Gitee fork](https://gitee.com/novel_dev_team/novel/badge/fork.svg?theme=gitee)](https://gitee.com/novel_dev_team/novel)
## 项目简介
novel 是一套基于时下**最新** Java 技术栈 Spring Boot 3 + Vue 3 开发的前后端分离的**学习型**小说项目,配备详细的项目教程手把手教你**从零开始**开发上线一个生产级别的 Java 系统,由小说门户系统、作家后台管理系统、平台后台管理系统等多个子系统构成。包括小说推荐、作品检索、小说排行榜、小说阅读、小说评论、会员中心、作家专区、充值订阅、新闻发布等功能。
novel 是一套基于时下**最新** Java 技术栈 Spring Boot 3 + Vue 3 开发的前后端分离**学习型**
小说项目,配备[保姆级教程](https://docs.xxyopen.com/course/novel)手把手教你**从零开始**开发上线一套生产级别的 Java
系统,由小说门户系统、作家后台管理系统、平台后台管理系统等多个子系统构成。包括小说推荐、作品检索、小说排行榜、小说阅读、小说评论、会员中心、作家专区、充值订阅、新闻发布等功能。
## 项目地址
- 后端项目(更新中):[GitHub](https://github.com/201206030/novel) [码云](https://gitee.com/novel_dev_team/novel)
- 线上应用版:[GitHub](https://github.com/201206030/novel-plus) [码云](https://gitee.com/novel_dev_team/novel-plus) [演示地址](http://47.106.243.172:8888/)
- 前端项目(更新中):[GitHub](https://github.com/201206030/novel-front-web)
[码云](https://gitee.com/novel_dev_team/novel-front-web)
- 线上应用版:[GitHub](https://github.com/201206030/novel-plus) [码云](https://gitee.com/novel_dev_team/novel-plus)
- 微服务版:[GitHub](https://github.com/201206030/novel-cloud) [码云](https://gitee.com/novel_dev_team/novel-cloud)
## 开发环境
- MySQL 8.0
- Redis 7.0
- Elasticsearch 8.2.0(可选)
- RabbitMQ 3.10.2(可选)
- XXL-JOB 2.3.1(可选)
- JDK 21
- Maven 3.8
- IntelliJ IDEA可选
- Node 16.14
**注Elasticsearch、RabbitMQ 和 XXL-JOB 默认关闭,可通过 application.yml 配置文件中相应的`enable`配置属性开启。**
## 后端技术选型
| 技术 | 版本 | 说明 | 官网 | 学习 |
|---------------------|:------------:|-------------------------| ------------------------------------ |:------------------------------------------------------------------------------------------------------------------------:|
| Spring Boot | 3.3.0 | 容器 + MVC 框架 | [进入](https://spring.io/projects/spring-boot) | [进入](https://docs.spring.io/spring-boot/docs/3.0.0/reference/html) |
| Spring AI | 1.0.0-SNAPSHOT | Spring 官方 AI 框架 | [进入](https://spring.io/projects/spring-ai) | [进入](https://docs.spring.io/spring-ai/reference/) |
| MyBatis | 3.5.9 | ORM 框架 | [进入](http://www.mybatis.org) | [进入](https://mybatis.org/mybatis-3/zh/index.html) |
| MyBatis-Plus | 3.5.3 | MyBatis 增强工具 | [进入](https://baomidou.com/) | [进入](https://baomidou.com/pages/24112f/) |
| JJWT | 0.11.5 | JWT 登录支持 | [进入](https://github.com/jwtk/jjwt) | - |
| Lombok | 1.18.24 | 简化对象封装工具 | [进入](https://github.com/projectlombok/lombok) | [进入](https://projectlombok.org/features/all) |
| Caffeine | 3.1.0 | 本地缓存支持 | [进入](https://github.com/ben-manes/caffeine) | [进入](https://github.com/ben-manes/caffeine/wiki/Home-zh-CN) |
| Redis | 7.0 | 分布式缓存支持 | [进入](https://redis.io) | [进入](https://redis.io/docs) |
| Redisson | 3.17.4 | 分布式锁实现 | [进入](https://github.com/redisson/redisson) | [进入](https://github.com/redisson/redisson/wiki/%E7%9B%AE%E5%BD%95) |
| MySQL | 8.0 | 数据库服务 | [进入](https://www.mysql.com) | [进入](https://docs.oracle.com/en-us/iaas/mysql-database/doc/getting-started.html) |
| ShardingSphere-JDBC | 5.5.1 | 数据库分库分表支持 | [进入](https://shardingsphere.apache.org) | [进入](https://shardingsphere.apache.org/document/5.1.1/cn/overview) |
| Elasticsearch | 8.2.0 | 搜索引擎服务 | [进入](https://www.elastic.co) | [进入](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html) |
| RabbitMQ | 3.10.2 | 开源消息中间件 | [进入](https://www.rabbitmq.com) | [进入](https://www.rabbitmq.com/tutorials/tutorial-one-java.html) |
| XXL-JOB | 2.3.1 | 分布式任务调度平台 | [进入](https://www.xuxueli.com/xxl-job) | [进入](https://www.xuxueli.com/xxl-job) |
| Sentinel | 1.8.4 | 流量控制组件 | [进入](https://github.com/alibaba/Sentinel) | [进入](https://github.com/alibaba/Sentinel/wiki/%E4%B8%BB%E9%A1%B5) |
| Springdoc-openapi | 2.0.0 | Swagger 3 接口文档自动生成 | [进入](https://github.com/springdoc/springdoc-openapi) | [进入](https://springdoc.org/) |
| Spring Boot Admin | 3.0.0-M1 | 应用管理和监控 | [进入](https://github.com/codecentric/spring-boot-admin) | [进入](https://codecentric.github.io/spring-boot-admin/3.0.0-M1) |
| Tomcat | 10.1.24 | Spring Boot 默认内嵌 Web 容器 | [进入](https://tomcat.apache.org) | [进入](https://tomcat.apache.org/tomcat-10.1-doc/index.html) |
| Docker | - | 应用容器引擎 | [进入](https://www.docker.com/) | - |
| Jenkins | - | 自动化部署工具 | [进入](https://github.com/jenkinsci/jenkins) | - |
| Sonarqube | - | 代码质量控制 | [进入](https://www.sonarqube.org/) | - |
**注:更多热门新技术待集成。**
## 前端技术选型
| 技术 | 版本 | 说明 | 官网 | 学习 |
| :----------------- | :-----: | -------------------------- | --------------------------------------- | :-------------------------------------------------: |
| Vue.js | 3.2.13 | 渐进式 JavaScript 框架 | https://v3.cn.vuejs.org | [进入](https://v3.cn.vuejs.org/guide/introduction.html) |
| Vue Router | 4.0.15 | Vue.js 的官方路由 | https://router.vuejs.org/zh/index.html | [进入](https://router.vuejs.org/zh/guide/) |
| axios | 0.27.2 | 基于 promise 的网络请求库 | https://axios-http.com/zh | [进入](https://axios-http.com/zh/docs/intro) |
| element-plus | 2.2.0 | 基于 Vue 3面向设计师和开发者的组件库 | https://element-plus.org/zh-CN/ | [进入](https://element-plus.org/zh-CN/guide/design.html) |
## 公众号
- 关注公众号接收`项目``文档`的更新动态
- 加微信群学习交流,公众号后台回复「**微信群**」即可
- 回复「**资料**」获取`Java 学习面试资料`
- 回复「**笔记**」获取`Spring Boot 3 学习笔记`
![xxyopen](https://youdoc.gitee.io/img/qrcode_for_gh.jpg)
## 赞赏支持
开源项目不易,若此项目能得到你的青睐,那么你可以赞赏支持作者持续开发与维护。
- 更完善的文档教程
- 服务器的费用也是一笔开销
- 为用户提供更好的开发环境
- 一杯咖啡
![mini-code](https://s1.ax1x.com/2020/10/31/BUQJwq.png)
| Vue.js | 3.2.13 | 渐进式 JavaScript 框架 | [进入](https://vuejs.org) | [进入](https://staging-cn.vuejs.org/guide/introduction.html) |
| Vue Router | 4.0.15 | Vue.js 的官方路由 | [进入](https://router.vuejs.org) | [进入](https://router.vuejs.org/zh/guide/) |
| axios | 0.27.2 | 基于 promise 的网络请求库 | [进入](https://axios-http.com) | [进入](https://axios-http.com/zh/docs/intro) |
| element-plus | 2.2.0 | 基于 Vue 3面向设计师和开发者的组件库 | [进入](https://element-plus.org) | [进入](https://element-plus.org/zh-CN/guide/design.html) |

View File

@ -1,6 +1,6 @@
{
"name": "novel-front-web",
"version": "3.2.0",
"version": "3.4.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

View File

@ -23,3 +23,28 @@ export function listChapters(bookId, params) {
export function publishChapter(bookId,params) {
return request.post(`/author/book/chapter/${bookId}`, params);
}
export function aiGenerate(action,params) {
const formData = new FormData();
Object.keys(params).forEach(key => {
formData.append(key, params[key]);
});
return request.post(`/author/ai/${action}`, formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
timeout: 60000
});
}
export function deleteChapter(id) {
return request.delete(`/author/book/chapter/${id}`);
}
export function getChapter(id) {
return request.get(`/author/book/chapter/${id}`);
}
export function updateChapter(id,params) {
return request.put(`/author/book/chapter/${id}`,params);
}

View File

@ -31,3 +31,7 @@ export function getUserinfo() {
export function updateUserInfo(userInfo) {
return request.put('/front/user',userInfo);
}
export function listComments(params) {
return request.get('/front/user/comments', { params });
}

View File

@ -81,10 +81,12 @@
.updateTable td { border-top: 1px solid #eee }
.updateTable .style { width: 74px; font-size: 14px; }
.updateTable .name { width: 192px; padding-right: 10px; font-size: 14px; }
.updateTable td.name { padding-top: 15px; }
.updateTable .name a, .updateTable .chapter a { max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: keep-all }
.updateTable .chapter { padding-right: 5px }
.updateTable .chapter a { max-width: 200px; float: left; color: #666 }
.updateTable .author { width: 82px; text-align: left }
.updateTable td.author { padding-top: 15px; }
.updateTable .time { width: 82px; text-align: center }
.updateTable .word { width: 60px; padding-right: 10px; text-align: right }
.updateTable .rank { width: 2.5em; padding-right: 10px; text-align: center }

View File

@ -3,16 +3,9 @@
<div class="box_center cf">
<div class="copyright">
<ul>
<li class="menu">
<a href="/?to=mobile">手机站</a><i class="line">|</i
><a href="/">网站首页</a><i class="line">|</i
><a href="/about/default.html">关于我们</a><i class="line">|</i
><a href="/about/contact.html">联系我们</a><i class="line">|</i
><a href="javascript:void(0)" @click="goFeedBack">反馈留言</a><i class="line">|</i><a href="/author/index.html">作家专区</a
><i class="line">|</i><a href="/mobile/fiction_house.apk">客户端</a>
</li>
<li>
Copyright (C) xiongxyang.gitee.io All rights
Copyright (C) xxyopen.com All rights
reserved&nbsp;&nbsp;小说精品屋版权所有
</li>
</ul>

View File

@ -0,0 +1,599 @@
<template>
<div class="my_l">
<ul class="log_list">
<li>
<router-link :class="`${routeName == 'userSetup' ? 'link_8 on' : 'link_8'}`" :to="{ name: 'userSetup' }"
>账号设置</router-link
>
</li>
<li>
<router-link :class="`${routeName == 'userComment' ? 'link_6 on' : 'link_6'}`" :to="{ name: 'userComment' }"
>我的评论</router-link
>
</li>
</ul>
</div>
</template>
<script>
import { useRoute } from "vue-router";
export default {
name: "UserMenu",
setup() {
const route = useRoute();
const routeName = route.name;
return {routeName}
}
};
</script>
<style scoped>
.avatar-uploader .avatar {
width: 178px;
height: 178px;
display: block;
}
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
}
.avatar-uploader .el-upload:hover {
border-color: var(--el-color-primary);
}
.el-icon.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
text-align: center;
}
.updateTable .style a {
color: #999;
}
.updateTable .author a {
color: #999;
cursor: text;
}
.bind,
.updateTable .style a:hover {
color: #f65167;
}
.userBox {
/*width: 998px; border: 1px solid #eaeaea;*/
margin: 0 auto 50px;
background: #fff;
border-radius: 6px;
}
.channelViewhistory .userBox {
margin: 0 auto;
}
.user_l {
width: 350px;
float: left;
padding: 100px 124px;
}
.user_l h3 {
font-size: 23px;
font-weight: normal;
line-height: 1;
text-align: center;
}
.user_l #LabErr {
color: #ff4040;
display: block;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
}
.user_l .log_list {
width: 350px;
}
.user_l .s_input {
margin-bottom: 25px;
font-size: 14px;
}
.s_input {
width: 348px;
height: 38px;
line-height: 38px\9;
vertical-align: middle;
border: 1px solid #ddd;
border-radius: 2px;
}
.icon_name,
.icon_key,
.icon_code {
width: 312px;
padding-left: 36px;
}
.icon_key {
background-position: 13px -51px;
}
.icon_code {
background-position: 13px -117px;
width: 200px;
float: left;
}
.code_pic {
height: 38px;
float: right;
}
.btn_phone {
height: 40px;
width: 100px;
float: right;
cursor: pointer;
padding: 0;
text-align: center;
border-radius: 2px;
background: #dfdfdf;
}
.log_code {
*padding-bottom: 25px;
}
.user_l .btn_red {
width: 100%;
font-size: 19px;
padding: 12px;
}
.autologin {
color: #999;
line-height: 1;
margin-bottom: 18px;
}
.autologin em {
vertical-align: 2px;
margin-left: 4px;
}
.user_r {
width: 259px;
margin: 80px 0;
padding: 20px 70px;
border-left: 1px dotted #e3e3e3;
float: right;
text-align: center;
}
.user_r .tit {
font-size: 16px;
line-height: 1;
padding: 6px 0 25px;
}
.user_r .btn_ora {
padding: 10px 34px;
}
.fast_login {
padding: 60px 0 0;
}
.fast_list {
text-align: center;
padding: 0.5rem;
}
.fast_list li {
display: inline-block;
*display: inline;
zoom: 1;
}
.fast_list li .img {
width: 48px;
height: 48px;
margin: 20px 0 5px;
}
.fast_list li a:hover {
opacity: 0.8;
filter: alpha(opacity=80);
-moz-opacity: 0.8;
}
.fast_list li span {
display: block;
}
.fast_list .login_qq {
margin: 0 42px;
}
.fast_list .login_wb a {
color: #f55c5b;
}
.fast_list .login_qq a {
color: #51b7ff;
}
.fast_list .login_wx a {
color: #66d65e;
}
.fast_tit {
position: relative;
overflow: hidden;
}
.fast_tit .lines {
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 1px;
line-height: 1;
background: #eaeaea;
}
.fast_tit .title {
background: #fff;
font-size: 16px;
padding: 3px 14px;
position: relative;
display: inline-block;
z-index: 999;
}
/*userinfo*/
.my_l {
width: 198px;
float: left;
font-size: 13px;
padding-top: 20px;
}
.my_l li a {
display: block;
height: 42px;
line-height: 42px;
padding-left: 62px;
border-left: 4px solid #fff;
margin-bottom: 5px;
color: #666;
}
.my_l li .on {
background-color: #fafafa;
border-left: 2px solid #f80;
color: #000;
border-radius: 0 2px 2px 0;
}
.my_l .link_1 {
background-position: 32px -188px;
}
.my_l .link_2 {
background-position: 32px -230px;
}
.my_l .link_3 {
background-position: 32px -272px;
}
.my_l .link_4 {
background-position: 32px -314px;
}
.my_l .link_5 {
background-position: 32px -356px;
}
.my_l .link_6 {
background-position: 32px -397px;
}
.my_l .link_7 {
background-position: 32px -440px;
}
.my_l .link_8 {
background-position: 32px -481px;
}
.my_r {
width: 739px;
padding: 0 30px 30px;
float: right;
border-left: 1px solid #efefef;
min-height: 470px;
}
.my_info {
padding: 30px 0 5px;
}
.user_big_head {
/*width:110px; height:110px; padding:4px; border:1px solid #eaeaea;*/
margin-right: 30px;
float: left;
width: 80px;
height: 80px;
border-radius: 50%;
}
.my_r .my_name {
font-size: 18px;
line-height: 1;
padding: 5px 0 12px 0;
}
.my_r .s_input {
width: 318px;
padding: 0 10px;
}
.my_list li {
line-height: 28px;
}
.my_list li i,
.my_list li em.red {
margin-right: 6px;
}
.my_list .binded {
color: #999;
margin-left: 6px;
}
.my_list .btn_link {
margin-left: 12px;
}
.mytab_list li {
line-height: 30px;
padding: 10px 0;
font-size: 14px;
}
.mytab_list li .tit {
width: 70px;
color: #aaa;
text-align: right;
display: inline-block;
margin-right: 18px;
}
.mytab_list .user_img {
width: 48px;
height: 48px;
vertical-align: middle;
border-radius: 50%;
}
.my_bookshelf .title {
padding: 20px 0 15px;
line-height: 30px;
}
.my_bookshelf h4 {
font-size: 14px;
color: #666;
}
.my_bookshelf h2 {
font-size: 18px;
font-weight: normal;
}
.updateTable {
width: 739px;
color: #999;
}
.updateTable table {
width: 100%;
margin-bottom: 14px;
}
.updateTable th,
.updateTable td {
height: 40px;
line-height: 40px;
vertical-align: middle;
padding-left: 6px;
font-weight: normal;
text-align: left;
}
.updateTable th {
background: #f9f9f9;
color: #333;
border-top: 1px solid #eee;
}
.updateTable td {
height: 40px;
line-height: 40px;
}
.updateTable .style {
width: 80px;
padding-left: 10px;
}
.updateTable .name {
width: 178px;
padding-right: 10px;
}
.updateTable .name a,
.updateTable .chapter a {
max-width: 168px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.updateTable .chapter {
padding-right: 5px;
}
.updateTable .chapter a {
max-width: 220px;
float: left;
}
.updateTable .author {
width: 72px;
text-align: left;
}
.updateTable .goread {
width: 80px;
text-align: center;
}
.updateTable .time {
width: 86px;
}
.updateTable .word {
width: 64px;
padding-right: 10px;
text-align: right;
}
.updateTable .rank {
width: 30px;
padding-right: 10px;
text-align: center;
}
.updateTable .name a,
.updateTable .chapter a,
.updateTable .author a {
height: 40px;
line-height: 40px;
display: inline-block;
overflow: hidden;
}
.updateTable tr:nth-child(2n) td {
background: #fafafa;
}
.dataTable {
width: 739px;
}
.dataTable table {
width: 100%;
margin-bottom: 14px;
border-collapse: collapse;
}
.dataTable th,
.dataTable td {
height: 40px;
line-height: 40px;
vertical-align: middle;
padding: 0 10px;
font-weight: normal;
text-align: center;
border: 1px solid #eaeaea;
}
.dataTable th {
background: #f8f8f8;
}
.nodate {
border-top: 1px solid #eaeaea;
padding: 60px 0;
}
.viewhistoryBox {
/*padding: 0 30px 30px; */
padding: 0 20px 10px;
}
.viewhistoryBox .updateTable {
width: 100%;
}
/*.btn_gray, .btn_red, .btn_ora { font-size:14px; padding:8px 28px }*/
.book_tit {
height: 48px;
line-height: 48px;
margin: 0 14px;
border-bottom: 1px solid #eaeaea;
overflow: hidden;
}
.book_tit .fl {
font-size: 14px;
color: #999;
}
.book_tit .fl h3 {
font-size: 18px;
color: #333;
font-weight: normal;
margin-right: 5px;
display: inline;
}
.book_tit .fr {
font-size: 14px;
}
.commentBar,
.feedback_list {
border-top: 1px solid #eee;
margin-bottom: 15px;
}
/*.comment_list { padding: 16px 0; border-bottom: 1px solid #eee }
.comment_list .user_head { width:54px; height:54px; border-radius:50%; float: left; margin-right: 14px }
.comment_list .li_1 { overflow: hidden }
.comment_list .user_name { color: #ed4259 }
.comment_list .li_2 { padding:3px 0; color:#999 }
.comment_list .li_3, .comment_list .li_4 { margin-left:68px }
.comment_list .reply { padding-left: 12px }
.comment_list .num { color: #ed4259; margin: 0 3px }
.comment_list .li_4 { line-height:34px; padding-top:8px; margin-top:15px; border-top:1px solid #eaeaea }
.comment_list .li_4 .more { background:#f7f7f7; border-radius:2px; color:#ed4259; text-align:center }*/
.no_contet {
padding: 190px 0 40px;
text-align: center;
color: #999;
border-top: 1px solid #eee;
}
.comment_list {
padding: 20px 0;
border-bottom: 1px solid #eee;
}
.comment_list:last-child {
border: none;
}
.comment_list .user_heads {
/*width: 54px; height: 54px; float: left;*/
position: relative;
margin-right: 20px;
}
.comment_list .user_head {
width: 50px;
height: 50px;
border-radius: 50%;
background: #f6f6f6;
}
.comment_list .user_heads span {
display: block;
margin: 0;
position: absolute;
left: 12px;
bottom: 0;
}
.comment_list ul {
/*width: 640px;*/
width: 660px;
}
.comment_list .li_0 {
font-family: "宋体";
}
.comment_list .li_0 strong {
font-size: 14px;
color: #f00;
}
.comment_list .li_1 {
overflow: hidden;
}
.comment_list .user_name {
color: #ed4259;
}
.comment_list .li_2 {
padding: 6px 0;
}
.comment_list .li_3 {
color: #999;
}
.comment_list .reply {
padding-left: 12px;
}
.comment_list .num {
color: #ed4259;
margin: 0 3px;
}
.comment_list .li_4 {
line-height: 34px;
padding-top: 8px;
margin-top: 15px;
border-top: 1px solid #eaeaea;
}
.pl_bar li {
display: block;
}
.pl_bar .name {
color: #666;
padding-top: 2px;
font-size: 14px;
}
.pl_bar .dec {
font-size: 14px;
line-height: 1.8;
padding: 12px 0;
}
.pl_bar .other {
line-height: 24px;
color: #999;
font-size: 13px;
}
.pl_bar .other a {
display: inline-block;
color: #999;
}
.pl_bar .reply {
padding-left: 22px;
}
/*.no_comment { padding: 70px 14px 115px; color: #CCCCCC; text-align: center; font-size: 14px; }*/
.reply_bar {
background: #f9f9f9;
border: 1px solid #eee;
border-radius: 6px;
padding: 10px;
line-height: 1.8;
}
</style>

View File

@ -5,6 +5,7 @@ import App from './App.vue'
import router from '@/router'
import '@/assets/styles/base.css'
import '@/assets/styles/main.css'
import { Loading } from '@element-plus/icons-vue'
const app = createApp(App)
@ -13,3 +14,5 @@ app.use(ElementPlus)
app.use(router)
app.mount('#app')
app.component('Loading', Loading)

View File

@ -66,6 +66,11 @@ const router = createRouter({
path: '/user/setup',
name: 'userSetup',
component: () => import('@/views/UserSetup')
},
{
path: '/user/comment',
name: 'userComment',
component: () => import('@/views/UserComment')
},
{
@ -92,6 +97,11 @@ const router = createRouter({
path: '/author/chapter_add',
name: 'authorChapterAdd',
component: () => import('@/views/author/ChapterAdd')
},
{
path: '/author/chapter_update',
name: 'authorChapterUpdate',
component: () => import('@/views/author/ChapterUpdate')
}
]
})

680
src/views/UserComment.vue Normal file
View File

@ -0,0 +1,680 @@
<template>
<Header />
<div class="main box_center cf">
<div class="userBox cf">
<UserMenu />
<div class="my_r">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl">我的书评</h2>
<div class="fr"></div>
</div>
<div class="bookComment">
<div v-if="total == 0" class="no_contet no_comment" >
您还没有发表过评论
</div>
<div v-if="total > 0" class="commentBar" id="commentBar">
<div v-for="(item, index) in comments"
:key="index" class="comment_list cf"><div class="user_heads fl" vals="389"><img :src="
imgBaseUrl + item.commentBookPic
" class="user_head" alt="" onerror="this.src='default.gif';this.onerror=null"><span class="user_level1" style="display: none;">见习</span></div><ul class="pl_bar fr"> <li class="name">{{ item.commentBook }}</li><li class="dec" v-html="item.commentContent"></li><li class="other cf"><span class="time fl">{{ item.commentTime }}</span><span class="fr"><a href="javascript:void(0);" onclick="javascript:BookDetail.AddAgreeTotal(77,this);" class="zan" style="display: none;">赞<i class="num">(0)</i></a></span></li> </ul> </div>
</div>
</div>
<el-pagination v-if="total > 0"
small
layout="prev, pager, next"
:background="backgroud"
:page-size="pageSize"
:total="total"
class="mt-4"
@current-change="handleCurrentChange"
/>
</div>
</div>
</div>
</div>
<Footer />
</template>
<script>
import "@/assets/styles/user.css";
import man from "@/assets/images/man.png";
import { listComments } from '@/api/user'
import { reactive, toRefs, onMounted, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import Header from "@/components/common/Header";
import Footer from "@/components/common/Footer";
import UserMenu from "@/components/user/Menu";
export default {
name: "userComment",
components: {
Header,
Footer,
UserMenu
},
setup() {
const route = useRoute();
const router = useRouter();
const state = reactive({
total: 0,
pageSize: 10,
comments:[],
baseUrl: process.env.VUE_APP_BASE_API_URL,
imgBaseUrl: process.env.VUE_APP_BASE_IMG_URL,
});
const handleCurrentChange = (pageNum) => {
loadComments(pageNum);
};
onMounted(async () => {
loadComments(0);
});
const loadComments = async (pageNum) => {
const { data } = await listComments({'pageNum':pageNum,'pageSize':state.pageSize});
state.comments = data.list;
state.total = Number(data.total);
};
return {
...toRefs(state),
handleCurrentChange,
man,
};
},
};
</script>
<style scoped>
.el-pagination {
justify-content: center;
}
.el-pagination.is-background .el-pager li:not(.is-disabled).is-active {
background-color: #f80 !important;
}
.el-pagination {
--el-pagination-hover-color: #f80 !important;
}
.avatar-uploader .avatar {
width: 178px;
height: 178px;
display: block;
}
.avatar-uploader .avatar {
width: 178px;
height: 178px;
display: block;
}
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
}
.avatar-uploader .el-upload:hover {
border-color: var(--el-color-primary);
}
.el-icon.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
text-align: center;
}
.updateTable .style a {
color: #999;
}
.updateTable .author a {
color: #999;
cursor: text;
}
.bind,
.updateTable .style a:hover {
color: #f65167;
}
.userBox {
/*width: 998px; border: 1px solid #eaeaea;*/
margin: 0 auto 50px;
background: #fff;
border-radius: 6px;
}
.channelViewhistory .userBox {
margin: 0 auto;
}
.user_l {
width: 350px;
float: left;
padding: 100px 124px;
}
.user_l h3 {
font-size: 23px;
font-weight: normal;
line-height: 1;
text-align: center;
}
.user_l #LabErr {
color: #ff4040;
display: block;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
}
.user_l .log_list {
width: 350px;
}
.user_l .s_input {
margin-bottom: 25px;
font-size: 14px;
}
.s_input {
width: 348px;
height: 38px;
line-height: 38px\9;
vertical-align: middle;
border: 1px solid #ddd;
border-radius: 2px;
}
.icon_name,
.icon_key,
.icon_code {
width: 312px;
padding-left: 36px;
}
.icon_key {
background-position: 13px -51px;
}
.icon_code {
background-position: 13px -117px;
width: 200px;
float: left;
}
.code_pic {
height: 38px;
float: right;
}
.btn_phone {
height: 40px;
width: 100px;
float: right;
cursor: pointer;
padding: 0;
text-align: center;
border-radius: 2px;
background: #dfdfdf;
}
.log_code {
*padding-bottom: 25px;
}
.user_l .btn_red {
width: 100%;
font-size: 19px;
padding: 12px;
}
.autologin {
color: #999;
line-height: 1;
margin-bottom: 18px;
}
.autologin em {
vertical-align: 2px;
margin-left: 4px;
}
.user_r {
width: 259px;
margin: 80px 0;
padding: 20px 70px;
border-left: 1px dotted #e3e3e3;
float: right;
text-align: center;
}
.user_r .tit {
font-size: 16px;
line-height: 1;
padding: 6px 0 25px;
}
.user_r .btn_ora {
padding: 10px 34px;
}
.fast_login {
padding: 60px 0 0;
}
.fast_list {
text-align: center;
padding: 0.5rem;
}
.fast_list li {
display: inline-block;
*display: inline;
zoom: 1;
}
.fast_list li .img {
width: 48px;
height: 48px;
margin: 20px 0 5px;
}
.fast_list li a:hover {
opacity: 0.8;
filter: alpha(opacity=80);
-moz-opacity: 0.8;
}
.fast_list li span {
display: block;
}
.fast_list .login_qq {
margin: 0 42px;
}
.fast_list .login_wb a {
color: #f55c5b;
}
.fast_list .login_qq a {
color: #51b7ff;
}
.fast_list .login_wx a {
color: #66d65e;
}
.fast_tit {
position: relative;
overflow: hidden;
}
.fast_tit .lines {
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 1px;
line-height: 1;
background: #eaeaea;
}
.fast_tit .title {
background: #fff;
font-size: 16px;
padding: 3px 14px;
position: relative;
display: inline-block;
z-index: 999;
}
/*userinfo*/
.my_l {
width: 198px;
float: left;
font-size: 13px;
padding-top: 20px;
}
.my_l li a {
display: block;
height: 42px;
line-height: 42px;
padding-left: 62px;
border-left: 4px solid #fff;
margin-bottom: 5px;
color: #666;
}
.my_l li .on {
background-color: #fafafa;
border-left: 2px solid #f80;
color: #000;
border-radius: 0 2px 2px 0;
}
.my_l .link_1 {
background-position: 32px -188px;
}
.my_l .link_2 {
background-position: 32px -230px;
}
.my_l .link_3 {
background-position: 32px -272px;
}
.my_l .link_4 {
background-position: 32px -314px;
}
.my_l .link_5 {
background-position: 32px -356px;
}
.my_l .link_6 {
background-position: 32px -397px;
}
.my_l .link_7 {
background-position: 32px -440px;
}
.my_l .link_8 {
background-position: 32px -481px;
}
.my_r {
width: 739px;
padding: 0 30px 30px;
float: right;
border-left: 1px solid #efefef;
min-height: 470px;
}
.my_info {
padding: 30px 0 5px;
}
.user_big_head {
/*width:110px; height:110px; padding:4px; border:1px solid #eaeaea;*/
margin-right: 30px;
float: left;
width: 80px;
height: 80px;
border-radius: 50%;
}
.my_r .my_name {
font-size: 18px;
line-height: 1;
padding: 5px 0 12px 0;
}
.my_r .s_input {
width: 318px;
padding: 0 10px;
}
.my_list li {
line-height: 28px;
}
.my_list li i,
.my_list li em.red {
margin-right: 6px;
}
.my_list .binded {
color: #999;
margin-left: 6px;
}
.my_list .btn_link {
margin-left: 12px;
}
.mytab_list li {
line-height: 30px;
padding: 10px 0;
font-size: 14px;
}
.mytab_list li .tit {
width: 70px;
color: #aaa;
text-align: right;
display: inline-block;
margin-right: 18px;
}
.mytab_list .user_img {
width: 48px;
height: 48px;
vertical-align: middle;
border-radius: 50%;
}
.my_bookshelf .title {
padding: 20px 0 15px;
line-height: 30px;
}
.my_bookshelf h4 {
font-size: 14px;
color: #666;
}
.my_bookshelf h2 {
font-size: 18px;
font-weight: normal;
}
.updateTable {
width: 739px;
color: #999;
}
.updateTable table {
width: 100%;
margin-bottom: 14px;
}
.updateTable th,
.updateTable td {
height: 40px;
line-height: 40px;
vertical-align: middle;
padding-left: 6px;
font-weight: normal;
text-align: left;
}
.updateTable th {
background: #f9f9f9;
color: #333;
border-top: 1px solid #eee;
}
.updateTable td {
height: 40px;
line-height: 40px;
}
.updateTable .style {
width: 80px;
padding-left: 10px;
}
.updateTable .name {
width: 178px;
padding-right: 10px;
}
.updateTable .name a,
.updateTable .chapter a {
max-width: 168px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.updateTable .chapter {
padding-right: 5px;
}
.updateTable .chapter a {
max-width: 220px;
float: left;
}
.updateTable .author {
width: 72px;
text-align: left;
}
.updateTable .goread {
width: 80px;
text-align: center;
}
.updateTable .time {
width: 86px;
}
.updateTable .word {
width: 64px;
padding-right: 10px;
text-align: right;
}
.updateTable .rank {
width: 30px;
padding-right: 10px;
text-align: center;
}
.updateTable .name a,
.updateTable .chapter a,
.updateTable .author a {
height: 40px;
line-height: 40px;
display: inline-block;
overflow: hidden;
}
.updateTable tr:nth-child(2n) td {
background: #fafafa;
}
.dataTable {
width: 739px;
}
.dataTable table {
width: 100%;
margin-bottom: 14px;
border-collapse: collapse;
}
.dataTable th,
.dataTable td {
height: 40px;
line-height: 40px;
vertical-align: middle;
padding: 0 10px;
font-weight: normal;
text-align: center;
border: 1px solid #eaeaea;
}
.dataTable th {
background: #f8f8f8;
}
.nodate {
border-top: 1px solid #eaeaea;
padding: 60px 0;
}
.viewhistoryBox {
/*padding: 0 30px 30px; */
padding: 0 20px 10px;
}
.viewhistoryBox .updateTable {
width: 100%;
}
/*.btn_gray, .btn_red, .btn_ora { font-size:14px; padding:8px 28px }*/
.book_tit {
height: 48px;
line-height: 48px;
margin: 0 14px;
border-bottom: 1px solid #eaeaea;
overflow: hidden;
}
.book_tit .fl {
font-size: 14px;
color: #999;
}
.book_tit .fl h3 {
font-size: 18px;
color: #333;
font-weight: normal;
margin-right: 5px;
display: inline;
}
.book_tit .fr {
font-size: 14px;
}
.commentBar,
.feedback_list {
border-top: 1px solid #eee;
margin-bottom: 15px;
}
/*.comment_list { padding: 16px 0; border-bottom: 1px solid #eee }
.comment_list .user_head { width:54px; height:54px; border-radius:50%; float: left; margin-right: 14px }
.comment_list .li_1 { overflow: hidden }
.comment_list .user_name { color: #ed4259 }
.comment_list .li_2 { padding:3px 0; color:#999 }
.comment_list .li_3, .comment_list .li_4 { margin-left:68px }
.comment_list .reply { padding-left: 12px }
.comment_list .num { color: #ed4259; margin: 0 3px }
.comment_list .li_4 { line-height:34px; padding-top:8px; margin-top:15px; border-top:1px solid #eaeaea }
.comment_list .li_4 .more { background:#f7f7f7; border-radius:2px; color:#ed4259; text-align:center }*/
.no_contet {
padding: 190px 0 40px;
text-align: center;
color: #999;
border-top: 1px solid #eee;
}
.comment_list {
padding: 20px 0;
border-bottom: 1px solid #eee;
}
.comment_list:last-child {
border: none;
}
.comment_list .user_heads {
/*width: 54px; height: 54px; float: left;*/
position: relative;
margin-right: 20px;
}
.comment_list .user_head {
width: 50px;
height: 50px;
border-radius: 50%;
background: #f6f6f6;
}
.comment_list .user_heads span {
display: block;
margin: 0;
position: absolute;
left: 12px;
bottom: 0;
}
.comment_list ul {
/*width: 640px;*/
width: 660px;
}
.comment_list .li_0 {
font-family: "宋体";
}
.comment_list .li_0 strong {
font-size: 14px;
color: #f00;
}
.comment_list .li_1 {
overflow: hidden;
}
.comment_list .user_name {
color: #ed4259;
}
.comment_list .li_2 {
padding: 6px 0;
}
.comment_list .li_3 {
color: #999;
}
.comment_list .reply {
padding-left: 12px;
}
.comment_list .num {
color: #ed4259;
margin: 0 3px;
}
.comment_list .li_4 {
line-height: 34px;
padding-top: 8px;
margin-top: 15px;
border-top: 1px solid #eaeaea;
}
.pl_bar li {
display: block;
}
.pl_bar .name {
color: #666;
padding-top: 2px;
font-size: 14px;
}
.pl_bar .dec {
font-size: 14px;
line-height: 1.8;
padding: 12px 0;
}
.pl_bar .other {
line-height: 24px;
color: #999;
font-size: 13px;
}
.pl_bar .other a {
display: inline-block;
color: #999;
}
.pl_bar .reply {
padding-left: 22px;
}
/*.no_comment { padding: 70px 14px 115px; color: #CCCCCC; text-align: center; font-size: 14px; }*/
.reply_bar {
background: #f9f9f9;
border: 1px solid #eee;
border-radius: 6px;
padding: 10px;
line-height: 1.8;
}
</style>

View File

@ -3,11 +3,7 @@
<div class="main box_center cf">
<div class="userBox cf">
<div class="my_l">
<ul class="log_list">
<li><a class="link_8 on">账号设置</a></li>
</ul>
</div>
<UserMenu />
<div class="my_r">
<div class="my_info cf">
<div class="my_info_txt">
@ -89,11 +85,13 @@ import { getImgVerifyCode } from "@/api/resource";
import { getUserinfo, updateUserInfo } from "@/api/user";
import Header from "@/components/common/Header";
import Footer from "@/components/common/Footer";
import UserMenu from "@/components/user/Menu";
export default {
name: "userSetup",
components: {
Header,
Footer,
UserMenu
},
setup() {
const route = useRoute();

View File

@ -25,7 +25,7 @@
<b>章节名</b>
<li>
<input
v-model="chapter.chapterName"
v-model="chapter.chapterName"
type="text"
id="bookIndex"
name="bookIndex"
@ -34,26 +34,102 @@
</li>
<b>章节内容</b>
<li id="contentLi">
<div class="ai-toolbar">
<el-button
v-for="btn in aiButtons"
:key="btn.action"
:type="btn.type"
:disabled="!hasSelection || generating"
@click="openDialog(btn.action)"
size="small"
>
{{ btn.label }}
<el-icon v-if="generating" class="is-loading">
<Loading />
</el-icon>
</el-button>
<!-- 参数输入对话框 -->
<el-dialog
v-model="dialogVisible"
:title="dialogTitle"
width="30%"
>
<div
v-if="
currentAction === 'expand' ||
currentAction === 'condense'
"
>
<el-input
v-model.number="ratio"
type="number"
:placeholder="`请输入${
currentAction === 'expand' ? '扩写' : '缩写'
}比例1-200%`"
min="1"
max="200"
>
<template #append>%</template>
</el-input>
</div>
<div v-if="currentAction === 'continue'">
<el-input
v-model.number="length"
type="number"
placeholder="请输入续写长度50-1000字"
min="50"
max="1000"
>
<template #append></template>
</el-input>
</div>
<template #footer>
<el-button @click="dialogVisible = false"
>取消</el-button
>
<el-button type="primary" @click="confirmParams"
>确定</el-button
>
</template>
</el-dialog>
</div>
<textarea
v-model="chapter.chapterContent"
ref="editor"
v-model="chapter.chapterContent"
name="bookContent"
rows="30"
cols="80"
id="bookContent"
class="textarea"
@mouseup="checkSelection"
@keyup="checkSelection"
></textarea>
</li>
<br />
<b>是否收费</b>
<li>
<input v-model="chapter.isVip" type="radio" name="isVip" value="0" checked="" />免费
<input v-model="chapter.isVip" type="radio" name="isVip" value="1" />收费
<input
v-model="chapter.isVip"
type="radio"
name="isVip"
value="0"
checked=""
/>
<input
v-model="chapter.isVip"
type="radio"
name="isVip"
value="1"
/>
</li>
<li style="margin-top: 10px">
<input
@click="saveChapter"
@click="saveChapter"
type="button"
name="btnRegister"
value="提交"
@ -104,12 +180,11 @@
<script>
import "@/assets/styles/book.css";
import { reactive, toRefs, onMounted, ref } from "vue";
import { reactive, toRefs, computed, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import { ElMessage } from "element-plus";
import { publishChapter } from "@/api/author";
import { ElMessage} from "element-plus";
import { publishChapter, aiGenerate } from "@/api/author";
import AuthorHeader from "@/components/author/Header.vue";
import picUpload from "@/assets/images/pic_upload.png";
export default {
name: "authorChapterAdd",
components: {
@ -118,12 +193,145 @@ export default {
setup() {
const route = useRoute();
const router = useRouter();
const editor = ref(null);
const state = reactive({
bookId: route.query.id,
chapter: { chapterName: "", chapterContent: "", isVip: 0 },
hasSelection: false,
generating: false,
selectedText: "",
aiButtons: [
{ label: "AI扩写", action: "expand", type: "primary" },
{ label: "AI缩写", action: "condense", type: "success" },
{ label: "AI续写", action: "continue", type: "warning" },
{ label: "AI润色", action: "polish", type: "danger" },
],
dialogVisible: false,
currentAction: '',
ratio: 30, // /
length: 200, //
});
const dialogTitle = computed(() => {
const map = {
expand: '扩写设置',
condense: '缩写设置',
continue: '续写设置',
polish: '润色设置'
}
return map[state.currentAction]
})
const openDialog = (action) => {
state.currentAction = action
//
if (action === 'polish') {
handleAI(action)
} else {
state.dialogVisible = true
}
}
const validateParams = () => {
if (state.currentAction === 'expand') {
if (!state.ratio || state.ratio < 110 || state.ratio > 200) {
ElMessage.error('请输入110-200%之间的比例')
return false
}
}
if (state.currentAction === 'condense') {
if (!state.ratio || state.ratio < 1 || state.ratio > 99) {
ElMessage.error('请输入1-99%之间的比例')
return false
}
}
if (state.currentAction === 'continue') {
if (!state.length || state.length < 50 || state.length > 1000) {
ElMessage.error('请输入50-1000字之间的长度')
return false
}
}
return true
}
const confirmParams = async () => {
if (!validateParams()) return
state.dialogVisible = false
await handleAI(state.currentAction)
}
const getActionName = (action) => {
return {
expand: `扩写(${state.ratio}%`,
condense: `缩写(${state.ratio}%`,
continue: `续写(${state.length}字)`,
polish: '润色'
}[action]
}
const checkSelection = () => {
const textarea = editor.value;
if (textarea) {
const start = textarea.selectionStart;
const end = textarea.selectionEnd;
state.hasSelection = start !== end;
if (state.hasSelection) {
state.selectedText = textarea.value.substring(start, end);
}
}
};
const typewriterEffect = (text) => {
return new Promise((resolve) => {
let index = 0;
const typing = setInterval(() => {
if (index < text.length) {
state.chapter.chapterContent += text.charAt(index);
index++;
//
editor.scrollTop = editor.scrollHeight;
} else {
clearInterval(typing);
resolve();
}
}, 20);
});
};
const handleAI = async (action) => {
try {
state.generating = true
const params = {
text: state.selectedText
}
//
if (action === 'expand' || action === 'condense') {
params.ratio = state.ratio
}
if (action === 'continue') {
params.length = state.length
}
const response = await aiGenerate(action,params)
//
const newContent = `\n\n【AI生成内容】${response.data}`;
state.hasSelection = false;
state.selectedText = '';
await typewriterEffect(newContent);
} catch (error) {
ElMessage.error("AI生成失败" + error.message);
} finally {
state.generating = false;
}
};
const saveChapter = async () => {
console.log("sate=========", state.chapter);
if (!state.chapter.chapterName) {
@ -141,12 +349,19 @@ export default {
}
await publishChapter(state.bookId, state.chapter);
router.push({ name: "authorChapterList", query:{'id':state.bookId} });
router.push({ name: "authorChapterList", query: { id: state.bookId } });
};
return {
...toRefs(state),
editor,
checkSelection,
handleAI,
saveChapter,
dialogTitle,
openDialog,
confirmParams,
getActionName
};
},
};
@ -744,4 +959,28 @@ a.redBtn:hover {
padding: 10px;
line-height: 1.8;
}
/* 新增AI工具栏样式 */
.ai-toolbar {
margin-bottom: 10px;
width: 500px;
}
.ai-toolbar .el-button {
margin-right: 10px;
}
.textarea {
position: relative;
font-family: "Microsoft YaHei", sans-serif;
line-height: 1.6;
padding: 10px;
}
.ai-toolbar .el-input {
margin-bottom: 15px;
}
:deep(.el-dialog__body) {
padding: 20px;
}
</style>

View File

@ -14,51 +14,71 @@
<div class="my_r">
<div id="noContentDiv" v-if="total == 0">
<div class="tc" style="margin-top: 200px">
<router-link class="redBtn" :to="{'name':'authorChapterAdd','query':{'id':bookId}}">章节发布</router-link>
<router-link
class="redBtn"
:to="{ name: 'authorChapterAdd', query: { id: bookId } }"
>章节发布</router-link
>
</div>
</div>
<div class="my_bookshelf" id="hasContentDiv" v-if="total > 0">
<div class="title cf">
<h2 class="fl">章节列表</h2>
<div class="fr">
<router-link class="redBtn" :to="{'name':'authorChapterAdd','query':{'id':bookId}}">新建章节</router-link>
<router-link
class="redBtn"
:to="{ name: 'authorChapterAdd', query: { id: bookId } }"
>新建章节</router-link
>
</div>
</div>
<div id="divData" class="updateTable">
<table cellpadding="0" cellspacing="0">
<thead>
<tr >
<tr>
<!-- <th class="style">
序号
</th>-->
<th class="name">章节名</th>
<th class="goread">更新时间</th>
<th class="goread">是否收费</th>
<!-- <th class="goread">操作</th>-->
<th class="goread">操作</th>
</tr>
</thead>
<tbody id="bookList">
<tr class="book_list" vals="291" v-for="(item, index) in chapters"
:key="index">
<tr
class="book_list"
vals="291"
v-for="(item, index) in chapters"
:key="index"
>
<td id="name1358314029098041344" class="name">
{{item.chapterName}}
{{ item.chapterName }}
</td>
<td class="goread">{{item.chapterUpdateTime}}<br />更新</td>
<td class="goread" valsc="291|2037554|1">{{item.isVip == 1 ? '收费' : '免费'}}</td>
<!--
<td class="goread">{{ item.chapterUpdateTime }}<br />更新</td>
<td class="goread" valsc="291|2037554|1">
{{ item.isVip == 1 ? "收费" : "免费" }}
</td>
<td class="goread" id="opt1358314029098041344">
<router-link
:to="{
name: 'authorChapterUpdate',
query: { id: item.id },
}"
>修改</router-link
>
<br />
<a
class="redBtn"
href='javascript:updateIndex("1358314029098041344",1)'
>修改 </a
><br /><a
href='javascript:deleteIndex("1358314029098041344")'
href="javascript:void(0);"
@click="deleteBookChapter(item.id)"
>删除 </a
><br />
</td>-->
</td>
</tr>
</tbody>
</table>
<el-pagination
@ -112,7 +132,7 @@
import "@/assets/styles/book.css";
import { reactive, toRefs, onMounted, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import { listChapters } from "@/api/author";
import { listChapters, deleteChapter } from "@/api/author";
import AuthorHeader from "@/components/author/Header.vue";
export default {
name: "authorChapterList",
@ -137,7 +157,7 @@ export default {
});
const load = async () => {
const { data } = await listChapters(state.bookId,state.searchCondition);
const { data } = await listChapters(state.bookId, state.searchCondition);
state.chapters = data.list;
state.searchCondition.pageNum = data.pageNum;
state.searchCondition.pageSize = data.pageSize;
@ -149,10 +169,16 @@ export default {
load();
};
const deleteBookChapter = async (id) => {
await deleteChapter(id);
load();
};
return {
...toRefs(state),
handleCurrentChange,
load,
deleteBookChapter,
};
},
};

View File

@ -0,0 +1,767 @@
<template>
<AuthorHeader />
<div class="main box_center cf">
<div class="userBox cf">
<div class="my_l">
<ul class="log_list">
<li>
<router-link class="link_4 on" :to="{ name: 'authorBookList' }"
>小说管理</router-link
>
</li>
<!--<li><a class="link_1 " href="/user/userinfo.html">批量小说爬取</a></li>
<li><a class="link_4 " href="/user/favorites.html">单本小说爬取</a></li>-->
</ul>
</div>
<div class="my_r">
<div class="my_bookshelf">
<div class="userBox cf">
<form method="post" action="./register.html" id="form2">
<div class="user_l">
<div></div>
<h3>小说章节内容填写</h3>
<ul class="log_list">
<li><span id="LabErr"></span></li>
<b>章节名</b>
<li>
<input
v-model="chapter.chapterName"
type="text"
id="bookIndex"
name="bookIndex"
class="s_input"
/>
</li>
<b>章节内容</b>
<li id="contentLi">
<textarea
v-model="chapter.chapterContent"
name="bookContent"
rows="30"
cols="80"
id="bookContent"
class="textarea"
></textarea>
</li>
<br />
<b>是否收费</b>
<li>
<input
v-model="chapter.isVip"
type="radio"
name="isVip"
value="0"
checked=""
/>
<input
v-model="chapter.isVip"
type="radio"
name="isVip"
value="1"
/>
</li>
<li style="margin-top: 10px">
<input
@click="updateBookChapter"
type="button"
name="btnRegister"
value="提交"
id="btnRegister"
class="btn_red"
/>
</li>
</ul>
</div>
</form>
</div>
<!--<div id="divData" class="updateTable">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th class="name">
爬虫源已开启的爬虫源
</th>
<th class="chapter">
成功爬取数量websocket实现
</th>
<th class="time">
目标爬取数量
</th>
<th class="goread">
状态正在运行已停止一次只能运行一个爬虫源
</th>
<th class="goread">
操作启动停止
</th>
</tr>
</thead>
<tbody id="bookShelfList">
</tbody>
</table>
<div class="pageBox cf" id="shellPage">
</div>
</div>-->
</div>
</div>
</div>
</div>
</template>
<script>
import "@/assets/styles/book.css";
import { reactive, toRefs, onMounted, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import { ElMessage } from "element-plus";
import { updateChapter, getChapter } from "@/api/author";
import AuthorHeader from "@/components/author/Header.vue";
import picUpload from "@/assets/images/pic_upload.png";
export default {
name: "authorChapterUpdate",
components: {
AuthorHeader,
},
setup() {
const route = useRoute();
const router = useRouter();
const state = reactive({
chapterId: route.query.id,
chapter: { chapterName: "", chapterContent: "", isVip: 0 },
});
onMounted(() => {
load();
});
const load = async () => {
const { data } = await getChapter(state.chapterId);
state.chapter = data;
};
const updateBookChapter = async () => {
console.log("sate=========", state.chapter);
if (!state.chapter.chapterName) {
ElMessage.error("章节名不能为空!");
return;
}
if (!state.chapter.chapterContent) {
ElMessage.error("章节内容不能为空!");
return;
}
if (state.chapter.chapterContent.length < 50) {
ElMessage.error("章节内容太少!");
return;
}
await updateChapter(state.chapterId, state.chapter);
ElMessage.success("更新成功!");
};
return {
...toRefs(state),
updateBookChapter,
};
},
};
</script>
<style>
.el-pagination {
justify-content: center;
}
.el-pagination.is-background .el-pager li:not(.is-disabled).is-active {
background-color: #f80 !important;
}
.el-pagination {
--el-pagination-hover-color: #f80 !important;
}
</style>
<style scoped>
.redBtn {
padding: 5px;
border-radius: 20px;
border: 1px solid #f80;
background: #f80;
color: #fff;
}
a.redBtn:hover {
color: #fff;
}
.avatar-uploader .avatar {
width: 178px;
height: 178px;
display: block;
}
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
}
.avatar-uploader .el-upload:hover {
border-color: var(--el-color-primary);
}
.el-icon.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
text-align: center;
}
.updateTable .style a {
color: #999;
}
.updateTable .author a {
color: #999;
cursor: text;
}
.bind,
.updateTable .style a:hover {
color: #f65167;
}
.userBox {
/*width: 998px; border: 1px solid #eaeaea;*/
margin: 0 auto 50px;
background: #fff;
border-radius: 6px;
}
.channelViewhistory .userBox {
margin: 0 auto;
}
.user_l {
width: 350px;
float: left;
padding: 100px 124px;
}
.user_l h3 {
font-size: 23px;
font-weight: normal;
line-height: 1;
text-align: center;
}
.user_l #LabErr {
color: #ff4040;
display: block;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
}
.user_l .log_list {
width: 350px;
}
.user_l .s_input {
margin-bottom: 25px;
font-size: 14px;
}
.s_input {
width: 348px;
height: 38px;
line-height: 38px\9;
vertical-align: middle;
border: 1px solid #ddd;
border-radius: 2px;
}
.icon_name,
.icon_key,
.icon_code {
width: 312px;
padding-left: 36px;
}
.icon_key {
background-position: 13px -51px;
}
.icon_code {
background-position: 13px -117px;
width: 200px;
float: left;
}
.code_pic {
height: 38px;
float: right;
}
.btn_phone {
height: 40px;
width: 100px;
float: right;
cursor: pointer;
padding: 0;
text-align: center;
border-radius: 2px;
background: #dfdfdf;
}
.log_code {
*padding-bottom: 25px;
}
.user_l .btn_red {
width: 100%;
font-size: 19px;
padding: 12px;
}
.autologin {
color: #999;
line-height: 1;
margin-bottom: 18px;
}
.autologin em {
vertical-align: 2px;
margin-left: 4px;
}
.user_r {
width: 259px;
margin: 80px 0;
padding: 20px 70px;
border-left: 1px dotted #e3e3e3;
float: right;
text-align: center;
}
.user_r .tit {
font-size: 16px;
line-height: 1;
padding: 6px 0 25px;
}
.user_r .btn_ora {
padding: 10px 34px;
}
.fast_login {
padding: 60px 0 0;
}
.fast_list {
text-align: center;
padding: 0.5rem;
}
.fast_list li {
display: inline-block;
*display: inline;
zoom: 1;
}
.fast_list li .img {
width: 48px;
height: 48px;
margin: 20px 0 5px;
}
.fast_list li a:hover {
opacity: 0.8;
filter: alpha(opacity=80);
-moz-opacity: 0.8;
}
.fast_list li span {
display: block;
}
.fast_list .login_qq {
margin: 0 42px;
}
.fast_list .login_wb a {
color: #f55c5b;
}
.fast_list .login_qq a {
color: #51b7ff;
}
.fast_list .login_wx a {
color: #66d65e;
}
.fast_tit {
position: relative;
overflow: hidden;
}
.fast_tit .lines {
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 1px;
line-height: 1;
background: #eaeaea;
}
.fast_tit .title {
background: #fff;
font-size: 16px;
padding: 3px 14px;
position: relative;
display: inline-block;
z-index: 999;
}
/*userinfo*/
.my_l {
width: 198px;
float: left;
font-size: 13px;
padding-top: 20px;
}
.my_l li a {
display: block;
height: 42px;
line-height: 42px;
padding-left: 62px;
border-left: 4px solid #fff;
margin-bottom: 5px;
color: #666;
}
.my_l li .on {
background-color: #fafafa;
border-left: 2px solid #f80;
color: #000;
border-radius: 0 2px 2px 0;
}
.my_l .link_1 {
background-position: 32px -188px;
}
.my_l .link_2 {
background-position: 32px -230px;
}
.my_l .link_3 {
background-position: 32px -272px;
}
.my_l .link_4 {
background-position: 32px -314px;
}
.my_l .link_5 {
background-position: 32px -356px;
}
.my_l .link_6 {
background-position: 32px -397px;
}
.my_l .link_7 {
background-position: 32px -440px;
}
.my_l .link_8 {
background-position: 32px -481px;
}
.my_r {
width: 739px;
padding: 0 30px 30px;
float: right;
border-left: 1px solid #efefef;
min-height: 470px;
}
.my_info {
padding: 30px 0 5px;
}
.user_big_head {
/*width:110px; height:110px; padding:4px; border:1px solid #eaeaea;*/
margin-right: 30px;
float: left;
width: 80px;
height: 80px;
border-radius: 50%;
}
.my_r .my_name {
font-size: 18px;
line-height: 1;
padding: 5px 0 12px 0;
}
.my_r .s_input {
width: 318px;
padding: 0 10px;
}
.my_list li {
line-height: 28px;
}
.my_list li i,
.my_list li em.red {
margin-right: 6px;
}
.my_list .binded {
color: #999;
margin-left: 6px;
}
.my_list .btn_link {
margin-left: 12px;
}
.mytab_list li {
line-height: 30px;
padding: 10px 0;
font-size: 14px;
}
.mytab_list li .tit {
width: 70px;
color: #aaa;
text-align: right;
display: inline-block;
margin-right: 18px;
}
.mytab_list .user_img {
width: 48px;
height: 48px;
vertical-align: middle;
border-radius: 50%;
}
.my_bookshelf .title {
padding: 20px 0 15px;
line-height: 30px;
}
.my_bookshelf h4 {
font-size: 14px;
color: #666;
}
.my_bookshelf h2 {
font-size: 18px;
font-weight: normal;
}
.updateTable {
width: 739px;
color: #999;
}
.updateTable table {
width: 100%;
margin-bottom: 14px;
}
.updateTable th,
.updateTable td {
height: 40px;
line-height: 40px;
vertical-align: middle;
padding-left: 6px;
font-weight: normal;
text-align: left;
}
.updateTable th {
background: #f9f9f9;
color: #333;
border-top: 1px solid #eee;
}
.updateTable td {
height: 40px;
line-height: 40px;
}
.updateTable .style {
width: 80px;
padding-left: 10px;
}
.updateTable .name {
width: 178px;
padding-right: 10px;
}
.updateTable .name a,
.updateTable .chapter a {
max-width: 168px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.updateTable .chapter {
padding-right: 5px;
}
.updateTable .chapter a {
max-width: 220px;
float: left;
}
.updateTable .author {
width: 72px;
text-align: left;
}
.updateTable .goread {
width: 80px;
text-align: center;
}
.updateTable .time {
width: 86px;
}
.updateTable .word {
width: 64px;
padding-right: 10px;
text-align: right;
}
.updateTable .rank {
width: 30px;
padding-right: 10px;
text-align: center;
}
.updateTable .name a,
.updateTable .chapter a,
.updateTable .author a {
height: 40px;
line-height: 40px;
display: inline-block;
overflow: hidden;
}
.updateTable tr:nth-child(2n) td {
background: #fafafa;
}
.dataTable {
width: 739px;
}
.dataTable table {
width: 100%;
margin-bottom: 14px;
border-collapse: collapse;
}
.dataTable th,
.dataTable td {
height: 40px;
line-height: 40px;
vertical-align: middle;
padding: 0 10px;
font-weight: normal;
text-align: center;
border: 1px solid #eaeaea;
}
.dataTable th {
background: #f8f8f8;
}
.nodate {
border-top: 1px solid #eaeaea;
padding: 60px 0;
}
.viewhistoryBox {
/*padding: 0 30px 30px; */
padding: 0 20px 10px;
}
.viewhistoryBox .updateTable {
width: 100%;
}
/*.btn_gray, .btn_red, .btn_ora { font-size:14px; padding:8px 28px }*/
.book_tit {
height: 48px;
line-height: 48px;
margin: 0 14px;
border-bottom: 1px solid #eaeaea;
overflow: hidden;
}
.book_tit .fl {
font-size: 14px;
color: #999;
}
.book_tit .fl h3 {
font-size: 18px;
color: #333;
font-weight: normal;
margin-right: 5px;
display: inline;
}
.book_tit .fr {
font-size: 14px;
}
.commentBar,
.feedback_list {
border-top: 1px solid #eee;
margin-bottom: 15px;
}
/*.comment_list { padding: 16px 0; border-bottom: 1px solid #eee }
.comment_list .user_head { width:54px; height:54px; border-radius:50%; float: left; margin-right: 14px }
.comment_list .li_1 { overflow: hidden }
.comment_list .user_name { color: #ed4259 }
.comment_list .li_2 { padding:3px 0; color:#999 }
.comment_list .li_3, .comment_list .li_4 { margin-left:68px }
.comment_list .reply { padding-left: 12px }
.comment_list .num { color: #ed4259; margin: 0 3px }
.comment_list .li_4 { line-height:34px; padding-top:8px; margin-top:15px; border-top:1px solid #eaeaea }
.comment_list .li_4 .more { background:#f7f7f7; border-radius:2px; color:#ed4259; text-align:center }*/
.no_contet {
padding: 190px 0 40px;
text-align: center;
color: #999;
border-top: 1px solid #eee;
}
.comment_list {
padding: 20px 0;
border-bottom: 1px solid #eee;
}
.comment_list:last-child {
border: none;
}
.comment_list .user_heads {
/*width: 54px; height: 54px; float: left;*/
position: relative;
margin-right: 20px;
}
.comment_list .user_head {
width: 50px;
height: 50px;
border-radius: 50%;
background: #f6f6f6;
}
.comment_list .user_heads span {
display: block;
margin: 0;
position: absolute;
left: 12px;
bottom: 0;
}
.comment_list ul {
/*width: 640px;*/
width: 660px;
}
.comment_list .li_0 {
font-family: "宋体";
}
.comment_list .li_0 strong {
font-size: 14px;
color: #f00;
}
.comment_list .li_1 {
overflow: hidden;
}
.comment_list .user_name {
color: #ed4259;
}
.comment_list .li_2 {
padding: 6px 0;
}
.comment_list .li_3 {
color: #999;
}
.comment_list .reply {
padding-left: 12px;
}
.comment_list .num {
color: #ed4259;
margin: 0 3px;
}
.comment_list .li_4 {
line-height: 34px;
padding-top: 8px;
margin-top: 15px;
border-top: 1px solid #eaeaea;
}
.pl_bar li {
display: block;
}
.pl_bar .name {
color: #666;
padding-top: 2px;
font-size: 14px;
}
.pl_bar .dec {
font-size: 14px;
line-height: 1.8;
padding: 12px 0;
}
.pl_bar .other {
line-height: 24px;
color: #999;
font-size: 13px;
}
.pl_bar .other a {
display: inline-block;
color: #999;
}
.pl_bar .reply {
padding-left: 22px;
}
/*.no_comment { padding: 70px 14px 115px; color: #CCCCCC; text-align: center; font-size: 14px; }*/
.reply_bar {
background: #f9f9f9;
border: 1px solid #eee;
border-radius: 6px;
padding: 10px;
line-height: 1.8;
}
</style>