发布uniapp1.0.4+5版本

This commit is contained in:
范鹏 2025-01-07 18:11:07 +08:00
parent 40828332d2
commit ff194611a9
7 changed files with 130 additions and 16 deletions

View File

@ -44,16 +44,14 @@
``` ```
## 调试方法 ## 调试方法
1. 在测试项目中执行以下命令将星云SDK项目作为子项目添加到测试项目中直接调用对应平台的index.js文件中的方法 1. 执行想要调试的平台命令
```shell
npm run web-build
npm run uni-build
``` ```
git subtree add --prefix=starCloud git@code.star-lock.cn:StarlockTeam/starcloud-sdk-uniapp.git master 2. 将项目与调试项目放在同级目录下在调试项目中执行npm命令
``` ```shell
2. 更新子项目 npm install ../[项目名称]
```
git subtree pull --prefix=starCloud git@code.star-lock.cn:StarlockTeam/starcloud-sdk-uniapp.git master
```
3. 推送子项目
```
git subtree push --prefix=starCloud git@code.star-lock.cn:StarlockTeam/starcloud-sdk-uniapp.git master
``` ```
3. 即可在调试项目中用调用正式版npm包方法进行调试

View File

@ -4,6 +4,7 @@ import {
convertWeekdaysToNumber, convertWeekdaysToNumber,
createPackageEnd, createPackageEnd,
md5Encrypt, md5Encrypt,
removeTrailingZeros,
timestampToArray, timestampToArray,
uint8ArrayToString uint8ArrayToString
} from './format' } from './format'
@ -787,9 +788,9 @@ export async function parsingCharacteristicValue(binaryData) {
176 + decrypted[174] + decrypted[175 + decrypted[174]] 176 + decrypted[174] + decrypted[175 + decrypted[174]]
) )
), ),
featureSettingParams: Array.from( featureSettingParams: removeTrailingZeros(Array.from(
decrypted.slice(176 + decrypted[174] + decrypted[175 + decrypted[174]]) decrypted.slice(176 + decrypted[174] + decrypted[175 + decrypted[174]])
), )),
lockConfig lockConfig
}) })
console.log('获取锁状态成功', this.lockInfo.lockConfig) console.log('获取锁状态成功', this.lockInfo.lockConfig)

4
env.js
View File

@ -1,7 +1,7 @@
// uni版本号 // uni版本号
export const uniVersion = '1.0.3' export const uniVersion = '1.0.4'
// uni构建号 // uni构建号
export const uniBuildNumber = 4 export const uniBuildNumber = 5
// web版本号 // web版本号
export const webVersion = '1.0.1' export const webVersion = '1.0.1'

View File

@ -77,3 +77,14 @@ export function uint8ArrayToString(uint8Array) {
} }
return str return str
} }
// 去除特征值尾部0
export function removeTrailingZeros(data) {
const featureCount = data[0]
let currentIndex = 1
for (let i = 0; i < featureCount; i++) {
const length = data[currentIndex + 1]
currentIndex += 2 + length
}
return data.slice(0, currentIndex)
}

View File

@ -1,8 +1,8 @@
{ {
"name": "star-cloud-uni", "name": "star-cloud-uni",
"version": "1.0.3", "version": "1.0.4",
"type": "module", "type": "module",
"main": "./web/index.js", "main": "./uni/index.js",
"author": "zzc059", "author": "zzc059",
"scripts": { "scripts": {
"web-build": "node obfuscate-web.js", "web-build": "node obfuscate-web.js",

70
uni.md
View File

@ -607,3 +607,73 @@ removeBadLock(params)
**返回** **返回**
# 电表
## 更新电表信息
**调用方法**
```javascript
import { refreshElecInfo } from 'star-cloud-web'
refreshElecInfo(params)
```
**入参**
| 参数名称 | 数据类型 | 必须 | 描述 |
|--------|--------|----|-------|
| uid | Number | N | 用户uid |
| elecId | Number | Y | 电表ID |
**返回**
# 冷水表
## 更新冷水表信息
**调用方法**
```javascript
import { refreshColdWaterInfo } from 'star-cloud-web'
refreshColdWaterInfo(params)
```
**入参**
| 参数名称 | 数据类型 | 必须 | 描述 |
|---------|--------|----|-------|
| uid | Number | N | 用户uid |
| waterId | Number | Y | 冷水表ID |
**返回**
# 热水表
## 更新热水表信息
**调用方法**
```javascript
import { refreshHotWaterInfo } from 'star-cloud-web'
refreshHotWaterInfo(params)
```
**入参**
| 参数名称 | 数据类型 | 必须 | 描述 |
|---------|--------|----|-------|
| uid | Number | N | 用户uid |
| waterId | Number | Y | 热水表ID |
**返回**

View File

@ -228,3 +228,37 @@ export const getServerTime = async () => {
export const getLockSupportFeatures = async params => { export const getLockSupportFeatures = async params => {
return await starCloudInstance.getLockSupportFeatures(params) return await starCloudInstance.getLockSupportFeatures(params)
} }
/**
* 电表-刷新电表信息
* @param params
* @param {Number} [params.uid] 用户ID
* @param {Number} params.elecId 用户ID
* @returns Result
*/
export const refreshElecInfo = async params => {
return await starCloudInstance.refreshElecInfo(params)
}
/**
* 冷水表-刷新水表信息
* @param params
* @param {Number} [params.uid] 用户ID
* @param {Number} params.waterId 冷水表ID
* @returns Result
*/
export const refreshColdWaterInfo = async params => {
return await starCloudInstance.refreshColdWaterInfo(params)
}
/**
* 热水表-刷新水表信息
* @param params
* @param {Number} [params.uid] 用户ID
* @param {Number} params.waterId 热水表ID
* @returns Result
*/
export const refreshHotWaterInfo = async params => {
return await starCloudInstance.refreshHotWaterInfo(params)
}