Browse Source

留言/活动/收藏

master
xuhuajiao 1 month ago
parent
commit
95b3267038
  1. 296
      pages.json
  2. 4
      pages/home/home.vue
  3. 24
      pages/user/user.vue
  4. 52
      subpkg/pages/activity-detail/activity-detail.vue
  5. 139
      subpkg/pages/activity-list/activity-list.vue
  6. 20
      subpkg/pages/book-detail/book-detail.vue
  7. 7
      subpkg/pages/book-list/book-list.vue
  8. 176
      subpkg/pages/collect-list/collect-list.vue
  9. 87
      subpkg/pages/feedback-detail/feedback-detail.vue
  10. 124
      subpkg/pages/feedback-list/feedback-list.vue
  11. 285
      subpkg/pages/feedback/feedback.vue
  12. 2
      subpkg/pages/reader-card/reader-card.vue

296
pages.json

@ -1,145 +1,151 @@
{
"pages": [
{
"path": "pages/home/home",
"style": {
"navigationBarTitleText": "图书馆"
}
},
{
"path": "pages/search/search",
"style": {
"navigationBarTitleText": "图书检索"
}
},
{
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/lendCar/lendCar",
"style": {
"navigationBarTitleText": "借阅清单"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"app-plus": {
"background": "#efeff4"
}
},
"tabBar":{
"selectedColor": "#409EFF",
"list": [{
"pagePath": "pages/home/home",
"text": "首页",
"iconPath": "static/tab/shouye.png",
"selectedIconPath": "static/tab/shouyeActive.png"
},{
"pagePath": "pages/search/search",
"text": "搜索",
"iconPath": "static/tab/search.png",
"selectedIconPath": "static/tab/searchActive.png"
},{
"pagePath": "pages/lendCar/lendCar",
"text": "借阅",
"iconPath": "static/tab/order.png",
"selectedIconPath": "static/tab/orderActive.png"
},{
"pagePath": "pages/user/user",
"text": "我的",
"iconPath": "static/tab/my.png",
"selectedIconPath": "static/tab/myActive.png"
}]
},
"subPackages": [
{
"root": "subpkg",
"pages": [
{
"path": "pages/book-detail/book-detail",
"style": {
"navigationBarTitleText": "图书详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/book-list/book-list",
"style": {
"navigationBarTitleText": "图书列表"
}
},
{
"path": "pages/ranking/ranking",
"style": {
"navigationBarTitleText": "借阅排行榜"
}
},
{
"path": "pages/activity-list/activity-list",
"style": {
"navigationBarTitleText": "活动列表"
}
},
{
"path": "pages/activity-detail/activity-detail",
"style": {
"navigationBarTitleText": "活动详情"
}
},
{
"path": "pages/myLending/myLending",
"style": {
"navigationBarTitleText": "我的借阅",
"enablePullDownRefresh": true, // -
"onReachBottomDistance": 100
}
},
{
"path": "pages/feedback/feedback",
"style": {
"navigationBarTitleText": "读者留言"
}
},
{
"path": "pages/reader-card/reader-card",
"style": {
"navigationBarTitleText": "读者证"
}
},
{
"path": "pages/feedback-list/feedback-list",
"style": {
"navigationBarTitleText": "读者留言"
}
},
{
"path": "pages/collect-list/collect-list",
"style": {
"navigationBarTitleText": "我的收藏",
"enablePullDownRefresh": true, // -
"onReachBottomDistance": 100
}
},
{
"path": "pages/user-info/user-info",
"style": {
"navigationBarTitleText": "个人资料"
}
}
]
}
]
}
{
"pages": [
{
"path": "pages/home/home",
"style": {
"navigationBarTitleText": "图书馆"
}
},
{
"path": "pages/search/search",
"style": {
"navigationBarTitleText": "图书检索"
}
},
{
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/lendCar/lendCar",
"style": {
"navigationBarTitleText": "借阅清单"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"app-plus": {
"background": "#efeff4"
}
},
"tabBar":{
"selectedColor": "#409EFF",
"list": [{
"pagePath": "pages/home/home",
"text": "首页",
"iconPath": "static/tab/shouye.png",
"selectedIconPath": "static/tab/shouyeActive.png"
},{
"pagePath": "pages/search/search",
"text": "搜索",
"iconPath": "static/tab/search.png",
"selectedIconPath": "static/tab/searchActive.png"
},{
"pagePath": "pages/lendCar/lendCar",
"text": "借阅",
"iconPath": "static/tab/order.png",
"selectedIconPath": "static/tab/orderActive.png"
},{
"pagePath": "pages/user/user",
"text": "我的",
"iconPath": "static/tab/my.png",
"selectedIconPath": "static/tab/myActive.png"
}]
},
"subPackages": [
{
"root": "subpkg",
"pages": [
{
"path": "pages/book-detail/book-detail",
"style": {
"navigationBarTitleText": "图书详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/book-list/book-list",
"style": {
"navigationBarTitleText": "图书列表"
}
},
{
"path": "pages/ranking/ranking",
"style": {
"navigationBarTitleText": "借阅排行榜"
}
},
{
"path": "pages/activity-list/activity-list",
"style": {
"navigationBarTitleText": "活动列表"
}
},
{
"path": "pages/activity-detail/activity-detail",
"style": {
"navigationBarTitleText": "活动详情"
}
},
{
"path": "pages/myLending/myLending",
"style": {
"navigationBarTitleText": "我的借阅",
"enablePullDownRefresh": true,
"onReachBottomDistance": 100
}
},
{
"path": "pages/feedback/feedback",
"style": {
"navigationBarTitleText": "读者留言"
}
},
{
"path": "pages/reader-card/reader-card",
"style": {
"navigationBarTitleText": "读者证"
}
},
{
"path": "pages/feedback-list/feedback-list",
"style": {
"navigationBarTitleText": "读者留言"
}
},
{
"path": "pages/feedback-detail/feedback-detail",
"style": {
"navigationBarTitleText": "留言详情"
}
},
{
"path": "pages/collect-list/collect-list",
"style": {
"navigationBarTitleText": "我的收藏",
"enablePullDownRefresh": true,
"onReachBottomDistance": 100
}
},
{
"path": "pages/user-info/user-info",
"style": {
"navigationBarTitleText": "个人资料"
}
}
]
}
]
}

4
pages/home/home.vue

@ -337,7 +337,7 @@ export default {
goToBookDetail(item) {
//
uni.navigateTo({
url: "/subpkg/pages/book-detail/book-detail?bookData=" + encodeURIComponent(JSON.stringify(item))
url: "/subpkg/pages/book-detail/book-detail?bookData=" + encodeURIComponent(JSON.stringify(item)) + "&fromRecommend=true"
})
},
@ -397,7 +397,7 @@ export default {
});
},
toFeedback() {
this.checkBindAndNavigate("/subpkg/pages/feedback-list/feedback-list", "请您绑定读者证");
this.checkBindAndNavigate("/subpkg/pages/feedback/feedback", "请您绑定读者证");
},
//
toLibraryCard() {

24
pages/user/user.vue

@ -185,29 +185,7 @@ export default {
}
});
});
},
toLogOut() {
uni.showModal({
title: '确认退出',
content: '确定要退出当前账号吗?',
success: (res) => {
if (res.confirm) {
uni.removeStorageSync(USER_KEY);
uni.removeStorageSync(STORAGE_KEYS.READER_CARD_LIST);
uni.removeStorageSync(STORAGE_KEYS.CURRENT_READER_CARD);
this.userInfo = {};
this.cardNo = "";
this.isBindLibraryCard = false;
this.base64Img = "";
uni.showToast({ title: '退出成功', icon: 'success' });
uni.switchTab({ url: "/pages/home/home" });
}
}
});
},
}
}
}
</script>

