rabin před 1 rokem
rodič
revize
9801d604de
3 změnil soubory, kde provedl 105 přidání a 0 odebrání
  1. 57 0
      config/wechat.php
  2. 1 0
      src/Code.php
  3. 47 0
      src/Ship.php

+ 57 - 0
config/wechat.php

@@ -168,4 +168,61 @@ $config['code'] = array
 	),
 );
 
+$config['ship'] = array
+(
+	'name' => '发货信息录入',
+	'method' => 'post',
+	'json' => true,
+	'url' => 'https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?',
+	'param' => array
+	(
+		'access_token' => 'token',
+		'order_key' => 'order_key',
+		'logistics_type' => '1',
+		'delivery_mode' => 'UNIFIED_DELIVERY',
+	),
+	//针对一些返回的名称,做转换
+	'response' => array
+	(
+		
+	),
+);
+
+$config['ship_confirm'] = array
+(
+	'name' => '确认收货',
+	'method' => 'post',
+	'json' => true,
+	'url' => 'https://api.weixin.qq.com/wxa/sec/order/notify_confirm_receive?',
+	'param' => array
+	(
+		'access_token' => 'token',
+		'merchant_id' => 'merchant_id',
+		'merchant_trade_no' => 'merchant_trade_no',
+		'received_time' => 'received_time',
+	),
+	//针对一些返回的名称,做转换
+	'response' => array
+	(
+		
+	),
+);
+
+$config['delivery'] = array
+(
+	'name' => '获取物流',
+	'method' => 'post',
+	'json' => true,
+	'url' => 'https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/get_delivery_list?',
+	'param' => array
+	(
+		'access_token' => 'token',
+	),
+	//针对一些返回的名称,做转换
+	'response' => array
+	(
+		
+	),
+);
+
 return $config;

+ 1 - 0
src/Code.php

@@ -19,6 +19,7 @@ class Code
         $filename = Dever::input('filename');
         $param['width'] = Dever::input('width', 200);
         $param['is_hyaline'] = false;
+        #正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
         $param['env_version'] = 'release';
         $update = Dever::input('update', 2);
 

+ 47 - 0
src/Ship.php

@@ -0,0 +1,47 @@
+<?php
+/*
+|--------------------------------------------------------------------------
+| 发货 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E4%B8%80%E3%80%81%E5%8F%91%E8%B4%A7%E4%BF%A1%E6%81%AF%E5%BD%95%E5%85%A5%E6%8E%A5%E5%8F%A3
+|--------------------------------------------------------------------------
+*/
+namespace Wechat_applet\Src;
+
+use Dever;
+use Token\Lib\Wechat;
+use Token\Lib\Core;
+
+class Ship
+{
+	# 获取物流
+	public function delivery($method, $project_id = 1)
+	{
+		return Core::run($project_id, 'delivery', '', 'ship.deliveryAction', 'wechat_applet', $method, true);
+	}
+
+	public function deliveryAction($project_id, $data, $method = false)
+	{
+		Dever::load($method, $data);
+	}
+
+	# 发货信息录入
+	public function add($callback, $project_id = 1)
+	{
+		return Core::run($project_id, 'ship', 'ship.addParam', '', 'wechat_applet', $callback, true);
+	}
+
+	public function addParam($callback)
+	{
+		return $callback();
+	}
+
+	# 发货信息确认
+	public function act($callback, $project_id = 1)
+	{
+		return Core::run($project_id, 'ship_confirm', 'ship.actParam', '', 'wechat_applet', $callback, true);
+	}
+
+	public function actParam($callback)
+	{
+		return $callback();
+	}
+}