Giter Club home page Giter Club logo

wx-miniprogram-ble-print-express's Introduction

IMG_8185.PNG

目前测试大部分蓝牙热敏打印机都能使用,打印速度快,能自定义打印速度,主要用了分包发送解决了Ble低功耗问题,本人测试的是一部汉印的N41BT,看懂代码四通一大的快递单都能打印。

最新开发一个小程序 用来做直播虚拟打单,不是用来做非法事情,是用来做直播热度加持的,就是让直播的时候不断有订单进来,打印机可以不断打单。 本来想用其他小程序,结果发现搜了一圈,没有实际订单啥小程序都用不了,只能测试打印,还不能自定义快递单内容,所以程序员出身的我,决定自己开发一个。 IMG_8192.PNG

IMG_8193.PNG

IMG_8195.PNG

自定义呢就是自己加几个输入框,因为没时间就懒得搞了,不过核心代码在这里,自己改改就行

上面是绘制快递单核心代码

连接蓝牙发现蓝牙代码如下

wx.createBLEConnection({
      deviceId: e.currentTarget.dataset.title,
      success: function (res) {
        console.log(res)
        app.BLEInformation.deviceId = e.currentTarget.dataset.title
        that.getSeviceId()
      }, fail: function (e) {
        wx.showModal({
          title: '提示',
          content: '连接失败',
          showCancel: false
        })
        console.log(e)
        wx.hideLoading()
      }, complete: function (e) {
        console.log(e)
      }
    })

连接代码大同小异就不贴了

wx-miniprogram-ble-print-express's People

Contributors

19931121bigman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.