52
subpkg/pages/activity-detail/activity-detail.vue

@ -15,7 +15,10 @@
</view>
<view class="rich-content">
<text class="content-title">活动介绍/回顾</text>
<text class="content-title">活动介绍/回顾</text>
<div v-if="detail.localImg" style="text-align:center; margin:12px 0;">
<image :src="require(`@/static/${detail.localImg}`)" mode="widthFix" style="width:90%; border-radius:8px;"></image>
</div>
<rich-text :nodes="contentNodes"></rich-text>
</view>
@ -25,12 +28,12 @@
<uni-icons custom-prefix="iconfont" type="icon-fenxiang01" size="20"></uni-icons>
<text>分享</text>
</button>
<!-- <button class="handle-btn" @click="toggleCollect">
<uni-icons :type="isCollected ? 'heart-filled' : 'heart'" size="20" color="#ff4444"></uni-icons>
<text>{{ isCollected ? '已收藏' : '收藏' }}</text>
</button> -->
</view>
<button class="join-btn" :class="detail.status === 0 ? 'disabled-btn' : ''">
<button
class="join-btn"
:class="detail.status === 0 ? 'disabled-btn' : ''"
@click="handleJoin"
>
{{ detail.status === 1 ? '我要参加' : '活动结束' }}
</button>
</view>
@ -47,7 +50,6 @@ export default {
contentNodes: ""
};
},
onLoad(options) {
const item = JSON.parse(decodeURIComponent(options.item));
this.detail = item;
@ -60,22 +62,15 @@ export default {
formatContent() {
let content = this.detail.content || "";
// ======================================
// 1. content <image src="@/static/..."> <img>
// ======================================
const localImgReg = /<image[^>]*\s+src\s*=\s*['"]@\/static\/([^'"]+)['"][^>]*>/gi;
content = content.replace(localImgReg, (match, path) => {
const imgPath = path.startsWith('/') ? path : '/' + path;
return `
<div style="text-align:center; margin:12px 0;">
<img src="/static${imgPath}" style="width:90%; border-radius:8px;">
</div>
`;
});
// const localImgReg = /<image[^>]*\s+src\s*=\s*['"]@\/static\/([^'"]+)['"][^>]*>/gi;
// content = content.replace(localImgReg, (match, path) => {
// return `
// <div style="text-align:center; margin:12px 0;">
// <img src="/static/${path}" style="width:90%; border-radius:8px;">
// </div>
// `;
// });
// ======================================
// 2. https://mmbiz.qpic.cn
// ======================================
const httpImgReg = /https:\/\/mmbiz\.qpic\.cn[^ \n\r'"]+/g;
content = content.replace(httpImgReg, url => {
return `
@ -88,7 +83,6 @@ export default {
this.contentNodes = content;
},
checkCollectStatus() {
const list = uni.getStorageSync('activityCollectList') || [];
this.isCollected = list.includes(this.activityId);
@ -105,6 +99,16 @@ export default {
}
uni.setStorageSync('activityCollectList', list);
this.isCollected = !this.isCollected;
},
handleJoin() {
if (this.detail.status === 0) {
return;
}
uni.showToast({
title: '报名成功',
icon: 'success'
});
}
},
@ -211,4 +215,4 @@ export default {
.disabled-btn {
background: #ccc !important;
}
</style>
</style>

139
subpkg/pages/activity-list/activity-list.vue

@ -1,5 +1,22 @@
<template>
<view class="activity-list">
<view class="tab-box">
<view
class="tab-item"
:class="{ active: currentTab === 0 }"
@click="switchTab(0)"
>
进行中
</view>
<view
class="tab-item"
:class="{ active: currentTab === 1 }"
@click="switchTab(1)"
>
往期活动
</view>
</view>
<scroll-view
scroll-y
refresher-enabled
@ -7,8 +24,7 @@
@refresherrefresh="onRefresh"
lower-threshold="100"
>
<!-- 活动列表 -->
<view class="activity-item" v-for="(item, index) in activityList" @click="toActivityDetail(item)" :key="index">
<view class="activity-item" v-for="(item, index) in displayList" @click="toActivityDetail(item)" :key="index">
<image class="activity-img" :src="item.imgUrl" mode="aspectFill"></image>
<view class="activity-info">
<view class="activity-info-left">
@ -29,10 +45,9 @@
</view>
</view>
<!-- 空状态 -->
<view class="empty-box" v-if="activityList.length === 0">
<view class="empty-box" v-if="displayList.length === 0">
<uni-icons custom-prefix="iconfont" type="icon-kongshuju" size="80"></uni-icons>
<text style="margin-top: 20px;">暂无活动敬请期待~</text>
<text style="margin-top: 20px;">暂无{{ currentTab === 0 ? '进行中的活动' : '往期活动' }}~</text>
</view>
</scroll-view>
</view>
@ -42,15 +57,26 @@
export default {
data() {
return {
currentTab: 0,
activityList: [],
refreshing: false
};
},
computed: {
displayList() {
return this.currentTab === 0
? this.activityList.filter(item => item.status === 1)
: this.activityList.filter(item => item.status === 0);
}
},
onLoad() {
this.getActivityList();
},
methods: {
// 2
switchTab(index) {
this.currentTab = index;
},
getActivityList() {
this.refreshing = true;
setTimeout(() => {
@ -58,11 +84,9 @@ export default {
{
imgUrl: "https://mmbiz.qpic.cn/mmbiz_jpg/tuyGibvSXrso7c068ibUK1dXCGM2oiaBHAe3c82icrPjhLr3aFMLzhQ8n4C9X6qY5n0aDkRibvTNxoFVchrQxnicSJ64LX5KJxKj80TutmMicRKoY0/640?wx_fmt=jpeg&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=3",
title: "以爱之名赴健康之约,致敬每一位伟大的母亲",
time: "2026-05-10 09:00 ~ 2026-05-10 11:30",
content: `
<image src="@/static/images/activity1.png" mode="aspectFill"></image>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">2026年5月10日以爱之名守护健康葛图讲坛35期母亲节健康关爱活动在葛店经开区图书馆温情启幕汇聚了近40组亲子家庭将健康科普化作深情告白把亲子陪伴化作节日惊喜为每一位母亲送上最真挚的节日祝福与贴心关怀</p>
time: "2026-05-10 09:00 ~ 2026-05-15 11:30",
localImg: "images/activity1.png",
content: `<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">2026年5月10日,“以爱之名,守护健康”葛图讲坛35期母亲节健康关爱活动在葛店经开区图书馆温情启幕,汇聚了近40组亲子家庭,将健康科普化作深情告白,把亲子陪伴化作节日惊喜,为每一位母亲送上最真挚的节日祝福与贴心关怀。</p>
https://mmbiz.qpic.cn/mmbiz_jpg/tuyGibvSXrsp5h4G9Ip4Jl10attsaXjlUyRLOcia8zXKfV0yc9cwOIgmvnSqusKkB4iaia8bMFDnBm2ApntEWA06QEmDt7hbwa5t5k3hofWZm3s/640?wx_fmt=jpeg&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=6
@ -118,27 +142,21 @@ export default {
愿每一份爱意及时抵达<br/>
让每一位母亲被时光温柔以待<br/>
被健康悉心守护<br/>
</p>
`,
status: 0,
</p>`,
status: 1,
location: "葛店经开区图书馆",
},
{
imgUrl: "https://mmbiz.qpic.cn/sz_mmbiz_jpg/tuyGibvSXrsqmHJvND8QQFHPDaFEuGGqaNgVvjEO7tqBziaqlcz5bURSyNd4DoKxcD41LWIDComEbUm25pBA86ibeN45zvoPAzDJzaoxayyicMc/640?wx_fmt=jpeg&from=appmsg#imgIndex=22",
title: "别让肥胖偷走健康,馆藏好书为健康支招",
time: "2026-05-11 09:00 ~ 2026-05-11 17:30",
content: `
<image src="@/static/images/activity2.png" mode="aspectFill"></image>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; font-size: 13px;">5月11日是专为对抗肥胖问题设立的世界防治肥胖日5·11谐音成我要瘦这简单的三个字背后藏着的是全球超20亿超重或肥胖人群的健康焦虑肥胖早已不是体态丰满的小事而是被世界卫生组织列为十大慢性疾病之一的公共卫生危机今天就让我们一起科学认识肥胖把健康主动权握在自己手中</p>
localImg: "images/activity2.png",
content: `<p style="padding:20px 12px; text-indent: 2em; line-height:28px; font-size: 13px;">5月11日,是专为对抗肥胖问题设立的世界防治肥胖日。当“5·11”谐音成“我要瘦”,这简单的三个字背后,藏着的是全球超20亿超重或肥胖人群的健康焦虑。肥胖早已不是“体态丰满”的小事,而是被世界卫生组织列为十大慢性疾病之一的公共卫生危机。今天,就让我们一起科学认识肥胖,把健康主动权握在自己手中。</p>
<div style="display:flex; justify-content: center; margin:40px auto 20px auto;">
<p style="background-color: rgb(93, 164, 124); padding: 4px 15px; color:#fff; border-radius: 4px; ">科学减重指南书籍推荐</p>
</div>
<p style="text-indent: 2em; line-height:28px; display: inline-block; margin:0 12px; border: 2px solid rgb(93, 164, 124); padding: 10px; background-color: rgb(199, 227, 178); font-size: 13px; text-align: justify; border-radius: 4px;">为什么你拼命运动还是瘦不下来为什么你严格节食却依旧反弹为什么别人轻松减肥你却举步维艰其实减肥不是一场靠意志力硬撑的战争而是一场需要科学指导的持久战想要打破减肥僵局不妨从阅读专业的减肥书籍开始今天葛店经开区图书馆就为你推荐几本靠谱的减肥好书帮你重塑身材拥抱健康生活</p>
https://mmbiz.qpic.cn/sz_mmbiz_jpg/tuyGibvSXrsoXfmjrjPs3sDmOmIkx7LSHA7bMdkNGvbVDdyN7AywSXk8hfL2Z0S0bv9S6NUSxuYngZnyRGXff2gmvuUn89iaxHfPxVQyNLLZg/640?wx_fmt=jpeg&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=16
<div style="display:flex; justify-content: center; margin:20px auto; flex-direction: column; padding:0 20px; font-size: 13px;">
<p>ISBN:</p>
<p style="text-align: center; line-height:36px;">978-7-5337-9035-6 </p>
@ -147,9 +165,7 @@ export default {
<p>内容简介:</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">本书分为五个篇章, 包括认知篇饮食营养篇心理篇运动篇, 以及特殊人群篇这五个篇章涵盖了超重和肥胖人群的体重管理, 以及消瘦人群的体重管理, 旨在为读者提供全面科学的体重管理指导</p>
</div>
https://mmbiz.qpic.cn/mmbiz_jpg/tuyGibvSXrso5oZu6lfdRoV4n8qqp55JYqOh44UrIiaicPHbnicIk8C7QVoCGiaNZXZXByXUWo7WqgiaBhGXztdZtYnC0ps8SYHjiaV9PKY8X6iaPqQ/640?wx_fmt=jpeg&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=17
<div style="display:flex; justify-content: center; margin:20px auto; flex-direction: column; padding:0 20px; font-size: 13px;">
<p>ISBN:</p>
<p style="text-align: center; line-height:36px;">978-7-5001-7513-1 </p>
@ -158,10 +174,7 @@ export default {
<p>内容简介:</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">本书主要内容: 身体重置计划不需要节食不需要有禁食窗口期, 无关饮食热量限制或其他时髦的花招它包含六大简单的操作技巧, 是为生活在现实世界中的真实成年人设计, 帮助成年人通过饮食实现健康生活, 甚至逆龄生态书中内容非常易于操作和可持续, 不需要很多额外的餐饮动作, 是一套详尽有效丰富的餐饮为主, 配合适当运动的综合性身体调节计划</p>
</div>
https://mmbiz.qpic.cn/sz_mmbiz_jpg/tuyGibvSXrspsqSQqHXGWtMUuLeKD7y1hJ0gDBqpBNJlRCMyPoZwjB8HN1chbl13zcQEIiaVBbrsRdnznThGze0EDQtfQyKen282oFUunVzB0/640?wx_fmt=jpeg&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=18
<div style="display:flex; justify-content: center; margin:20px auto; flex-direction: column; padding:0 20px; font-size: 13px;">
<p>ISBN:</p>
<p style="text-align: center; line-height:36px;">978-7-5532-1045-2</p>
@ -170,60 +183,39 @@ export default {
<p>内容简介:</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">作者谢佳妤在整理其奶奶李瑞芬遗稿的基础上用年轻化的语言讲述了饮食与健康的关系说明了各种常见的营养素的作用和正确进行食物搭配的方法有助于读者学会科学选择食物理性对待食物养成均衡饮食合理膳食的习惯</p>
</div>
<div style="display:flex; justify-content: center; margin:40px auto 20px auto;">
<p style="background-color: rgb(93, 164, 124); padding: 4px 15px; color:#fff; border-radius: 4px; ">肥胖是疾病的导火索</p>
</div>
<div>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">很多人觉得胖点没关系看着富态但医学研究早已证实肥胖是多种疾病的共同土壤它就像一颗埋在身体里的定时炸弹随时可能引爆健康危机</p>
https://mmbiz.qpic.cn/sz_mmbiz_png/tuyGibvSXrsoGIHpwHdfEr7sM6Ldqd4YjPwaYBBeFc2CRickibceCwIEXIopOCO6HWMIagYQkEwApf42cYxPUbdUqT3d2rFudibJcM53n3wTG0Q/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=20
<p style="text-align: center; line-height:36px;">1.代谢系统紊乱</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">约80%的2型糖尿病患者伴有超重或肥胖内脏脂肪释放的炎症因子会干扰胰岛素信号让身体对胰岛素失灵血糖随之失控此外肥胖还会诱发痛风高脂血症让血液变成浓稠的油脂汤</p>
<p style="text-align: center; line-height:36px;">2.心血管不堪重负</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">肥胖者患高血压的风险比正常人高60%冠心病风险更是高出2-3腹部堆积的脂肪会压迫血管加速动脉粥样硬化心梗中风等急性心血管事件的发生率也随之飙升</p>
https://mmbiz.qpic.cn/sz_mmbiz_jpg/tuyGibvSXrsqmHJvND8QQFHPDaFEuGGqaNgVvjEO7tqBziaqlcz5bURSyNd4DoKxcD41LWIDComEbUm25pBA86ibeN45zvoPAzDJzaoxayyicMc/640?wx_fmt=jpeg&from=appmsg#imgIndex=22
<p style="text-align: center; line-height:36px;">3.癌症风险飙升</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">国际癌症研究机构确认肥胖与至少13种癌症相关其中子宫内膜癌风险增加6倍食管腺癌肝癌肾癌等发病概率也显著上升脂肪组织分泌的异常激素会持续刺激细胞变异为癌症埋下隐患</p>
<p style="text-align: center; line-height:36px;">4.生活质量直线下降</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">体重每增加5公斤膝关节骨关节炎风险上升36%重度肥胖者中阻塞性睡眠呼吸暂停综合征患病率超70%每晚都在缺氧中挣扎更不用提肥胖带来的自卑抑郁等心理问题让很多人在社交中抬不起头 </p>
</div>
<div style="display:flex; justify-content: center; margin:40px auto 20px auto;">
<p style="background-color: rgb(93, 164, 124); padding: 4px 15px; color:#fff; border-radius: 4px; ">科学减重避开误区找对方法</p>
</div>
<div>
https://mmbiz.qpic.cn/mmbiz_png/tuyGibvSXrsroDeiawZ9ApdibzQc2ZXAp8u1JSsViciaibwfIupY4VTpIets2AoEY87dfbKIS8cuDeR7icLqBGNSUkV8nCA3fmyLDw2hH7dtdWK5FE/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=29
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">提到减肥很多人第一反应就是节食吃减肥药但这些极端方法往往伤身又反弹真正的科学减重是建立健康的生活方式让身体慢慢回归平衡</p>
<p style="text-align: center; line-height:36px;">1.不是饿肚子会吃饭</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">控制总能量合理分配先根据身高cm-105算出理想体重再按每天每公斤理想体重15-35kcal计算总能量轻体力劳动者选20-25kcal将一日三餐能量按3:4:3分配早餐吃好午餐吃饱晚餐吃少</p>
https://mmbiz.qpic.cn/mmbiz_png/tuyGibvSXrsobpIdpicy3GeZ9HxuWwQCKqAr85ibIHfZKGFAsgewVSrh6fwI04vlJGAOBgiaRB5eyp4HHo4NJ3wWiberXHvke4LGs6hnKupzqPqk/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=31
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">拒绝高热量陷阱少吃油炸食品含糖糕点肥肉等高能量食物这些食物往往一口就占了半天的能量配额多吃全谷物蔬菜优质蛋白比如燕麦西兰花鸡胸肉它们能带来更强的饱腹感还能保证营养均衡</p>
https://mmbiz.qpic.cn/sz_mmbiz_png/tuyGibvSXrsq1ypaFcwARIlrCXTqibKZcjwozFc9JlKTap25kzbxY7a8Fk7l5ibLxibKN7bTIak0logVmTGR48N9xHz3NF1nL7gxXZ6MncFvGt8/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=32
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">养成健康进食习惯细嚼慢咽每口饭嚼20次以上定时定量进餐不吃夜宵用小盘子盛饭避免眼大肚小吃撑自己</p>
<p style="text-align: center; line-height:36px;">2. 动起来让脂肪起来</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">有氧运动为主抗阻运动为辅每周进行150-300分钟中等强度有氧运动比如快走慢跑游泳每次30分钟以上能有效燃烧脂肪每周再安排2-3次抗阻运动举哑铃做平板支撑都可以增加肌肉量能提高基础代谢让你躺着也能消耗更多能量</p>
https://mmbiz.qpic.cn/mmbiz_png/tuyGibvSXrsp64a3In2BKHfQQHEIkDIUSjCklsbETfrcRkHyd35fW3OUYZeibpJHRE6zicbicSf94DIics1vP9b27o1GPH7X2rQkk0wh8bNNaicoQ/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=34
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">打破久坐魔咒每坐1小时就起身活动3-5分钟伸伸懒腰倒杯水走两步每天的零碎时间加起来也是一笔不小的运动财富</p>
<p style="text-align: center; line-height:36px;">3.小习惯大改变</p>
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">睡够7小时睡眠不足会导致瘦素分泌减少饥饿素分泌增加让你忍不住想吃高糖高脂食物尽量在晚上11点前入睡给身体足够的修复时间 </p>
https://mmbiz.qpic.cn/mmbiz_png/tuyGibvSXrspLUJPiaZuP1eAZXWjyNyGeKLNgnXibwich4xnqgQJjXcyxCIickVWr8ibsmnEmTUx2JuwARYWxDR3yW2ibIJX2O3RzSic3xT3RNlkwaA/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=35
https://mmbiz.qpic.cn/sz_mmbiz_png/tuyGibvSXrsqKnXiak3cs5BPILA59JRapTCkFBycZ0SYdzxBQ1LMnqkXicWZiaNiaYPsTyZ9S1wBOyuv0j24v6pbyjWIO2p8Ue42LWckMYWuaSrs/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=36
@ -231,17 +223,14 @@ export default {
https://mmbiz.qpic.cn/mmbiz_png/tuyGibvSXrsoGPLDZ7l26cKDDac6BewgQuZiaic4M5Rk052cibY1OYBiaE9G46QAIEeCdSZN58usFVWMIto6dcz2lxg04ksYRaECazibulFu9pjf4/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=37
<p style="padding:20px 12px; text-indent: 2em; line-height:28px; ">定期监测体重每周固定时间称一次体重比如每周一早上空腹称重及时调整饮食和运动计划避免体重悄悄失控</p>
</div>
<p style="text-align: center; line-height:36px; padding-top: 40px;">
<p style="text-align: center; line-height:36px; padding-top: 40px;">
每个人<br/>
从自己做起<br/>
主动学习健康知识<br/>
管住嘴<br/>
迈开腿<br/>
用实际行动对抗肥胖<br/>
</p>
`,
</p>`,
status: 0,
location: "葛店经开区图书馆",
}
@ -250,19 +239,16 @@ export default {
}, 300);
},
//
onRefresh() {
this.getActivityList();
},
//
toActivityDetail(item) {
if (item.link) {
uni.navigateTo({
url: '/subpkg/pages/webview/webview?url=' + encodeURIComponent(item.link)
});
} else {
//
uni.navigateTo({
url: "/subpkg/pages/activity-detail/activity-detail?item=" + encodeURIComponent(JSON.stringify(item))
});
@ -274,13 +260,48 @@ export default {
<style lang="scss" scoped>
.activity-list {
padding: 20px 10px;
padding: 15px 10px;
height: 100vh;
box-sizing: border-box;
background-color: #f5f5f5;
}
.tab-box {
display: flex;
background-color: #fff;
margin-bottom: 10px;
position: sticky;
top: 0;
z-index: 99;
}
.tab-item {
flex: 1;
text-align: center;
padding: 10px 0;
font-size: 15px;
color: #333;
position: relative;
}
.tab-item.active {
color: #01a4fe;
font-weight: bold;
}
.tab-item.active::after {
content: '';
position: absolute;
width: 25px;
height: 2px;
background-color: #01a4fe;
bottom: 0;
left: 50%;
transform: translateX(-50%);
border-radius: 2px;
}
scroll-view {
height: 100%;
height: calc(100vh - 120px);
}
.empty-box {
@ -288,7 +309,7 @@ scroll-view {
flex-direction: column;
justify-content: center;
align-items: center;
height: calc(100vh - 150rpx);
height: calc(100vh - 200px);
color: #999;
font-size: 15px;
}
@ -349,4 +370,4 @@ scroll-view {
}
}
}
</style>
</style>

20
subpkg/pages/book-detail/book-detail.vue

@ -1,5 +1,5 @@
<template>
<view class="detail-container">
<view class="detail-container">
<!-- 书籍头部信息 -->
<view class="article-detail-container">
<view class="article-detail-left">
@ -12,7 +12,7 @@
</view>
</view>
<view class="article-detail-right">
<image
<image
class="img-item"
:src="bookInfo.cover || bookInfo.base64Cover || '/static/images/default-book.png'"
mode="widthFix"
@ -87,7 +87,7 @@
<uni-icons custom-prefix="iconfont" type="icon-fenxiang01" size="20"></uni-icons>
<text class="share-text">分享</text>
</button>
<button class="handle-btn" @click="toggleCollect">
<button v-if="!fromRecommend" class="handle-btn" @click="toggleCollect">
<uni-icons :type="isCollected ? 'heart-filled' : 'heart'" size="20" color="#ff4444"></uni-icons>
<text class="share-text">{{ isCollected ? '已收藏' : '收藏' }}</text>
</button>
@ -108,8 +108,9 @@ export default {
isCollected: false,
bookrecno: '',
opacUrl: '',
bookInfo: {}, // biblios
holdingsData: [], // holdings
fromRecommend: false,
bookInfo: {},
holdingsData: [],
};
},
onLoad(options) {
@ -118,7 +119,7 @@ export default {
const bookData = JSON.parse(decodeURIComponent(options.bookData));
this.bookInfo = bookData;
this.bookrecno = bookData.bookrecno || "";
//
this.fromRecommend = options.fromRecommend === 'true';
this.holdingsData = [];
this.checkCollectStatus();
return;
@ -126,6 +127,7 @@ export default {
// 2. bookrecno
this.bookrecno = options.bookrecno || "";
this.fromRecommend = false;
this.getOpacUrl();
},
computed: {
@ -160,7 +162,7 @@ export default {
//
async getBookDetail() {
if (!this.bookrecno || !this.opacUrl) return;
uni.showLoading({ title: '加载中...' });
try {
const params = {
@ -169,7 +171,7 @@ export default {
};
const res = await FetchFindbookByQuery(params);
console.log('bookrecno详情',res);
const apiData = res.data || {};
this.bookInfo = apiData.biblios || {};
console.log('bookrecno-bookInfo详情',this.bookInfo);
@ -366,4 +368,4 @@ export default {
.detail-bottom{
justify-content: space-around;
}
</style>
</style>

7
subpkg/pages/book-list/book-list.vue

@ -73,7 +73,6 @@ export default {
this.getBookRecommendList();
},
// +
async getBookRecommendList() {
this.loading = true;
try {
@ -110,7 +109,7 @@ export default {
//
const url = this.baseUrl + '/api/fileRelevant/getImg?imgType=2&imgId=' + item.imgPath;
const base64 = await this.urlToBase64(url);
if (base64) {
item.base64Cover = base64;
this.$set(this.bookList, i, item); //
@ -120,7 +119,7 @@ export default {
goToDetail(item) {
uni.navigateTo({
url: "/subpkg/pages/book-detail/book-detail?bookData=" + encodeURIComponent(JSON.stringify(item))
url: "/subpkg/pages/book-detail/book-detail?bookData=" + encodeURIComponent(JSON.stringify(item)) + "&fromRecommend=true"
})
},
}
@ -146,4 +145,4 @@ export default {
font-size: 14px;
color: #999;
}
</style>
</style>

176
subpkg/pages/collect-list/collect-list.vue

@ -1,73 +1,25 @@
<template>
<view class="collection-page">
<view class="tab-box">
<view class="tab-item" :class="activeTab === 1 ? 'active' : ''" @click="switchTab(1)"> 图书 </view>
<view class="tab-item" :class="activeTab === 2 ? 'active' : ''" @click="switchTab(2)"> 活动 </view>
</view>
<!-- 内容区域 -->
<view class="content-box">
<!-- 图书收藏 -->
<view v-if="activeTab === 1" class="tab-content">
<view class="empty" v-if="bookCollectList.length === 0">
<uni-icons style="margin-left: 20px;" custom-prefix="iconfont" type="icon-kongshuju" size="80"></uni-icons>
<text style="margin-top: 20px;">暂无收藏的图书~</text>
</view>
<view class="recommendation-list" v-else>
<view
class="book-item"
v-for="(item, index) in bookCollectList"
@click="goToBookDetail(item)"
:key="index"
>
<image class="book-cover" :src="item.cover"></image>
<view class="book-title">{{ item.title }}</view>
</view>
</view>
<uni-load-more status="loading" v-if="isLoading"></uni-load-more>
<view class="no-more" v-if="noMore && bookCollectList.length > 0">
没有更多数据了
</view>
<view class="empty" v-if="bookCollectList.length === 0">
<uni-icons style="margin-left: 20px;" custom-prefix="iconfont" type="icon-kongshuju" size="80"></uni-icons>
<text style="margin-top: 20px;">暂无收藏的图书~</text>
</view>
<!-- 活动收藏 -->
<view v-if="activeTab === 2" class="tab-content">
<view class="empty" v-if="activityCollectList.length === 0">
<uni-icons style="margin-left: 20px;" custom-prefix="iconfont" type="icon-kongshuju" size="80"></uni-icons>
<text style="margin-top: 20px;">暂无收藏的活动~</text>
</view>
<view class="activity-list" v-else>
<view
class="activity-item"
v-for="(item, index) in activityCollectList"
@click="toActivityDetail(item)"
:key="index"
>
<image class="activity-img" :src="item.imgUrl"></image>
<view class="activity-info">
<view class="activity-info-left">
<text class="title">{{ item.title }}</text>
<view class="time">
<uni-icons class="time-icon" type="time" size="15"></uni-icons>
<text>{{ item.time }}</text>
</view>
</view>
<button
class="activity-btn"
:class="item.status === 0 ? 'disabled-btn' : ''"
type="primary"
:disabled="item.status === 0"
>
{{ item.status === 1 ? '立即参加' : '活动结束' }}
</button>
</view>
</view>
</view>
<uni-load-more status="loading" v-if="isLoading"></uni-load-more>
<view class="no-more" v-if="noMore && activityCollectList.length > 0">
没有更多数据了
<view class="recommendation-list" v-else>
<view
class="book-item"
v-for="(item, index) in bookCollectList"
@click="goToBookDetail(item)"
:key="index"
>
<image class="book-cover" :src="item.cover"></image>
<view class="book-title">{{ item.title }}</view>
</view>
</view>
<uni-load-more status="loading" v-if="isLoading"></uni-load-more>
<view class="no-more" v-if="noMore && bookCollectList.length > 0">
没有更多数据了
</view>
</view>
</view>
</template>
@ -76,41 +28,20 @@
export default {
data() {
return {
activeTab: 1,
isLoading: false,
noMore: false,
pageNum: 1,
pageSize: 5,
bookCollectList: [
// { isbn: '9787544741110', title: '', cover: 'https://qiniu.aiyxlib.com/1606124577077' },
// { isbn: '9787539938032', title: 'Vim 8', cover: 'https://qiniu.aiyxlib.com/1606178450151' },
// { isbn: '9787536692930', title: 'Oracle', cover: 'https://qiniu.aiyxlib.com/1606123986028' }
{ isbn: '9787544741110', title: '人工智能基础——数学知识', cover: 'https://qiniu.aiyxlib.com/1606124577077' },
{ isbn: '9787539938032', title: 'Vim 8文本处理实战', cover: 'https://qiniu.aiyxlib.com/1606178450151' },
{ isbn: '9787536692930', title: 'Oracle从入门到精通', cover: 'https://qiniu.aiyxlib.com/1606123986028' }
],
allActivityList: [
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-03 ~2025-11-09", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-03 ~2025-11-09", status: 0 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-05 ~2025-11-10", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-06 ~2025-11-12", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-07 ~2025-11-13", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-08 ~2025-11-14", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-09 ~2025-11-15", status: 0 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-10 ~2025-11-16", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-11 ~2025-11-17", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '访', time: "2025-11-12 ~2025-11-18", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-13 ~2025-11-19", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-14 ~2025-11-20", status: 0 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-15 ~2025-11-21", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-16 ~2025-11-22", status: 1 },
// { imgUrl: "https://qiniu.aiyxlib.com/1605060269830", title: '', time: "2025-11-17 ~2025-11-23", status: 1 },
],
activityCollectList: [],
}
},
onLoad() {
this.initActivityList() //
},
onPullDownRefresh() {
@ -119,52 +50,28 @@ export default {
onReachBottom() {
if (this.noMore || this.isLoading) return
this.loadMore() //
this.loadMore()
},
methods: {
switchTab(tab) {
this.activeTab = tab
// Tab
},
// /
initActivityList() {
this.pageNum = 1
this.noMore = false
this.activityCollectList = this.allActivityList.slice(0, this.pageSize)
this.noMore = this.allActivityList.length <= this.pageSize
},
refreshData() {
this.isLoading = true
setTimeout(() => {
//
this.bookCollectList = [
{ isbn: '9787544741110', title: '人工智能基础——数学知识', cover: 'https://qiniu.aiyxlib.com/1606124577077' },
{ isbn: '9787539938032', title: 'Vim 8文本处理实战', cover: 'https://qiniu.aiyxlib.com/1606178450151' },
{ isbn: '9787536692930', title: 'Oracle从入门到精通', cover: 'https://qiniu.aiyxlib.com/1606123986028' }
]
//
this.initActivityList()
this.isLoading = false
uni.stopPullDownRefresh()
}, 500)
},
//
loadMore() {
this.isLoading = true
this.pageNum++
setTimeout(() => {
const start = (this.pageNum - 1) * this.pageSize
const end = this.pageNum * this.pageSize
const newArr = this.allActivityList.slice(start, end)
if (newArr.length) {
this.activityCollectList = [...this.activityCollectList, ...newArr]
}
this.noMore = this.allActivityList.length <= end
this.noMore = true
this.isLoading = false
}, 500)
},
@ -172,57 +79,20 @@ export default {
goToBookDetail(item) {
uni.navigateTo({ url: "/subpkg/pages/book-detail/book-detail?isbn=" + item.isbn })
},
toActivityDetail(item) {
uni.navigateTo({ url: "/subpkg/pages/activity-detail/activity-detail?title=" + item.title })
},
},
}
</script>
<style lang="scss" scoped>
.collection-page {
padding: 10px 0;
background-color: #f7f8fa;
min-height: 100vh;
}
.tab-box {
display: flex;
background-color: #fff;
margin-bottom: 10px;
position: sticky;
top: 0;
z-index: 99;
}
.tab-item {
flex: 1;
text-align: center;
padding: 10px 0;
font-size: 15px;
color: #333;
position: relative;
}
.tab-item.active {
color: #01a4fe;
font-weight: bold;
}
.tab-item.active::after {
content: '';
position: absolute;
width: 25px;
height: 2px;
background-color: #01a4fe;
bottom: 0;
left: 50%;
transform: translateX(-50%);
border-radius: 2px;
}
.content-box {
padding: 0 10px;
}
.tab-content {
padding-top: 10px;
}
.empty {
text-align: center;
@ -243,4 +113,4 @@ export default {
margin-bottom: 16px;
}
}
</style>
</style>

87
subpkg/pages/feedback-detail/feedback-detail.vue

@ -0,0 +1,87 @@
<template>
<view class="feedback-detail-page">
<view class="section">
<text class="subject">{{ detail.subject }}</text>
<view class="section-content">{{ detail.content }}</view>
<text class="time">{{ detail.createTime }}</text>
</view>
<view class="section reply-section">
<view class="section-title">馆方回复</view>
<view class="section-content" v-if="detail.reply">{{ detail.reply }}</view>
<view class="section-content no-reply" v-else>未回复</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detail: {}
};
},
onLoad(options) {
if (options.item) {
this.detail = JSON.parse(decodeURIComponent(options.item));
}
}
};
</script>
<style lang="scss" scoped>
.feedback-detail-page {
padding: 15px;
background-color: #f7f8fa;
min-height: 100vh;
}
.section {
background-color: #fff;
border-radius: 10px;
padding: 15px;
margin-bottom: 12px;
}
.section-title {
font-size: 14px;
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.section-content {
font-size: 15px;
color: #666;
line-height: 1.6;
margin-bottom: 6px;
}
.section-content:last-child {
margin-bottom: 0;
}
.subject {
font-size: 16px;
font-weight: bold;
color: #333;
display: block;
margin-bottom: 10px;
}
.time {
font-size: 12px;
color: #999;
display: block;
text-align: right;
}
.no-reply {
color: #999;
font-style: italic;
}
.reply-section {
background-color: #f0f9ff;
}
</style>

124
subpkg/pages/feedback-list/feedback-list.vue

@ -1,53 +1,24 @@
<template>
<view class="feedback-page">
<!-- 留言列表 -->
<view class="feedback-list">
<!-- 空状态无留言时显示 -->
<view class="empty-box" v-if="feedbackList.length === 0">
<uni-icons style="margin-left: 20px;" custom-prefix="iconfont" type="icon-kongshuju" size="80" color="#ccc"></uni-icons>
<text style="margin-top: 20px;">暂无留言</text>
</view>
<!-- 有数据时显示列表 -->
<view
class="feedback-item"
v-for="(item, index) in feedbackList"
:key="index"
@click="goDetail(item)"
>
<!-- 头像 + 用户名 + 点赞 -->
<view class="feedback-item-top">
<view class="user-info">
<image
class="avatar"
:src="item.avatar || '/static/images/logo.jpg'"
mode="aspectFill"
></image>
<text class="username">{{ item.nickname }}</text>
</view>
<!-- 点赞按钮 -->
<view class="like-box" @click="likeComment(index)">
<uni-icons
:type="item.isLike ? 'hand-up-filled' : 'hand-up'"
size="22"
:color="item.isLike ? '#FF4D4F' : '#999'"
></uni-icons>
<text class="like-count">{{ item.likeNum }}</text>
</view>
</view>
<!-- 留言内容 -->
<view class="feedback-content">
<text class="content-text">{{ item.content }}</text>
<text class="subject">{{ item.subject }}</text>
<text class="create-time">{{ item.createTime }}</text>
</view>
</view>
</view>
<!-- 写留言按钮 有数据才显示 -->
<view class="write-btn-box" v-if="feedbackList.length > 0">
<button class="write-btn" @click="goWriteComment">写留言</button>
<view class="write-btn-box">
<button class="write-btn" @click="goWriteComment">去留言</button>
</view>
</view>
</template>
@ -56,20 +27,41 @@
export default {
data() {
return {
feedbackList: [] //
feedbackList: [
{
id: 1,
subject: '建议增加更多儿童绘本',
content: '图书馆的儿童区绘本种类不够丰富,希望能增加更多适合3-6岁儿童的绘本读物。',
createTime: '2026-05-10 14:30',
reply: '感谢您的建议!我们已将增加儿童绘本纳入采购计划,预计下季度会新增500余册绘本。'
},
{
id: 2,
subject: '自习室空调温度过低',
content: '最近自习室空调开得太冷了,希望能适当调高温度,或者提供毯子。',
createTime: '2026-05-08 09:15',
reply: ''
},
{
id: 3,
subject: '希望延长周末开放时间',
content: '周末很多人想来看书,但是下午5点就关门了,希望能够延长到晚上8点。',
createTime: '2026-05-05 16:45',
reply: '您的建议已收悉,我们正在研究调整开放时间的可行性,感谢支持。'
}
]
};
},
methods: {
likeComment(index) {
const item = this.feedbackList[index];
item.isLike ? item.likeNum-- : item.likeNum++;
item.isLike = !item.isLike;
},
goWriteComment() {
uni.navigateTo({
url: '/subpkg/pages/feedback/feedback'
});
},
goDetail(item) {
uni.navigateTo({
url: '/subpkg/pages/feedback-detail/feedback-detail?item=' + encodeURIComponent(JSON.stringify(item))
});
}
}
};
@ -81,14 +73,12 @@ export default {
min-height: 100vh;
}
/* 留言列表 */
.feedback-list {
height: calc(100vh - 80px);
overflow-y: scroll;
padding: 10px;
}
/* 空状态 */
.empty-box {
display: flex;
flex-direction: column;
@ -99,7 +89,6 @@ export default {
font-size: 15px;
}
/* 单条留言 */
.feedback-item {
background-color: #fff;
border-radius: 8px;
@ -108,49 +97,14 @@ export default {
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}
.feedback-item-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.user-info {
display: flex;
align-items: center;
}
.avatar {
width: 30px;
height: 30px;
border-radius: 50%;
margin-right: 8px;
}
.username {
font-size: 14px;
color: #333;
font-weight: 500;
}
.like-box {
display: flex;
align-items: center;
}
.like-count {
font-size: 12px;
color: #999;
margin-left: 4px;
}
.feedback-content {
line-height: 1.6;
}
.content-text {
font-size: 14px;
color: #555;
.subject {
font-size: 15px;
font-weight: bold;
color: #333;
display: block;
margin-bottom: 8px;
}
@ -158,6 +112,8 @@ export default {
.create-time {
font-size: 12px;
color: #999;
display: block;
text-align: right;
}
.write-btn-box {
@ -169,10 +125,10 @@ export default {
}
.write-btn {
background-color: #007aff;
background-color: #01a4fe;
color: #fff;
border-radius: 25px;
font-size: 14px;
padding: 4px 0;
}
</style>
</style>

285
subpkg/pages/feedback/feedback.vue

@ -1,86 +1,245 @@
<template>
<!-- :style="{ bottom: bottom + 'px' }" -->
<view class="comment-container" >
<uni-easyinput
v-model="value"
type="textarea"
placeholder="HI,请留下您的留言吧!"
:inputBorder="false"
></uni-easyinput>
<button class="commit" type="primary" :disabled="!value" @click="onBtnClick">
提交
</button>
<view class="feedback-container">
<view class="form-box">
<view class="item">
<text class="label">姓名</text>
<input
class="input"
placeholder="请输入姓名"
v-model="formData.name"
:disabled="hasNickname"
/>
</view>
<view class="item">
<text class="label">读者证</text>
<input
class="input"
placeholder="请输入读者证号"
v-model="formData.readerCard"
disabled
/>
</view>
<view class="item">
<text class="label">主题</text>
<input
class="input"
placeholder="请输入主题(最少5个字)"
v-model="formData.subject"
maxlength="50"
/>
</view>
<view class="item">
<text class="label">联系方式/手机号码</text>
<input
class="input"
placeholder="请输入手机号码"
v-model="formData.phone"
type="number"
maxlength="11"
/>
</view>
<view class="item textarea-item">
<text class="label">您的建议或意见</text>
<textarea
class="textarea"
placeholder="HI,请留下您的留言吧!(最少10个字)"
v-model="formData.content"
:maxlength="500"
/>
</view>
<button class="commit" type="primary" @click="onBtnClick">提交</button>
</view>
</view>
</template>
<script>
import { userArticleComment } from 'api/user';
import { getCurrentReaderCard } from '@/utils/storage';
const USER_KEY = 'user-info';
export default {
name: 'article-comment-commit',
props: {
},
data() {
return {
value: '',
bottom: 0
hasNickname: false,
formData: {
name: '',
readerCard: '',
subject: '',
phone: '',
content: ''
}
};
},
created() {
//
uni.onKeyboardHeightChange(({ height }) => {
this.bottom = height;
});
onLoad() {
this.loadReaderCardInfo();
this.loadUserInfo();
},
methods: {
/**
* 发送按钮点击事件
*/
async onBtnClick() {
//
async loadReaderCardInfo() {
try {
const readerCard = await getCurrentReaderCard();
if (readerCard) {
this.formData.readerCard = readerCard.bindValue || '';
}
} catch (err) {
console.error('Failed to load reader card info:', err);
}
},
loadUserInfo() {
const userInfo = uni.getStorageSync(USER_KEY) || {};
if (userInfo.nickname) {
this.formData.name = userInfo.nickname;
this.hasNickname = true;
}
},
validatePhone(phone) {
const phoneReg = /^1[3-9]\d{9}$/;
return phoneReg.test(phone);
},
onBtnClick() {
const { name, readerCard, subject, phone, content } = this.formData;
if (!name || name.trim().length === 0) {
uni.showToast({
title: '请输入姓名',
icon: 'none'
});
return;
}
if (!readerCard || readerCard.trim().length === 0) {
uni.showToast({
title: '请先绑定读者证',
icon: 'none'
});
return;
}
if (!subject || subject.trim().length < 5) {
uni.showToast({
title: '主题至少需要5个字',
icon: 'none'
});
return;
}
if (!phone) {
uni.showToast({
title: '请输入手机号码',
icon: 'none'
});
return;
}
if (!this.validatePhone(phone)) {
uni.showToast({
title: '手机号码格式不正确',
icon: 'none'
});
return;
}
if (!content || content.trim().length < 10) {
uni.showToast({
title: '建议内容至少需要10个字',
icon: 'none'
});
return;
}
uni.showLoading({
title: '加载中'
});
//
// const { data: res } = await userArticleComment({
// articleId: this.articleId,
// content: this.value
// });
console.log('this.value',this.value)
uni.showToast({
title: '发表成功',
icon: 'success',
mask: true
title: '提交中'
});
//
this.$emit('success', res);
setTimeout(() => {
uni.hideLoading();
uni.showToast({
title: '提交成功',
icon: 'success',
mask: true
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
}, 1000);
}
}
};
</script>
<style lang="scss" scoped>
.comment-container {
position: relative;
padding: 10px;
::v-deep .uni-easyinput{
width: calc(100% - 20px) !important;
background-color: #fff;
padding: 12px;
box-shadow: 0px 3px 60px 1px rgba(0,0,0,0.08);
border-radius: 6px;
}
::v-deep .uni-easyinput__content{
padding: 5px 10px !important;
background: #F1F1F9 !important;
}
::v-deep .uni-easyinput__content-textarea{
height: 140px !important;
}
.commit{
margin: 40px 20px 0 20px;
background-color: #01a4fe;
border-radius: 23px;
}
.feedback-container {
padding: 15px;
background-color: #f5f5f5;
min-height: 100vh;
}
.form-box {
background-color: #fff;
border-radius: 10px;
padding: 20px;
}
.item {
margin-bottom: 20px;
}
.label {
display: block;
font-size: 15px;
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.input {
width: 100%;
height: 44px;
background-color: #f5f5f5;
border-radius: 6px;
padding: 0 15px;
font-size: 14px;
color: #333;
box-sizing: border-box;
}
.input[disabled] {
background-color: #e8e8e8;
color: #999;
}
.textarea-item {
margin-bottom: 30px;
}
.textarea {
width: 100%;
min-height: 120px;
background-color: #f5f5f5;
border-radius: 6px;
padding: 12px 15px;
font-size: 14px;
color: #333;
box-sizing: border-box;
line-height: 1.6;
}
.commit {
width: 100%;
height: 44px;
background-color: #01a4fe;
color: #fff;
border-radius: 22px;
font-size: 16px;
border: none;
margin-top: 20px;
}
.commit::after {
border: none;
}
</style>

2
subpkg/pages/reader-card/reader-card.vue

@ -225,7 +225,7 @@ export default {
if (this.cardList.length === 0) {
clearReaderCardCache();
setTimeout(() => uni.navigateBack(), 1500);
setTimeout(() => uni.navigateBack(), 1000);
}
}
} catch (err) {

Loading…
Cancel
Save