# Mini Program Transaction Guarantee Badge Display Component Integration Guide

# I. Function Description

The Mini Program Transaction Guarantee Badge Display Component is available to Merchants who have obtained the transaction guarantee badge. They can incorporate this component into their Mini Program product detail pages to demonstrate official recognition of their accounts, thereby enhancing users’ trust in transactions. For a detailed illustration of custom scenarios, please refer to the figure below (the component shown is only the boxed area in the image; no additional information is displayed).

The Mini Program Transaction Guarantee Badge serves as certification for high-quality Mini Programs that meet transaction health standards. For requirements and application procedures, please refer to the document „Transaction Guarantee Badge Product Description“. You can apply for the transaction guarantee badge on the „MP Backend – Features – Transaction Guarantee – Transaction Guarantee Badge“ page. See the figure below for details.

# 1. Integration Steps

  1. Integration Method: Add configuration to app.json
    "plugins": {
      "shoppingGuarantee": {
        "version": "latest",
        "provider": "wxd65104595293601e"
      }
    },

Ensure the version field is set to 'latest' to ensure proper functionality.

  1. Using the Component: Add component configuration in the page file, such as test.json:
{
  "usingComponents": {
    "guarantee-bar": "plugin://shoppingGuarantee/guarantee-bar"
  }
}
  1. In the Corresponding Page WXML: Use the component in test.wxml:
  <guarantee-bar pageType="{{pageType}}" goodsName="{{goodsName}}" goodsImg="{{goodsImg}}" align="{{align}}" spaceSize="{{spaceSize}}" goodsPrice="{{goodsPrice}}" bannerStyle="{{bannerStyle}}"  />

# Special Note (for Mini Programs Developed by Third-Party Service Providers):

If the Mini Program was developed by a third-party service provider, additional configuration must be added to ext.json to ensure proper functionality:

{"recompile": true}

# 2. Corresponding Configurations

Attribute Type Default Value Required Description
pageType string goods_detail No Page type (enumerated value). Details are as follows:
Valid Values Meaning
goods_detail Product detail page type
goodsName string - Yes Product name
goodsImg string - Yes Product image
goodsPrice string - Yes Product price (specific price or price range)
align string - Yes Cell alignment method (enumerated value). Details are as follows:
Valid Values Description
between Aligns text between the left and right margins. The spaceSize cannot be modified; this value is used by default.
left Aligns text to the left. When left alignment is selected, the spaceSize can be adjusted (must be greater than or equal to 12).
spaceSize string 12 No The left alignment spacing when left alignment is selected (effective only for left alignment).
bannerStyle object - Yes Attribute corresponding to the right-side text style (enumerated value, string type). Valid values are as follows:
Valid values for bannerStyle.fontSize Description
mini The corresponding font size is 14.
normal The corresponding font size is 15.
middle The corresponding font size is 16.
large The corresponding font size is 17.
Valid values for bannerStyle.fontOpacity Description
gray 灰色
dark 黑色

Example: test.wxml

  <guarantee-bar pageType="goods_detail" goodsName="{{goodsName}}" goodsImg="{{goodsImg}}" goodsPrice="{{goodsPrice}}" align="{{align}}" spaceSize="{{spaceSize}}" bannerStyle="{{bannerStyle}}" />

test.js

Page({
  data: {
    align: 'between',
    spaceSize: 12,
    bannerStyle: {
      fontSize: 'normal',
      fontOpacity: 'gray',
    },
    pageType: 'goods_detail',
    goodsName: 'WeChat Bubble Dog Zero Wallet',
    goodsImg: 'https://xxxxx/',
    goodsPrice: '28 yuan'
  },
});