From 1bf7caf34e1933dd1630507c473e6f375497c3e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Fri, 13 Feb 2026 19:37:24 +0800
Subject: [PATCH] =?UTF-8?q?feat(house):=20=E6=B7=BB=E5=8A=A0=E6=88=BF?=
=?UTF-8?q?=E6=BA=90=E5=8D=96=E4=BB=B7=E5=92=8C=E6=80=BB=E4=BB=B7=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96=E5=88=86=E4=BA=AB=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在房源添加页面添加卖价(元/平)和总价(万)输入字段
- 实现卖价变动时总价自动计算功能
- 在房源详情页显示卖价和总价信息
- 调整物业费显示位置提升界面布局合理性
- 更新服务器配置地址从gxwebsoft.com到websoft.top
- 替换必看好房标签为特价好房标签统一显示
- 修复房源详情页分享功能和海报生成流程
- 添加跟进记录页面和相应跳转功能
- 优化房源管理页面删除按钮显示逻辑
- 实现闪屏页跳过功能和登录状态记忆
- 添加房源海报生成组件支持分享推广
- 修复分享路径参数传递和用户信息存储
---
.idea/AugmentWebviewStateStore.xml | 10 +
.idea/workspace.xml | 37 +--
api/config.js | 14 +-
api/demo.js | 2 +-
api/upload.js | 2 +-
api/user.js | 2 +-
components/house-poster-generator/index.vue | 206 ++++++++++++++
config.js | 17 +-
core/config/defaultConfig.js | 2 +-
pages.json | 7 +
pages/flash/index.vue | 10 +-
pages/house/house.vue | 2 +-
pages/house/liked.vue | 2 +-
pages/house/views.vue | 2 +-
pages/index/index.vue | 2 +-
pages/login/components/mp-weixin-mobile.vue | 1 +
pages/user/user.vue | 6 +-
store/modules/user.js | 9 +
sub_pages/house/add.vue | 16 ++
sub_pages/house/detail.vue | 46 ++-
sub_pages/house/house.vue | 4 +-
sub_pages/house/record.vue | 17 ++
海报功能修复总结.md | 299 ++++++++++++++++++++
海报功能测试指南.md | 184 ++++++++++++
24 files changed, 829 insertions(+), 70 deletions(-)
create mode 100644 .idea/AugmentWebviewStateStore.xml
create mode 100644 components/house-poster-generator/index.vue
create mode 100644 sub_pages/house/record.vue
create mode 100644 海报功能修复总结.md
create mode 100644 海报功能测试指南.md
diff --git a/.idea/AugmentWebviewStateStore.xml b/.idea/AugmentWebviewStateStore.xml
new file mode 100644
index 0000000..e86f0d2
--- /dev/null
+++ b/.idea/AugmentWebviewStateStore.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ae94025..0dd995a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,19 +4,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -80,7 +68,7 @@
-
+
@@ -98,7 +86,23 @@
1749352650830
-
+
+
+ 1749470992116
+
+
+
+ 1749470992116
+
+
+
+ 1749474861846
+
+
+
+ 1749474861846
+
+
@@ -106,6 +110,7 @@
-
+
+
\ No newline at end of file
diff --git a/api/config.js b/api/config.js
index 4ff046a..72be33a 100755
--- a/api/config.js
+++ b/api/config.js
@@ -8,22 +8,12 @@ module.exports = {
// 应用秘钥
appSecret: '1f1d186d98ea4620ac65afbf34940051',
- // 开发环境
- // apiUrl: "http://127.0.0.1:9095/api",
- // socketUrl: 'ws://localhost:9190',
- // fileUrl: 'https://file.wsdns.cn',
- // apiUrl: "http://47.119.165.234:5483/api",
-
-
- // 测试环境
- // apiUrl: 'https://server.gxwebsoft.com/api',
- // socketUrl: 'wss://server.gxwebsoft.com',
fileUrl: 'https://file.wsdns.cn',
// 生产环境
- serverUrl: 'https://server.gxwebsoft.com/api',
+ serverUrl: 'https://server.websoft.top/api',
apiUrl: 'https://cms-api.websoft.top/api',
- socketUrl: 'wss://server.gxwebsoft.com',
+ socketUrl: 'wss://server.websoft.top',
// fileUrl: 'https://oss.jimeigroup.cn',
diff --git a/api/demo.js b/api/demo.js
index 6807a7d..2925918 100644
--- a/api/demo.js
+++ b/api/demo.js
@@ -4,7 +4,7 @@ import http from './index.js';
export const ServerTime = () => http.post('http://127.0.0.1:9090/hxz/v1/ServerTime')
export const QRCodeTransaction = (data) => http.post('http://127.0.0.1:9090/hxz/v1/QRCodeTransaction',data)
-export const QRCodeTransaction2 = (data) => http.post('https://server.gxwebsoft.com/hxz/v1/QRCodeTransaction',data)
+export const QRCodeTransaction2 = (data) => http.post('https://server.websoft.top/hxz/v1/QRCodeTransaction',data)
export const TransactionInquiry = (data) => http.post('http://127.0.0.1:9090/hxz/v1/TransactionInquiry',data)
diff --git a/api/upload.js b/api/upload.js
index 48173ca..e886f83 100644
--- a/api/upload.js
+++ b/api/upload.js
@@ -10,7 +10,7 @@ import appConfig from '@/config.js'
// export const uploadFile = (file) => http.upload(fileUrl + '/api/file/upload', file)
// 阿里云OSS
-export const uploadFile = (file) => http.upload('https://server.gxwebsoft.com/api/oss/upload', file)
+export const uploadFile = (file) => http.upload('https://server.websoft.top/api/oss/upload', file)
// export const uploadFile = async ({filePath}) => {
// // 获取临时凭证
diff --git a/api/user.js b/api/user.js
index 3df1649..a48bdff 100644
--- a/api/user.js
+++ b/api/user.js
@@ -1,7 +1,7 @@
import http from './index.js';
// 获取用户资料
-export const getUser = (params) => http.get('https://server.gxwebsoft.com/api/auth/user', {params})
+export const getUser = (params) => http.get('https://server.websoft.top/api/auth/user', {params})
// 修改用户资料
export const updateUser = (data) => http.put('/system/user', data)
diff --git a/components/house-poster-generator/index.vue b/components/house-poster-generator/index.vue
new file mode 100644
index 0000000..4b0038c
--- /dev/null
+++ b/components/house-poster-generator/index.vue
@@ -0,0 +1,206 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config.js b/config.js
index 76325aa..b8ca12b 100755
--- a/config.js
+++ b/config.js
@@ -9,23 +9,12 @@ module.exports = {
appSecret: '1f1d186d98ea4620ac65afbf34940051',
// 生产环境
- serverUrl: 'https://server.gxwebsoft.com/api',
+ serverUrl: 'https://server.websoft.top/api',
+ // apiUrl: 'http://127.0.0.1:9200/api',
apiUrl: 'https://cms-api.websoft.top/api',
- socketUrl: 'wss://server.gxwebsoft.com',
+ socketUrl: 'wss://server.websoft.top',
fileUrl: 'https://file.wsdns.cn',
- // 开发环境
- // apiUrl: "http://127.0.0.1:9000/api",
- // socketUrl: 'ws://localhost:9190',
- // fileUrl: 'https://file.wsdns.cn',
- // apiUrl: "http://47.119.165.234:5483/api",
-
-
- // 测试环境
- // apiUrl: 'https://server.gxwebsoft.com/api',
- // socketUrl: 'wss://server.gxwebsoft.com',
- // fileUrl: 'https://file.wsdns.cn',
-
// 游客 userId
userId: 3373,
// 用户ID前缀
diff --git a/core/config/defaultConfig.js b/core/config/defaultConfig.js
index 41bd0ec..0755d16 100755
--- a/core/config/defaultConfig.js
+++ b/core/config/defaultConfig.js
@@ -9,7 +9,7 @@ export default {
* 后端api地址 (必填; 斜杠/结尾; 请确保能访问)
* 例如: https://www.你的域名.com/index.php?s=/api/
*/
- apiUrl: "https://server.gxwebsoft.com/api",
+ apiUrl: "https://server.websoft.top/api",
/**
* 商城ID (必填)
diff --git a/pages.json b/pages.json
index 6c07240..bf8b43a 100755
--- a/pages.json
+++ b/pages.json
@@ -74,6 +74,13 @@
"enablePullDownRefresh": false
}
+ },{
+ "path": "house/record",
+ "style": {
+ "navigationBarTitleText": "跟进记录",
+ "enablePullDownRefresh": false
+ }
+
}
]
}],
diff --git a/pages/flash/index.vue b/pages/flash/index.vue
index 0d297da..10acc33 100644
--- a/pages/flash/index.vue
+++ b/pages/flash/index.vue
@@ -8,7 +8,7 @@
爱尚家找房
-->
-
+
立即跳过({{ times }})
@@ -57,6 +57,10 @@
timer() {
const app = this
app.smsState = false
+ if(uni.getStorageSync('skip')){
+ app.onLogin()
+ return;
+ }
const inter = setInterval(() => {
app.times = app.times - 1
if (app.times <= 0) {
@@ -86,6 +90,10 @@
// })
// }
+ },
+ onSkip(){
+ uni.setStorageSync('skip',true)
+ this.onLogin()
}
}
}
diff --git a/pages/house/house.vue b/pages/house/house.vue
index 06649c9..d26a99c 100644
--- a/pages/house/house.vue
+++ b/pages/house/house.vue
@@ -106,7 +106,7 @@
reset: true
},
{
- name: '必看好房',
+ name: '特价好房',
reset: false
}
];
diff --git a/pages/house/liked.vue b/pages/house/liked.vue
index b27a99c..53b593f 100644
--- a/pages/house/liked.vue
+++ b/pages/house/liked.vue
@@ -57,7 +57,7 @@
reset: true
},
{
- name: '必看好房',
+ name: '特价好房',
reset: false
}
];
diff --git a/pages/house/views.vue b/pages/house/views.vue
index d7cfca2..d98d5ef 100644
--- a/pages/house/views.vue
+++ b/pages/house/views.vue
@@ -57,7 +57,7 @@
reset: true
},
{
- name: '必看好房',
+ name: '特价好房',
reset: false
}
];
diff --git a/pages/index/index.vue b/pages/index/index.vue
index ec38212..6453a1b 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -110,7 +110,7 @@
reset: true
},
{
- name: '必看好房',
+ name: '特价好房',
reset: false
}
];
diff --git a/pages/login/components/mp-weixin-mobile.vue b/pages/login/components/mp-weixin-mobile.vue
index e6ea6cb..e401e81 100755
--- a/pages/login/components/mp-weixin-mobile.vue
+++ b/pages/login/components/mp-weixin-mobile.vue
@@ -35,6 +35,7 @@
+
diff --git a/pages/user/user.vue b/pages/user/user.vue
index f774152..df320ed 100644
--- a/pages/user/user.vue
+++ b/pages/user/user.vue
@@ -122,13 +122,13 @@
-
+
-
+
@@ -415,7 +415,7 @@
}).then(response => {
console.log("response: ", response);
if (response.code == 401) {
- this.handleLogout()
+ // this.handleLogout()
}
})
}
diff --git a/store/modules/user.js b/store/modules/user.js
index 3ea8053..8b3ab12 100755
--- a/store/modules/user.js
+++ b/store/modules/user.js
@@ -25,11 +25,14 @@ const loginSuccess = ({commit,dispatch}, data) => {
// 保存tokne和userId到缓存
storage.set(USER_ID, user.userId, expiryTime)
storage.set(USER_INFO, user, expiryTime)
+ storage.set('Phone',user.phone)
storage.set(ACCESS_TOKEN, access_token, expiryTime)
// 记录到store全局变量
commit('SET_TOKEN', access_token)
commit('SET_USER_ID', user.userId)
commit('SET_USER', user)
+ commit('SET_PHONE',user.phone)
+ uni.setStorageSync('Phone',user.phone)
dispatch('ConnectSocket')
@@ -42,6 +45,8 @@ const user = {
token: '',
// 用户ID
userId: null,
+ // 手机号码
+ phone: null,
// 用户
userInfo: null,
@@ -58,6 +63,10 @@ const user = {
SET_USER: (state, value) => {
state.userInfo = value
storage.set(USER_INFO, value)
+ },
+ SET_PHONE: (state,value) => {
+ state.phone = value
+ storage.set('Phone', value)
}
},
diff --git a/sub_pages/house/add.vue b/sub_pages/house/add.vue
index 123f7e4..f7134da 100644
--- a/sub_pages/house/add.vue
+++ b/sub_pages/house/add.vue
@@ -77,6 +77,7 @@
inputAlign="right" maxlength="30" :border="false" placeholder="请输入物业费" />
+
佣金:{{ form.commission || '' }}
@@ -108,6 +108,8 @@
+ 卖价:{{ form.salePrice || '' }}元/m²
+ 总价:{{ form.totalPrice || '' }}万元
@@ -135,16 +137,17 @@
-
-
- 管理员备注
+
+
+ 管理员备注
+
-
+
@@ -168,7 +171,8 @@
{{ `粉丝:${item.id}` }}
-->
- {{ form.gradeName }}
+ ******
+
@@ -183,16 +187,17 @@
已收藏
收藏
-
+
+
-
+
+
@@ -239,7 +244,7 @@
reset: true
},
{
- name: '必看好房',
+ name: '特价好房',
reset: false
}
];
@@ -386,7 +391,9 @@
posterApiParam: {},
// 海报预览相关
showPosterPreview: false,
- currentPosterUrl: ''
+ currentPosterUrl: '',
+ dealerId: 0,
+ mobile: ''
};
},
@@ -410,6 +417,12 @@
}).catch((err) => {
console.log(err);
})
+ if(options.dealerId){
+ this.dealerId = options.dealerId
+ }
+ if(options.mobile){
+ this.mobile = options.phone
+ }
},
@@ -423,7 +436,8 @@
},
onShareAppMessage() {
return {
- title: this.form.houseTitle
+ title: this.form.houseTitle,
+ path: `/sub_pages/house/detail?houseId=${this.form.houseId}&dealerId=${uni.setStorageSync('userId')}&mobile=${uni.getStorageInfoSync('Phone')}`
}
},
onShareTimeline() {
@@ -971,6 +985,10 @@
margin: auto;
padding: 20rpx;
z-index: 100;
+
+ .title2 {
+ width: 100% !important;
+ }
.title {
font-size: 36rpx;
diff --git a/sub_pages/house/house.vue b/sub_pages/house/house.vue
index b3376a5..535806b 100644
--- a/sub_pages/house/house.vue
+++ b/sub_pages/house/house.vue
@@ -15,9 +15,9 @@
-
+
diff --git a/sub_pages/house/record.vue b/sub_pages/house/record.vue
new file mode 100644
index 0000000..c59c00a
--- /dev/null
+++ b/sub_pages/house/record.vue
@@ -0,0 +1,17 @@
+
+
+
+ 王子
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/海报功能修复总结.md b/海报功能修复总结.md
new file mode 100644
index 0000000..1bbe328
--- /dev/null
+++ b/海报功能修复总结.md
@@ -0,0 +1,299 @@
+# 海报生成功能修复总结
+
+## 🔧 修复的问题
+
+### 1. 主要错误
+**错误信息**:`Error in callback for watcher "value": "TypeError: app.apiCall is not a function"`
+
+**根本原因**:
+- `GoodsPosterPopup` 组件期望接收一个 `apiCall` 函数
+- 函数传递过程中存在 `this` 上下文绑定问题导致 `this.swiperList` 和 `this.form` 为 `undefined`
+- 图片URL格式处理不完善
+
+### 2. 新发现的问题
+从测试日志可以看出:
+```
+generateHousePoster 被调用,参数: {...}
+当前房源图片列表: undefined
+房源信息: undefined
+```
+这说明函数的 `this` 上下文丢失了。
+
+## ✅ 修复内容
+
+### 1. 房源详情页面 (sub_pages/house/detail.vue)
+
+#### 修复点1:修改模板中的函数传递
+```vue
+
+
+
+
+
+```
+
+#### 修复点2:移除不必要的数据初始化
+```javascript
+// 修改前
+data() {
+ return {
+ posterApiCall: null, // 移除这行
+ posterApiParam: {}
+ }
+}
+
+// 修改后
+data() {
+ return {
+ posterApiParam: {}
+ }
+}
+```
+
+#### 修复点3:创建新的海报生成处理方法(确保this上下文正确)
+```javascript
+// 处理海报生成(确保this上下文正确)
+handleGenerateHousePoster(params) {
+ console.log('handleGenerateHousePoster 被调用,参数:', params);
+ console.log('当前房源图片列表:', this.swiperList);
+ console.log('房源信息:', this.form);
+ console.log('this 上下文:', this);
+
+ return new Promise((resolve, reject) => {
+ try {
+ // 优先使用房源的第一张图片作为海报
+ if (this.swiperList && this.swiperList.length > 0) {
+ const firstImage = this.swiperList[0];
+ // 支持多种图片URL格式
+ const imageUrl = firstImage.url || firstImage.image || firstImage.src || firstImage;
+
+ console.log('第一张图片对象:', firstImage);
+ console.log('提取的图片URL:', imageUrl);
+
+ if (imageUrl && typeof imageUrl === 'string' && imageUrl.trim() !== '') {
+ console.log('使用房源图片作为海报:', imageUrl);
+ resolve({
+ data: {
+ imageUrl: imageUrl.trim()
+ }
+ });
+ return;
+ }
+ }
+
+ console.log('没有可用的房源图片,生成默认海报');
+ // 如果没有房源图片,生成默认海报
+ this.handleGenerateTextPoster()
+ .then(imageUrl => {
+ console.log('生成默认海报成功:', imageUrl);
+ resolve({
+ data: {
+ imageUrl: imageUrl
+ }
+ });
+ })
+ .catch(err => {
+ console.log('生成默认海报失败:', err);
+ reject(err);
+ });
+ } catch (error) {
+ console.error('handleGenerateHousePoster 执行出错:', error);
+ reject(error);
+ }
+ });
+}
+```
+
+#### 修复点3:改进默认海报生成
+```javascript
+generateTextPoster() {
+ return new Promise((resolve, reject) => {
+ try {
+ // 创建一个简单的文字海报信息
+ const houseTitle = this.form.houseTitle || '房源信息';
+ const monthlyRent = this.form.monthlyRent || 0;
+ const houseType = this.form.houseType || '';
+ const extent = this.form.extent || 0;
+ const address = this.form.address || '';
+
+ console.log('生成默认海报,房源信息:', {
+ houseTitle, monthlyRent, houseType, extent, address
+ });
+
+ // 使用占位图片服务生成默认海报
+ const defaultPosterUrl = 'https://dummyimage.com/400x600/4a90e2/ffffff&text=' +
+ encodeURIComponent(`${houseTitle}\n${monthlyRent}元/月\n${houseType}\n${extent}m²`);
+
+ console.log('生成的默认海报URL:', defaultPosterUrl);
+ resolve(defaultPosterUrl);
+ } catch (error) {
+ console.error('generateTextPoster 执行出错:', error);
+ // 如果生成默认海报也失败,使用一个简单的占位图
+ resolve('https://dummyimage.com/400x600/cccccc/666666&text=房源海报');
+ }
+ });
+}
+```
+
+#### 修复点4:优化分享数据设置
+```javascript
+onShare() {
+ // 检查是否有房源信息
+ if (!this.form.houseTitle) {
+ uni.showToast({
+ title: '房源信息加载中...',
+ icon: 'none'
+ });
+ return;
+ }
+
+ // 设置分享数据
+ this.shareTitle = `${this.form.houseTitle} ${this.form.monthlyRent}元/月`;
+
+ // 获取分享图片URL,支持多种格式
+ let shareImageUrl = '';
+ if (this.swiperList && this.swiperList.length > 0) {
+ const firstImage = this.swiperList[0];
+ shareImageUrl = firstImage.url || firstImage.image || firstImage.src || firstImage || '';
+ }
+ this.shareImageUrl = shareImageUrl;
+
+ // 设置海报API参数
+ this.posterApiParam = {
+ houseId: this.form.houseId,
+ houseTitle: this.form.houseTitle,
+ monthlyRent: this.form.monthlyRent,
+ houseType: this.form.houseType,
+ extent: this.form.extent,
+ address: this.form.address
+ };
+
+ // 更新全局分享数据
+ uni.$u.mpShare = {
+ title: this.shareTitle,
+ path: `sub_pages/house/detail?houseId=${this.form.houseId}&user_id=${uni.getStorageSync('userId')}`,
+ imageUrl: this.shareImageUrl
+ };
+
+ console.log('分享数据设置完成:', {
+ shareTitle: this.shareTitle,
+ shareImageUrl: this.shareImageUrl,
+ posterApiParam: this.posterApiParam
+ });
+
+ // 显示分享弹窗
+ this.showShareSheet = true;
+}
+```
+
+### 2. ShareSheet 组件 (components/share-sheet/index.vue)
+
+#### 修复点:添加调试日志
+```javascript
+// 生成二维码海报
+handlePoster() {
+ console.log('ShareSheet handlePoster 被调用');
+ console.log('posterApiCall 类型:', typeof this.posterApiCall);
+ console.log('posterApiCall 函数:', this.posterApiCall);
+ console.log('posterApiParam:', this.posterApiParam);
+
+ this.showGoodsPosterPopup = true
+ this.handleCancel()
+}
+```
+
+### 3. GoodsPosterPopup 组件 (components/goods-poster-popup/index.vue)
+
+#### 修复点:增强错误处理和调试
+```javascript
+// 显示海报弹窗
+onShowPopup() {
+ const app = this
+ console.log('GoodsPosterPopup onShowPopup 被调用');
+ console.log('apiCall 类型:', typeof app.apiCall);
+ console.log('apiCall 函数:', app.apiCall);
+ console.log('apiParam:', app.apiParam);
+ console.log('platform:', app.platform);
+
+ if (typeof app.apiCall !== 'function') {
+ console.error('apiCall 不是一个函数!');
+ uni.showToast({
+ title: '海报生成功能异常',
+ icon: 'none'
+ });
+ app.onClose();
+ return;
+ }
+
+ const params = { ...app.apiParam, channel: app.platform };
+ console.log('调用 apiCall,参数:', params);
+
+ app.apiCall(params)
+ .then(result => {
+ console.log('apiCall 调用成功,结果:', result);
+ if (result && result.data && result.data.imageUrl) {
+ app.imageUrl = result.data.imageUrl;
+ app.show = true;
+ console.log('海报图片URL设置成功:', app.imageUrl);
+ } else {
+ console.error('apiCall 返回的数据格式不正确:', result);
+ uni.showToast({
+ title: '海报生成失败',
+ icon: 'none'
+ });
+ app.onClose();
+ }
+ })
+ .catch(err => {
+ console.error('apiCall 调用失败:', err);
+ uni.showToast({
+ title: '海报生成失败',
+ icon: 'none'
+ });
+ app.onClose();
+ });
+}
+```
+
+## 🧪 测试步骤
+
+### 1. 打开控制台
+在微信开发者工具中打开控制台,查看日志输出
+
+### 2. 测试生成海报功能
+1. 进入房源详情页面
+2. 点击"分享"按钮
+3. 选择"生成海报"
+4. 观察控制台输出
+
+### 3. 预期结果
+- ✅ 控制台显示:`generateHousePoster 被调用,参数: {...}`
+- ✅ 控制台显示:`当前房源图片列表: [...]`
+- ✅ 海报弹窗正常显示
+- ✅ 不再出现 `app.apiCall is not a function` 错误
+- ✅ 海报图片能正常显示和保存
+
+## 🎯 关键修复点总结
+
+1. **移除不必要的数据初始化**:避免 `posterApiCall: null` 导致的问题
+2. **直接传递方法引用**:确保 `this` 上下文正确绑定
+3. **增强图片URL处理**:支持多种图片URL格式
+4. **完善错误处理**:添加详细的错误提示和降级方案
+5. **添加调试日志**:便于快速定位问题
+
+## 🚀 预期效果
+
+修复后,海报生成功能应该完全正常:
+- ✅ 有房源图片时,使用第一张图片作为海报
+- ✅ 没有房源图片时,生成包含房源信息的默认海报
+- ✅ 海报保存功能正常
+- ✅ 错误处理完善,用户体验良好
+- ✅ 无控制台错误
diff --git a/海报功能测试指南.md b/海报功能测试指南.md
new file mode 100644
index 0000000..8539ae3
--- /dev/null
+++ b/海报功能测试指南.md
@@ -0,0 +1,184 @@
+# 海报功能测试指南
+
+## 🚀 如何测试修复后的海报功能
+
+### 1. 启动项目
+
+#### 使用HBuilderX(推荐)
+1. 打开HBuilderX
+2. 导入项目文件夹
+3. 选择"运行" -> "运行到小程序模拟器" -> "微信开发者工具"
+
+#### 使用微信开发者工具
+1. 打开微信开发者工具
+2. 选择"导入项目"
+3. 选择项目根目录
+4. 项目类型选择"小程序"
+
+### 2. 测试步骤
+
+#### 步骤1:打开控制台
+在微信开发者工具中:
+1. 点击"调试器"标签
+2. 打开"Console"面板
+3. 确保能看到日志输出
+
+#### 步骤2:进入房源详情页面
+1. 在小程序中导航到房源列表页面
+2. 选择任意一个房源,点击进入详情页面
+3. 等待房源信息加载完成
+
+#### 步骤3:测试海报生成功能
+1. 在房源详情页面,点击底部的"分享"按钮
+2. 在弹出的分享面板中,点击"生成海报"选项
+3. 观察控制台输出和海报弹窗
+
+### 3. 预期结果
+
+#### 控制台日志输出
+应该看到以下日志(按顺序):
+
+```javascript
+// 1. 分享按钮点击时
+分享数据设置完成: {
+ shareTitle: "房源标题 租金元/月",
+ shareImageUrl: "图片URL或空字符串",
+ posterApiParam: { houseId: xxx, houseTitle: "...", ... }
+}
+
+// 2. ShareSheet组件处理
+ShareSheet handlePoster 被调用
+posterApiCall 类型: function
+posterApiCall 函数: ƒ generateHousePoster(params) { ... }
+posterApiParam: { houseId: xxx, houseTitle: "...", ... }
+
+// 3. GoodsPosterPopup组件处理
+GoodsPosterPopup onShowPopup 被调用
+apiCall 类型: function
+apiCall 函数: ƒ generateHousePoster(params) { ... }
+apiParam: { houseId: xxx, houseTitle: "...", ... }
+platform: undefined
+调用 apiCall,参数: { houseId: xxx, ..., channel: undefined }
+
+// 4. generateHousePoster函数执行
+generateHousePoster 被调用,参数: { houseId: xxx, ..., channel: undefined }
+当前房源图片列表: [...]
+房源信息: { houseTitle: "...", monthlyRent: xxx, ... }
+
+// 5a. 如果有房源图片
+第一张图片对象: { url: "图片URL", ... }
+提取的图片URL: "图片URL"
+使用房源图片作为海报: "图片URL"
+
+// 5b. 如果没有房源图片
+没有可用的房源图片,生成默认海报
+生成默认海报,房源信息: { houseTitle: "...", monthlyRent: xxx, ... }
+生成的默认海报URL: "https://dummyimage.com/..."
+生成默认海报成功: "https://dummyimage.com/..."
+
+// 6. 最终结果
+apiCall 调用成功,结果: { data: { imageUrl: "图片URL" } }
+海报图片URL设置成功: "图片URL"
+```
+
+#### 界面表现
+1. **海报弹窗正常显示**:应该看到一个居中的弹窗,包含海报图片
+2. **海报图片正常加载**:
+ - 如果房源有图片:显示房源的第一张图片
+ - 如果房源没有图片:显示包含房源信息的默认海报
+3. **保存功能正常**:点击"保存海报图"按钮,应该能正常保存到相册
+
+#### 错误情况处理
+如果出现错误,应该看到友好的提示信息,而不是控制台错误:
+- "海报生成功能异常"
+- "海报生成失败"
+
+### 4. 常见问题排查
+
+#### 问题1:仍然出现 "app.apiCall is not a function" 错误
+**可能原因**:
+- 缓存问题,需要清除小程序缓存
+- 代码修改未生效
+
+**解决方案**:
+1. 在微信开发者工具中点击"清缓存" -> "清除数据缓存"
+2. 重新编译项目
+3. 检查代码修改是否保存
+
+#### 问题2:海报弹窗不显示
+**检查控制台日志**:
+- 确认 `posterApiCall` 类型是 `function`
+- 确认 `generateHousePoster` 被正确调用
+- 查看是否有其他错误信息
+
+#### 问题3:海报图片不显示
+**可能原因**:
+- 图片URL无效
+- 网络问题
+- 图片格式不支持
+
+**检查方法**:
+1. 查看控制台中的图片URL
+2. 在浏览器中直接访问图片URL验证是否有效
+3. 检查网络连接
+
+#### 问题4:默认海报不生成
+**检查控制台日志**:
+- 确认进入了 `generateTextPoster` 方法
+- 查看房源信息是否正确获取
+- 检查默认海报URL是否生成
+
+### 5. 测试用例
+
+#### 测试用例1:有图片的房源
+1. 选择一个有图片的房源
+2. 执行海报生成流程
+3. 验证使用房源图片作为海报
+
+#### 测试用例2:没有图片的房源
+1. 选择一个没有图片的房源(或手动清空图片数据)
+2. 执行海报生成流程
+3. 验证生成默认海报
+
+#### 测试用例3:网络异常情况
+1. 断开网络连接
+2. 执行海报生成流程
+3. 验证错误处理是否正常
+
+### 6. 性能测试
+
+#### 测试海报生成速度
+1. 记录从点击"生成海报"到海报显示的时间
+2. 应该在2-3秒内完成
+3. 如果超时,检查图片加载和网络情况
+
+#### 测试内存使用
+1. 在开发者工具中查看内存使用情况
+2. 多次生成海报,确认没有内存泄漏
+
+### 7. 兼容性测试
+
+#### 不同设备测试
+1. 在不同型号的手机上测试
+2. 测试不同版本的微信客户端
+3. 确保功能在各种环境下都能正常工作
+
+### 8. 修复验证清单
+
+- [ ] 控制台不再出现 "app.apiCall is not a function" 错误
+- [ ] 海报弹窗能正常显示
+- [ ] 有图片的房源能正确显示房源图片作为海报
+- [ ] 没有图片的房源能生成默认海报
+- [ ] 海报保存功能正常
+- [ ] 错误情况有友好的提示信息
+- [ ] 分享其他功能(复制链接、微信分享等)不受影响
+
+## 🎯 总结
+
+如果以上测试都通过,说明海报生成功能已经修复成功。如果仍有问题,请提供:
+
+1. 完整的控制台错误信息
+2. 具体的操作步骤
+3. 出现问题的环境信息(设备型号、微信版本等)
+
+这将帮助进一步诊断和解决问题。