Skip to main content

WeChat Store Product

WdStoreProduct

Usage Instructions

The WeChat Mini Program embeds WeChat Store products, displays store products, and redirects to transactions. It supports the Store Preferred Alliance's product promotion and commission function.

Component Usage Limitations

  1. The component must be used in a real Mini Program environment to observe the actual effect.

  2. Due to platform rules, keep the component content fully displayed. If you need to customize styles, use custom-style. The number and spacing of component elements, product guarantee content and sales data, component font size, and the height of the "Buy" button cannot be modified. Failure to comply will render the component unavailable and may result in suspension of the ability to use this component.

  3. This component is currently not supported in Mini Programs on WeChat for Windows or WeChat for Mac.

  4. Parameters product-promotion-link and media-id must be passed during the initial loading of the component. Adjusting parameters after the component has finished loading is not currently supported.

Properties

组件接收的外部传入的属性

属性名
属性标识
类型
说明
小店appidappidstring

小店appid。获取方式:小店后台 - 店铺管理 - 基础信息 - 账号信息 - 微信小店ID。

商品idproductIdstring

获取小店商品id,可以通过API获取参考链接或通过小店后台 - 商品管理 - 商品列表 - 规格/编码获取。

带货商品跟佣信息productPromotionLinkstring

若需要商品售卖时使用小店优选联盟带货跟佣功能,可以通过API获取带货商品跟佣信息参考链接

媒体文件idmediaIdstring

可以通过API获取参考链接

自定义样式customStyleobject

自定义样式,可参考微信小店文档

开启自定义插槽customContentboolean

开启自定义插槽。开启后可自行控制卡片内容。

示例:false

跳转页面openPagestring

设置点击打开的页面(同时开启 custom-content 属性后生效)。

logo位置logoPositionstring

设置小店标识的位置,不允许隐藏(同时开启 custom-content 属性后生效)。

示例:"bottom-left"

Events

组件暴露的事件,可以监听组件的事件来触发一些外部的动作

事件名
事件code
事件出参 event.detail
适用情况
说明
跳转小店成功的回调bindentersuccess小程序

-

跳转小店失败的回调bindentererrorobject
  • code: string错误码
  • message: string错误信息
小程序

-