设置服务顺序

规范

如需影响给定商家的服务显示顺序,请在服务 Feed 的每个 Service 上设置 ranking_hint.score
// Ranking hints for a service.
message ServiceRankingHint {
  // Arbitrary partner or merchant assigned rank for this service.
  //
  // Services with a higher score will be shown more prominently (e.g. shown
  // higher in lists). Note that other factors may also influence ranking, such
  // as price, availability, user history, etc.
  //
  // Optional. Must be non-negative if set.
  optional float score = 1;
}
如果显示了多项服务(例如:紧接着显示可供用户选择的所有服务的“预订”按钮后面的页面),它将使用 Service.ranking_hint.score 作为一项服务信号。得分越高,网页上显示的 Service 分数就越高。

示例

商家有 3 种服务:“理发”、“染色”和“头皮按摩和理发”,首选顺序如下:
  1. 理发
  2. 头皮按摩和理发
  3. 涂色
服务 Feed 可以按以下方式指定:

服务

{
  "service": [
    {
      "price": {
        "currency_code": "USD",
        "price_micros": 20000000
      },
      "service_id": "haircut",
      "prepayment_type": "NOT_SUPPORTED",
      "merchant_id": "beauty-1",
      "localized_service_name": {
        "value": "Haircut",
        "localized_value": [
          {
            "locale": "en",
            "value": "Haircut"
          }
        ]
      },
      "localized_description": {
        "value": "Get a haircut.",
        "localized_value": [
          {
            "locale": "en",
            "value": "Get a haircut."
          }
        ]
      },
      "ranking_hint": {
        "score": 30.0
      }
    },
    {
      "localized_service_name": {
        "value": "Coloring",
        "localized_value": [
          {
            "locale": "en",
            "value": "Coloring"
          }
        ]
      },
      "price": {
        "currency_code": "USD",
        "price_micros": 40000000
      },
      "service_id": "haircoloring",
      "prepayment_type": "NOT_SUPPORTED",
      "merchant_id": "beauty-1",
      "localized_description": {
        "value": "Get your hair dyed.",
        "localized_value": [
          {
            "locale": "en",
            "value": "Get your hair dyed."
          }
        ]
      },
      "ranking_hint": {
        "score": 10.0
      }
    },
    {
      "localized_service_name": {
        "value": "Scalp massage and Haircut",
        "localized_value": [
          {
            "locale": "en",
            "value": "Scalp massage and Haircut"
          }
        ]
      },
      "price": {
        "currency_code": "USD",
        "price_micros": 30000000
      },
      "service_id": "scalpmassage",
      "prepayment_type": "NOT_SUPPORTED",
      "merchant_id": "beauty-1",
      "localized_description": {
        "value": "Get a shampoo and scalp massage followed by a haircut.",
        "localized_value": [
          {
            "locale": "en",
            "value": "Get a shampoo and scalp massage followed by a haircut."
          }
        ]
      },
      "ranking_hint": {
        "score": 20.0
      }
    }
  ]
}
上面指定的排序(不包含其他信号)会导致:

服务顺序:理发、头皮按摩、理发、染色。