hookehuyr

feat: 产品模块接口集成完成

- 首页热卖产品集成产品列表API (listAPI, recommend=hot)
  - 动态标签渲染,使用API返回的bg_color和text_color
  - 移除硬编码数据,改用API动态返回
- 产品详情页集成详情API (detailAPI)
  - 产品特色改为产品描述,使用rich-text渲染富文本
  - 附件大小使用file_size_formatted字段显示格式化大小
  - 移除收藏功能
  - 修复nut-loading不兼容问题,改用CSS加载动画
- 更新API集成日志和规范文档状态
- 添加CHANGELOG记录

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
......@@ -17,6 +17,7 @@ declare module 'vue' {
NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']
NutButton: typeof import('@nutui/nutui-taro')['Button']
NutInput: typeof import('@nutui/nutui-taro')['Input']
NutLoading: typeof import('@nutui/nutui-taro')['Loading']
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
NutRadio: typeof import('@nutui/nutui-taro')['Radio']
......
......@@ -5,6 +5,55 @@
---
## [2026-02-03] - 产品模块接口集成完成
### 新增
- 首页热卖产品模块集成产品列表 API
- 使用 `listAPI` 接口,参数 `recommend=hot` 获取热卖产品
- 移除硬编码产品数据,改用 API 动态返回的产品列表
- 实现动态标签样式,根据 API 返回的 `bg_color``text_color` 字段设置标签背景色和文字颜色
- 影响文件:src/pages/index/index.vue
### 修改
- 产品详情页集成详情 API
- 使用 `detailAPI` 接口获取产品详情数据
- "产品特色" 改为 "产品描述",使用 `<rich-text>` 组件渲染富文本内容(`product_description` 字段)
- 附件大小直接使用 `file_size_formatted` 字段显示格式化后的文件大小
- 移除收藏功能(产品模块无此功能)
- 移除 `nut-loading` 组件(Taro 不支持),改用纯 CSS 实现的加载动画
- 影响文件:src/pages/product-detail/index.vue
### 修复
- 修复首页热卖产品模块重复调用 API 的问题
- 修复产品详情页 `nut-loading` 组件不兼容问题,使用 CSS `animate-spin` 实现加载动画
### 文档
- 更新 API 集成日志 `docs/api-integration-log.md`
- 添加产品模块记录,包含产品列表和产品详情 2 个接口
- 更新进度统计:16 个接口(11 个已完成,3 个已废弃,2 个开发中)
- 更新模块快速索引,添加产品模块
- 更新 API 规范文档状态
- `docs/api-specs/get_product/list.md` 状态改为 `done`
- `docs/api-specs/get_product/detail.md` 状态改为 `done`
---
**详细信息**
- **影响文件**:
- `src/pages/index/index.vue`(热卖产品模块 API 集成)
- `src/pages/product-detail/index.vue`(产品详情 API 集成)
- `docs/api-integration-log.md`(API 集成日志更新)
- `docs/api-specs/get_product/list.md`(状态更新)
- `docs/api-specs/get_product/detail.md`(状态更新)
- **技术栈**: Vue 3, Taro 4, Composition API
- **测试状态**: ✅ 已通过
- **备注**:
- 热卖产品接口参数:`recommend=hot`,无需传 limit、page、cid 参数
- 产品标签支持自定义背景色和文字颜色
- 富文本使用 Taro 的 `<rich-text>` 组件渲染
---
## [2026-02-03] - 修复反馈列表无法滚动
### 修复
......
......@@ -4,11 +4,11 @@
## 📊 总体进度
- **总接口数**: 14
- **已完成**: 9 (64.3%)
- **总接口数**: 16
- **已完成**: 11 (68.8%)
- **联调中**: 0 (0%)
- **已废弃**: 3 (21.4%)
- **后端开发中**: 2 (14.3%)
- **已废弃**: 3 (18.8%)
- **后端开发中**: 2 (12.5%)
- **有阻塞**: 0
---
......@@ -402,6 +402,95 @@
---
### 产品模块
#### 接口 1: 产品列表
**接口信息**
- **接口名称**: `listAPI`
- **接口路径**: `/srv/?a=get_product&t=list`
- **请求方法**: GET
- **负责页面**: `src/pages/index/index.vue` (首页热卖产品模块)
- **负责人**: 后端团队
**接口文档更新记录**
| 日期 | 版本 | 变更内容 | 变更原因 | 文档链接 |
|------|------|---------|---------|---------|
| 2026-02-03 | v1.0 | 初始版本 | - | [查看](docs/api-specs/get_product/list.md) |
**页面调试情况**
| 日期 | 调试页面 | 问题记录 | 解决方案 | 状态 |
|------|---------|---------|---------|------|
| 2026-02-03 | `src/pages/index/index.vue` | 联调完成 | 热卖产品列表、动态标签均正常 | ✅ 已完成 |
**接口状态**: ✅ 已完成
**备注**:
- **调用参数**: `recommend: 'hot'` (热卖产品)
- **首页场景**: 不传 limit、page、cid 参数,使用默认值
- **返回数据结构**:
- `data.list[]` - 产品列表
- `data.categories[]` - 分类列表
- `data.total` - 产品总数
- **产品字段**:
- `id` - 产品ID
- `product_name` - 产品名称
- `recommend` - 推荐位 (normal-普通, hot-热卖)
- `tags[]` - 产品标签数组(包含 id、name、bg_color、text_color)
- `cover_image` - 产品封面图
- `categories[]` - 产品所属分类
- **标签渲染**: 使用 API 返回的 `bg_color``text_color` 动态设置标签样式
- **实现位置**: `src/pages/index/index.vue:250-262`, `src/pages/index/index.vue:52-92`
---
#### 接口 2: 产品详情
**接口信息**
- **接口名称**: `detailAPI`
- **接口路径**: `/srv/?a=get_product&t=detail`
- **请求方法**: GET
- **负责页面**: `src/pages/product-detail/index.vue`
- **负责人**: 后端团队
**接口文档更新记录**
| 日期 | 版本 | 变更内容 | 变更原因 | 文档链接 |
|------|------|---------|---------|---------|
| 2026-02-03 | v1.0 | 初始版本 | - | [查看](docs/api-specs/get_product/detail.md) |
**页面调试情况**
| 日期 | 调试页面 | 问题记录 | 解决方案 | 状态 |
|------|---------|---------|---------|------|
| 2026-02-03 | `src/pages/product-detail/index.vue` | nut-loading 组件报错 | 改用纯 CSS 加载动画 | ✅ 已解决 |
| 2026-02-03 | `src/pages/product-detail/index.vue` | 联调完成 | 产品详情、富文本描述、附件列表均正常 | ✅ 已完成 |
**接口状态**: ✅ 已完成
**备注**:
- **调用参数**: `i: productId` (产品ID)
- **返回数据结构**:
- `product_name` - 产品名称
- `product_description` - 产品描述(富文本HTML)
- `cover_image` - 产品封面图
- `recommend` - 推荐位
- `tags[]` - 产品标签数组(包含 id、name、bg_color、text_color)
- `documents[]` - 附件列表
- `categories[]` - 产品所属分类
- **富文本渲染**: 使用 `<rich-text>` 组件渲染 `product_description` 字段
- **附件显示**:
- 文件名: `doc.file_name`
- 文件大小: `doc.file_size_formatted` (已格式化,如 "72.61 KB")
- 文件URL: `doc.file_url`
- 点击预览: 通过 `useFileOperation` composable 打开文档
- **移除功能**: 原有的收藏功能已移除(按钮和代码)
- **实现位置**: `src/pages/product-detail/index.vue:135-162`, `src/pages/product-detail/index.vue:56-92`
---
### 消息模块
#### 接口 1: 我的消息列表
......@@ -524,19 +613,19 @@
### 本周进度 (2026-01-27 ~ 2026-02-03)
- **新增接口**: 14
- **完成联调**: 9
- **新增接口**: 16
- **完成联调**: 11
- **已废弃**: 3
- **联调中**: 0
- **后端开发中**: 2
- **发现问题**: 5
- **解决问题**: 5
- **发现问题**: 6
- **解决问题**: 6
### 历史进度
| 周 | 完成数 | 新增数 | 废弃数 | 问题数 |
|----|--------|--------|--------|--------|
| 2026-01-27 ~ 2026-02-03 | 7 | 14 | 3 | 0 |
| 2026-01-27 ~ 2026-02-03 | 9 | 16 | 3 | 0 |
---
......@@ -545,17 +634,16 @@
### 按状态查看
- [✅ 已完成](#用户中心模块) - 6个接口
- [✅ 已完成](#意见反馈模块) - 2个接口
- [✅ 已完成](#产品模块) - 2个接口
- [❌ 已废弃](#通用模块) - 3个接口
- [⏳ 后端开发中](#消息模块) - 2个接口
- [⏳ 后端开发中](#首页模块) - 1个接口
### 按模块查看
- [用户中心](#用户中心模块) - ✅ 6个已完成
- [通用](#通用模块) - ❌ 3个已废弃
- [意见反馈](#意见反馈模块) - ⏳ 2个后端开发中
- [意见反馈](#意见反馈模块) - ✅ 2个已完成
- [产品](#产品模块) - ✅ 2个已完成
- [消息](#消息模块) - ⏳ 2个后端开发中
- [首页](#首页模块) - ⏳ 1个后端开发中
- [产品详情](#产品模块) - ⏳ 未开始
- [知识库](#知识库模块) - ⏳ 未开始
- [家办](#家办模块) - ⏳ 未开始
- [签单](#签单模块) - ⏳ 未开始
......@@ -592,14 +680,17 @@
---
**最后更新时间**: 2026-02-03 22:00
**文档版本**: v1.6
**最后更新时间**: 2026-02-03 23:30
**文档版本**: v1.7
**更新内容**:
- 意见反馈模块联调完成:2个接口
- 意见反馈列表(listAPI):✅ 已完成
- 提交意见反馈(addAPI):✅ 已完成
- 产品模块联调完成:2个接口
- 产品列表(listAPI):✅ 已完成
- 首页热卖产品模块,使用 recommend=hot 参数
- 动态标签渲染(使用 API 返回的 bg_color 和 text_color)
- 产品详情(detailAPI):✅ 已完成
- 产品详情页,使用富文本渲染 product_description
- 附件列表显示(使用 file_size_formatted 字段)
- 移除收藏功能
- 修复问题:
- 生命周期钩子导入错误(useShow → useDidShow、onMounted 从 Vue 导入)
- 图片显示错误(images 改为数组格式处理)
- NutUI Loading 组件报错(改用自定义 CSS spinner)
- 更新总体进度:14个接口(9个已完成,3个已废弃,2个后端开发中)
- 产品详情页 nut-loading 组件报错(改用纯 CSS 加载动画)
- 更新总体进度:16个接口(11个已完成,3个已废弃,2个后端开发中)
......
# 产品详情
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
version: 1.0.0
paths:
/srv/:
get:
summary: 产品详情
deprecated: false
description: ''
tags:
- 产品
parameters:
- name: f
in: query
description: ''
required: true
example: manulife
schema:
type: string
- name: a
in: query
description: ''
required: true
example: get_product
schema:
type: string
- name: t
in: query
description: ''
required: true
example: detail
schema:
type: string
- name: client_id
in: query
description: 主体id
required: false
example: '30901'
schema:
type: string
- name: i
in: query
description: 产品id
required: true
example: '2769848'
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
type: integer
msg:
type: integer
data:
type: object
properties:
id:
type: integer
title: 产品id
product_name:
type: string
title: 产品名
recommend:
type: string
title: '推荐位: normal-普通, hot-热卖'
status:
type: string
created_by:
type: integer
created_time:
type: string
updated_by:
type: integer
updated_time:
type: string
form_sn:
type: string
title: 关联表单sn
product_description:
type: string
title: 产品描述
categories:
type: array
items:
type: object
properties:
id:
type: string
title: 分类id
name:
type: string
title: 分类名称
x-apifox-orders:
- id
- name
title: 产品所属分类
tags:
type: array
items:
type: object
properties:
id:
type: string
title: 标签id
name:
type: string
title: 标签名
bg_color:
type: string
title: 标签背景色
text_color:
type: string
title: 标签文字色
required:
- id
- name
- bg_color
- text_color
x-apifox-orders:
- id
- name
- bg_color
- text_color
title: 产品标签
documents:
type: array
items:
type: object
properties:
file_url:
type: string
title: 附件地址
file_name:
type: string
title: 附件名
file_size:
type: string
title: 附件大小
file_size_formatted:
type: string
title: 附件大小(转换过显示)
x-apifox-orders:
- file_url
- file_name
- file_size
- file_size_formatted
title: 附件列表
cover_image:
type: string
title: 产品封面图
required:
- id
- product_name
- recommend
- status
- created_by
- created_time
- updated_by
- updated_time
- form_sn
- product_description
- categories
- tags
- documents
- cover_image
x-apifox-orders:
- id
- product_name
- recommend
- status
- created_by
- created_time
- updated_by
- updated_time
- form_sn
- product_description
- cover_image
- categories
- tags
- documents
required:
- code
- msg
- data
x-apifox-orders:
- code
- msg
- data
example:
code: 1
msg: 0
data:
id: 2769848
product_name: '1111'
recommend: normal
sort: 0
status: '3'
created_by: 21580
created_time: '2026-02-02 16:33:01'
updated_by: 21580
updated_time: '2026-02-03 14:52:41'
client_id: 30901
form_sn: customize_jsj_ivleuz
product_description: "<p>5564</p>\r\n<p>hdye</p>"
categories:
- id: '2769851'
name: '11'
tags:
- id: '2769846'
name: 测试1
bg_color: '#1e9fff'
text_color: '#ffffff'
- id: '2769847'
name: '111'
bg_color: '#3e5160'
text_color: '#ffffff'
documents:
- file_url: >-
https://cdn.ipadbiz.cn/space_30901/申请提交-生成计划书_FvdRVOS0K-Wmp05ZKHpx64sEXcKQ.png
file_name: 申请提交-生成计划书.png
file_size: '74356'
file_size_formatted: 72.61 KB
headers: {}
x-apifox-name: 成功
x-apifox-ordering: 0
security: []
x-apifox-folder: 产品
x-apifox-status: done
x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414567246-run
components:
schemas: {}
responses: {}
securitySchemes: {}
servers: []
security: []
```
# 产品列表
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
version: 1.0.0
paths:
/srv/:
get:
summary: 产品列表
deprecated: false
description: ''
tags:
- 产品
parameters:
- name: f
in: query
description: ''
required: true
example: manulife
schema:
type: string
- name: a
in: query
description: ''
required: true
example: get_product
schema:
type: string
- name: t
in: query
description: ''
required: true
example: list
schema:
type: string
- name: client_id
in: query
description: 主体id
required: false
example: '30901'
schema:
type: string
- name: limit
in: query
description: ''
required: false
example: '10'
schema:
type: string
- name: page
in: query
description: ''
required: false
example: '0'
schema:
type: string
- name: cid
in: query
description: 分类id
required: false
schema:
type: string
- name: recommend
in: query
description: '推荐位: normal-普通, hot-热卖'
required: false
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
type: integer
msg:
type: integer
data:
type: object
properties:
categories:
type: array
items:
type: object
properties:
id:
type: integer
title: 分类id
name:
type: string
title: 分类名
x-apifox-orders:
- id
- name
title: 分类列表
list:
type: array
items:
type: object
properties:
id:
type: integer
title: 产品id
product_name:
type: string
title: 产品名
recommend:
type: string
title: '推荐位: normal-普通, hot-热卖'
form_sn:
type: string
created_time:
type: string
title: 创建时间
categories:
type: array
items:
type: object
properties:
id:
type: string
title: 分类id
name:
type: string
title: 分类名
required:
- id
- name
x-apifox-orders:
- id
- name
title: 产品所属分类
tags:
type: array
items:
type: object
properties:
id:
type: string
title: 标签id
name:
type: string
title: 标签名
bg_color:
type: string
title: 标签背景色
text_color:
type: string
title: 标签文字色
required:
- id
- name
- bg_color
- text_color
x-apifox-orders:
- id
- name
- bg_color
- text_color
title: 产品标签
cover_image:
type: string
title: 产品封面图
required:
- id
- product_name
- recommend
- form_sn
- created_time
- categories
- tags
- cover_image
x-apifox-orders:
- id
- product_name
- recommend
- form_sn
- cover_image
- created_time
- categories
- tags
title: 产品列表
total:
type: integer
title: 产品总数
required:
- categories
- list
- total
x-apifox-orders:
- categories
- list
- total
required:
- code
- msg
- data
x-apifox-orders:
- code
- msg
- data
example:
code: 1
msg: 0
data:
categories:
- id: 2769851
name: '11'
list:
- id: 2769856
product_name: '22'
recommend: hot
form_sn: customize_jsj_pnzuky
created_time: '2026-02-03 10:36:29'
categories:
- id: '2769851'
name: '11'
tags:
- id: '2769847'
name: '111'
bg_color: '#3e5160'
text_color: '#ffffff'
- id: 2769848
product_name: '1111'
recommend: normal
form_sn: customize_jsj_ivleuz
created_time: '2026-02-02 16:33:01'
categories:
- id: '2769851'
name: '11'
tags:
- id: '2769846'
name: 测试1
bg_color: '#1e9fff'
text_color: '#ffffff'
- id: '2769847'
name: '111'
bg_color: '#3e5160'
text_color: '#ffffff'
- id: 2769845
product_name: '1'
recommend: normal
form_sn: customize_jsj_pnzuky
created_time: '2026-02-02 16:22:26'
categories: []
tags: []
total: 3
headers: {}
x-apifox-name: 成功
x-apifox-ordering: 0
security: []
x-apifox-folder: 产品
x-apifox-status: done
x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414404531-run
components:
schemas: {}
responses: {}
securitySchemes: {}
servers: []
security: []
```
import { fn, fetch } from '@/api/fn';
const Api = {
Detail: '/srv/?a=get_product&t=detail',
List: '/srv/?a=get_product&t=list',
}
/**
* @description 产品详情
* @remark
* @param {Object} params 请求参数
* @param {string} params.client_id (可选) 主体id
* @param {string} params.i 产品id
* @returns {Promise<{
* code: number; // 状态码
* msg: string; // 消息
* data: {
* id: integer; // 产品id
* product_name: string; // 产品名
* recommend: string; // 推荐位: normal-普通, hot-热卖
* status: string; //
* created_by: integer; //
* created_time: string; //
* updated_by: integer; //
* updated_time: string; //
* form_sn: string; // 关联表单sn
* product_description: string; // 产品描述
* categories: Array<{
* id: string; // 分类id
* name: string; // 分类名称
* }>;
* tags: Array<{
* id: string; // 标签id
* name: string; // 标签名
* bg_color: string; // 标签背景色
* text_color: string; // 标签文字色
* }>;
* documents: Array<{
* file_url: string; // 附件地址
* file_name: string; // 附件名
* file_size: string; // 附件大小
* file_size_formatted: string; // 附件大小(转换过显示)
* }>;
* cover_image: string; // 产品封面图
* };
* }>}
*/
export const detailAPI = (params) => fn(fetch.get(Api.Detail, params));
/**
* @description 产品列表
* @remark
* @param {Object} params 请求参数
* @param {string} params.client_id (可选) 主体id
* @param {string} params.limit (可选)
* @param {string} params.page (可选)
* @param {string} params.cid (可选) 分类id
* @param {string} params.recommend (可选) 推荐位: normal-普通, hot-热卖
* @returns {Promise<{
* code: number; // 状态码
* msg: string; // 消息
* data: {
* categories: Array<{
* id: integer; // 分类id
* name: string; // 分类名
* }>;
* list: Array<{
* id: integer; // 产品id
* product_name: string; // 产品名
* recommend: string; // 推荐位: normal-普通, hot-热卖
* form_sn: string; //
* created_time: string; // 创建时间
* categories: array; // 产品所属分类
* tags: array; // 产品标签
* cover_image: string; // 产品封面图
* }>;
* total: integer; // 产品总数
* };
* }>}
*/
export const listAPI = (params) => fn(fetch.get(Api.List, params));
......@@ -26,14 +26,14 @@
<view class="flex flex-wrap">
<view
class="flex flex-col items-center w-1/3 mb-[40rpx]"
v-for="(item, index) in loopData0"
v-for="(item, index) in loopNav"
:key="index"
@tap="handleGridNav(item)"
>
<view class="w-[88rpx] h-[88rpx] rounded-[24rpx] bg-blue-50 flex items-center justify-center mb-[16rpx]">
<IconFont :name="item.icon" class="text-blue-600" size="24" />
</view>
<text class="text-gray-800 text-[26rpx]">{{ item.lanhutext0 }}</text>
<text class="text-gray-800 text-[26rpx]">{{ item.name }}</text>
</view>
</view>
</view>
......@@ -48,66 +48,43 @@
</view>
</view>
<!-- Product Card 1 -->
<view class="bg-gray-50 rounded-[24rpx] p-[28rpx] mb-[24rpx]">
<text class="block text-gray-800 text-[28rpx] font-medium mb-[20rpx]">家庭财富传承保障计划(分红)</text>
<view class="flex flex-wrap gap-[12rpx] mb-[24rpx]">
<view class="bg-red-50 rounded-[8rpx] px-[16rpx] py-[6rpx]">
<text class="text-red-600 text-[22rpx]">收益率3.5%</text>
</view>
<view class="bg-orange-50 rounded-[8rpx] px-[16rpx] py-[6rpx]">
<text class="text-orange-600 text-[22rpx]">5年超值</text>
</view>
<view class="bg-green-50 rounded-[8rpx] px-[16rpx] py-[6rpx]">
<text class="text-green-600 text-[22rpx]">保证收益万能</text>
</view>
</view>
<view class="flex justify-between gap-[24rpx]">
<nut-button
plain
color="#2563EB"
class="flex-1 !h-[64rpx] !rounded-[16rpx] !text-[26rpx] !m-0 !border-blue-600"
@tap="goToProductDetail(1)"
<!-- 动态产品列表 -->
<view
v-for="(product, index) in hotProducts"
:key="product.id"
class="bg-gray-50 rounded-[24rpx] p-[28rpx]"
:class="{ 'mb-[24rpx]': index < hotProducts.length - 1 }"
>
产品详情
</nut-button>
<nut-button
color="#2563EB"
class="flex-1 !h-[64rpx] !rounded-[16rpx] !text-[26rpx] !m-0"
@tap="openPlanPopup('A')"
<text class="block text-gray-800 text-[28rpx] font-medium mb-[20rpx]">{{ product.product_name }}</text>
<!-- 动态标签 -->
<view v-if="product.tags && product.tags.length" class="flex flex-wrap gap-[12rpx] mb-[24rpx]">
<view
v-for="tag in product.tags"
:key="tag.id"
class="rounded-[8rpx] px-[16rpx] py-[6rpx]"
:style="{
backgroundColor: tag.bg_color,
color: tag.text_color
}"
>
计划书
</nut-button>
<text class="text-[22rpx]">{{ tag.name }}</text>
</view>
</view>
<!-- Product Card 2 -->
<view class="bg-gray-50 rounded-[24rpx] p-[28rpx]">
<text class="block text-gray-800 text-[28rpx] font-medium mb-[20rpx]">儿童教育金储备方案(分红)</text>
<view class="flex flex-wrap gap-[12rpx] mb-[24rpx]">
<view class="bg-red-50 rounded-[8rpx] px-[16rpx] py-[6rpx]">
<text class="text-red-600 text-[22rpx]">收益率4.2%</text>
</view>
<view class="bg-orange-50 rounded-[8rpx] px-[16rpx] py-[6rpx]">
<text class="text-orange-600 text-[22rpx]">10年期</text>
</view>
<view class="bg-green-50 rounded-[8rpx] px-[16rpx] py-[6rpx]">
<text class="text-green-600 text-[22rpx]">教育专属</text>
</view>
</view>
<view class="flex justify-between gap-[24rpx]">
<nut-button
plain
color="#2563EB"
class="flex-1 !h-[64rpx] !rounded-[16rpx] !text-[26rpx] !m-0 !border-blue-600"
@tap="goToProductDetail(2)"
@tap="goToProductDetail(product.id)"
>
产品资料
产品详情
</nut-button>
<nut-button
color="#2563EB"
class="flex-1 !h-[64rpx] !rounded-[16rpx] !text-[26rpx] !m-0"
@tap="openPlanPopup('B')"
@tap="openPlanPopup(product.id)"
>
计划书
</nut-button>
......@@ -187,7 +164,7 @@
<script setup>
import { ref, shallowRef } from 'vue';
import Taro, { useShareAppMessage } from '@tarojs/taro';
import Taro, { useShareAppMessage, useLoad } from '@tarojs/taro';
import { useGo } from '@/hooks/useGo';
import { useListItemClick, ListType } from '@/composables/useListItemClick';
import { getDocumentIcon, getDocumentLabel } from '@/utils/documentIcons';
......@@ -197,6 +174,7 @@ import PlanPopup from '@/components/PlanPopup/index.vue';
import SchemeA from '@/components/PlanSchemes/SchemeA.vue';
import SchemeB from '@/components/PlanSchemes/SchemeB.vue';
import ListItemActions from '@/components/ListItemActions/index.vue';
import { listAPI } from '@/api/get_product';
// Plan Popup State
const showPlanPopup = ref(false);
......@@ -226,16 +204,42 @@ const handlePlanSubmit = (formData) => {
};
// Grid navigation data with routes
const loopData0 = shallowRef([
{ icon: 'order', lanhutext0: '计划书', route: '/pages/plan/index' },
{ icon: 'my', lanhutext0: '入职相关', route: '/pages/onboarding/index' },
{ icon: 'cart', lanhutext0: '签单相关', route: '/pages/signing/index' },
{ icon: 'home', lanhutext0: '家办相关', route: '/pages/family-office/index' },
{ icon: 'category', lanhutext0: '产品知识库', route: '/pages/knowledge-base/index' },
{ icon: 'star', lanhutext0: '工具箱', route: null }, // 待开发
const loopNav = shallowRef([
{ icon: 'order', name: '计划书', route: '/pages/plan/index' },
{ icon: 'my', name: '入职相关', route: '/pages/onboarding/index' },
{ icon: 'cart', name: '签单相关', route: '/pages/signing/index' },
{ icon: 'home', name: '家办相关', route: '/pages/family-office/index' },
{ icon: 'category', name: '产品知识库', route: '/pages/knowledge-base/index' },
{ icon: 'star', name: '工具箱', route: null }, // 待开发
]);
/**
* 热卖产品数据
*
* @description 从服务器获取的热卖产品列表
*/
const hotProducts = ref([]);
/**
* 获取热卖产品列表
*
* @description 调用产品列表API,recommend参数为hot
*/
const fetchHotProducts = async () => {
try {
const res = await listAPI({
recommend: 'hot'
});
if (res.code === 1 && res.data && res.data.list) {
hotProducts.value = res.data.list;
}
} catch (err) {
console.error('获取热卖产品失败:', err);
}
};
/**
* 热门资料数据
*
* @description 本周热门资料列表数据,包含不同类型的文件
......@@ -328,6 +332,11 @@ const openWebView = (url) => {
});
};
// 页面加载时获取热卖产品
useLoad(() => {
fetchHotProducts();
});
useShareAppMessage(() => {
return {
title: '臻奇智荟圈',
......
This diff is collapsed. Click to expand it.