feat: 更新心理论坛页面,优化分类和搜索功能

- 将应用版本号更新至1.0.53
- 修改开发环境baseUrl配置,确保使用本地测试地址
- 在心理论坛页面新增分类选择和搜索功能
- 优化滚动条样式和页面布局
This commit is contained in:
2026-03-30 16:33:42 +08:00
parent b0c63d3faa
commit 78cc9cbccf
3 changed files with 45 additions and 16 deletions

View File

@@ -1,10 +1,12 @@
<template>
<view class="commonPageBox">
<z-paging ref="paging" v-model="dataList" auto-show-back-to-top @query="getDataList">
<z-paging ref="paging" v-model="dataList" auto-show-back-to-top :auto="false" @query="getDataList">
<template #top>
<z-nav-bar title="心理论坛"></z-nav-bar>
<view class="search_box">
<u-search placeholder="请输入文章标题" v-model="query.title" @search="handleSearch" @custom="handleSearch"></u-search>
<u-tabs :list="classification" keyName="dictValue" lineWidth="30" class="classification_tabs" @click="handleClassification"></u-tabs>
</view>
</template>
@@ -39,15 +41,38 @@ export default {
},
dataList: [], //列表数据
statusNull: null, //暂无数据显示
classification: []
}
},
mounted(){
},
onLoad() {
// this.getDataList(this.query.page, this.query.limit)
this.getClassification();
},
methods: {
//免费课程数据
// 获取分类
getClassification(){
this.$http.request({
url: "book/sysdictdata/selectByType/psycheForumLabel",
method: "GET",
header: { "Content-Type": "application/json" },
})
.then((res) => {
if (res.code == 0 && res.dataList) {
this.classification = res.dataList;
this.query.type = res.dataList[0].dictType;
this.$refs.paging.reload();
}
})
.catch((e) => {
console.log("获取分类失败", e);
});
},
handleClassification(e){
this.query.type = e.dictType;
this.$refs.paging.reload();
},
// 获取列表
getDataList(pageNo, pageSize){
this.$http.request({
url: 'common/wxPublicAccount/getWxPublicAccountArticleList',
@@ -63,7 +88,7 @@ export default {
})
.then(res=> {
if (res.code == 0) {
if(res.page.records && res.page.records.length>0){
if(res.page.records){
this.$refs.paging.complete(res.page.records);
}else{
this.$refs.paging.complete(false);
@@ -85,7 +110,7 @@ export default {
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.commonPageBox{
background: #eff5f8;
height: 100vh;
@@ -94,6 +119,11 @@ export default {
background: #fff;
padding: 0 20rpx 20rpx;
}
.classification_tabs {
::v-deep .u-tabs__wrapper__nav__item {
padding: 0 20rpx;
}
}
.cateList {
width: 100%;
}
@@ -189,25 +219,24 @@ export default {
color: #999;
font-size: 22rpx;
}
::v-deep ::-webkit-scrollbar {
::v-deep .zp-scroll-view .uni-scroll-view::-webkit-scrollbar {
/*滚动条整体样式*/
width: 4px !important;
height: 1px !important;
height: 4px !important;
overflow: auto !important;
background: #ccc !important;
background: #f5f5f5 !important;
-webkit-appearance: auto !important;
display: block;
}
::v-deep ::-webkit-scrollbar-thumb {
::v-deep .zp-scroll-view .uni-scroll-view::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px !important;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
background: #7b7979 !important;
background: #eee !important;
}
::v-deep ::-webkit-scrollbar-track {
::v-deep .zp-scroll-view .uni-scroll-view::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
// border-radius: 10px !important;