1.1.18 • Published 4 years ago

@unovo/blu-opendoor v1.1.18

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

注意在使用科技侠服务的时候需要在小程序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);
      }
    });
1.1.18

4 years ago

1.1.17

5 years ago

1.1.16

5 years ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.0

5 years ago

1.1.0-0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago