From e4f9739d74323aacf09d139700f22a383910ee97 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 04 三月 2026 10:38:32 +0800
Subject: [PATCH] 合并
---
mini-program/pages/community/community.vue | 244 +++++++++++++++++++++++++++++++++++++-----------
1 files changed, 186 insertions(+), 58 deletions(-)
diff --git a/mini-program/pages/community/community.vue b/mini-program/pages/community/community.vue
index 020c8b7..43e6f1f 100644
--- a/mini-program/pages/community/community.vue
+++ b/mini-program/pages/community/community.vue
@@ -9,7 +9,7 @@
</view>
<view class="search">
<u-search placeholder="璇疯緭鍏ュ叧閿瘝" height="36" searchIconColor="#999999" borderColor="#eeeeee"
- bgColor="rgba(255,255,255,0.9)" :showAction="false" v-model="keyword" />
+ bgColor="rgba(255,255,255,0.9)" :showAction="false" v-model="info" @search="search" @clear="search" />
<view class="search-shai" @click="show = true">
<text>绛涢��</text>
<image src="/static/icon/ic_shaixuan@2x.png" mode="widthFix"></image>
@@ -17,43 +17,50 @@
</view>
</view>
<view class="list">
- <view class="list-item" v-for="(item, index) in 10" :key="index">
- <view class="info">
- <view class="info-title">鎸栨帢鏈哄湪鍐璧峰姩涓轰粈涔堝洶闅撅紵</view>
- <view class="info-desc">鎸栨帢鏈哄湪鍐璧峰姩涓轰粈涔堝洶闅撅紵涓嶄粎鍐冲畾浜庢湰韬殑鎶�鏈姸鍐碉紝杩樺彈澶栫晫姘旀俯鐨勫奖鍝�</view>
- <view class="info-data">
- <view class="tips">缁翠慨</view>
- <text>100 闃呰锝�2025-10-10 21:00</text>
+ <template v-if="list.length > 0">
+ <view class="list-item" v-for="(item, index) in list" :key="index" @click="jump(item.id, item.contentType, item.content)">
+ <view class="info">
+ <view class="info-title">{{item.name}}</view>
+ <view class="info-desc" v-if="item.contentInfo">{{item.contentInfo}}</view>
+ <view class="info-data">
+ <view class="tips" :style="{ border: '1rpx solid' + item.param, color: item.param }">{{item.lablesName}}</view>
+ <text>{{item.looknum > 999 ? '999+' : item.looknum || 0}} 闃呰锝渰{item.createDate.substring(0, 16)}}</text>
+ </view>
+ </view>
+ <view class="image" v-if="item.imgurlfull">
+ <image :src="item.imgurlfull" mode="widthFix"></image>
</view>
</view>
- <view class="image">
- <image src="/static/logo.png" mode="widthFix"></image>
+ </template>
+ <template v-else>
+ <view class="wushuju">
+ <image src="/static/images/default_nodata_white.png" mode="widthFix"></image>
</view>
- </view>
+ </template>
</view>
<!-- 绛涢�� -->
<u-popup :show="show" mode="bottom" :safeAreaInsetBottom="false" round="15" :closeable="true" @close="show = false">
<view class="sear">
<view class="sear-title">绛涢��</view>
- <view class="sear-item">
- <view class="sear-item-label">鍒嗙被</view>
- <view class="sear-item-list">
- <view class="sear-item-list-item active">缁翠慨</view>
- <view class="sear-item-list-item">淇濆吇</view>
- <view style="width: 216rpx; height: 0;"></view>
+ <scroll-view scroll-y>
+ <view class="sear-item">
+ <view class="sear-item-label">鍒嗙被</view>
+ <view class="sear-item-list">
+ <view :class="item.active ? 'sear-item-list-item active' : 'sear-item-list-item'" v-for="(item, index) in fenlei" :key="item.id" @click="sele(index, 1)">{{item.name}}</view>
+ <view style="width: 216rpx; height: 0;"></view>
+ </view>
</view>
- </view>
- <view class="sear-item">
- <view class="sear-item-label">鎵�灞炲搧鐗�</view>
- <view class="sear-item-list">
- <view class="sear-item-list-item active">鍝佺墝鍚嶇О</view>
- <view class="sear-item-list-item">鍝佺墝鍚嶇О</view>
- <view style="width: 216rpx; height: 0;"></view>
+ <view class="sear-item">
+ <view class="sear-item-label">鎵�灞炲搧鐗�</view>
+ <view class="sear-item-list">
+ <view :class="item.active ? 'sear-item-list-item active' : 'sear-item-list-item'" v-for="(item, index) in pinpai" :key="item.id" @click="sele(index, 2)">{{item.name}}</view>
+ <view style="width: 216rpx; height: 0;"></view>
+ </view>
</view>
- </view>
+ </scroll-view>
<view class="sear-footer">
- <view class="sear-footer-btn1">閲嶇疆</view>
- <view class="sear-footer-btn2">纭</view>
+ <view class="sear-footer-btn1" @click="reset">閲嶇疆</view>
+ <view class="sear-footer-btn2" @click="search">纭</view>
</view>
</view>
</u-popup>
@@ -69,8 +76,102 @@
data() {
return {
show: false,
- keyword: ''
+ info: '',
+ page: 1,
+ next: true,
+ list: [],
+ fenlei: [],
+ pinpai: []
};
+ },
+ onLoad() {
+ this.getList()
+ this.getCategary()
+ },
+ onReachBottom() {
+ this.getList()
+ },
+ methods: {
+ reset() {
+ this.page = 1
+ this.next = true
+ this.list = []
+ this.fenlei.forEach(item => { item.active = false })
+ this.pinpai.forEach(item => { item.active = false })
+ this.show = false
+ this.getList()
+ },
+ search() {
+ this.page = 1
+ this.next = true
+ this.list = []
+ this.show = false
+ this.getList()
+ },
+ sele(index, type) {
+ if (type === 1) {
+ this.fenlei.forEach((item, i) => {
+ item.active = index === i
+ })
+ } else {
+ this.pinpai.forEach((item, i) => {
+ item.active = index === i
+ })
+ }
+ },
+ getCategary() {
+ this.$u.api.getGoodsLabelsByType({
+ type: 9
+ }).then(res => {
+ if (res.code === 200) {
+ res.data.forEach(item => {
+ item.active = false
+ })
+ this.fenlei = res.data
+ }
+ })
+ this.$u.api.getGoodsLabelsByType({
+ type: 1
+ }).then(res => {
+ if (res.code === 200) {
+ res.data.forEach(item => {
+ item.active = false
+ })
+ this.pinpai = res.data
+ }
+ })
+ },
+ jump(id, contentType, url) {
+ if (contentType == 0) {
+ uni.navigateTo({
+ url: '/pages/article-details/article-details?id=' + id
+ })
+ } else {
+ uni.navigateTo({
+ url: '/pagesA/pages/webview/webview?url=' + url
+ })
+ }
+ },
+ getList() {
+ if (!this.next) return;
+ this.$u.api.getArticlePage({
+ capacity: 10,
+ page: this.page,
+ model: {
+ info: this.info,
+ brandId: this.pinpai.filter(item => item.active).length > 0 ? this.pinpai.filter(item => item.active)[0].id : null,
+ labelId: this.fenlei.filter(item => item.active).length > 0 ? this.fenlei.filter(item => item.active)[0].id : null
+ }
+ }).then(res => {
+ if (res.code === 200) {
+ this.list.push(...res.data.records)
+ this.page++
+ if (this.list.length === res.data.total) {
+ this.next = false
+ }
+ }
+ })
+ },
}
}
</script>
@@ -89,36 +190,44 @@
font-size: 32rpx;
color: #111111;
}
- .sear-item {
+ scroll-view {
width: 100%;
- display: flex;
- flex-direction: column;
- margin-top: 48rpx;
- .sear-item-label {
- font-weight: 500;
- font-size: 32rpx;
- color: #111111;
- }
- .sear-item-list {
- margin-top: 30rpx;
+ max-height: 60vh;
+ .sear-item {
+ width: 100%;
display: flex;
- align-items: center;
- justify-content: space-between;
- flex-wrap: wrap;
- .active {
- background: rgba(0,64,150,0.1) !important;
- color: #004096 !important;
+ flex-direction: column;
+ margin-top: 28rpx;
+ .sear-item-label {
+ font-weight: 500;
+ font-size: 32rpx;
+ color: #111111;
}
- .sear-item-list-item {
- width: 216rpx;
- height: 72rpx;
- line-height: 72rpx;
- text-align: center;
- background: #F7F7F7;
- border-radius: 8rpx;
- font-weight: 400;
- font-size: 28rpx;
- color: #333333;
+ .sear-item-list {
+ margin-top: 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ .active {
+ background: rgba(0,64,150,0.1) !important;
+ color: #004096 !important;
+ }
+ .sear-item-list-item {
+ width: 216rpx;
+ height: 72rpx;
+ line-height: 72rpx;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis; /* 鏄剧ず鐪佺暐鍙� */
+ text-align: center;
+ background: #F7F7F7;
+ border-radius: 8rpx;
+ font-weight: 400;
+ font-size: 28rpx;
+ color: #333333;
+ margin-bottom: 20rpx;
+ }
}
}
}
@@ -159,6 +268,17 @@
box-sizing: border-box;
display: flex;
flex-direction: column;
+ .wushuju {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 200rpx;
+ image {
+ width: 320rpx;
+ height: 320rpx;
+ }
+ }
.list-item {
width: 100%;
padding: 30rpx 0;
@@ -171,6 +291,10 @@
display: flex;
flex-direction: column;
.info-title {
+ width: calc(100vw - 60rpx - 220rpx);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
font-weight: 600;
font-size: 32rpx;
color: #222222;
@@ -186,16 +310,20 @@
align-items: center;
margin-top: 20rpx;
.tips {
+ max-width: 110rpx;
height: 40rpx;
line-height: 40rpx;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ // display: flex;
+ // align-items: center;
+ // justify-content: center;
padding: 0 8rpx;
box-sizing: border-box;
- background: rgba(0,183,117,0.1);
border-radius: 8rpx;
-
font-weight: 400;
font-size: 22rpx;
- color: #00B775;
margin-right: 20rpx;
}
text {
--
Gitblit v1.9.3