@unovo/blu-opendoor
小程序蓝牙开门组件
Last updated 10 months ago by yangtuan2010 .
ISC · Original npm · Tarball · package.json
$ cnpm install @unovo/blu-opendoor 
SYNC missed versions from official npm registry.

注意在使用科技侠服务的时候需要在小程序app.js中配蓝牙插件并在小程序后台加入此插件, 榉树则不需要

// App配置
  config = {
   ....其他
    'plugins': {
      // 蓝牙门锁插件
      'ScienerPlugin': {
        'version': '1.1.3',
        'provider': 'wx3107f0a218053d99'
      }
    }
  }

蓝牙开门服务,目前包含榉树和科技侠开门

这个内容已经发布到npm上,需要修改代码可拉取本代码,修改src中内容后npm run build 出lib目录,lib目录才是真正发布到npm的目录

发布到npm的步骤

  • npm run build 编辑es6文件到es5模式

  • npm version ? 可以使用以下这些命令

  • major: 主版本号
  • premajor: 预备主版本
  • minor: 次版本号
  • preminor: 预备次版本
  • patch: 修订号
  • prepatch: 预备修订版
  • prerelease: 预发布版本
  • npm adduser 登录npm 接下来会以问答的形式向你了解你的用户名、密码以及公开的邮箱,之后输入

  • npm publish 进行发布

如何使用

  • 安装 npm install @unovo/blu-opendoor --save

  • 引入 import { jushuService, kjxService } from '@unovo/blu-opendoor';

  • 使用榉树服务

  const jushuBluService = new jushuService();
    // 参数1:指令,参数2:mac, 参数3:回调
    jushuBluService.begin(cmd, key.lockMac, (result) => {
      this.openDoorBack({
        success: result.errorCode, // 是否开门成功,1:成功,0:失败,
        errMsg: result.errMsg,
        electricQuantity: result.electricQuantity
      });
      if (result.errorCode == 1) {
        this.openDoorSuccess(result);
      } else {
        this.openDoorFail(result);
      }
    });
  • 使用科技侠服务
  const kjxBluService = new kjxService();
    // 参数1:门锁信息,参数2:回调
    kjxBluService.begin(key, (result) => {
      if (result.success == 1 || result.errorCode == 0) {
        result.success = 1;
        this.openDoorBack(result);
        this.openDoorSuccess(result);
      } else {
        result.success = 0;
        this.openDoorBack(result);
        this.openDoorFail(result);
      }
    });

Current Tags

  • 1.1.18                                ...           latest (10 months ago)

24 Versions

  • 1.1.18                                ...           10 months ago
  • 1.1.17                                ...           a year ago
  • 1.1.16                                ...           a year ago
  • 1.1.15                                ...           a year ago
  • 1.1.14                                ...           a year ago
  • 1.1.13                                ...           a year ago
  • 1.1.12                                ...           a year ago
  • 1.1.11                                ...           a year ago
  • 1.1.10                                ...           a year ago
  • 1.1.9                                ...           a year ago
  • 1.1.8                                ...           a year ago
  • 1.1.7                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.1.0-0                                ...           a year ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 2
Last Month 3
Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |