> 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`类。
