Skip to content

Commit 3f6c084

Browse files
committed
refactor:重新提交全新的多网合一代码
1 parent 5aa1bb4 commit 3f6c084

File tree

1,871 files changed

+113232
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,871 files changed

+113232
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintrc.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
'extends': [
7+
'plugin:vue/essential',
8+
'@vue/standard'
9+
],
10+
rules: {
11+
'arrow-parens': 0,
12+
'no-multiple-empty-lines': 0,
13+
'no-trailing-spaces': 0,
14+
'no-mixed-spaces-and-tabs': 0,
15+
'no-duplicates': 0,
16+
'no-tabs': 0,
17+
'indent': 0,
18+
semi: 2,
19+
eqeqeq: 2,
20+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
21+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
22+
'no-redeclare': 0
23+
},
24+
parserOptions: {
25+
parser: 'babel-eslint'
26+
},
27+
globals: {
28+
App: true,
29+
Page: true,
30+
wx: true,
31+
uni: true,
32+
getApp: true,
33+
getPage: true,
34+
getCurrentPages: true,
35+
requirePlugin: true
36+
}
37+
}

.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.DS_Store
2+
node_modules/
3+
unpackage/
4+
dist/
5+
native/android/app/src/main/assets/apps/
6+
7+
# local env files
8+
.env.local
9+
.env.*.local
10+
11+
# Log files
12+
npm-debug.log*
13+
yarn-debug.log*
14+
yarn-error.log*
15+
*.log
16+
17+
# Editor directories and files
18+
.project
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw*
24+
25+
# Lock files
26+
yarn.lock
27+
package-lock.json
28+
29+
# Gradle directory
30+
.gradle/
31+
.idea/
32+
build/
33+
34+
# files for the dex VM
35+
*.dex
36+
37+
#built application files
38+
*.apk
39+
*.ap_
40+
41+
# Java class files
42+
*.class
43+
44+
# Local configuration file (sdk path, etc)
45+
local.properties
46+
47+
.idea/workspace.xml
48+
.idea/libraries
49+
.idea/gradle.xml
50+
.idea/misc.xml
51+
*.iml
52+
src/service/config.js
53+
54+
/src/service/config.js

.vscode/launch.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [{
7+
"type": "chrome",
8+
"request": "launch",
9+
"name": "启动 Chrome 并打开 localhost",
10+
"url": "http://localhost:8080",
11+
"webRoot": "${workspaceFolder}"
12+
}]
13+
}

