Polyv Help Center

Help Center

7-商品

Updated: 2024-10-18 17:34:17

1.Product

The core external class of the product manager is PLVProductManager, which can be accessed via the productManager property of the SDK object.

2.Product Page

The product page is a web component whose core external class is PLVProductWeb. Simply embed this component into the layout to complete the integration of the product page.

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

For detailed usage code, refer to the PLVLIProductWebView class in the demo project.

3.Callbacks

Business event messages for products are monitored through callback registration, including:

  • productManager.eventNotify.on: Product data callback registration
  • productController.eventNotify.on: Product click callback registration

For example, to monitor product data, you can do so as follows:

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

For detailed usage code, refer to the PLVLILiveHomeLayout class in the demo project.

联系客服,在线咨询