Compare commits

...

No commits in common. 'main' and 'master' have entirely different histories.
main ... master

@ -1,87 +0,0 @@
# 校园二手交易小程序
## 1. 系统简介
本项目是一个功能完善的校园二手交易微信小程序,旨在为大学校园内的学生和教职工提供一个安全、便捷、高效的二手物品交易平台。系统不仅包含了完整的商品交易流程,还融入了丰富的社交和实用功能,构建了一个活跃的校园社区生态。
### 主要功能模块
- **商品模块**:用户可以轻松发布、编辑、下架自己的二手商品,支持图文描述、价格、分类、交易地点等信息。
- **交易流程**:实现了从创建订单、买家支付(模拟)、卖家确认、买家收货到交易完成的全闭环流程。
- **求购广场**:用户可以发布求购信息,寻找自己需要的物品,其他用户可以响应求购。
- **智能定价**:支持用户上传二手商品,生成闲置商品破损程度分析和定价建议
- **实时聊天**:买卖双方可以进行一对一的实时沟通,支持文字和图片消息。
- **校园地图模式**:以地图为载体,直观展示校园内各个交易地点的商品信息,方便用户发现附近的宝贝。
- **智能推荐**:根据用户的浏览和收藏行为,个性化推荐可能感兴趣的商品。
### 技术栈
- **前端**:微信小程序原生开发 (WXML, WXSS, JavaScript)
- **后端**:微信小程序云开发
- **数据库**:微信云开发数据库
- **核心服务**:微信云函数、云存储
---
## 2. 环境配置与部署指南
请严格按照以下步骤进行配置,以确保项目能成功运行。
### 步骤 1准备工作
1. **安装微信开发者工具**:前往 [微信开放平台](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) 下载并安装最新版的微信开发者工具。
2. **注册小程序账号**:拥有一个自己的小程序 AppID。个人或企业主体均可。
### 步骤 2导入项目
1. 打开微信开发者工具,点击“导入项目”。
2. **项目目录**:选择本项目的根目录 `ruangong1`
3. **AppID**:填写您自己的小程序 AppID。
4. **项目名称**:自定义即可。
5. 点击“导入”。
### 步骤 3开通并配置云开发环境
1. 在开发者工具的顶部工具栏中,点击“云开发”按钮,打开云开发控制台。
2. 按照提示**开通云开发**,系统会自动为您创建一个云开发环境。
3. **记住您的环境 ID**,它通常是一串类似 `your-env-id-xxxxxxxx` 的字符串。
4. 回到开发者工具的编辑器界面,打开文件 `miniprogram/app.js`
5. 找到以下代码块(大约在第 6 行):
```javascript
this.globalData = {
env: '' // <--- ID
};
```
6. 将您刚刚获取的**环境 ID** 填入 `env` 字段的引号中。
### 步骤 4部署云函数
1. 在开发者工具的左侧文件树中,找到 `cloudfunctions/quickstartFunctions` 目录。
2. 右键点击该目录,选择“**上传并部署:云端安装依赖**”。
3. 等待几分钟,直到开发者工具的控制台提示部署成功。
### 步骤 5创建数据库集合
这是**非常关键**的一步。项目需要以下数据库集合来存储数据,您必须手动创建它们。
1. 打开云开发控制台,切换到“数据库”标签页。
2. 点击“**+**”号按钮,选择“创建集合”。
3. 依次创建以下所有集合(**集合名称必须完全一致**
- `T_user`
- `T_product`
- `T_want`
- `T_order`
- `T_favorites`
- `T_campus_landmarks`
- `T_chat`
- `T_message`
- `T_notify`
- `T_user_behavior`
4. **设置权限**:为了方便开发和测试,您可以暂时将所有集合的权限设置为“**所有用户可读,仅创建者可读写**”。上线前请根据实际业务需求调整为更严格的权限规则。
### 步骤 6运行项目
完成以上所有步骤后,点击开发者工具顶部的“编译”按钮。如果一切顺利,您应该可以在模拟器中看到小程序的启动界面。
至此,项目已成功在您的开发环境中运行起来。祝您使用愉快!

@ -0,0 +1 @@
Subproject commit f77c57bff10f52d0cc2b5ff80af0c5e8ffdac54f

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 934 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 KiB

@ -1,14 +0,0 @@
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/

@ -1,87 +0,0 @@
# 校园二手交易小程序
## 1. 系统简介
本项目是一个功能完善的校园二手交易微信小程序,旨在为大学校园内的学生和教职工提供一个安全、便捷、高效的二手物品交易平台。系统不仅包含了完整的商品交易流程,还融入了丰富的社交和实用功能,构建了一个活跃的校园社区生态。
### 主要功能模块
- **商品模块**:用户可以轻松发布、编辑、下架自己的二手商品,支持图文描述、价格、分类、交易地点等信息。
- **交易流程**:实现了从创建订单、买家支付(模拟)、卖家确认、买家收货到交易完成的全闭环流程。
- **求购广场**:用户可以发布求购信息,寻找自己需要的物品,其他用户可以响应求购。
- **智能定价**:支持用户上传二手商品,生成闲置商品破损程度分析和定价建议
- **实时聊天**:买卖双方可以进行一对一的实时沟通,支持文字和图片消息。
- **校园地图模式**:以地图为载体,直观展示校园内各个交易地点的商品信息,方便用户发现附近的宝贝。
- **智能推荐**:根据用户的浏览和收藏行为,个性化推荐可能感兴趣的商品。
### 技术栈
- **前端**:微信小程序原生开发 (WXML, WXSS, JavaScript)
- **后端**:微信小程序云开发
- **数据库**:微信云开发数据库
- **核心服务**:微信云函数、云存储
---
## 2. 环境配置与部署指南
请严格按照以下步骤进行配置,以确保项目能成功运行。
### 步骤 1准备工作
1. **安装微信开发者工具**:前往 [微信开放平台](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) 下载并安装最新版的微信开发者工具。
2. **注册小程序账号**:拥有一个自己的小程序 AppID。个人或企业主体均可。
### 步骤 2导入项目
1. 打开微信开发者工具,点击“导入项目”。
2. **项目目录**:选择本项目的根目录 `ruangong1`
3. **AppID**:填写您自己的小程序 AppID。
4. **项目名称**:自定义即可。
5. 点击“导入”。
### 步骤 3开通并配置云开发环境
1. 在开发者工具的顶部工具栏中,点击“云开发”按钮,打开云开发控制台。
2. 按照提示**开通云开发**,系统会自动为您创建一个云开发环境。
3. **记住您的环境 ID**,它通常是一串类似 `your-env-id-xxxxxxxx` 的字符串。
4. 回到开发者工具的编辑器界面,打开文件 `miniprogram/app.js`
5. 找到以下代码块(大约在第 6 行):
```javascript
this.globalData = {
env: '' // <--- ID
};
```
6. 将您刚刚获取的**环境 ID** 填入 `env` 字段的引号中。
### 步骤 4部署云函数
1. 在开发者工具的左侧文件树中,找到 `cloudfunctions/quickstartFunctions` 目录。
2. 右键点击该目录,选择“**上传并部署:云端安装依赖**”。
3. 等待几分钟,直到开发者工具的控制台提示部署成功。
### 步骤 5创建数据库集合
这是**非常关键**的一步。项目需要以下数据库集合来存储数据,您必须手动创建它们。
1. 打开云开发控制台,切换到“数据库”标签页。
2. 点击“**+**”号按钮,选择“创建集合”。
3. 依次创建以下所有集合(**集合名称必须完全一致**
- `T_user`
- `T_product`
- `T_want`
- `T_order`
- `T_favorites`
- `T_campus_landmarks`
- `T_chat`
- `T_message`
- `T_notify`
- `T_user_behavior`
4. **设置权限**:为了方便开发和测试,您可以暂时将所有集合的权限设置为“**所有用户可读,仅创建者可读写**”。上线前请根据实际业务需求调整为更严格的权限规则。
### 步骤 6运行项目
完成以上所有步骤后,点击开发者工具顶部的“编译”按钮。如果一切顺利,您应该可以在模拟器中看到小程序的启动界面。
至此,项目已成功在您的开发环境中运行起来。祝您使用愉快!

@ -1,14 +0,0 @@
{
"permissions": {
"openapi": [
"wxacode.get"
]
},
"timeout": 300,
"envVariables": {
"QQMAP_KEY": "QBJBZ-E433N-DYYFX-SDC5E-EUB3V-MJBOE",
"QQMAP_KEYS": "7YTBZ-DTQHW-RPURE-YWKGQ-UTODK-RZFVP",
"QQMAP_REFERER": "https://servicewechat.com",
"QQMAP_SK": ""
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,17 +0,0 @@
{
"name": "quickstartFunctions",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@coze/api": "^1.3.7",
"axios": "^1.13.1",
"form-data": "^4.0.4",
"wx-server-sdk": "~2.4.0"
}
}

@ -1,58 +0,0 @@
// 测试AI定价功能的脚本
// 用于本地测试云函数逻辑
const cloud = require("wx-server-sdk");
cloud.init({
env: "cloud1-7gmt1869f0703287" // 使用你的环境ID
});
// 导入云函数
const analyzeProductPrice = require('./index.js').analyzeProductPrice;
async function testAnalyzeProductPrice() {
console.log('========== 开始测试AI定价功能 ==========');
// 测试用例1: 使用fileID需要先上传一个图片到云存储
const testEvent1 = {
type: 'analyzeProductPrice',
fileID: 'cloud://cloud1-7gmt1869f0703287.636c-cloud1-7gmt1869f0703287-1316160869/pricing/test.jpg',
originalPrice: 100
};
// 测试用例2: 使用imageUrl使用一个公开的图片URL
const testEvent2 = {
type: 'analyzeProductPrice',
imageUrl: 'https://pic1.zhimg.com/v2-24d60d3e9a24ce8d1f3ee0d9f05f929c_b.jpg',
originalPrice: 100
};
try {
console.log('\n测试用例2: 使用imageUrl测试');
console.log('测试参数:', JSON.stringify(testEvent2, null, 2));
const result = await analyzeProductPrice(testEvent2);
console.log('\n========== 测试结果 ==========');
console.log(JSON.stringify(result, null, 2));
if (result.success) {
console.log('\n✅ 测试成功!');
console.log('商品名称:', result.data.productName);
console.log('建议价格:', result.data.suggestedPrice);
console.log('商品成色:', result.data.conditionLevel);
console.log('AI评分:', result.data.aiScore);
} else {
console.log('\n❌ 测试失败!');
console.log('错误信息:', result.error);
console.log('错误详情:', result.details);
}
} catch (error) {
console.error('\n========== 测试异常 ==========');
console.error('错误信息:', error.message);
console.error('错误堆栈:', error.stack);
}
}
// 运行测试
testAnalyzeProductPrice();

@ -1,28 +0,0 @@
// 测试云函数AI定价功能
async function testCloudFunction() {
try {
console.log('开始测试云函数AI定价功能...');
// 模拟云函数调用 - 使用用户提供的具体图片URL
const event = {
type: 'analyzeProductPrice',
imageUrl: 'https://pic1.zhimg.com/v2-24d60d3e9a24ce8d1f3ee0d9f05f929c_b.jpg',
originalPrice: 100
};
// 导入云函数
const cloudFunction = require('./index.js');
console.log('调用云函数analyzeProductPrice...');
const result = await cloudFunction.main(event, {});
console.log('云函数调用结果:', JSON.stringify(result, null, 2));
} catch (error) {
console.error('❌ 测试过程中发生错误:', error.message);
console.error('错误堆栈:', error.stack);
}
}
// 运行测试
testCloudFunction();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save