Browse Source

feat: 添加浏览记录功能并重构粉丝列表组件

- 将环境配置从 local 改为 prod
- 新增 browseRecord 模型及相关 API 接口
- 提取粉丝列表为独立组件 FansList 并在多处复用
- 在群组详情页二维码图片添加长按菜单功能
- 重构帖子详情页的浏览/点赞/分享列表展示逻辑
master
主管理员 6 days ago
parent
commit
53295275d9
7 changed files with 134 additions and 145 deletions
  1. +1
    -1
      api/api.js
  2. +19
    -0
      api/model/browseRecord.js
  3. +87
    -0
      components/list/fansList.vue
  4. +1
    -1
      config.js
  5. +4
    -1
      pages_order/group/groupDetail.vue
  6. +6
    -59
      pages_order/mine/fans.vue
  7. +16
    -83
      pages_order/post/postDetail.vue

+ 1
- 1
api/api.js View File

@ -435,7 +435,7 @@ const config = {
},
}
const models = ['order', 'group', 'article']
const models = ['order', 'group', 'article', 'browseRecord']
models.forEach(key => {
addApiModel(require(`./model/${key}.js`).default, key)


+ 19
- 0
api/model/browseRecord.js View File

@ -0,0 +1,19 @@
// 评论相关接口
const api = {
//发布评论
addBrowseRecord: {
url: '/city/browseRecord/addBrowseRecord',
method: 'POST',
limit : 1000,
auth : true,
showLoading : true,
},
//获取评论列表type-0帖子-1租房-2工作-3景点-4美食-5活动-6人找车-7车找人-8文章
getBrowseRecordPage: {
url: '/city/browseRecord/getBrowseRecordPage',
method: 'GET',
},
}
export default api

+ 87
- 0
components/list/fansList.vue View File

@ -0,0 +1,87 @@
<template>
<view class="fansList">
<view class="fanst" v-for="(item, index) in list" :key="item.id || index">
<view class="profilepicture">
<image :src="getItem(item).headImage" mode="aspectFill"></image>
</view>
<view class="name">
<view class="namea">
{{ getItem(item).nickName }}
</view>
<view class="nameb">
{{ getItem(item).createTime }}
</view>
</view>
<view class="Dot" v-if="showDot">
<uv-icon name="more-dot-fill"></uv-icon>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'FansList',
props: {
list: {
type: Array,
default: () => []
},
showDot: {
type: Boolean,
default: false
},
},
methods: {
getItem(item){
return item && item.user || item
}
}
}
</script>
<style scoped lang="scss">
.fansList {
margin: 20rpx 10rpx;
background-color: white;
.fanst {
margin: 20rpx 0rpx;
display: flex;
align-items: center;
padding: 20rpx;
.profilepicture {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
image {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
}
.name {
letter-spacing: 2rpx;
font-size: 25rpx;
margin-left: 20rpx;
.namea {
font-weight: bold;
}
.nameb {
color: rgba(0, 0, 0, 0.5);
}
}
.Dot {
margin-left: auto;
}
}
}
</style>

+ 1
- 1
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'local'
const type = 'prod'
// 环境配置


+ 4
- 1
pages_order/group/groupDetail.vue View File

@ -18,7 +18,10 @@
<view class="group-actions">
<view v-if="showQrCode" class="qr-code-section">
<view class="qr-code-title">扫码加入群聊</view>
<image :src="groupInfo.qrCode || '/static/image/qr/default.jpg'" class="qr-code-image" mode="aspectFit"></image>
<image
:src="groupInfo.qrCode || '/static/image/qr/default.jpg'"
show-menu-by-longpress
class="qr-code-image" mode="aspectFit"></image>
<view class="qr-code-tip">长按保存二维码微信扫码加入</view>
</view>
<view v-else class="watch-ad-btn" @click="watchAd">


+ 6
- 59
pages_order/mine/fans.vue View File

@ -7,32 +7,18 @@
placeholder="请输入搜索关键字..." v-model="queryParams.title"></uv-search>
</view>
<view class="fansList">
<view class="fanst" v-for="(item,index) in list">
<view class=" profilepicture">
<image :src="item.headImage" mode="aspectFill"></image>
</view>
<view class="name">
<view class="namea">
{{ item.nickName }}
</view>
<view class="nameb">
<!-- 感悟哲理积极面对人生传递正能量 -->
{{ item.createTime }}
</view>
</view>
<view class="Dot">
<uv-icon name="more-dot-fill"></uv-icon>
</view>
</view>
</view>
<view>
<FansList :list="list" showDot />
</view>
</view>
</template>
<script>
import mixinsList from '@/mixins/list.js'
import FansList from '@/components/list/fansList.vue'
export default {
mixins: [mixinsList],
components: { FansList },
data() {
return {
mixinsListApi : 'getFansList',
@ -45,44 +31,5 @@
</script>
<style scoped lang="scss">
.fansList {
margin: 20rpx 10rpx;
background-color: white;
.fanst{
margin: 20rpx 0rpx;
display: flex;
align-items: center;
padding: 20rpx;
.profilepicture {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
image{
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
}
.name {
letter-spacing: 2rpx;
font-size: 25rpx;
margin-left: 20rpx;
.namea {
font-weight: bold;
}
.nameb {
color: rgba(0, 0, 0, 0.5);
}
}
.Dot{
margin-left: auto;
}
}
}
/* 列表样式由 FansList 组件内部维护 */
</style>

+ 16
- 83
pages_order/post/postDetail.vue View File

@ -27,18 +27,8 @@
@click="tabsClick"></uv-tabs>
</view>
<view class="avatarStack" v-if="tagIndex == 1">
<!-- 头像堆叠组件 - 显示查看过的用户 -->
<avatarStack
:avatars="viewedUsers || []"
:maxDisplay="5"
:avatarSize="50"
:overlapOffset="12"
descriptionType="viewed"
@avatarClick="handleAvatarClick"
@moreClick="handleMoreViewers"
v-if="viewedUsers && viewedUsers.length > 0"
/>
<view class="avatarStack" v-if="tagIndex != 0">
<FansList :list="list" />
</view>
<commentList v-if="tagIndex == 0" @getData="getData" :list="list" :params="params" />
@ -61,7 +51,7 @@
import daynamicInfo from '@/components/list/dynamic/daynamicInfo.vue'
import statisticalDataInfo from '@/components/list/statisticalDataInfo.vue'
import dynamicToShop from '@/components/list/dynamic/dynamicToShop.vue'
import avatarStack from '@/components/list/avatarStack.vue'
import FansList from '@/components/list/fansList.vue'
export default {
mixins: [mixinsSex, mixinsList],
components: {
@ -70,51 +60,13 @@
daynamicInfo,
statisticalDataInfo,
dynamicToShop,
avatarStack,
FansList,
},
data() {
return {
detail: {
},
// -
viewedUsers: [
{
id: '1',
userHead: '/static/image/logo.jpg',
name: '用户A'
},
{
id: '2',
userHead: 'https://image.hhlm1688.com/2025-06-08/67fbe844-da4a-4272-8d51-364453d0f3aa.jpeg',
name: '用户B'
},
{
id: '3',
userHead: '/static/image/logo.jpg',
name: '用户C'
},
{
id: '4',
userHead: 'https://image.hhlm1688.com/2025-06-08/67fbe844-da4a-4272-8d51-364453d0f3aa.jpeg',
name: '用户D'
},
{
id: '5',
userHead: '/static/image/logo.jpg',
name: '用户E'
},
{
id: '6',
userHead: 'https://image.hhlm1688.com/2025-06-08/67fbe844-da4a-4272-8d51-364453d0f3aa.jpeg',
name: '用户F'
},
{
id: '7',
userHead: '/static/image/logo.jpg',
name: '用户G'
}
],
mixinsListApi : 'getCommentPage',
params : {
type : '0',
@ -123,16 +75,20 @@
},
tags : [
{
name : '评论'
name : '评论',
api : 'getCommentPage',
},
{
name : '浏览'
name : '浏览',
api : 'getBrowseRecordPage',
},
{
name : '点赞'
name : '点赞',
api : 'getBrowseRecordPage',
},
{
name : '分享'
name : '分享',
api : 'getBrowseRecordPage',
},
],
tagIndex : 0,
@ -146,6 +102,7 @@
this.id = options.id
this.queryParams.type = this.params.type
this.queryParams.orderId = options.id
this.queryParams.formId = options.id
this.params.orderId = options.id
},
@ -171,6 +128,9 @@
methods: {
tabsClick({index}){
this.tagIndex = index
this.mixinsListApi = this.tags[index].api
this.queryParams.category = index - 1
this.getData()
},
getDetail() {
this.$api('getPostDetail', {
@ -185,30 +145,6 @@
}
})
},
//
handleAvatarClick(avatar, index) {
console.log('点击头像:', avatar, index);
//
this.$u.route({
url: '/pages_order/user/userDetail',
params: {
userId: avatar.id
}
});
},
//
handleMoreViewers() {
console.log('查看更多查看者');
//
this.$u.route({
url: '/pages_order/post/viewersList',
params: {
postId: this.detail.id
}
});
},
}
}
</script>
@ -251,9 +187,6 @@
}
}
.avatarStack {
display: flex;
justify-content: flex-end;
margin: 20rpx;
}
}
</style>

Loading…
Cancel
Save