.vscode/settings.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"editor.tabSize": 2,
3+
"prettier.semi": false,
4+
"explorer.confirmDelete": false,
5+
"git.autofetch": true,
6+
"explorer.confirmDragAndDrop": false,
7+
"window.zoomLevel": 0,
8+
"editor.detectIndentation": true,
9+
"editor.formatOnSave": true,
10+
"editor.formatOnType": true,
11+
"editor.formatOnPaste": true,
12+
"vetur.format.defaultFormatter.js": "vscode-typescript",
13+
"vetur.format.defaultFormatter.html": "js-beautify-html",
14+
"files.autoSave": "afterDelay",
15+
"files.autoSaveDelay": 3000,
16+
"prettier.eslintIntegration": true,
17+
"prettier.singleQuote": true,
18+
"eslint.run": "onSave",
19+
"vetur.format.styleInitialIndent": true,
20+
"vetur.format.scriptInitialIndent": true,
21+
"editor.wordWrapColumn": 800,
22+
"vetur.format.defaultFormatterOptions": {
23+
"js-beautify-html": {
24+
"wrap_attributes": "auto"
25+
},
26+
"prettyhtml": {
27+
"printWidth": 120,
28+
"singleQuote": false,
29+
"wrapAttributes": false,
30+
"sortAttributes": false
31+
}
32+
},
33+
"html.format.wrapAttributes": "auto",
34+
"eslint.autoFixOnSave": true,
35+
"eslint.validate": [
36+
"javascript",
37+
"javascriptreact",
38+
{
39+
"language": "html",
40+
"autoFix": true
41+
},
42+
{
43+
"language": "vue",
44+
"autoFix": true
45+
}
46+
],
47+
"[markdown]": {
48+
"editor.wordWrap": "off",
49+
"editor.quickSuggestions": false
50+
},
51+
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
52+
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
53+
"typescript.format.insertSpaceAfterConstructor": true,
54+
"javascript.format.insertSpaceAfterConstructor": true
55+
}

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
## install dependencies
2+
3+
npm install
4+
yarn install
5+
npm install -g yarn
6+
7+
## 发布流程
8+
9+
5ug publish all
10+
5ug init
11+
npm run build
12+
13+
### 开发强调非常非常重要
14+
15+
- x-icon 用法:优先级 icon,name,src
16+
- 多余的 console.info()删掉
17+
18+
## 运行
19+
20+
- 运行 h5:npm run dev
21+
- 运行小程序: npm run dev:mp
22+
23+
## 安卓离线构建
24+
25+
- 使用 HBuilderX 构建离线资源
26+
- 复制 src/unpackage/resources/**UNI**FED8DFC 到 native/android/app/src/main/assets/apps/ 下
27+
- 使用 Android Studio 打包安装文件
28+
29+
## 开发注意点
30+
31+
- 分析 html 结构,减少 html 嵌套
32+
- 在组件中尽量的少定义变量,特别时 data,能少一个是一个
33+
- 变量名不能使用拼音,使用英文,更不能缩写
34+
- 不能使用本地图片,所有的图片配合可视化编辑来处理,使用远程图片,否则小程序 100%体积超过
35+
- 所有的 data 数据,模拟数据第一选择使用 diy 构建自动表单,第二选择使用 data.json 数据
36+
- 不能使用 window.location 进行跳转,而是使用 this.\$api.to()
37+
- 不能用中文,用 id,等特殊字符来做判断
38+
- 精通 uti-app 的配置、组件、接口、规范等https://uniapp.dcloud.io/component/README
39+
- 不能在页面上做过多的开发
40+
- css 背景,尽可能的不用图片,使用样式来处理
41+
- 页面结构有服务端 DIY 平台定义,有组件组成
42+
- 组件 components(所有平台共用、接口、数据格式统一)
43+
- 元件 elements (各平台独立写)
44+
- 精通https://github.com/dcloudio/hello-uniapp 所有的目录结构
45+
- 精通文章:https://ask.dcloud.net.cn/article/35232
46+
- 优先调试小程序
47+
- div 使用 view
48+
49+
## 以达优的组件
50+
51+
- 图标(x-icon) ,支持小程序、H5。可加载图片、svg 图标、远程图片以及远程图标
52+
53+
## 5ug-cli 命令使用
54+
55+
- 全局安装 npm install 5ug-cli -g
56+
57+
### 登录:5ug login
58+
59+
-输入用户名,密码,选择项目
60+
61+
### 创建组件:5ug create <name>
62+
63+
-例如: 5ug create test/zk-test 创建组件 其中 test/zk-test 为组件路径和格式
64+
65+
### 发布组件:5ug publish <name>
66+
67+
- 功能:1.发布源文件 2.发布风格 3.版本统计
68+
- 例如:5ug publish test/zk-test 创建组件 其中 test/zk-test 为组件路径和格式
69+
70+
### 发布所有组件:5ug publish all
71+
72+
### 构建 main.js 5ug main
73+
74+
- 遍历当前项目中 src/components src/elements src/admins 三个目录,自动生成 main.js
75+
- 只支持二级目录,不支持一级目录和三级目录
76+
77+
## 创建模块流程
78+
79+
### 第一步 创建组件:5ug create <name>
80+
81+
- 本地生成模板文件,包括 vue,js,scss 等文件
82+
- 5ug publish all 发布所有组件
83+
84+
### 第二步 发布组件:5ug publish <name>
85+
86+
- 在服务器中创建组件,包括风格、样式、版本等
87+
88+
### 第三步 同步表单
89+
90+
- 在/operation/init 点击数据处理
91+
92+
### 第四步 模块添加
93+
94+
- 在/widget/edit 添加模块
95+
96+
### 第五步 编辑表单
97+
98+
- 使用正确的数据格式
99+
100+
### 第六步 前端调试
101+
102+
- 发布最新的数据格式

README1.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
## 一套 Vue 代码, 支持 PC、H5、小程序、安卓 App、苹果 App
2+
3+
![图片](https://raw.githubusercontent.com/zhongku/zkweb/master/src/assets/img/github/banner.png)
4+
5+
> (High quality Weex、MpVue)
6+
7+
## 后台 DIY 系统,所见即所得、最大程度的复用代码
8+
9+
![图片](https://raw.githubusercontent.com/zhongku/zkweb/master/src/assets/img/github/diy.jpg)
10+
11+
## 想解决的痛点
12+
13+
* 维护一套代码,同时维护 PC、H5、小程序、安卓 App、苹果 App 减少代码负债
14+
* 用 vue.js 开发,支持多个终端
15+
* 通过可视化编辑,让客户个性化 DIY 各个终端
16+
* 开发同一份代码,可以在不同的端上分别执行,避免了多端的重复研发成本
17+
* 使用同一种开发体验,包括语法设计和工程链路等,减低人员培训成本
18+
* 同一套组件:设计基于小程序、 iOS、Android、H5、PC,有一定的通用性和普遍性
19+
20+
## Build Setup
21+
22+
```bash
23+
# install dependencies
24+
npm install
25+
npm install --global yarn
26+
yarn install
27+
28+
# build mini program
29+
npm run dev:min
30+
31+
# build H5 pages
32+
npm run dev
33+
34+
# build for production with minification for mini program
35+
npm run build:min
36+
37+
# build for production with minification for H5 pages
38+
npm run build
39+
40+
# build for production and view the bundle analyzer report
41+
npm run build --report
42+
43+
# eslint 检查
44+
npm run lint
45+
46+
# eslint 自动修复
47+
npm run fix
48+
49+
# build app pages, run debug service
50+
npm run dev:app
51+
52+
# 打包app js包到android和ios工程
53+
npm run pack:app
54+
```
55+
56+
## 特性
57+
58+
* 支持移动端 H5 `Vue.js` 构建移动端应用
59+
* 支持微信小程序:,使用 `mpvue` 复用代码构建小程序应用
60+
* 支持 PC 系统,使用饿了么框架
61+
* 支持安卓 App,使用 weex 打包
62+
* 支持苹果 App,使用 weex 打包
63+
* 支持移微信公众号,在后端配置即可
64+
* 约定大于配置:尽可能的让业务实现代码最小化
65+
* 引用不强依赖:彻底的组件化开发能力,尽可能的复用代码
66+
* 系统构建流程:(Api 接口+组件)--->模块(Widget)-->页面-->流程
67+
* 优雅的 Api 接口,包括时间戳、域名、Key、秘钥等多种方式组合加密,更安全
68+
* 自动 Api 接口,Api 接口与 ZKCloud(asp.net core 开发),自动同步,提高标准,压缩打包体积
69+
* 自动生成 app.json 无需写代码
70+
* 自动路由,新增页面路由无需代码
71+
* 自动表单:通过 json 数据自动构建表单
72+
* 自动表格:通过 json 数据自动构建表格
73+
* 自动详情页:通过 json 数据,自动构建详情页
74+
* 服务器 SSR 渲染页面,减少海量的视图工作量,压缩打包体积,动态渲染页面
75+
* 通过视图页面,比如说一个界面 index.html?page=product/show/1,不同的 page 代表不同的页面
76+
* 远程可视化编辑,后台修改后,无需重新发布或上架
77+
78+
## 组件(components)
79+
80+
* 轮播(zk-swiper),已支持小程序、h5
81+
* 图标导航(zk-grid),已支持小程序、h5
82+
83+
## 元件(elements)
84+
85+
* 图标(x-icon) ,支持小程序、H5。可加载图片、svg 图标、远程图片以及远程图标
86+
87+
* 轮播(zk-swiper),已支持小程序、h5
88+
* 图标导航(zk-grid),已支持小程序、h5
89+
* x-verifiy-phone
90+
91+
一个使用 JavaScript 实现的开源可视化库,可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器(IE8/9/10/11,Chrome,Firefox,Safari 等)
92+
93+
94+
* 期待您的加入,交流 QQ 群:215176974

babel.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
presets: [
3+
['@vue/app', {
4+
useBuiltIns: 'entry'
5+
}]
6+
]
7+
}

doc/#bus.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## strikeView
2+
- 修改头像及提现

doc/DIY调试.doc

317 KB
Binary file not shown.

0 commit comments

Comments
 (0)