> For the complete documentation index, see [llms.txt](https://polyv.gitbook.io/document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polyv.gitbook.io/document/docs/live/harmony/7-shang-pin.md).

# 7-商品

* [1.商品](#1商品)
* [2.商品页](#2商品页)
* [3.回调](#3回调)

#### 1.商品

商品管理器的对外核心类为`PLVProductManager`，可以通过 SDK 对象的`productManager`属性对其进行访问。

#### 2.商品页

商品页是一个 Web 组件，其对外核心类为`PLVProductWeb`，只需要把该组件嵌入到布局中即可完成商品页的集成。

```ts
PLVProductWeb({
  controller: this.productController, // web组件控制器
  interactManager: this.interactManager // 互动管理器
})
```

详细使用代码可以参考 demo 项目的`PLVLIProductWebView`类。

#### 3.回调

商品的业务事件消息通过回调注册进行监听，包括：

* productManager.eventNotify.on：商品数据回调注册
* productController.eventNotify.on：商品点击回调注册

以监听商品数据为例，可以通过以下方式进行监听：

```ts
sdk.productManager.eventNotify.on('product_data', (value: PLVProductDataBean) => {
  // 处理逻辑
  this.productDataBean = value
}, this)
```

详细使用代码可以参考 demo 项目的`PLVLILiveHomeLayout`类。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://polyv.gitbook.io/document/docs/live/harmony/7-shang-pin.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
