diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 769dcdb..4f69855 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -27,6 +27,7 @@ module.exports = {
'plugin:prettier/recommended',
'./.eslintrc-auto-import.json'
],
+ ignorePatterns: ['utils/log.js', 'unpackage/**/*'],
/**
* "off" 或 0 ==> 关闭规则
* "warn" 或 1 ==> 打开的规则作为警告(不影响代码执行)
@@ -73,7 +74,7 @@ module.exports = {
'vue/singleline-html-element-content-newline': 'off', // 在单行元素的内容之前和之后需要换行符
'vue/attribute-hyphenation': 'off', // 对模板中的自定义组件强制执行属性命名样式
'vue/require-default-prop': 'off', // 此规则要求为每个 prop 为必填时,必须提供默认值
- 'vue/multi-word-component-names': 'off', // 要求组件名称始终为 “-” 链接的单词
+ 'vue/multi-word-component-names': 'off', // 要求组件名称始终为 "-" 链接的单词
'vue.prefer-template': 'off',
'vuejs-accessibility/click-events-have-key-events': 'off',
'no-console': 'off',
diff --git a/.lintstagedrc.json b/.lintstagedrc.json
index 3fa3573..3ae556d 100644
--- a/.lintstagedrc.json
+++ b/.lintstagedrc.json
@@ -1,9 +1,4 @@
{
- "src/**/*.{vue,js}": [
- "npm run prettier",
- "npm run eslint"
- ],
- "src/**/*.{vue,scss,css,less}": [
- "npm run stylelint:out"
- ]
+ "src/**/*.{vue,js}": ["npm run prettier", "npm run eslint"],
+ "src/**/*.{vue,scss,css,less}": ["npm run stylelint:out"]
}
diff --git a/.prettierrc.json b/.prettierrc.json
index f353308..6557641 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -15,8 +15,5 @@
"embeddedLanguageFormatting": "auto",
"vueIndentScriptAndStyle": true,
"singleAttributePerLine": false,
- "htmlWhitespaceSensitivity": "css",
- "requirePragma": false,
- "insertPragma": false,
- "proseWrap": "preserve"
+ "htmlWhitespaceSensitivity": "css"
}
diff --git a/.stylelintrc.json b/.stylelintrc.json
index 3cd2e82..d2921e2 100644
--- a/.stylelintrc.json
+++ b/.stylelintrc.json
@@ -5,9 +5,22 @@
"stylelint-config-recess-order",
"stylelint-config-html/vue"
],
+ "ignoreFiles": ["**/*.js", "**/*.ts", "unpackage/**/*"],
"overrides": [
{
- "files": ["**/*.(scss|css|vue|html)"],
+ "files": ["**/*.vue"],
+ "customSyntax": "postcss-html",
+ "rules": {
+ "at-rule-no-unknown": null,
+ "no-unknown-custom-properties": null
+ }
+ },
+ {
+ "files": ["**/*.vue/*.scss"],
+ "customSyntax": "postcss-scss"
+ },
+ {
+ "files": ["**/*.(scss|css|html)"],
"customSyntax": "postcss-scss"
}
],
@@ -23,32 +36,20 @@
}
],
"color-hex-length": null,
- "declaration-property-value-no-unknown": [
- true,
- {
- "ignoreProperties": [
- "font-size",
- "width",
- "height",
- "margin",
- "padding",
- "border-radius",
- "line-height",
- "box-shadow"
- ]
- }
- ],
+ "declaration-property-value-no-unknown": null,
"shorthand-property-no-redundant-values": null,
"alpha-value-notation": null,
"color-function-notation": null,
- "declaration-property-value-allowed-list": {
- "font-size": ["/rpx$/"],
- "width": ["/rpx$/"],
- "height": ["/rpx$/"],
- "margin": ["/rpx$/"],
- "padding": ["/rpx$/"],
- "border-radius": ["/rpx$/"],
- "line-height": ["/rpx$/"]
- }
+ "at-rule-no-unknown": null,
+ "property-no-unknown": null,
+ "no-unknown-custom-properties": null,
+ "value-keyword-case": null,
+ "custom-property-pattern": null,
+ "selector-pseudo-class-no-unknown": [
+ true,
+ {
+ "ignorePseudoClasses": ["deep", "global"]
+ }
+ ]
}
}
diff --git a/package.json b/package.json
index 136b775..2ddc94c 100644
--- a/package.json
+++ b/package.json
@@ -30,5 +30,12 @@
"unocss-preset-weapp": "^65.4.1",
"vite-plugin-eslint": "^1.8.1",
"postcss-scss": "^4.0.9"
+ },
+ "scripts": {
+ "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}\"",
+ "lint:style": "stylelint --fix \"**/*.{css,scss,vue}\"",
+ "lint:all": "npm run format && npm run lint && npm run lint:style"
}
}
diff --git a/pages/addDeviceForBluetooth/addLockGuid.vue b/pages/addDeviceForBluetooth/addLockGuid.vue
index 42e3368..544c149 100644
--- a/pages/addDeviceForBluetooth/addLockGuid.vue
+++ b/pages/addDeviceForBluetooth/addLockGuid.vue
@@ -54,10 +54,10 @@
diff --git a/pages/main/home.vue b/pages/main/home.vue
index 7dc265f..bd9f770 100644
--- a/pages/main/home.vue
+++ b/pages/main/home.vue
@@ -1,6 +1,6 @@
-
+
-
+
添加锁时,手机必须在锁旁边
-
+
{{ group.groupName }}
@@ -50,14 +50,14 @@
-
+
import { timeFormat } from 'uview-plus'
import { mapState, mapActions } from 'pinia'
- import { getUserInfoRequest, loginRequest } from '@/api/user'
+ import { loginRequest } from '@/api/user'
import { useUserStore } from '@/stores/user'
import { useLockStore } from '@/stores/lock'
import { useBluetoothStore } from '@/stores/bluetooth'
@@ -188,7 +188,7 @@
return {
refresherTriggered: false,
focus: false,
- penging: true,
+ pending: true,
deviceInfo: null,
options: [
{
@@ -225,7 +225,7 @@
const token = getStorage('token')
if (token) {
await Promise.all([this.getLockList(this.lockSearch), this.getUserInfo()]).then(res => {
- this.penging = false
+ this.pending = false
uni.hideLoading()
const list = getStorage('lockList')
const userInfo = getStorage('userInfo')
@@ -241,7 +241,7 @@
})
} else {
await this.homeLogin()
- this.penging = false
+ this.pending = false
uni.hideLoading()
}
const _data = JSON.parse(JSON.stringify(data))
@@ -481,11 +481,11 @@
},
async nextPage() {
if (this.lockList.length < this.lockTotal) {
- const sreach = {
+ const search = {
...this.lockSearch,
pageNo: this.lockSearch.pageNo + 1
}
- const { code } = await this.getLockList(search)
+ const { code, message } = await this.getLockList(search)
if (code !== 0) {
uni.showToast({
title: message,
@@ -534,7 +534,7 @@
name: 'addLockGuid'
})
},
- async toLockDeatil(lock) {
+ async toLockDetail(lock) {
if (!(this.bluetoothStatus === 0 || this.bluetoothStatus === -1)) {
this.getBluetoothStatus()
return
@@ -592,20 +592,20 @@
}
.u-swipe-action {
- overflow: inherit !important;
- padding-bottom: 32rpx;
- width: 672rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
+ width: 672rpx;
+ padding-bottom: 32rpx;
+ overflow: inherit !important;
}
.u-swipe-action-item {
+ width: 320rpx;
+ height: 300rpx;
margin-top: 32rpx;
overflow: inherit !important;
border-radius: 32rpx !important;
- width: 320rpx;
- height: 300rpx;
}
.u-swipe-action-item__right {
@@ -623,61 +623,60 @@
diff --git a/pages/main/lockDetail.vue b/pages/main/lockDetail.vue
index b0fe71f..b2041be 100644
--- a/pages/main/lockDetail.vue
+++ b/pages/main/lockDetail.vue
@@ -443,86 +443,85 @@