diff --git a/admin/src/main/java/io/modules/sys/controller/WallController.java b/admin/src/main/java/io/modules/sys/controller/BookController.java similarity index 81% rename from admin/src/main/java/io/modules/sys/controller/WallController.java rename to admin/src/main/java/io/modules/sys/controller/BookController.java index 7ef380f..4129877 100644 --- a/admin/src/main/java/io/modules/sys/controller/WallController.java +++ b/admin/src/main/java/io/modules/sys/controller/BookController.java @@ -1,6 +1,4 @@ package io.modules.sys.controller; - - import io.common.annotation.LogOperation; import io.common.constant.Constant; import io.common.page.PageData; @@ -22,20 +20,11 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; import java.util.Map; - - -/** - * 吐槽墙 - * - * @author Mark # - * @since 1.0.0 2024-12-12 - */ @RestController -@RequestMapping("item/wall") -@Tag(name="吐槽墙") -public class WallController { +@RequestMapping("sys/book") +public class BookController { @Autowired - private BookService wallService; + private BookService bookService; @GetMapping("page") @Operation(summary = "分页") @@ -45,58 +34,45 @@ public class WallController { @Parameter(name = Constant.ORDER_FIELD, description = "排序字段", in = ParameterIn.QUERY, ref="String") , @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)", in = ParameterIn.QUERY, ref="String") }) - @RequiresPermissions("item:wall:page") public Result> page(@Parameter(hidden = true) @RequestParam Map params){ - PageData page = wallService.page(params); - + PageData page = bookService.page(params); return new Result>().ok(page); } @GetMapping("{id}") @Operation(summary = "信息") - @RequiresPermissions("item:wall:info") public Result get(@PathVariable("id") Long id){ - BookDTO data = wallService.get(id); - + BookDTO data = bookService.get(id); return new Result().ok(data); } @PostMapping @Operation(summary = "保存") @LogOperation("保存") - @RequiresPermissions("item:wall:save") public Result save(@RequestBody BookDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - - wallService.save(dto); - + bookService.save(dto); return new Result(); } @PutMapping @Operation(summary = "修改") @LogOperation("修改") - @RequiresPermissions("item:wall:update") public Result update(@RequestBody BookDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - - wallService.update(dto); - + bookService.update(dto); return new Result(); } @DeleteMapping @Operation(summary = "删除") @LogOperation("删除") - @RequiresPermissions("item:wall:delete") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); - - wallService.delete(ids); - + bookService.delete(ids); return new Result(); } diff --git a/admin/src/main/resources/application-dev.yml b/admin/src/main/resources/application-dev.yml index edf4608..ca94df3 100644 --- a/admin/src/main/resources/application-dev.yml +++ b/admin/src/main/resources/application-dev.yml @@ -3,7 +3,7 @@ spring: druid: #MySQL driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:33060/block_house?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + url: jdbc:mysql://localhost:3306/block-chaincopyright?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true username: root password: 123456 initial-size: 10 diff --git a/admin/src/main/resources/mapper/sys/SysUserTokenDao.xml b/admin/src/main/resources/mapper/sys/BookDao.xml similarity index 100% rename from admin/src/main/resources/mapper/sys/SysUserTokenDao.xml rename to admin/src/main/resources/mapper/sys/BookDao.xml diff --git a/common/src/main/java/io/modules/item/dao/WallDao.java b/common/src/main/java/io/modules/item/dao/BookDao.java similarity index 80% rename from common/src/main/java/io/modules/item/dao/WallDao.java rename to common/src/main/java/io/modules/item/dao/BookDao.java index 148c84f..74df758 100644 --- a/common/src/main/java/io/modules/item/dao/WallDao.java +++ b/common/src/main/java/io/modules/item/dao/BookDao.java @@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper; * @since 1.0.0 2024-12-12 */ @Mapper -public interface WallDao extends BaseDao { +public interface BookDao extends BaseDao { } diff --git a/common/src/main/java/io/modules/item/dto/BookDTO.java b/common/src/main/java/io/modules/item/dto/BookDTO.java index bdf4391..ad99d54 100644 --- a/common/src/main/java/io/modules/item/dto/BookDTO.java +++ b/common/src/main/java/io/modules/item/dto/BookDTO.java @@ -1,5 +1,6 @@ package io.modules.item.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.SchemaProperty; import lombok.Data; @@ -17,20 +18,24 @@ public class BookDTO implements Serializable { private Long id; // 主键ID private Long userId; // 主键ID - private String img; // 封面 + private String image; // 封面 private String isbn; // ISBN编号 private String title; // 图书标题 private String author; // 作者 private String publisher; // 出版社 + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") private Date publishDate; // 出版日期 private String copyrightOwner; // 版权持有人 - private Integer copyrightStartYear; // 版权起始年份 - private Integer copyrightEndYear; // 版权到期年份 + + private String copyrightStartYear; // 版权起始年份 + private String copyrightEndYear; // 版权到期年份 private String edition; // 版次 private String language; // 语言 private BigDecimal price; // 图书定价 private String hex; // 上链哈希值 private Date createTime; // 创建时间 private String file; // 电子数据文件地址 + private String status; } diff --git a/common/src/main/java/io/modules/item/dto/UserDTO.java b/common/src/main/java/io/modules/item/dto/UserDTO.java index fa8c701..a044932 100644 --- a/common/src/main/java/io/modules/item/dto/UserDTO.java +++ b/common/src/main/java/io/modules/item/dto/UserDTO.java @@ -33,8 +33,8 @@ public class UserDTO implements Serializable { @SchemaProperty(name = "昵称") private String nickName; - @SchemaProperty(name = "介绍") - private String introduce; + @SchemaProperty(name = "手机号") + private String phone; } diff --git a/common/src/main/java/io/modules/item/entity/BookEntity.java b/common/src/main/java/io/modules/item/entity/BookEntity.java index 11627c6..db7d520 100644 --- a/common/src/main/java/io/modules/item/entity/BookEntity.java +++ b/common/src/main/java/io/modules/item/entity/BookEntity.java @@ -1,6 +1,7 @@ package io.modules.item.entity; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.math.BigDecimal; @@ -12,19 +13,22 @@ public class BookEntity { private Long id; // 主键ID private Long userId; - private String img; // 封面 + private String image; // 封面 private String isbn; // ISBN编号 private String title; // 图书标题 private String author; // 作者 private String publisher; // 出版社 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") private Date publishDate; // 出版日期 private String copyrightOwner; // 版权持有人 - private Integer copyrightStartYear; // 版权起始年份 - private Integer copyrightEndYear; // 版权到期年份 + + private String copyrightStartYear; // 版权起始年份 + private String copyrightEndYear; // 版权到期年份 private String edition; // 版次 private String language; // 语言 private BigDecimal price; // 图书定价 private String hex; // 上链哈希值 private Date createTime; // 创建时间 private String file; // 电子数据文件地址 + private String status; // 电子数据文件地址 } diff --git a/common/src/main/java/io/modules/item/entity/FrontUserEntity.java b/common/src/main/java/io/modules/item/entity/FrontUserEntity.java index 94e4be8..3605049 100644 --- a/common/src/main/java/io/modules/item/entity/FrontUserEntity.java +++ b/common/src/main/java/io/modules/item/entity/FrontUserEntity.java @@ -31,7 +31,7 @@ public class FrontUserEntity { */ private String nickName; /** - * 介绍 + * 手机号 */ - private String introduce; + private String phone; } diff --git a/common/src/main/java/io/modules/item/service/impl/BookServiceImpl.java b/common/src/main/java/io/modules/item/service/impl/BookServiceImpl.java index 0b223e2..2f1b5da 100644 --- a/common/src/main/java/io/modules/item/service/impl/BookServiceImpl.java +++ b/common/src/main/java/io/modules/item/service/impl/BookServiceImpl.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import cn.hutool.core.util.StrUtil; import io.common.service.impl.CrudServiceImpl; -import io.modules.item.dao.WallDao; +import io.modules.item.dao.BookDao; import io.modules.item.dto.BookDTO; import io.modules.item.entity.BookEntity; import io.modules.item.service.BookService; @@ -14,19 +14,20 @@ import java.util.Map; @Service -public class BookServiceImpl extends CrudServiceImpl implements BookService { +public class BookServiceImpl extends CrudServiceImpl implements BookService { @Override public QueryWrapper getWrapper(Map params){ String id = (String)params.get("id"); String userId = (String)params.get("userId"); - + String title = (String)params.get("title"); + String status = (String)params.get("status"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StrUtil.isNotBlank(id), "id", id); - wrapper.eq(StrUtil.isNotBlank(userId), "userId", userId); - + wrapper.eq(StrUtil.isNotBlank(userId), "user_id", userId); + wrapper.like(StrUtil.isNotBlank(title), "title", title); + wrapper.like(StrUtil.isNotBlank(status), "status", status); + wrapper.orderByDesc("create_time"); return wrapper; } - - } diff --git a/front/src/main/java/io/controller/BookController.java b/front/src/main/java/io/controller/BookController.java index 3f78082..7cf1957 100644 --- a/front/src/main/java/io/controller/BookController.java +++ b/front/src/main/java/io/controller/BookController.java @@ -1,4 +1,5 @@ package io.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.annotation.Login; import io.annotation.LoginUser; import io.common.page.PageData; @@ -7,7 +8,10 @@ import io.common.validator.ValidatorUtils; import io.common.validator.group.AddGroup; import io.common.validator.group.DefaultGroup; import io.entity.UserEntity; +import io.modules.item.dao.BookDao; import io.modules.item.dto.BookDTO; +import io.modules.item.dto.OrderDTO; +import io.modules.item.entity.BookEntity; import io.modules.item.service.DictService; import io.modules.item.service.BookService; import io.swagger.v3.oas.annotations.Operation; @@ -29,6 +33,9 @@ public class BookController { @Autowired private BookService bookService; + @Autowired + private BookDao bookDao; + @Login @GetMapping("page") @Operation(summary = "分页") @@ -49,5 +56,26 @@ public class BookController { return new Result(); } + @GetMapping("{id}") + @Operation(summary = "信息") + public Result get(@PathVariable("id") Long id){ + BookDTO data = bookService.get(id); + return new Result().ok(data); + } + + + @GetMapping("hex") + @Operation(summary = "分页") + public Result hex(@Parameter(hidden = true) @RequestParam String hex){ + + LambdaQueryWrapper lwq = new LambdaQueryWrapper<>(); + lwq.eq(BookEntity::getHex,hex); + + BookEntity bookEntity = bookDao.selectOne(lwq); + if (bookEntity == null){ + return new Result().error("查询不到信息"); + } + return new Result().ok(bookEntity); + } } diff --git a/front/src/main/java/io/controller/UserController.java b/front/src/main/java/io/controller/UserController.java index 578b3f8..ba06364 100644 --- a/front/src/main/java/io/controller/UserController.java +++ b/front/src/main/java/io/controller/UserController.java @@ -73,7 +73,7 @@ public class UserController { user.setId(dto.getId()); user.setUsername(dto.getUsername()); user.setNickName(dto.getNickName()); - user.setIntroduce(dto.getIntroduce()); + user.setPhone(dto.getPhone()); user.setPassword(DigestUtil.sha256Hex(dto.getPassword())); userService.updateById(user); return new Result(); diff --git a/front/src/main/java/io/dto/RegisterDTO.java b/front/src/main/java/io/dto/RegisterDTO.java index c587bc7..89aab4e 100644 --- a/front/src/main/java/io/dto/RegisterDTO.java +++ b/front/src/main/java/io/dto/RegisterDTO.java @@ -30,6 +30,6 @@ public class RegisterDTO { @Schema(title = "昵称") private String nickName; - @Schema(title = "介绍") - private String introduce; + @Schema(title = "手机号") + private String phone; } diff --git a/front/src/main/java/io/entity/UserEntity.java b/front/src/main/java/io/entity/UserEntity.java index b7ba927..7513cf3 100644 --- a/front/src/main/java/io/entity/UserEntity.java +++ b/front/src/main/java/io/entity/UserEntity.java @@ -30,9 +30,9 @@ public class UserEntity implements Serializable { */ private String nickName; /** - * 介绍 + * 手机号 */ - private String introduce; + private String phone; /** * 用户名 */ diff --git a/front/src/main/resources/application-dev.yml b/front/src/main/resources/application-dev.yml index c48514e..8f711a0 100644 --- a/front/src/main/resources/application-dev.yml +++ b/front/src/main/resources/application-dev.yml @@ -6,7 +6,7 @@ spring: datasource: druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:33060/block_house?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + url: jdbc:mysql://localhost:3306/block-chaincopyright?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true username: root password: 123456 initial-size: 10 @@ -33,7 +33,7 @@ spring: multi-statement-allow: true web: resources: - static-locations: "file:D:/202505/block-chaincopyright/upload/" + static-locations: "file:D:/20250519/block-chaincopyright/upload/" upload: - path: D:\202505\block-chaincopyright\upload + path: D:\20250519\block-chaincopyright\upload url: http://localhost:18081/ diff --git a/ui/src/components/BarChart.vue b/ui/src/components/BarChart.vue deleted file mode 100644 index 1bef0d6..0000000 --- a/ui/src/components/BarChart.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - diff --git a/ui/src/components/front/info-bottom.vue b/ui/src/components/front/info-bottom.vue deleted file mode 100644 index 847724a..0000000 --- a/ui/src/components/front/info-bottom.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - diff --git a/ui/src/components/front/item.vue b/ui/src/components/front/item.vue deleted file mode 100644 index 8874b97..0000000 --- a/ui/src/components/front/item.vue +++ /dev/null @@ -1,265 +0,0 @@ - - - - diff --git a/ui/src/components/front/item2.vue b/ui/src/components/front/item2.vue deleted file mode 100644 index 7d73fed..0000000 --- a/ui/src/components/front/item2.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - diff --git a/ui/src/components/hot/Hot1.vue b/ui/src/components/hot/Hot1.vue deleted file mode 100644 index 67aa976..0000000 --- a/ui/src/components/hot/Hot1.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - - diff --git a/ui/src/components/nav/Navigation.vue b/ui/src/components/nav/Navigation.vue index d32fc95..e8968ea 100644 --- a/ui/src/components/nav/Navigation.vue +++ b/ui/src/components/nav/Navigation.vue @@ -32,8 +32,9 @@ diff --git a/ui/src/components/view/brand-pie.vue b/ui/src/components/view/brand-pie.vue deleted file mode 100644 index e4b1509..0000000 --- a/ui/src/components/view/brand-pie.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/ui/src/components/view/foundation-line.vue b/ui/src/components/view/foundation-line.vue deleted file mode 100644 index 1e81fa3..0000000 --- a/ui/src/components/view/foundation-line.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - diff --git a/ui/src/layouts/frontUserInfo.vue b/ui/src/layouts/frontUserInfo.vue index 942c5ed..7004e94 100644 --- a/ui/src/layouts/frontUserInfo.vue +++ b/ui/src/layouts/frontUserInfo.vue @@ -35,8 +35,7 @@ const state = reactive({ userMenu:[ {name: '个人中心', path: '/user'}, {name: '我的收藏', path: '/collect'}, - {name: '我的换住', path: '/order'}, - + {name: '版权管理', path: '/push'}, ] }) diff --git a/ui/src/pages/address/index.vue b/ui/src/pages/address/index.vue deleted file mode 100644 index acc7ff8..0000000 --- a/ui/src/pages/address/index.vue +++ /dev/null @@ -1,232 +0,0 @@ - - - - -{ -"meta": { -"layout": "front" -} -} - diff --git a/ui/src/pages/admin/cate.vue b/ui/src/pages/admin/cate.vue deleted file mode 100644 index 082aef0..0000000 --- a/ui/src/pages/admin/cate.vue +++ /dev/null @@ -1,207 +0,0 @@ - - - - -{ -"meta": { -"layout": "admin" -} -} - diff --git a/ui/src/pages/admin/comment.vue b/ui/src/pages/admin/comment.vue deleted file mode 100644 index ab388eb..0000000 --- a/ui/src/pages/admin/comment.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - -{ -"meta": { -"layout": "admin" -} -} - diff --git a/ui/src/pages/admin/house.vue b/ui/src/pages/admin/house.vue deleted file mode 100644 index 9349818..0000000 --- a/ui/src/pages/admin/house.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - -{ -"meta": { -"layout": "admin", -"title": "房源管理" -} -} - diff --git a/ui/src/pages/admin/index.vue b/ui/src/pages/admin/index.vue index 63ef4e0..08f79b4 100644 --- a/ui/src/pages/admin/index.vue +++ b/ui/src/pages/admin/index.vue @@ -4,26 +4,19 @@
- +
- 房源管理 + 版权管理
- - - - - - - - + - +
- 认证管理 + 轮播
@@ -40,62 +33,12 @@ - + + -
- - -
-
{{ overviewData.totalProperties }}
-
总房源
-
-
- -
-
{{ overviewData.activeUsers }}
-
活跃用户
-
-
- -
-
{{ overviewData.totalTransactions }}
-
总交易
-
-
-
- - -
-
{{ overviewData.pendingCertifications }}
-
待认证
-
-
- -
-
{{ overviewData.availableProperties }}
-
可换住房源
-
-
- -
-
{{ overviewData.blockHeight }}
-
区块链高度
-
-
-
-
-
-
- - -
@@ -103,67 +46,6 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -181,59 +63,6 @@ import { const router = useRouter() -// 数据概览 -const overviewData = ref({ - totalProperties: 1245, - activeUsers: 876, - totalTransactions: 3421, - pendingCertifications: 23, - availableProperties: 567, - blockHeight: 124567 -}) - -// 最近交易 -const recentTransactions = ref([ - { - txHash: '0x4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6', - property: '阳光公寓-302', - fromUser: '用户A', - toUser: '用户B', - date: '2023-05-15', - status: '已完成' - }, - { - txHash: '0x5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7', - property: '绿洲小区-1201', - fromUser: '用户C', - toUser: '用户D', - date: '2023-05-14', - status: '进行中' - }, - { - txHash: '0x6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8', - property: '湖畔别墅-8', - fromUser: '用户E', - toUser: '用户F', - date: '2023-05-13', - status: '已完成' - }, - { - txHash: '0x7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9', - property: '城市花园-502', - fromUser: '用户G', - toUser: '用户H', - date: '2023-05-12', - status: '已取消' - }, - { - txHash: '0x8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0', - property: '星空大厦-2103', - fromUser: '用户I', - toUser: '用户J', - date: '2023-05-11', - status: '已完成' - } -]) // 待认证申请 const pendingCertifications = ref([ @@ -269,13 +98,6 @@ const pendingCertifications = ref([ } ]) -// 区块链信息 -const blockchainInfo = ref({ - height: 124567, - nodes: 12, - pendingTxs: 8, - status: '运行正常' -}) // 图表引用 const chart = ref(null) @@ -292,7 +114,7 @@ onMounted(() => { } }, legend: { - data: ['换住交易', '认证交易'] + data: ['用户量', '发布量'] }, grid: { left: '3%', diff --git a/ui/src/pages/admin/leaderboard.vue b/ui/src/pages/admin/leaderboard.vue deleted file mode 100644 index 0e0e4be..0000000 --- a/ui/src/pages/admin/leaderboard.vue +++ /dev/null @@ -1,211 +0,0 @@ - - - - -{ -"meta": { -"layout": "admin" -} -} - diff --git a/ui/src/pages/admin/order.vue b/ui/src/pages/admin/order.vue deleted file mode 100644 index 4605a5e..0000000 --- a/ui/src/pages/admin/order.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - -{ -"meta": { -"layout": "admin" -} -} - diff --git a/ui/src/pages/admin/user.vue b/ui/src/pages/admin/user.vue index a72a9a9..3810aca 100644 --- a/ui/src/pages/admin/user.vue +++ b/ui/src/pages/admin/user.vue @@ -16,11 +16,11 @@ - + - + @@ -231,11 +143,12 @@ import { useRoute } from 'vue-router' import { SuccessFilled, ShoppingCart, - Goods, - + Download, + Document, + Notebook, + User, Connection, ArrowRight, - OfficeBuilding, Coin, Money, Checked @@ -256,31 +169,58 @@ const state = reactive({ price: 0, totalAmount: 0 }, - cateList: [], - userInfo:{}, - houseList:[] + userInfo: {} }) +/** + * 格式化日期 + */ +function formatDate(dateStr: string) { + if (!dateStr) return '' + const date = new Date(dateStr) + return date.toLocaleDateString() +} + +/** + * 获取状态标签类型 + */ +function getStatusTagType(status: string) { + switch(status) { + case '已通过': return 'success' + case '审核中': return 'warning' + case '已拒绝': return 'danger' + default: return 'info' + } +} + /** * 缩短哈希显示 */ function shortenHash(hash: string) { if (!hash) return '' - return hash.substring(0, 6) + '...' + hash.substring(hash.length - 4) + return hash.substring(0, 6) + '...' + hash.substring(hash.length - 4) } +/** + * 更新总价 + */ +function updateTotalAmount() { + state.buyForm.totalAmount = (state.buyForm.price * state.buyForm.quantity).toFixed(2) +} +/** + * 初始化数据 + */ function init() { - frontRequest.get(`/api/item/${itemId}`).then(response => { - state.info = response.data - }) - frontRequest.get(`api/address/page`).then(response => { - state.cateList = response.data.list + frontRequest.get(`/api/book/${itemId}`).then(response => { + state.info = response.data + state.buyForm.title = state.info.title + state.buyForm.price = state.info.price + updateTotalAmount() }) - frontRequest.get("/api/item/push").then(res =>{ - state.houseList = res.data - + frontRequest.get("/api/user/userInfo").then(res => { + state.userInfo = res.data }) } @@ -288,8 +228,8 @@ function init() { * 用户收藏 */ function handleFavorite() { - if (state.info.isFavorite) { - frontRequest.post("/api/behavior/delete", {itemId: itemId, type: 1}).then(res => { + if (state.info.isFavorite) { + frontRequest.post("/api/behavior/delete", {itemId: itemId, type: 1}).then(res => { ElMessage.success({ message: '已取消收藏', offset: 80 @@ -297,7 +237,7 @@ function handleFavorite() { init() }) } else { - frontRequest.post("/api/behavior", {itemId: itemId, type: 1}).then(res => { + frontRequest.post("/api/behavior", {itemId: itemId, type: 1}).then(res => { ElMessage.success({ message: '收藏成功', offset: 80 @@ -308,47 +248,44 @@ function handleFavorite() { } /** - * 购买按钮提交 + * 下载电子文件 */ -const buySubmitForm = (formEl: FormInstance | undefined) => { - if (!formEl) return - formEl.validate((valid) => { - if (valid) { - frontRequest.post("/api/order",{ - itemId:itemId, //房源编号 - userHouseId:state.buyForm.userHouseId, //换住房源编号 - }).then(() => { - ElMessage.success({ - message: '换住信息已提交区块链网络', - offset: 80 - }) - buyDrawer.value = false - }) - } - }) +function handleDownload() { + if (!state.info.file) { + ElMessage.warning(' 该图书暂无电子文件') + return + } + window.open(state.info.file, '_blank') } /** * 购买按钮 */ -const handleBuy = () => { - //判断是否是自己房源 - frontRequest.get("/api/user/userInfo").then(res =>{ - if (state.info.userId === res.data.id){ - ElMessage.warning("自己房源不能换住") - return - } - state.userInfo = res.data - buyDrawer.value = true - state.buyForm.title = state.info.title - state.buyForm.id = state.info.id - state.buyForm.price = state.info.price - updateTotalAmount() - }) +function handlePurchase() { + if (state.info.userId === state.userInfo.id) { + ElMessage.warning(" 不能购买自己的图书版权") + return + } + buyDrawer.value = true } - - +/** + * 购买按钮提交 + */ +const buySubmitForm = (formEl: FormInstance | undefined) => { + if (!formEl) return + formEl.validate((valid) => { + if (valid) { + frontRequest.post("/api/order", state.buyForm).then(() => { + ElMessage.success({ + message: '版权购买信息已提交区块链网络', + offset: 80 + }) + buyDrawer.value = false + }) + } + }) +} onMounted(() => { init() @@ -384,7 +321,7 @@ onMounted(() => { .logo-icon { margin-right: 10px; font-size: 24px; - color: #1abc9c; + color: #3498db; } .blockchain-breadcrumb { @@ -405,6 +342,7 @@ onMounted(() => { height: 400px; display: block; transition: all 0.3s; + background-color: #f5f7fa; } .main-image:hover { @@ -415,7 +353,7 @@ onMounted(() => { position: absolute; top: 15px; right: 15px; - background-color: rgba(26, 188, 156, 0.9); + background-color: rgba(52, 152, 219, 0.9); color: white; padding: 6px 12px; border-radius: 4px; @@ -439,18 +377,43 @@ onMounted(() => { z-index: 2; } -.location-tag { - background-color: rgba(52, 152, 219, 0.9); +.language-tag { + background-color: rgba(41, 128, 185, 0.9); color: white; border: none; } -.type-tag { - background-color: rgba(46, 204, 113, 0.9); +.status-tag { + background-color: rgba(39, 174, 96, 0.9); color: white; border: none; } +/* 电子文件下载区 */ +.file-section { + margin-top: 20px; + text-align: center; +} + +.download-button { + width: 100%; + height: 48px; + font-size: 16px; +} + +.file-info { + margin-top: 10px; + color: #7f8c8d; + font-size: 14px; + display: flex; + align-items: center; + justify-content: center; +} + +.file-info .el-icon { + margin-right: 5px; +} + /* 信息区域 */ .info-section { padding: 0 15px; @@ -460,10 +423,22 @@ onMounted(() => { font-size: 24px; font-weight: 700; color: #2c3e50; - margin-bottom: 20px; + margin-bottom: 10px; line-height: 1.3; } +.author-info { + display: flex; + align-items: center; + color: #7f8c8d; + margin-bottom: 20px; + font-size: 16px; +} + +.author-info .el-icon { + margin-right: 8px; +} + .property-meta { margin-bottom: 30px; } @@ -478,7 +453,7 @@ onMounted(() => { .meta-label { color: #7f8c8d; margin-right: 10px; - min-width: 80px; + min-width: 100px; } .meta-value { @@ -556,7 +531,7 @@ onMounted(() => { .detail-label { color: #7f8c8d; margin-right: 8px; - min-width: 50px; + min-width: 80px; } .detail-value { @@ -570,7 +545,7 @@ onMounted(() => { padding: 15px; border-radius: 6px; margin-bottom: 30px; - border-left: 4px solid #1abc9c; + border-left: 4px solid #3498db; } .hash-title { @@ -583,7 +558,7 @@ onMounted(() => { .hash-title .el-icon { margin-right: 8px; - color: #1abc9c; + color: #3498db; } .hash-value { @@ -604,7 +579,7 @@ onMounted(() => { } .view-transaction { - color: #1abc9c !important; + color: #3498db !important; font-size: 13px; } @@ -621,7 +596,7 @@ onMounted(() => { } .buy-button { - background-color: #e74c3c; + background-color: #3498db; border: none; height: 48px; font-size: 16px; @@ -631,32 +606,13 @@ onMounted(() => { } .buy-button:hover { - background-color: #c0392b; + background-color: #2980b9; } .buy-button .el-icon { margin-right: 8px; } -.cart-button { - height: 48px; - font-size: 16px; - font-weight: 500; - padding: 0 25px; - flex: 1; - border: 1px solid #1abc9c; - color: #1abc9c; - background-color: rgba(26, 188, 156, 0.1); -} - -.cart-button:hover { - background-color: rgba(26, 188, 156, 0.2); -} - -.cart-button .el-icon { - margin-right: 8px; -} - .favorite-button { height: 48px; font-size: 16px; @@ -689,6 +645,12 @@ onMounted(() => { height: 48px; font-size: 16px; margin-top: 20px; + background-color: #3498db; + border: none; +} + +.confirm-button:hover { + background-color: #2980b9; } .confirm-button .el-icon { @@ -704,7 +666,6 @@ onMounted(() => { flex-direction: column; } .buy-button, - .cart-button, .favorite-button { width: 100%; } diff --git a/ui/src/pages/list/index.vue b/ui/src/pages/list/index.vue index a77b4df..91c7f88 100644 --- a/ui/src/pages/list/index.vue +++ b/ui/src/pages/list/index.vue @@ -5,7 +5,7 @@ - - - - - - - - - - - - - - - - - - @@ -51,9 +33,9 @@
{{ item.title }}
-
{{ item.name}}/{{item.face}}/{{ item.type}}/{{item.face}}/{{ item.area}}平方
+
{{ item.edition}}/{{item.language}}/{{ item.publisher}}/{{item.copyrightStartYear}}/{{ item.copyrightEndYear}}
- {{ item.price }}元/平方 + {{ item.publisher }} 区块溯源
@@ -84,50 +66,23 @@ const state = reactive({ page: { page: 1, title: '', - limit:12 + limit:8 }, - getList: [{ - "id": "9787559485054", - "title": "房东急售近地铁 近医院 诚心出售", - "name": "学府小区", - "city": "深圳", - "type": "学区房", - "area": "73.0", - "floor": 6, - "face": "西", - "decoration": "简装修", - "image": "http://localhost:18081/360x312c (1).webp", - "price": 6600, - "description": "

临近重点小学,交通便利

", - "tag": "深圳", - "hex": "0x389d64c05c566eafd726cf75af4b474250aefea760969b9ed04429ef520eb7f8730c176e2e39a429", - "sort": 3, - "status": 1, - "view": 8, - "createTime": "2025-05-19 16:42:57", - "userId": "1863920777825390593", - "user": null, - "orderEntityList": [], - "isFavorite": null - }], + getList: [], brands:[] }) - /** * 初始化 */ function init() { - frontRequest.get("/api/item/page",{ + frontRequest.get("/api/book/page",{ params: state.page }).then((res) => { state.getList = res.data.list state.total = res.data.total }) - frontRequest.get("/api/categories/page").then((res) => { - state.brands = res.data.list - }) } /** * 分页 @@ -136,7 +91,6 @@ const handleCurrentChange = (val: number) => { state.page.page = val init() } - /** * 跳转 */ @@ -162,25 +116,7 @@ onMounted(() => { border-radius: 24px; overflow: hidden; } -/* 品牌标签样式 */ -.brand-container { - padding: 0 20px 20px; -} -.brand-list { - display: flex; - flex-wrap: wrap; - gap: 12px; - justify-content: center; -} -.brand-item { - padding: 8px 20px; - transition: all 0.3s; - cursor: pointer; -} -.brand-item:hover { - transform: translateY(-2px); - background-color: #fef0f0; -} + /* 房源卡片样式 */ .product-container { padding: 0 20px; @@ -261,7 +197,6 @@ onMounted(() => { justify-content: center; } - { "meta": { diff --git a/ui/src/pages/order/index.vue b/ui/src/pages/order/index.vue index 7e68d29..9df21cf 100644 --- a/ui/src/pages/order/index.vue +++ b/ui/src/pages/order/index.vue @@ -49,7 +49,7 @@ class="order-table" > - + @@ -265,11 +186,34 @@ const handleSearch = async () => { .search-input { width: 400px; } + +.copyright-detail { + margin-top: 20px; +} + +.detail-card { + padding: 20px; +} + +.info-header { + display: flex; + align-items: center; + margin-bottom: 15px; +} + .info-header h2 { margin-right: 15px; font-size: 22px; color: #333; } + +.info-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 20px; + margin-bottom: 20px; +} + .info-section h3 { color: #666; font-size: 18px; @@ -278,363 +222,27 @@ const handleSearch = async () => { border-bottom: 1px solid #eee; } - - - + { "meta": { diff --git a/ui/src/pages/upload.vue b/ui/src/pages/upload.vue index 98ac9cd..c7fce52 100644 --- a/ui/src/pages/upload.vue +++ b/ui/src/pages/upload.vue @@ -1,142 +1,397 @@ + { "meta": { -"layout": "front" +"layout": "front", +"requiresAuth": true } } diff --git a/ui/src/utils/utils.ts b/ui/src/utils/utils.ts index 0ed01ee..22aba87 100644 --- a/ui/src/utils/utils.ts +++ b/ui/src/utils/utils.ts @@ -7,8 +7,8 @@ export const getAdminList = () => { "icon": "HomeFilled" // 首页 }, { - "path": "/admin/house", - "name": "房源管理", + "path": "/admin/book", + "name": "版权管理", "icon": "Discount" // 电影管理 }, @@ -34,33 +34,23 @@ export const getFrontList = () => { }, { "path": "/list", - "name": "供应房源", + "name": "版权展示", "icon": "House", }, + { + "path": "/upload", + "name": "发布版权", + "icon": "Trophy" + }, { - "path": "/upload", - "name": "发布房源", + "path": "/push", + "name": "版权管理", "icon": "Trophy" }, { "path": "/topic", - "name": "房源溯源", - "icon": "Trophy" - }, - { - "path": "/order", - "name": "我的换住", - "icon": "Trophy" - }, - { - "path": "/push", - "name": "我的发布", - "icon": "Trophy" - }, - { - "path": "/collect", - "name": "我的收藏", + "name": "版权溯源", "icon": "Trophy" }, ] @@ -86,12 +76,4 @@ export const getDecoration = () => { const routes =["精装", "简装", "毛坯"] return routes; } -export const getHouseStatus = () => { - const routes =[ - {name:"未审核",status:0}, - {name:"上架",status:1}, - {name:"下架",status:2}, - {name:"审核失败",status:3}, - ] - return routes; -} +