Skip to content

Commit 62329f7

Browse files
committed
初始化uniapp、引入uview-ui
1 parent 1f11313 commit 62329f7

File tree

152 files changed

+28964
-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.

152 files changed

+28964
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
/.vs
106+
/uniapp/.hbuilderx

uniapp/App.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script>
2+
export default {
3+
onLaunch: function() {
4+
console.log('App Launch')
5+
},
6+
onShow: function() {
7+
console.log('App Show')
8+
},
9+
onHide: function() {
10+
console.log('App Hide')
11+
}
12+
}
13+
</script>
14+
15+
<style lang="scss">
16+
/*每个页面公共css */
17+
@import "uview-ui/index.scss";
18+
</style>

uniapp/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
6+
<title></title>
7+
<!--preload-links-->
8+
<!--app-context-->
9+
</head>
10+
<body>
11+
<div id="app"><!--app-html--></div>
12+
<script type="module" src="/main.js"></script>
13+
</body>
14+
</html>

uniapp/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import App from './App'
2+
import Vue from 'vue'
3+
import uView from "uview-ui"
4+
Vue.use(uView);
5+
Vue.config.productionTip = false
6+
App.mpType = 'app'
7+
const app = new Vue({
8+
...App
9+
})
10+
app.$mount()

uniapp/manifest.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"name" : "uni",
3+
"appid" : "__UNI__3136F4B",
4+
"description" : "",
5+
"versionName" : "1.0.0",
6+
"versionCode" : "100",
7+
"transformPx" : false,
8+
/* 5+App特有相关 */
9+
"app-plus" : {
10+
"usingComponents" : true,
11+
"nvueStyleCompiler" : "uni-app",
12+
"compilerVersion" : 3,
13+
"splashscreen" : {
14+
"alwaysShowBeforeRender" : true,
15+
"waiting" : true,
16+
"autoclose" : true,
17+
"delay" : 0
18+
},
19+
/* 模块配置 */
20+
"modules" : {},
21+
/* 应用发布信息 */
22+
"distribute" : {
23+
/* android打包配置 */
24+
"android" : {
25+
"permissions" : [
26+
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
27+
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
28+
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
29+
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
30+
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
31+
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
32+
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
33+
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
34+
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
35+
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
36+
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
37+
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
38+
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
39+
"<uses-feature android:name=\"android.hardware.camera\"/>",
40+
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
41+
]
42+
},
43+
/* ios打包配置 */
44+
"ios" : {},
45+
/* SDK配置 */
46+
"sdkConfigs" : {}
47+
}
48+
},
49+
/* 快应用特有相关 */
50+
"quickapp" : {},
51+
/* 小程序特有相关 */
52+
"mp-weixin" : {
53+
"appid" : "",
54+
"setting" : {
55+
"urlCheck" : false
56+
},
57+
"usingComponents" : true
58+
},
59+
"mp-alipay" : {
60+
"usingComponents" : true
61+
},
62+
"mp-baidu" : {
63+
"usingComponents" : true
64+
},
65+
"mp-toutiao" : {
66+
"usingComponents" : true
67+
},
68+
"uniStatistics" : {
69+
"enable" : false
70+
},
71+
"vueVersion" : "2"
72+
}

uniapp/pages.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"easycom": {
3+
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
4+
},
5+
"pages": [
6+
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
7+
{
8+
"path": "pages/index/index",
9+
"style": {
10+
"navigationBarTitleText": "uni-app"
11+
}
12+
}
13+
],
14+
"globalStyle": {
15+
"navigationBarTextStyle": "black",
16+
"navigationBarTitleText": "uni-app",
17+
"navigationBarBackgroundColor": "#F8F8F8",
18+
"backgroundColor": "#F8F8F8"
19+
}
20+
}

uniapp/pages/index/index.vue

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<template>
2+
<view class="content">
3+
<image class="logo" src="/static/logo.png"></image>
4+
<view class="text-area">
5+
<text class="title">{{title}}</text>
6+
</view>
7+
</view>
8+
</template>
9+
10+
<script>
11+
export default {
12+
data() {
13+
return {
14+
title: 'Hello'
15+
}
16+
},
17+
onLoad() {
18+
19+
},
20+
methods: {
21+
22+
}
23+
}
24+
</script>
25+
26+
<style>
27+
.content {
28+
display: flex;
29+
flex-direction: column;
30+
align-items: center;
31+
justify-content: center;
32+
}
33+
34+
.logo {
35+
height: 200rpx;
36+
width: 200rpx;
37+
margin-top: 200rpx;
38+
margin-left: auto;
39+
margin-right: auto;
40+
margin-bottom: 50rpx;
41+
}
42+
43+
.text-area {
44+
display: flex;
45+
justify-content: center;
46+
}
47+
48+
.title {
49+
font-size: 36rpx;
50+
color: #8f8f94;
51+
}
52+
</style>

uniapp/static/logo.png

3.93 KB
Loading

