From da39128b21dda052108ab145513784e861b5c5be Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Mon, 16 Jun 2025 16:07:14 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20uts=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 32 ++ manifest.json | 203 ++++++------ package-lock.json | 299 +++++++++++++++++- package.json | 9 +- pages.json | 7 + pages/main/lockDetail.vue | 11 +- pages/p2p/appPlayer.vue | 67 ++++ pages/setting/videoSlot.vue | 7 +- stores/basic.js | 5 + tsconfig.json | 16 + uni_modules/xhj-tencent-xp2p/changelog.md | 0 uni_modules/xhj-tencent-xp2p/package.json | 72 +++++ uni_modules/xhj-tencent-xp2p/readme.md | 7 + .../utssdk/app-android/config.json | 4 + .../utssdk/app-android/index.uts | 79 +++++ .../xhj-tencent-xp2p/utssdk/interface.uts | 17 + 16 files changed, 725 insertions(+), 110 deletions(-) create mode 100644 pages/p2p/appPlayer.vue create mode 100644 tsconfig.json create mode 100644 uni_modules/xhj-tencent-xp2p/changelog.md create mode 100644 uni_modules/xhj-tencent-xp2p/package.json create mode 100644 uni_modules/xhj-tencent-xp2p/readme.md create mode 100644 uni_modules/xhj-tencent-xp2p/utssdk/app-android/config.json create mode 100644 uni_modules/xhj-tencent-xp2p/utssdk/app-android/index.uts create mode 100644 uni_modules/xhj-tencent-xp2p/utssdk/interface.uts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 457d7c5..37c8fbb 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -30,6 +30,38 @@ module.exports = { 'plugin:prettier/recommended' ], ignorePatterns: ['utils/log.js', 'unpackage/**/*'], + // 针对不同文件类型使用不同配置 + overrides: [ + { + files: ['**/*.uts'], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + extends: ['plugin:@typescript-eslint/recommended'], + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, + globals: { + IUniError: 'readonly', + UniError: 'readonly', + uni: 'readonly', + getApp: 'readonly', + wx: 'readonly', + getCurrentPages: 'readonly', + requirePlugin: 'readonly', + plus: 'readonly' + }, + rules: { + 'func-names': 'off', + '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-explicit-any': 'warn', + eqeqeq: 'warn', + 'no-undef': 'off', + 'prettier/prettier': 'off', + 'import/no-unresolved': 'off' // 禁用模块解析检查 + } + } + ], /** * "off" 或 0 ==> 关闭规则 * "warn" 或 1 ==> 打开的规则作为警告(不影响代码执行) diff --git a/manifest.json b/manifest.json index 503c8fa..3d45751 100644 --- a/manifest.json +++ b/manifest.json @@ -1,104 +1,111 @@ { - "name": "星星锁Lite", - "appid": "__UNI__933D519", - "description": "", - "versionName": "1.3.0", - "versionCode": "37", - "mp-weixin": { - "appid": "wx9829a39e65550757", - "setting": { - "urlCheck": true, - "minified": true - }, - "permission": { - "scope.bluetooth": { - "desc": "蓝牙将用于控制和管理您的智能门锁" - } - }, - "requiredPrivateInfos": ["getLocation"], - "usingComponents": true, - "lazyCodeLoading": "requiredComponents", - "optimization": { - "subPackages": true - }, - "plugins": { - "wmpf-voip": { - "version": "latest", - "provider": "wxf830863afde621eb", - "genericsImplementation": { - "call-page-plugin": { - "custombox": "pages/main/customBox" - } - } - } - } - }, - "vueVersion": "3", - "app-plus": { - "distribute": { - "icons": { - "android": { - "hdpi": "unpackage/res/icons/72x72.png", - "xhdpi": "unpackage/res/icons/96x96.png", - "xxhdpi": "unpackage/res/icons/144x144.png", - "xxxhdpi": "unpackage/res/icons/192x192.png" + "name" : "星星锁Lite", + "appid" : "__UNI__933D519", + "description" : "", + "versionName" : "1.3.0", + "versionCode" : "37", + "mp-weixin" : { + "appid" : "wx9829a39e65550757", + "setting" : { + "urlCheck" : true, + "minified" : true }, - "ios": { - "appstore": "unpackage/res/icons/1024x1024.png", - "ipad": { - "app": "unpackage/res/icons/76x76.png", - "app@2x": "unpackage/res/icons/152x152.png", - "notification": "unpackage/res/icons/20x20.png", - "notification@2x": "unpackage/res/icons/40x40.png", - "proapp@2x": "unpackage/res/icons/167x167.png", - "settings": "unpackage/res/icons/29x29.png", - "settings@2x": "unpackage/res/icons/58x58.png", - "spotlight": "unpackage/res/icons/40x40.png", - "spotlight@2x": "unpackage/res/icons/80x80.png" - }, - "iphone": { - "app@2x": "unpackage/res/icons/120x120.png", - "app@3x": "unpackage/res/icons/180x180.png", - "notification@2x": "unpackage/res/icons/40x40.png", - "notification@3x": "unpackage/res/icons/60x60.png", - "settings@2x": "unpackage/res/icons/58x58.png", - "settings@3x": "unpackage/res/icons/87x87.png", - "spotlight@2x": "unpackage/res/icons/80x80.png", - "spotlight@3x": "unpackage/res/icons/120x120.png" - } + "permission" : { + "scope.bluetooth" : { + "desc" : "蓝牙将用于控制和管理您的智能门锁" + } + }, + "requiredPrivateInfos" : [ "getLocation" ], + "usingComponents" : true, + "lazyCodeLoading" : "requiredComponents", + "optimization" : { + "subPackages" : true + }, + "plugins" : { + "wmpf-voip" : { + "version" : "latest", + "provider" : "wxf830863afde621eb", + "genericsImplementation" : { + "call-page-plugin" : { + "custombox" : "pages/main/customBox" + } + } + } } - }, - "android": { - "permissions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - } }, - "modules": { - "Bluetooth": {} - }, - "splashscreen": { - "waiting": false + "vueVersion" : "3", + "app-plus" : { + "distribute" : { + "icons" : { + "android" : { + "hdpi" : "unpackage/res/icons/72x72.png", + "xhdpi" : "unpackage/res/icons/96x96.png", + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + }, + "ios" : { + "appstore" : "unpackage/res/icons/1024x1024.png", + "ipad" : { + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "settings" : "unpackage/res/icons/29x29.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png" + }, + "iphone" : { + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "notification@3x" : "unpackage/res/icons/60x60.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png" + } + } + }, + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ios" : { + "dSYMs" : false + } + }, + "modules" : { + "Bluetooth" : {}, + "VideoPlayer" : {}, + "LivePusher" : {}, + "Camera" : {}, + "Record" : {} + }, + "splashscreen" : { + "waiting" : false + } } - } } diff --git a/package-lock.json b/package-lock.json index c5dbe72..52e2014 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,8 @@ "@iconify-json/material-symbols": "^1.2.22", "@iconify-json/solar": "^1.2.2", "@iconify/utils": "^2.3.0", + "@typescript-eslint/eslint-plugin": "^8.34.0", + "@typescript-eslint/parser": "^8.34.0", "@unocss/preset-icons": "^66.1.2", "commitizen": "^4.3.1", "crc": "^4.3.2", @@ -37,6 +39,7 @@ "stylelint-config-recess-order": "^6.0.0", "stylelint-config-recommended-scss": "^14.1.0", "stylelint-config-standard": "^37.0.0", + "typescript": "^5.8.3", "unocss": "^65.4.3", "unocss-preset-weapp": "^65.4.1", "vite-plugin-eslint": "^1.8.1" @@ -930,9 +933,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.5.1.tgz", - "integrity": "sha512-soEIOALTfTK6EjmKMMoLugwaP0rzkad90iIWd1hMO9ARkSAyjfMfkRRhLvD5qH7vvM0Cg72pieUfR6yh6XxC4w==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", + "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", "dev": true, "license": "MIT", "dependencies": { @@ -1639,6 +1642,276 @@ "undici-types": "~6.20.0" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.34.0.tgz", + "integrity": "sha512-QXwAlHlbcAwNlEEMKQS2RCgJsgXrTJdjXT08xEgbPFa2yYQgVjBymxP5DrfrE7X7iodSzd9qBUHUycdyVJTW1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.34.0", + "@typescript-eslint/type-utils": "8.34.0", + "@typescript-eslint/utils": "8.34.0", + "@typescript-eslint/visitor-keys": "8.34.0", + "graphemer": "^1.4.0", + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.34.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.34.0.tgz", + "integrity": "sha512-vxXJV1hVFx3IXz/oy2sICsJukaBrtDEQSBiV48/YIV5KWjX1dO+bcIr/kCPrW6weKXvsaGKFNlwH0v2eYdRRbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.34.0", + "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/typescript-estree": "8.34.0", + "@typescript-eslint/visitor-keys": "8.34.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.34.0.tgz", + "integrity": "sha512-iEgDALRf970/B2YExmtPMPF54NenZUf4xpL3wsCRx/lgjz6ul/l13R81ozP/ZNuXfnLCS+oPmG7JIxfdNYKELw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.34.0", + "@typescript-eslint/types": "^8.34.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.0.tgz", + "integrity": "sha512-9Ac0X8WiLykl0aj1oYQNcLZjHgBojT6cW68yAgZ19letYu+Hxd0rE0veI1XznSSst1X5lwnxhPbVdwjDRIomRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/visitor-keys": "8.34.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.34.0.tgz", + "integrity": "sha512-+W9VYHKFIzA5cBeooqQxqNriAP0QeQ7xTiDuIOr71hzgffm3EL2hxwWBIIj4GuofIbKxGNarpKqIq6Q6YrShOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.34.0.tgz", + "integrity": "sha512-n7zSmOcUVhcRYC75W2pnPpbO1iwhJY3NLoHEtbJwJSNlVAZuwqu05zY3f3s2SDWWDSo9FdN5szqc73DCtDObAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.34.0", + "@typescript-eslint/utils": "8.34.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.0.tgz", + "integrity": "sha512-9V24k/paICYPniajHfJ4cuAWETnt7Ssy+R0Rbcqo5sSFr3QEZ/8TSoUi9XeXVBGXCaLtwTOKSLGcInCAvyZeMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.0.tgz", + "integrity": "sha512-rOi4KZxI7E0+BMqG7emPSK1bB4RICCpF7QD3KCLXn9ZvWoESsOMlHyZPAHyG04ujVplPaHbmEvs34m+wjgtVtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.34.0", + "@typescript-eslint/tsconfig-utils": "8.34.0", + "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/visitor-keys": "8.34.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.0.tgz", + "integrity": "sha512-8L4tWatGchV9A1cKbjaavS6mwYwp39jql8xUmIIKJdm+qiaeHy5KMKlBrf30akXAWBzn2SqKsNOtSENWUwg7XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.34.0", + "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/typescript-estree": "8.34.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.0.tgz", + "integrity": "sha512-qHV7pW7E85A0x6qyrFn+O+q1k1p3tQCsqIZ1KZ5ESLXY57aTvUd3/a4rdPTeXisvhXn2VQG0VSKUqs8KHF2zcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.34.0", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", @@ -9164,6 +9437,19 @@ "node": ">=6" } }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -9299,12 +9585,11 @@ } }, "node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index e055ba6..a6b80ef 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "@iconify-json/material-symbols": "^1.2.22", "@iconify-json/solar": "^1.2.2", "@iconify/utils": "^2.3.0", + "@typescript-eslint/eslint-plugin": "^8.34.0", + "@typescript-eslint/parser": "^8.34.0", "@unocss/preset-icons": "^66.1.2", "commitizen": "^4.3.1", "crc": "^4.3.2", @@ -32,15 +34,16 @@ "stylelint-config-recess-order": "^6.0.0", "stylelint-config-recommended-scss": "^14.1.0", "stylelint-config-standard": "^37.0.0", + "typescript": "^5.8.3", "unocss": "^65.4.3", "unocss-preset-weapp": "^65.4.1", "vite-plugin-eslint": "^1.8.1" }, "scripts": { "prepare": "husky install", - "format": "prettier --write \"**/*.{js,jsx,ts,tsx,vue,json,css,scss}\"", - "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,vue,json,css,scss}\"", - "lint": "eslint --fix \"**/*.{js,jsx,ts,tsx,vue}\"", + "format": "prettier --write \"**/*.{js,jsx,ts,tsx,vue,uts,json,css,scss}\"", + "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,vue,uts,json,css,scss}\"", + "lint": "eslint --fix \"**/*.{js,jsx,ts,tsx,vue,uts}\"", "lint:style": "stylelint --fix \"**/*.{css,scss,vue}\"", "lint:all": "npm run format && npm run lint && npm run lint:style" } diff --git a/pages.json b/pages.json index fbf61bb..90331cf 100644 --- a/pages.json +++ b/pages.json @@ -38,6 +38,13 @@ "navigationBarTitleText": "门锁记录", "disableScroll": true } + }, + { + "path": "appPlayer", + "style": { + "navigationBarTitleText": "监控", + "disableScroll": true + } } ], "plugins": { diff --git a/pages/main/lockDetail.vue b/pages/main/lockDetail.vue index 2b85cb3..34406bb 100644 --- a/pages/main/lockDetail.vue +++ b/pages/main/lockDetail.vue @@ -175,7 +175,7 @@ { + // #ifdef MP + $basic.routeJump({ name: 'p2pPlayer' }) + // #endif + // #ifdef APP-PLUS + $basic.routeJump({ name: 'appPlayer' }) + // #endif + } + const openDoorOperate = async type => { const timestamp = new Date().getTime() if ( diff --git a/pages/p2p/appPlayer.vue b/pages/p2p/appPlayer.vue new file mode 100644 index 0000000..f6a4efc --- /dev/null +++ b/pages/p2p/appPlayer.vue @@ -0,0 +1,67 @@ + + + diff --git a/pages/setting/videoSlot.vue b/pages/setting/videoSlot.vue index 36942c6..23025aa 100644 --- a/pages/setting/videoSlot.vue +++ b/pages/setting/videoSlot.vue @@ -21,7 +21,12 @@ > - + diff --git a/stores/basic.js b/stores/basic.js index 91c4afb..9140131 100644 --- a/stores/basic.js +++ b/stores/basic.js @@ -431,6 +431,11 @@ const pages = [ name: 'safeVerify', path: '/pages/user/safeVerify', tabBar: false + }, + { + name: 'appPlayer', + path: '/pages/p2p/appPlayer', + tabBar: false } ] diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f964faa --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "strict": false, + "skipLibCheck": true, + "allowJs": true, + "noEmit": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "moduleResolution": "bundler" + }, + "include": ["**/*.ts", "**/*.tsx", "**/*.uts", "**/*.vue"], + "exclude": ["node_modules", "unpackage", "dist"] +} diff --git a/uni_modules/xhj-tencent-xp2p/changelog.md b/uni_modules/xhj-tencent-xp2p/changelog.md new file mode 100644 index 0000000..e69de29 diff --git a/uni_modules/xhj-tencent-xp2p/package.json b/uni_modules/xhj-tencent-xp2p/package.json new file mode 100644 index 0000000..aa78a75 --- /dev/null +++ b/uni_modules/xhj-tencent-xp2p/package.json @@ -0,0 +1,72 @@ +{ + "id": "xhj-tencent-xp2p", + "displayName": "xhj-tencent-xp2p", + "version": "1.0.0", + "description": "xhj-tencent-xp2p", + "keywords": [ + "xhj-tencent-xp2p" + ], + "repository": "", + "engines": { + "HBuilderX": "^3.6.8" + }, + "dcloudext": { + "type": "uts", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "", + "data": "", + "permissions": "" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "u", + "aliyun": "u", + "alipay": "u" + }, + "client": { + "Vue": { + "vue2": "u", + "vue3": "u" + }, + "App": { + "app-android": "u", + "app-ios": "u", + "app-harmony": "u" + }, + "H5-mobile": { + "Safari": "u", + "Android Browser": "u", + "微信浏览器(Android)": "u", + "QQ浏览器(Android)": "u" + }, + "H5-pc": { + "Chrome": "u", + "IE": "u", + "Edge": "u", + "Firefox": "u", + "Safari": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} diff --git a/uni_modules/xhj-tencent-xp2p/readme.md b/uni_modules/xhj-tencent-xp2p/readme.md new file mode 100644 index 0000000..ab30efd --- /dev/null +++ b/uni_modules/xhj-tencent-xp2p/readme.md @@ -0,0 +1,7 @@ +# xhj-tencent-xp2p +### 开发文档 +[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html) +[UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html) +[UTS uni-app兼容模式组件](https://uniapp.dcloud.net.cn/plugin/uts-component.html) +[UTS 标准模式组件](https://doc.dcloud.net.cn/uni-app-x/plugin/uts-vue-component.html) +[Hello UTS](https://gitcode.net/dcloud/hello-uts) \ No newline at end of file diff --git a/uni_modules/xhj-tencent-xp2p/utssdk/app-android/config.json b/uni_modules/xhj-tencent-xp2p/utssdk/app-android/config.json new file mode 100644 index 0000000..349c16f --- /dev/null +++ b/uni_modules/xhj-tencent-xp2p/utssdk/app-android/config.json @@ -0,0 +1,4 @@ +{ + "minSdkVersion": "21", + "dependencies": ["com.tencent.iot.thirdparty.android:xp2p-sdk:2.4.54"] +} diff --git a/uni_modules/xhj-tencent-xp2p/utssdk/app-android/index.uts b/uni_modules/xhj-tencent-xp2p/utssdk/app-android/index.uts new file mode 100644 index 0000000..d5cad3d --- /dev/null +++ b/uni_modules/xhj-tencent-xp2p/utssdk/app-android/index.uts @@ -0,0 +1,79 @@ +import { UTSAndroid } from 'io.dcloud.uts' +import { XP2PAppConfig, XP2P } from 'com.tencent.xnet' +import { Result, InitParams, IdParams } from '../interface.uts' + +export const startService = async function (params: InitParams): Promise { + try { + const context = UTSAndroid.getAppContext() + + let xp2pConfig: XP2PAppConfig = new XP2PAppConfig() + + xp2pConfig.appKey = params.appKey + xp2pConfig.appSecret = params.appSecret + + await XP2P.startService( + context, + params.productId, + params.deviceName, + params.xp2pInfo, + xp2pConfig + ) + + return { + code: 0, + data: {}, + message: '成功' + } + } catch (error) { + return { + code: -1, + data: {}, + message: error.toString() + } + } +} + +export const getLiveUrl = async function (params: IdParams): Promise { + try { + const liveUrl = await XP2P.delegateHttpFlv(params.id) + + return { + code: 0, + data: { + url: liveUrl + }, + message: '成功' + } + } catch (error) { + return { + code: -1, + data: {}, + message: error.toString() + } + } +} + +export const stopService = async function (params: IdParams): Promise { + try { + await XP2P.stopService(params.id) + return { + code: 0, + data: {}, + message: '成功' + } + } catch (error) { + return { + code: -1, + data: {}, + message: error.toString() + } + } +} + +// export const setCallback = function (callback: XP2PCallback) { +// try { +// XP2P.setCallback(callback) +// } catch (error) { +// console.log(2, error) +// } +// } diff --git a/uni_modules/xhj-tencent-xp2p/utssdk/interface.uts b/uni_modules/xhj-tencent-xp2p/utssdk/interface.uts new file mode 100644 index 0000000..de67211 --- /dev/null +++ b/uni_modules/xhj-tencent-xp2p/utssdk/interface.uts @@ -0,0 +1,17 @@ +export type Result = { + code: number + data: object + message: string +} + +export type InitParams = { + appKey: string + appSecret: string + productId: string + deviceName: string + xp2pInfo: string +} + +export type IdParams = { + id: string +} From d7c5ad41024c15655160bb3f6e02a0933f5c41ec Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Mon, 16 Jun 2025 16:23:42 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96ticket=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/p2p/authorizeWechat.vue | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pages/p2p/authorizeWechat.vue b/pages/p2p/authorizeWechat.vue index 4068106..b9de33e 100644 --- a/pages/p2p/authorizeWechat.vue +++ b/pages/p2p/authorizeWechat.vue @@ -42,6 +42,12 @@ 微信会收到视频通话请求 + + 获取ticket + @@ -100,6 +106,41 @@ } }) + const getTicket = async () => { + uni.showLoading({ + title: '加载中...' + }) + const result = await getInfo() + uni.hideLoading() + if (result.code === 0) { + const ticket = result.data.WXIoTDeviceInfo.SNTicket + uni.showModal({ + title: '票据', + content: ticket, + showCancel: false, + confirmText: '复制', + success: ({ confirm }) => { + if (confirm) { + uni.setClipboardData({ + data: ticket, + success: () => { + uni.showToast({ + title: '复制成功', + icon: 'none' + }) + } + }) + } + } + }) + } else { + uni.showToast({ + title: result.message, + icon: 'none' + }) + } + } + const getDeviceVoIPList = async () => { return new Promise(resolve => { wx.getDeviceVoIPList({ From 88b512aa7f194ecb3d78c27df04b7de399913119 Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Tue, 17 Jun 2025 16:49:04 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsconfig.json | 18 +-- manifest.json | 211 ++++++++++++------------ pages.json | 7 - pages/main/lockDetail.vue | 5 - pages/p2p/appPlayer.vue | 67 -------- pages/p2p/p2pPlayer.vue | 329 ++++++++++++++++++++++++++------------ stores/basic.js | 5 - tsconfig.json | 2 +- 8 files changed, 340 insertions(+), 304 deletions(-) delete mode 100644 pages/p2p/appPlayer.vue diff --git a/jsconfig.json b/jsconfig.json index eb0cdc9..8a31a45 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -2,9 +2,7 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "@/*": [ - "./*" - ] + "@/*": ["./*"] }, "target": "es2020", "module": "esnext", @@ -15,14 +13,6 @@ "strict": true, "skipLibCheck": true }, - "include": [ - "**/*.js", - "**/*.jsx", - "**/*.vue" - ], - "exclude": [ - "node_modules", - "unpackage", - "dist" - ] -} \ No newline at end of file + "include": ["**/*.js", "**/*.jsx", "**/*.vue", "pages/p2p/p2pPlayer.nvue"], + "exclude": ["node_modules", "unpackage", "dist"] +} diff --git a/manifest.json b/manifest.json index 3d45751..4d30de7 100644 --- a/manifest.json +++ b/manifest.json @@ -1,111 +1,110 @@ { - "name" : "星星锁Lite", - "appid" : "__UNI__933D519", - "description" : "", - "versionName" : "1.3.0", - "versionCode" : "37", - "mp-weixin" : { - "appid" : "wx9829a39e65550757", - "setting" : { - "urlCheck" : true, - "minified" : true - }, - "permission" : { - "scope.bluetooth" : { - "desc" : "蓝牙将用于控制和管理您的智能门锁" - } - }, - "requiredPrivateInfos" : [ "getLocation" ], - "usingComponents" : true, - "lazyCodeLoading" : "requiredComponents", - "optimization" : { - "subPackages" : true - }, - "plugins" : { - "wmpf-voip" : { - "version" : "latest", - "provider" : "wxf830863afde621eb", - "genericsImplementation" : { - "call-page-plugin" : { - "custombox" : "pages/main/customBox" - } - } - } - } + "name": "星星锁Lite", + "appid": "__UNI__933D519", + "description": "", + "versionName": "1.3.0", + "versionCode": "37", + "mp-weixin": { + "appid": "wx9829a39e65550757", + "setting": { + "urlCheck": true, + "minified": true }, - "vueVersion" : "3", - "app-plus" : { - "distribute" : { - "icons" : { - "android" : { - "hdpi" : "unpackage/res/icons/72x72.png", - "xhdpi" : "unpackage/res/icons/96x96.png", - "xxhdpi" : "unpackage/res/icons/144x144.png", - "xxxhdpi" : "unpackage/res/icons/192x192.png" - }, - "ios" : { - "appstore" : "unpackage/res/icons/1024x1024.png", - "ipad" : { - "app" : "unpackage/res/icons/76x76.png", - "app@2x" : "unpackage/res/icons/152x152.png", - "notification" : "unpackage/res/icons/20x20.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "proapp@2x" : "unpackage/res/icons/167x167.png", - "settings" : "unpackage/res/icons/29x29.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "spotlight" : "unpackage/res/icons/40x40.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png" - }, - "iphone" : { - "app@2x" : "unpackage/res/icons/120x120.png", - "app@3x" : "unpackage/res/icons/180x180.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "notification@3x" : "unpackage/res/icons/60x60.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "settings@3x" : "unpackage/res/icons/87x87.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png", - "spotlight@3x" : "unpackage/res/icons/120x120.png" - } - } - }, - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "ios" : { - "dSYMs" : false - } - }, - "modules" : { - "Bluetooth" : {}, - "VideoPlayer" : {}, - "LivePusher" : {}, - "Camera" : {}, - "Record" : {} - }, - "splashscreen" : { - "waiting" : false + "permission": { + "scope.bluetooth": { + "desc": "蓝牙将用于控制和管理您的智能门锁" + } + }, + "usingComponents": true, + "lazyCodeLoading": "requiredComponents", + "optimization": { + "subPackages": true + }, + "plugins": { + "wmpf-voip": { + "version": "latest", + "provider": "wxf830863afde621eb", + "genericsImplementation": { + "call-page-plugin": { + "custombox": "pages/main/customBox" + } } + } } + }, + "vueVersion": "3", + "app-plus": { + "distribute": { + "icons": { + "android": { + "hdpi": "unpackage/res/icons/72x72.png", + "xhdpi": "unpackage/res/icons/96x96.png", + "xxhdpi": "unpackage/res/icons/144x144.png", + "xxxhdpi": "unpackage/res/icons/192x192.png" + }, + "ios": { + "appstore": "unpackage/res/icons/1024x1024.png", + "ipad": { + "app": "unpackage/res/icons/76x76.png", + "app@2x": "unpackage/res/icons/152x152.png", + "notification": "unpackage/res/icons/20x20.png", + "notification@2x": "unpackage/res/icons/40x40.png", + "proapp@2x": "unpackage/res/icons/167x167.png", + "settings": "unpackage/res/icons/29x29.png", + "settings@2x": "unpackage/res/icons/58x58.png", + "spotlight": "unpackage/res/icons/40x40.png", + "spotlight@2x": "unpackage/res/icons/80x80.png" + }, + "iphone": { + "app@2x": "unpackage/res/icons/120x120.png", + "app@3x": "unpackage/res/icons/180x180.png", + "notification@2x": "unpackage/res/icons/40x40.png", + "notification@3x": "unpackage/res/icons/60x60.png", + "settings@2x": "unpackage/res/icons/58x58.png", + "settings@3x": "unpackage/res/icons/87x87.png", + "spotlight@2x": "unpackage/res/icons/80x80.png", + "spotlight@3x": "unpackage/res/icons/120x120.png" + } + } + }, + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ios": { + "dSYMs": false + } + }, + "modules": { + "Bluetooth": {}, + "VideoPlayer": {}, + "LivePusher": {}, + "Camera": {}, + "Record": {} + }, + "splashscreen": { + "waiting": false + } + } } diff --git a/pages.json b/pages.json index 90331cf..fbf61bb 100644 --- a/pages.json +++ b/pages.json @@ -38,13 +38,6 @@ "navigationBarTitleText": "门锁记录", "disableScroll": true } - }, - { - "path": "appPlayer", - "style": { - "navigationBarTitleText": "监控", - "disableScroll": true - } } ], "plugins": { diff --git a/pages/main/lockDetail.vue b/pages/main/lockDetail.vue index 34406bb..bd4ee91 100644 --- a/pages/main/lockDetail.vue +++ b/pages/main/lockDetail.vue @@ -310,12 +310,7 @@ }) const jumpToPlayer = () => { - // #ifdef MP $basic.routeJump({ name: 'p2pPlayer' }) - // #endif - // #ifdef APP-PLUS - $basic.routeJump({ name: 'appPlayer' }) - // #endif } const openDoorOperate = async type => { diff --git a/pages/p2p/appPlayer.vue b/pages/p2p/appPlayer.vue deleted file mode 100644 index f6a4efc..0000000 --- a/pages/p2p/appPlayer.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - diff --git a/pages/p2p/p2pPlayer.vue b/pages/p2p/p2pPlayer.vue index 12f1afb..44a4fba 100644 --- a/pages/p2p/p2pPlayer.vue +++ b/pages/p2p/p2pPlayer.vue @@ -1,48 +1,67 @@