其余文件

This commit is contained in:
2026-04-14 17:46:22 +08:00
parent 294b68fe37
commit 3691f4db22
1343 changed files with 189847 additions and 0 deletions

View File

@ -0,0 +1,50 @@
<?php
namespace Expressage;
class Expressage
{
protected $app;
protected $key;
protected $debug;
protected $logistics_info;
public function __construct($app, $key, $debug = false)
{
$this->app = $app;
$this->key = $key;
$this->debug = $debug;
}
/**
* 格式化
* @return bool
*/
public function logisticsFormat()
{
if (empty($this->logistics_info)) {
return false;
}
$info = $this->logistics_info;
foreach ($info as $k => $v) {
$info[$k] = array_values($v);
}
return $info;
}
/**
* 电商Sign签名生成
* @param data 内容
* @param appkey Appkey
* @return DataSign签名
*/
protected function encrypt($data, $appkey)
{
return urlencode(base64_encode(md5($data . $appkey)));
}
public function getError()
{
return $this->error;
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace expressage;
use Requests;
class Kd100 extends Expressage
{
public function logistics($code, $number, $extra = "")
{
$request_data = '{"com":"' . $code . '","num":"' . $number . '","from":"","phone":"' . $extra . '","to":"","resultv2":"0","show":"0","order":"desc"}';
$datas = array(
'customer' => $this->app,
'sign' => strtoupper(md5($request_data . $this->key . $this->app)),
'param' => $request_data,
);
$params = "";
foreach ($datas as $k => $v) {
$params .= "$k=" . urlencode($v) . "&";
}
$params = substr($params, 0, -1);
$result = Requests::get('http://poll.kuaidi100.com/poll/query.do?' . $params);
$result = json_decode($result->body, true);
if (isset($result['data'])) {
$this->logistics_info = $result['data'];
$this->logistics_info;
}
$this->error = json_encode($result, JSON_UNESCAPED_UNICODE);
return false;
}
}

View File

@ -0,0 +1,43 @@
<?php
namespace expressage;
use app\common\server\ConfigServer;
use Requests;
class Kdniao extends Expressage
{
public function logistics($code, $number, $extra = "")
{
//$customer,付费的模式下,顺丰快递需要快递单号对应的寄件人或收件人的手机号后四位数字
$request_daata = "{'OrderCode':'','ShipperCode':'$code','LogisticCode':'$number','CustomerName':'$extra'}";
$datas = array(
'EBusinessID' => $this->app,
'RequestType' => '1002',
'RequestData' => urlencode($request_daata),
'DataType' => '2',
);
//快递鸟请求接口类型
$request_type = ConfigServer::get('kdniao', 'type', 'free');
$search_url = 'https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx';
//为付费类型时调整请求指令
if ($request_type == 'pay') {
$datas['RequestType'] = '8001';
}
$datas['DataSign'] = self::encrypt($request_daata, $this->key);
$result = Requests::post($search_url,[], $datas);
$result = json_decode($result->body,true);
if(isset($result['Traces'])){
$this->logistics_info = $result['Traces'];
}
$this->error = json_encode($result, JSON_UNESCAPED_UNICODE);
return false;
}
}

View File

@ -0,0 +1,43 @@
const ci = require('miniprogram-ci')
let data = process.argv[2];
data = JSON.parse(data);
if(data.length == 0) {
console.log('参数缺失');
process.exit(-1);
}
let appid = data.appid;
let privateKeyPath = `../extend/miniprogram-ci/private.${appid}.key`;
let desc = data.desc;
let version = data.version;
async function upload() {
// 注意: new ci.Project 调用时,请确保项目代码已经是完整的,避免编译过程出现找不到文件的报错。
const project = new ci.Project({
appid: appid,
type: 'miniProgram',
projectPath: './mp-weixin',
privateKeyPath: privateKeyPath,
ignores: ['node_modules/**/*'],
})
try {
const result = await ci.upload({
project,
version,
desc,
setting: {
es6: false,//对应于微信开发者工具的 "es6 转 es5"
es7: false,//对应于微信开发者工具的 "增强编译"
minify: true,//上传时压缩所有代码,对应于微信开发者工具的 "上传时压缩代码"
},
onProgressUpdate: console.log,
})
} catch (err) {
}finally {
process.exit(0);
}
}
upload()