From b2b8544e47eea574a05358928cd074aba8cee919 Mon Sep 17 00:00:00 2001
From: wangfukang <15630117759@163.com>
Date: Tue, 21 Jul 2026 08:46:48 +0800
Subject: [PATCH] 1
---
package2/IdleTrad/chat.vue | 50 ++-
package2/IdleTrad/detail.vue | 326 ++++++++++++++---
package2/IdleTrad/sessionList.vue | 167 +++++++--
package2/IdleTrad/wantList.vue | 582 ++++++++++++++++++++++++++++++
package2/myCenter/myPost.vue | 190 +++++++++-
5 files changed, 1220 insertions(+), 95 deletions(-)
create mode 100644 package2/IdleTrad/wantList.vue
diff --git a/package2/IdleTrad/chat.vue b/package2/IdleTrad/chat.vue
index 24c70e4..4c78936 100644
--- a/package2/IdleTrad/chat.vue
+++ b/package2/IdleTrad/chat.vue
@@ -9,10 +9,11 @@
-
+
+ 求购
{{goods.title}}
- ¥{{goods.price}}
+ {{isWant ? '预算 ¥' : '¥'}}{{displayPrice}}
查看 ›
@@ -64,6 +65,7 @@
import fishMarketSocket from '@/common/fishMarketSocket.js'
import {
getFishGoodsDetail,
+ getFishWantDetail,
getFishChatSession,
pageFishChatMessages,
uploadFishImage
@@ -75,6 +77,7 @@
statusBarTop: 24,
sessionId: '',
goodsId: '',
+ wantId: '',
session: null,
goods: null,
messages: [],
@@ -95,8 +98,22 @@
if (!this.goods || !this.goods.imageList) return []
return this.goods.imageList
},
+ isWant() {
+ return !!this.wantId
+ },
+ goodsCover() {
+ if (!this.goods) return ''
+ return this.goods.coverImage || this.imageList[0] || ''
+ },
+ displayPrice() {
+ if (!this.goods) return 0
+ return this.isWant ? (this.goods.expectedPrice || 0) : (this.goods.price || 0)
+ },
peerName() {
if (!this.goods || !this.session) return '校园同学'
+ if (this.isWant) {
+ return this.selfId == String(this.session.buyerId) ? '供货同学' : (this.goods.userName || '求购同学')
+ }
return this.selfId == String(this.session.sellerId) ? '买家同学' : (this.goods.userName || '卖家同学')
},
peerAvatar() {
@@ -106,6 +123,7 @@
onLoad(options) {
this.sessionId = options && options.sessionId ? options.sessionId : ''
this.goodsId = options && options.goodsId ? options.goodsId : ''
+ this.wantId = options && options.wantId ? options.wantId : ''
if (uni.getMenuButtonBoundingClientRect) {
this.statusBarTop = uni.getMenuButtonBoundingClientRect().top || this.statusBarTop
}
@@ -127,11 +145,17 @@
getFishChatSession(this.sessionId).then(session => {
this.session = session
const goodsId = this.goodsId || (session && session.goodsId)
+ const wantId = this.wantId || (session && session.wantId)
if (goodsId) {
this.goodsId = goodsId
getFishGoodsDetail(goodsId).then(goods => {
this.goods = goods
})
+ } else if (wantId) {
+ this.wantId = wantId
+ getFishWantDetail(wantId).then(want => {
+ this.goods = want
+ })
}
})
this.loadMessages(true).then(() => {
@@ -149,6 +173,9 @@
this.totalPages = Number(page && (page.pages || page.totalPages)) || 1
this.messages = reset ? normalized : normalized.concat(this.messages)
this.scrollToBottom()
+ if (reset) {
+ uni.$emit('fishUnreadChange')
+ }
})
},
loadOlder() {
@@ -272,8 +299,14 @@
uni.previewImage({ urls: [url], current: url })
},
goGoods() {
- if (!this.goodsId) return
- uni.navigateTo({ url: '/package2/IdleTrad/detail?id=' + this.goodsId })
+ if (this.isWant) {
+ if (!this.wantId) return
+ uni.navigateTo({ url: '/package2/IdleTrad/detail?type=want&id=' + this.wantId })
+ return
+ }
+ if (this.goodsId) {
+ uni.navigateTo({ url: '/package2/IdleTrad/detail?id=' + this.goodsId })
+ }
}
}
}
@@ -343,6 +376,15 @@
background: #edf4f1;
}
+ .no-cover {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #7f8d88;
+ font-size: 22rpx;
+ font-weight: 900;
+ }
+
.goods-main {
flex: 1;
min-width: 0;
diff --git a/package2/IdleTrad/detail.vue b/package2/IdleTrad/detail.vue
index 0bac3ac..65cb49c 100644
--- a/package2/IdleTrad/detail.vue
+++ b/package2/IdleTrad/detail.vue
@@ -2,12 +2,14 @@
- 闲置详情
+ {{isWant ? '求购详情' : '闲置详情'}}
+ 加载中...
- ¥{{goods.price}}
- ¥{{goods.originPrice}}
+ {{isWant ? '预算 ¥' : '¥'}}{{displayPrice}}
+ ¥{{goods.originPrice}}
{{saleStatusText}}
{{goods.title}}
@@ -36,7 +38,8 @@
{{goods.browseCount || 0}}浏览
{{goods.regionName || '本校'}}
-
+
+ 求购
{{item}}
@@ -45,7 +48,7 @@
- {{goods.userName || '校园同学'}} 已实名
+ 半径卖家已实名
{{goods.sellerOnlineStatus || '3天内在线'}}
线下面交
@@ -67,41 +70,72 @@
-