Skip to content

接入示例 ​

本页有一个在线演示,可以体验用户的购买流程;还有一段可以直接复制的接入代码。

在线演示 ​

下面是一个模拟的商品页,点击里面的购买按钮,就能看到用户实际会经历的流程:

📱 Live Demo - Click button to experience purchase flow

The following example shows the complete integration effect of RAKUFUN SDK

🎧 Authentic Japanese Products · International Shipping

RAKUFUN provides safe and reliable Japanese product purchasing services

Sony WH-1000XM5 Wireless Headphones

Sony WH-1000XM5 Wireless Noise Canceling Headphones

54,800円62,800円

🌟 Product Features

  • Industry-leading active noise cancellation technology
  • 30-hour ultra-long battery life
  • Quick Attention mode for instant environmental awareness
  • Multipoint connection, connect two devices simultaneously
  • Authentic Japanese import with manufacturer warranty

演示里的购买按钮是页面自己做的,用的是 自定义模式。下面的代码则是默认模式,用的是 SDK 自带的底部面板。

接入代码 ​

下面是默认模式(页面底部自动显示购买面板)的接入代码。放进您的商品页,再把商品信息换成真实数据即可:

html
<!DOCTYPE html>
<html lang="zh-CN">
<body>
    <!-- 您的商品页内容 -->

    <script src="https://sdk.rakufun.com/rakufun-universal.min.js"></script>
    <script>
        // 设置当前商品的信息,用户点击底部面板里的购买按钮时会用到
        rakufun.setUIProductData({
            url: window.location.href,
            title: "Sony WH-1000XM5 Wireless Headphones",
            price: "54800",
            description: "Industry-leading noise cancellation technology, 30-hour battery life.",
            images: ["https://images.unsplash.com/photo-1583394838336-acd977736f90?w=800"],
            condition: "New",
            brand: "Sony",
            minQuantity: "1",
            maxStock: "50",
            shippingInfo: "0",
            deliveryTime: "2-4 days",
            precautions: "1-year manufacturer warranty included.",
            productParameters: "Weight: 250g, Battery Life: 30 hours"
        });
    </script>
</body>
</html>

接入后的效果:

  • 非日本 IP 访问时,页面底部会出现 RAKUFUN 购买面板(日本 IP 下默认不显示)
  • 用户点击面板里的购买按钮,会在新标签页打开 RAKUFUN 商品页,并带上上面设置的商品信息

接下来 ​


有疑问?联系我们:service@rakufun.com

基于 MIT 许可证发布