Socket
Socket
Sign inDemoInstall

wx-channel-shop-printer

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wx-channel-shop-printer

视频号小店 · 电子面单打印,简单封装 API。


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
9.90 kB
Created
Weekly downloads
 

Readme

Source

wx-channel-shop-printer

视频号小店 · 电子面单打印,简单封装 API。

https://developers.weixin.qq.com/doc/channels/API/ewaybill/connect_printer.html

使用

import { WxChannelShopPrinter } from "wx-channel-shop-printer";

const printer = new WxChannelShopPrinter();

获取打印机列表

const list = await printer.getPrinterList();
/**
 * [{
 *   "name": "_KM_202_NEW_",
 *   "displayName": "KM-202(NEW)",
 *   "status": 3
 * }]
 */

获取打印组件版本号

获取打印组件的版本号。

const info = await printer.getAppInfo();
/**
 * {
 *   "version": "1.3.4"
 * }
 */

打印面单

发送指令给打印组件,打印对应的面单

注意:

const tasks = await printer.print({
  version: "2.0", // 必传
  taskList: [
    {
      printInfo: "", // String, [获取打印报文]接口返回的 print_info
      printNum: {
        curNum: 1, // 打印计数-当前张数
        sumNum: 2, // 打印计数-总张数
      },
    },
  ],
  printer: "_KM_202_NEW_", // 选中的打印机,printer.name
});
/**
 * [{
 *   "taskID": "1234",
 *   "success": true,
 *   "failureReason": ""
 * }]
 */

FAQs

Last updated on 19 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc