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.

0 commit comments

Comments
 (0)