Skip to content

Commit

Permalink
feat: add album code
Browse files Browse the repository at this point in the history
  • Loading branch information
shenyanxiu committed Dec 27, 2024
1 parent b6001a3 commit a7a0abd
Show file tree
Hide file tree
Showing 59 changed files with 1,982 additions and 45 deletions.
30 changes: 0 additions & 30 deletions common/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions smartspeaker/README.md

This file was deleted.

8 changes: 8 additions & 0 deletions smartspeaker/album/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.nyc_output
/coverage
/node_modules
/tests/fixtures
/sign
/dist
/build
/package-lock.json
57 changes: 57 additions & 0 deletions smartspeaker/album/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"root": true,
"env": {
"node": true,
"commonjs": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:ux/essential"
],
"plugins":["prettier","import"],
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module",
"ecmaFeatures": {
"ecmaVersion": true,
"jsx": true
}
},
"globals": {
"setGlobalData":true,
"getGlobalData":true
},
"rules": {
"prettier/prettier": 1,
"indent": [
"warn",
2
],
"no-console": "off",
"no-unused-vars": [
"error",
{"vars": "all",
"args": "after-used",
"ignoreRestSiblings": false ,
"varsIgnorePattern": "prompt"
}
],
"quotes": "off",
"linebreak-style": [
"warn",
"unix"
],
"semi": [
"warn",
"never"
],
"import/no-unresolved": "warn",
"import/no-unused-modules": "error",
"import/no-duplicates": "warn",
"import/no-named-default": "warn",
"import/namespace": ["warn", { "allowComputed": true }],
"import/default": "warn",
"import/named": "warn"
}
}
7 changes: 7 additions & 0 deletions smartspeaker/album/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.nyc_output
/coverage
/node_modules
/sign
/dist
/build
.husky/
16 changes: 16 additions & 0 deletions smartspeaker/album/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules
build
dist

.DS_Store
Thumbs.db

*.log
*.iml
.idea/
.vscode/

.nyc_output
/coverage

/logs
23 changes: 23 additions & 0 deletions smartspeaker/album/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
printWidth: 100, // 指定代码长度,超出换行
tabWidth: 2, // tab 键的宽度
useTabs: false, // 使用空格替代tab
semi: false, // 结尾加上分号
singleQuote: false, // 使用单引号
quoteProps: 'consistent', // 要求对象字面量属性是否使用引号包裹,(‘as-needed’: 没有特殊要求,禁止使用,'consistent': 保持一致 , preserve: 不限制,想用就用)
trailingComma: 'none', // 不添加对象和数组最后一个元素的逗号
bracketSpacing: false, // 对象中对空格和空行进行处理
jsxBracketSameLine: false, // 在多行JSX元素的最后一行追加 >
requirePragma: false, // 是否严格按照文件顶部的特殊注释格式化代码
insertPragma: false, // 是否在格式化的文件顶部插入Pragma标记,以表明该文件被prettier格式化过了
proseWrap: 'preserve', // 按照文件原样折行
htmlWhitespaceSensitivity: 'ignore', // html文件的空格敏感度,控制空格是否影响布局
endOfLine: 'auto', // 结尾是 \n \r \n\r auto
overrides: [
{
files: '*.ux',
options: { parser: 'vue' }
}
]
}

72 changes: 72 additions & 0 deletions smartspeaker/album/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
module.exports = {
extends: [
"stylelint-config-standard",
"stylelint-config-recess-order"
// "stylelint-selector-bem-pattern"
],
ignoreFiles: ["node_modules", "test", "dist", "**/*.js"],
rules: {
"no-descending-specificity": null,
"color-hex-case": "lower",
"color-hex-length": "short",
"at-rule-no-unknown": null,
"block-no-empty": null,
"selector-pseudo-class-no-unknown": [
true,
{
ignorePseudoClasses: ["blur"]
}
],
"property-no-unknown": [
true,
{
ignoreProperties: [
"placeholder-color",
"gradient-start",
"gradient-center",
"gradient-end",
"caret-color",
"selected-color",
"block-color",
// text
"lines",

// swiper
"indicator-color",
"indicator-selected-color",
"indicator-size",
"indicator-top",
"indicator-left",
"indicator-right",
"indicator-bottom",

// progress
"stroke-width",
"layer-color",
"start-angle",
"total-angle",
"center-x",
"center-y",
"radius",

// picker
"selected-color",
"selected-font-size",

// switch
"thumb-color",
"track-color",
]
}
],
"max-line-length": null,
// "indentation": 2,
// "no-empty-source": null,
"selector-type-no-unknown": [
true,
{
ignoreTypes: ["selected-color", "block-color"]
}
]
}
}
88 changes: 88 additions & 0 deletions smartspeaker/album/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
## 简介

家庭相册是音箱上的重要应用之一,主要功能如下:
- 用户图片滑动预览
- 点击图片预览/查看大图
- 用户可通过二维码扫描添加图片

## 项目结构

```cpp
album
├─ package.json
├─ src
│ ├─ app.ux
│ ├─ common
│ │ ├─ images
│ │ ├─ js js文件
│ │ │ ├─ constants.js
│ │ │ ├─ exchange.js
│ │ │ ├─ http.js
│ │ │ ├─ promisify.js
│ │ │ ├─ storage.js
│ │ │ └─ util.js
│ │ ├─ logo.png
│ │ └─ style 样式
│ │ └─ unocss-vela.css
│ ├─ components 组件
│ │ └─ MyButton
│ │ └─ index.ux
│ ├─ config-watch.json
│ ├─ i18n 多语言
│ │ ├─ defaults.json
│ │ ├─ en.json
│ │ └─ zh-CN.json
│ ├─ manifest.json
│ └─ pages
│ ├─ empty
│ │ └─ index.ux 未开启家庭相册屏保提示页
│ ├─ home
│ │ └─ index.ux 首页
│ ├─ manual
│ │ └─ index.ux 查看帮助页
│ ├─ preview
│ │ └─ index.ux 大图预览页
│ ├─ screenSaver
│ │ └─ index.ux 设为屏保页
│ └─ upload
│ └─ index.ux 上传图片页
└─ unocss.config.js
```

## 快速上手

### 1. 开发

```
npm install
npm run start
```

### 2. 构建

```
npm run build
npm run release
```

### 3. 调试

```
npm run watch
```
### 4. 代码规范化配置
代码规范化可以帮助开发者在git commit前进行代码校验、格式化、commit信息校验

使用前提:必须先关联git

macOS or Linux
```
sh husky.sh
```

windows
```
./husky.sh
```


Loading

0 comments on commit a7a0abd

Please sign in to comment.