From 403d3b929d1e871a769080e7704ca65cb17a9589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B4=E7=85=AE=E7=89=9B=E8=82=89?= Date: Mon, 18 Dec 2023 09:44:50 +0800 Subject: [PATCH] Shipping documentation (#2775) * Create shipping.md * Update sidebar.js --- docs/src/5.x/mini-program/shipping.md | 117 ++++++++++++++++++++++++++ docs/src/5.x/sidebar.js | 6 +- 2 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 docs/src/5.x/mini-program/shipping.md diff --git a/docs/src/5.x/mini-program/shipping.md b/docs/src/5.x/mini-program/shipping.md new file mode 100644 index 000000000..679ec4f10 --- /dev/null +++ b/docs/src/5.x/mini-program/shipping.md @@ -0,0 +1,117 @@ +# 小程序发货信息管理 + +> 微信文档 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html + + +## 发货信息录入接口 + +```php +$data = [ + 'order_key' => [ + 'order_number_type' => 1, + 'mchid' => '', + 'out_trade_no' => '' + ], + 'logistics_type' => 4, + 'delivery_mode' => 1, + 'shipping_list' => [ + 'tracking_no' => '323244567777', + 'express_company' => 'DHL', + 'item_desc' => '微信红包抱枕*1个', + 'contact' => [ + 'consignor_contact' => '189****1234', + 'receiver_contact' => '189****1234' + ], + ], + 'upload_time' => '2022-12-15T13:29:35.120+08:00', + 'payer' => [ + 'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o' + ] +]; + +$app->shipping->uploadShippingInfo($data); +``` + +## 发货信息合单录入接口 + +```php + $data = [ + 'order_key' => [ + 'order_number_type' => 1, + 'mchid' => '', + 'out_trade_no' => '' + ], + 'sub_orders' => [ + 'order_key' => [ + 'order_number_type' => 1, + 'transaction_id' => '', + 'mchid' => '', + 'out_trade_no' => '' + ], + 'logistics_type' => 4, + 'delivery_mode' => 1, + 'shipping_list' => [ + 'tracking_no' => '323244567777', + 'express_company' => 'DHL', + 'item_desc' => '微信红包抱枕*1个', + 'contact' => [ + 'consignor_contact' => '189****1234', + 'receiver_contact' => '189****1234' + ], + ], + ], + 'upload_time' => '2022-12-15T13:29:35.120+08:00', + 'payer' => [ + 'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o' + ] +]; + +$app->shipping->uploadCombineShippingInfo($data); +``` + +## 查询订单发货状态 + +```php +$data = $app->shipping->getOrder([ + 'transaction_id' => 'xxx' +]); +``` + +## 查询订单列表 + +```php +$data = $app->shipping->getOrderList(); +``` + +## 确认收货提醒接口 + +```php +$data = [ + 'transaction_id' => '42000020212023112332159214xx', + 'received_time' => '' +]; + +$app->shipping->notifyConfirmReceive($data); +``` + +## 消息跳转路径设置接口 + +```php +$data = [ + 'path' => 'pages/goods/order_detail?id=xxxx', +]; + +$app->shipping->setMsgJumpPath($data); +``` + +## 查询小程序是否已开通发货信息管理服务 + +```php +$app->shipping->isTradeManaged(); +``` + +## 查询小程序是否已完成交易结算管理确认 + +```php +$app->shipping->isTradeCompleted(); +``` diff --git a/docs/src/5.x/sidebar.js b/docs/src/5.x/sidebar.js index ceca937d6..127dd7af5 100644 --- a/docs/src/5.x/sidebar.js +++ b/docs/src/5.x/sidebar.js @@ -145,7 +145,11 @@ exports = module.exports = [ text: 'Short Link', link: '/5.x/mini-program/short_link.html' }, - { text: '手机号', link: '/5.x/mini-program/phone_number.html' } + { text: '手机号', link: '/5.x/mini-program/phone_number.html' }, + { + text: '小程序发货信息管理服务', + link: '/5.x/mini-program/shipping.html' + } ] }, {