uniapp/uni.scss

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/* 颜色变量 */
2+
3+
/* 行为相关颜色 */
4+
$uni-color-primary: #007aff;
5+
$uni-color-success: #4cd964;
6+
$uni-color-warning: #f0ad4e;
7+
$uni-color-error: #dd524d;
8+
9+
/* 文字基本颜色 */
10+
$uni-text-color:#333;//基本色
11+
$uni-text-color-inverse:#fff;//反色
12+
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
13+
$uni-text-color-placeholder: #808080;
14+
$uni-text-color-disable:#c0c0c0;
15+
16+
/* 背景颜色 */
17+
$uni-bg-color:#ffffff;
18+
$uni-bg-color-grey:#f8f8f8;
19+
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
20+
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
21+
22+
/* 边框颜色 */
23+
$uni-border-color:#c8c7cc;
24+
25+
/* 尺寸变量 */
26+
27+
/* 文字尺寸 */
28+
$uni-font-size-sm:12px;
29+
$uni-font-size-base:14px;
30+
$uni-font-size-lg:16;
31+
32+
/* 图片尺寸 */
33+
$uni-img-size-sm:20px;
34+
$uni-img-size-base:26px;
35+
$uni-img-size-lg:40px;
36+
37+
/* Border Radius */
38+
$uni-border-radius-sm: 2px;
39+
$uni-border-radius-base: 3px;
40+
$uni-border-radius-lg: 6px;
41+
$uni-border-radius-circle: 50%;
42+
43+
/* 水平间距 */
44+
$uni-spacing-row-sm: 5px;
45+
$uni-spacing-row-base: 10px;
46+
$uni-spacing-row-lg: 15px;
47+
48+
/* 垂直间距 */
49+
$uni-spacing-col-sm: 4px;
50+
$uni-spacing-col-base: 8px;
51+
$uni-spacing-col-lg: 12px;
52+
53+
/* 透明度 */
54+
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
55+
56+
/* 文章场景相关 */
57+
$uni-color-title: #2C405A; // 文章标题颜色
58+
$uni-font-size-title:20px;
59+
$uni-color-subtitle: #555555; // 二级标题颜色
60+
$uni-font-size-subtitle:26px;
61+
$uni-color-paragraph: #3F536E; // 文章段落颜色
62+
$uni-font-size-paragraph:15px;
63+
64+
65+
/* uni.scss */
66+
@import 'uview-ui/theme.scss';

uniapp/uview-ui/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 www.uviewui.com
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

uniapp/uview-ui/README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<p align="center">
2+
<img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;">
3+
</p>
4+
<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView</h3>
5+
<h3 align="center">多平台快速开发的UI框架</h3>
6+
7+
8+
## 说明
9+
10+
uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
11+
12+
## 特性
13+
14+
- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序
15+
- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
16+
- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨
17+
- 众多的常用页面和布局,让您专注逻辑,事半功倍
18+
- 详尽的文档支持,现代化的演示效果
19+
- 按需引入,精简打包体积
20+
21+
22+
## 安装
23+
24+
```bash
25+
# npm方式安装
26+
npm i uview-ui
27+
```
28+
29+
## 快速上手
30+
31+
1. `main.js`引入uView库
32+
```js
33+
// main.js
34+
import uView from 'uview-ui';
35+
Vue.use(uView);
36+
```
37+
38+
2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)
39+
```css
40+
/* App.vue */
41+
<style lang="scss">
42+
@import "uview-ui/index.scss";
43+
</style>
44+
```
45+
46+
3. `uni.scss`引入全局scss变量文件
47+
```css
48+
/* uni.scss */
49+
@import "uview-ui/theme.scss";
50+
```
51+
52+
4. `pages.json`配置easycom规则(按需引入)
53+
54+
```js
55+
// pages.json
56+
{
57+
"easycom": {
58+
// npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
59+
// npm安装方式
60+
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
61+
// 下载安装方式
62+
// "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
63+
},
64+
// 此为本身已有的内容
65+
"pages": [
66+
// ......
67+
]
68+
}
69+
```
70+
71+
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
72+
73+
## 使用方法
74+
配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
75+
76+
```html
77+
<template>
78+
<u-button>按钮</u-button>
79+
</template>
80+
```
81+
82+
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
83+
84+
## 链接
85+
86+
- [官方文档](https://uviewui.com/)
87+
- [更新日志](https://uviewui.com/components/changelog.html)
88+
- [升级指南](https://uviewui.com/components/changelog.html)
89+
- [关于我们](https://uviewui.com/cooperation/about.html)
90+
91+
## 预览
92+
93+
您可以通过**微信**扫码,查看最佳的演示效果。
94+
<br>
95+
<br>
96+
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
97+
98+
<!-- ## 捐赠uView的研发
99+
100+
uView文档和源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。
101+
102+
<img src="https://uviewui.com/common/wechat.png" width="220" >
103+
<img style="margin-left: 100px;" src="https://uviewui.com/common/alipay.png" width="220" >
104+
-->
105+
## 版权信息
106+
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。

0 commit comments

Comments
 (0)