create-young-proj 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/index.mjs +8 -8
- package/package.json +1 -1
- package/template-uni-app/.vscode/css.code-snippets +398 -0
- package/template-uni-app/.vscode/extensions.json +9 -0
- package/template-uni-app/.vscode/js.code-snippets +1669 -0
- package/template-uni-app/.vscode/settings.json +7 -0
- package/template-uni-app/.vscode/vue-html.code-snippets +668 -0
- package/template-uni-app/README.md +46 -0
- package/template-uni-app/_env +1 -0
- package/template-uni-app/_env.development +11 -0
- package/template-uni-app/_env.production +11 -0
- package/template-uni-app/_env.test +14 -0
- package/template-uni-app/_gitignore +3 -0
- package/template-uni-app/auto-imports.d.ts +404 -0
- package/template-uni-app/components.d.ts +20 -0
- package/template-uni-app/custom-plugins/index.ts +8 -0
- package/template-uni-app/custom-plugins/multiconf.ts +77 -0
- package/template-uni-app/custom-plugins/polyfill.ts +32 -0
- package/template-uni-app/index.html +23 -0
- package/template-uni-app/package.json +84 -0
- package/template-uni-app/pnpm-lock.yaml +7530 -0
- package/template-uni-app/rome.json +26 -0
- package/template-uni-app/src/App.vue +76 -0
- package/template-uni-app/src/apis/index.ts +36 -0
- package/template-uni-app/src/apis/lib/index.ts +236 -0
- package/template-uni-app/src/apis/requests/get.ts +52 -0
- package/template-uni-app/src/apis/requests/index.ts +8 -0
- package/template-uni-app/src/apis/requests/post.ts +23 -0
- package/template-uni-app/src/components/young-loading/young-loading.vue +38 -0
- package/template-uni-app/src/components/young-navbar/young-navbar.vue +253 -0
- package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +137 -0
- package/template-uni-app/src/components/young-tabbar-layout/young-tabbar-layout.vue +27 -0
- package/template-uni-app/src/config/enum.ts +46 -0
- package/template-uni-app/src/config/index.ts +8 -0
- package/template-uni-app/src/config/map.ts +15 -0
- package/template-uni-app/src/env.d.ts +35 -0
- package/template-uni-app/src/main.ts +20 -0
- package/template-uni-app/src/manifest.json +83 -0
- package/template-uni-app/src/pages/index.vue +52 -0
- package/template-uni-app/src/pages/my.vue +29 -0
- package/template-uni-app/src/pages.json +63 -0
- package/template-uni-app/src/store/index.ts +16 -0
- package/template-uni-app/src/store/local/index.ts +40 -0
- package/template-uni-app/src/store/system.ts +12 -0
- package/template-uni-app/src/uni.scss +76 -0
- package/template-uni-app/src/utils/auth.ts +125 -0
- package/template-uni-app/src/utils/index.ts +11 -0
- package/template-uni-app/src/utils/map.ts +97 -0
- package/template-uni-app/src/utils/modal.ts +98 -0
- package/template-uni-app/src/utils/route.ts +149 -0
- package/template-uni-app/src/utils/system.ts +66 -0
- package/template-uni-app/tsconfig.json +13 -0
- package/template-uni-app/unocss.config.ts +30 -0
- package/template-uni-app/vite.config.ts +68 -0
@@ -0,0 +1,253 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-19 09:03:51
|
4
|
+
* @LastEditTime: 2023-07-19 16:47:55
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
interface Props {
|
9
|
+
/**
|
10
|
+
* 是否是自定义导航
|
11
|
+
*/
|
12
|
+
custom?: boolean;
|
13
|
+
/**
|
14
|
+
* 是否返回
|
15
|
+
*/
|
16
|
+
isback?: boolean;
|
17
|
+
/**
|
18
|
+
* 标题
|
19
|
+
*/
|
20
|
+
title?: string;
|
21
|
+
/**
|
22
|
+
* 标题颜色
|
23
|
+
*/
|
24
|
+
color?: string;
|
25
|
+
/**
|
26
|
+
* 背景色
|
27
|
+
*/
|
28
|
+
bgcolor?: string;
|
29
|
+
/**
|
30
|
+
* 是否固定
|
31
|
+
*/
|
32
|
+
fixed?: boolean;
|
33
|
+
/**
|
34
|
+
* 等高的占位元素
|
35
|
+
*/
|
36
|
+
placeholder?: boolean;
|
37
|
+
/**
|
38
|
+
* 设置层级
|
39
|
+
*/
|
40
|
+
zIndex?: number;
|
41
|
+
/**
|
42
|
+
* 是否展示
|
43
|
+
*/
|
44
|
+
ishow?: boolean
|
45
|
+
}
|
46
|
+
|
47
|
+
withDefaults(defineProps<Props>(), {
|
48
|
+
custom: true,
|
49
|
+
isback: true,
|
50
|
+
title: '',
|
51
|
+
color: '#fff',
|
52
|
+
bgcolor: 'linear-gradient(180deg, #3E3A39 0%, #0D0D0D 100%)',
|
53
|
+
fixed: true,
|
54
|
+
placeholder: true,
|
55
|
+
zIndex: 2,
|
56
|
+
ishow: true
|
57
|
+
});
|
58
|
+
|
59
|
+
const navHeight = getNavbarHeihgt();
|
60
|
+
|
61
|
+
// 页面数量 当只有一个页面且不是主页面的时候 back 图标变成 home 图标
|
62
|
+
const pagesCount = computed(() => {
|
63
|
+
return getCurrentPages().length;
|
64
|
+
});
|
65
|
+
|
66
|
+
const pagesTitle = computed(() => {
|
67
|
+
const page = getCurrentPages()[pagesCount.value - 1];
|
68
|
+
let res = '';
|
69
|
+
for (const key in Pages) {
|
70
|
+
const val = Pages[key as keyof typeof Pages]?.slice(1);
|
71
|
+
const route = page.route;
|
72
|
+
if (route === val) {
|
73
|
+
res = key;
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
return res;
|
78
|
+
});
|
79
|
+
|
80
|
+
const handleLeftClick = () => {
|
81
|
+
if (pagesCount.value === 1) {
|
82
|
+
relaunch(Pages.首页);
|
83
|
+
} else {
|
84
|
+
back();
|
85
|
+
}
|
86
|
+
};
|
87
|
+
</script>
|
88
|
+
|
89
|
+
<template>
|
90
|
+
<view v-if="ishow">
|
91
|
+
<view class="y__navbar">
|
92
|
+
<view class="y__navbar-wrap flex items-center relative box-border left-0"
|
93
|
+
:class="{ 'custom': custom, 'fixed': fixed || placeholder }"
|
94
|
+
:style="{ 'height': navHeight.customBarH + 'px', 'padding-top': navHeight.statusBarH + 'px', 'background': bgcolor, 'color': color, 'z-index': zIndex }">
|
95
|
+
<!-- 返回 -->
|
96
|
+
<view class="action navbar-action__left" v-if="isback" @click="handleLeftClick">
|
97
|
+
<template v-if="$slots.back">
|
98
|
+
<slot name="back" />
|
99
|
+
</template>
|
100
|
+
<template v-else>
|
101
|
+
<!-- <image v-if="pagesCount === 1" src="../static/home.png" class="w20px h20px"></image>
|
102
|
+
<image v-else src="../static/back.png" class="w20px h20px"></image> -->
|
103
|
+
</template>
|
104
|
+
<slot name="backText" />
|
105
|
+
</view>
|
106
|
+
<slot name="left" />
|
107
|
+
|
108
|
+
<!-- //标题 -->
|
109
|
+
<view class="navbar-title absolute ">
|
110
|
+
<template v-if="$slots.title">
|
111
|
+
<slot name="title" />
|
112
|
+
</template>
|
113
|
+
<template v-else><text :style="{ 'color': color }">{{ title || pagesTitle }}</text></template>
|
114
|
+
</view>
|
115
|
+
|
116
|
+
<!-- //右侧 -->
|
117
|
+
<view class="action navbar-action__right">
|
118
|
+
<slot name="right" />
|
119
|
+
</view>
|
120
|
+
</view>
|
121
|
+
</view>
|
122
|
+
<view :style="{ 'height': navHeight.customBarH + 'px' }" v-if="placeholder"></view>
|
123
|
+
</view>
|
124
|
+
</template>
|
125
|
+
|
126
|
+
|
127
|
+
<style lang="scss" scoped>
|
128
|
+
.nvuefont {
|
129
|
+
font-family: nvueIcon;
|
130
|
+
}
|
131
|
+
|
132
|
+
.y__navbar {
|
133
|
+
/* #ifndef APP-NVUE */
|
134
|
+
display: -webkit-box;
|
135
|
+
display: -webkit-flex;
|
136
|
+
display: flex;
|
137
|
+
display: -ms-flexbox;
|
138
|
+
/* #endif */
|
139
|
+
flex-direction: row;
|
140
|
+
}
|
141
|
+
|
142
|
+
.y__navbar-wrap {
|
143
|
+
flex: 1;
|
144
|
+
flex-direction: row;
|
145
|
+
align-items: center;
|
146
|
+
background-color: #fff;
|
147
|
+
color: #333;
|
148
|
+
justify-content: space-between;
|
149
|
+
min-height: 90rpx;
|
150
|
+
position: relative;
|
151
|
+
z-index: 2021;
|
152
|
+
}
|
153
|
+
|
154
|
+
.y__navbar-wrap.custom {
|
155
|
+
/* #ifdef MP-WEIXIN */
|
156
|
+
padding-right: 200rpx;
|
157
|
+
/* #endif */
|
158
|
+
/* #ifdef MP-ALIPAY */
|
159
|
+
padding-right: 150rpx;
|
160
|
+
/* #endif */
|
161
|
+
}
|
162
|
+
|
163
|
+
.y__navbar-wrap.fixed {
|
164
|
+
/* #ifdef APP-NVUE */
|
165
|
+
left: 0;
|
166
|
+
right: 0;
|
167
|
+
/* #endif */
|
168
|
+
/* #ifndef APP-NVUE */
|
169
|
+
width: 100%;
|
170
|
+
/* #endif */
|
171
|
+
max-width: 750rpx;
|
172
|
+
position: fixed;
|
173
|
+
top: 0;
|
174
|
+
}
|
175
|
+
|
176
|
+
.y__navbar-wrap .action {
|
177
|
+
/* #ifndef APP-NVUE */
|
178
|
+
display: -webkit-box;
|
179
|
+
display: -webkit-flex;
|
180
|
+
display: flex;
|
181
|
+
display: -ms-flexbox;
|
182
|
+
height: 100%;
|
183
|
+
max-width: 100%;
|
184
|
+
/* #endif */
|
185
|
+
flex-direction: row;
|
186
|
+
align-items: center;
|
187
|
+
justify-content: center;
|
188
|
+
}
|
189
|
+
|
190
|
+
/*左侧*/
|
191
|
+
.navbar-action__left {
|
192
|
+
font-size: 32rpx;
|
193
|
+
padding: 0 24rpx;
|
194
|
+
}
|
195
|
+
|
196
|
+
.navbar-action__left .iconfont {
|
197
|
+
font-size: 42rpx;
|
198
|
+
}
|
199
|
+
|
200
|
+
/*标题*/
|
201
|
+
.y__navbar-wrap .navbar-title {
|
202
|
+
flex: 1;
|
203
|
+
font-size: 34rpx;
|
204
|
+
left: 50%;
|
205
|
+
transform: translateX(-50%);
|
206
|
+
}
|
207
|
+
|
208
|
+
// .y__navbar-wrap .navbar-title:first-child {
|
209
|
+
// font-size: 36rpx;
|
210
|
+
// margin-left: 24rpx;
|
211
|
+
// }
|
212
|
+
|
213
|
+
.y__navbar-wrap .navbar-title.center {
|
214
|
+
/* #ifdef APP-NVUE */
|
215
|
+
left: 0;
|
216
|
+
right: 0;
|
217
|
+
/* #endif */
|
218
|
+
/* #ifndef APP-NVUE */
|
219
|
+
width: 100%;
|
220
|
+
z-index: -1;
|
221
|
+
/* #endif */
|
222
|
+
align-items: center;
|
223
|
+
text-align: center;
|
224
|
+
text-overflow: ellipsis;
|
225
|
+
white-space: nowrap;
|
226
|
+
overflow: hidden;
|
227
|
+
position: absolute;
|
228
|
+
}
|
229
|
+
|
230
|
+
.y__navbar-wrap.custom .navbar-title.center {
|
231
|
+
/* #ifdef MP */
|
232
|
+
width: auto;
|
233
|
+
align-items: auto;
|
234
|
+
text-align: left;
|
235
|
+
position: static;
|
236
|
+
/* #endif */
|
237
|
+
}
|
238
|
+
|
239
|
+
/*搜索条*/
|
240
|
+
.navbar-action__search.action {
|
241
|
+
flex: 1;
|
242
|
+
justify-content: flex-start;
|
243
|
+
}
|
244
|
+
|
245
|
+
.navbar-action__right {
|
246
|
+
font-size: 32rpx;
|
247
|
+
padding-right: 24rpx;
|
248
|
+
}
|
249
|
+
|
250
|
+
.navbar-action__right .iconfont {
|
251
|
+
font-size: 42rpx;
|
252
|
+
}
|
253
|
+
</style>
|
@@ -0,0 +1,137 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-18 17:44:06
|
4
|
+
* @LastEditTime: 2023-07-19 10:34:41
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
import { Pages } from '@/config';
|
9
|
+
import { isHttpUrl } from '@bluesyoung/utils';
|
10
|
+
type Tabbar = {
|
11
|
+
selectedIconPath: string;
|
12
|
+
iconPath: string;
|
13
|
+
text: string;
|
14
|
+
pagePath: Pages;
|
15
|
+
};
|
16
|
+
|
17
|
+
withDefaults(defineProps<{ z?: number }>(), { z: 99 });
|
18
|
+
|
19
|
+
const list = ref<Tabbar[]>([
|
20
|
+
{
|
21
|
+
text: '首页',
|
22
|
+
iconPath: 'home',
|
23
|
+
selectedIconPath: 'home-filled',
|
24
|
+
pagePath: Pages.首页
|
25
|
+
},
|
26
|
+
{
|
27
|
+
text: '我的',
|
28
|
+
iconPath: 'contact',
|
29
|
+
selectedIconPath: 'contact-filled',
|
30
|
+
pagePath: Pages.个人中心
|
31
|
+
}
|
32
|
+
]);
|
33
|
+
|
34
|
+
const current = computed(() => {
|
35
|
+
const [page] = getCurrentPages();
|
36
|
+
const route = page.route;
|
37
|
+
const index = list.value.findIndex(path => path.pagePath === '/' + route);
|
38
|
+
return index;
|
39
|
+
});
|
40
|
+
|
41
|
+
const tabChange = (index: number) => {
|
42
|
+
if (index === current.value) {
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
tabbar(list.value[index].pagePath);
|
46
|
+
}
|
47
|
+
</script>
|
48
|
+
|
49
|
+
<template>
|
50
|
+
<view class="t-tabbar" :style="{ zIndex: z }">
|
51
|
+
<view @click="tabChange(index)" v-for="(item, index) in list" :key="index" class="t-tabbar__item"
|
52
|
+
:class="{ 't-bar__item_on': index === current }">
|
53
|
+
<view style="position: relative;display:inline-block;">
|
54
|
+
<image v-if="isHttpUrl(item.selectedIconPath)" :src="current === index ? item.selectedIconPath : item.iconPath"
|
55
|
+
class="t-tabbar__icon"></image>
|
56
|
+
<uni-icons :type="current === index ? item.selectedIconPath : item.iconPath" />
|
57
|
+
</view>
|
58
|
+
<view class="t-tabbar__label">{{ item.text }}</view>
|
59
|
+
</view>
|
60
|
+
</view>
|
61
|
+
</template>
|
62
|
+
|
63
|
+
<style lang="scss" scoped>
|
64
|
+
.t-tabbar {
|
65
|
+
display: flex;
|
66
|
+
// position: relative;
|
67
|
+
position: fixed;
|
68
|
+
bottom: 0;
|
69
|
+
left: 0;
|
70
|
+
right: 0;
|
71
|
+
background-color: #ffffff;
|
72
|
+
}
|
73
|
+
|
74
|
+
.t-tabbar:before {
|
75
|
+
content: ' ';
|
76
|
+
position: absolute;
|
77
|
+
left: 0;
|
78
|
+
top: 0;
|
79
|
+
right: 0;
|
80
|
+
height: 1px;
|
81
|
+
border-top: 1rpx solid rgba(0, 0, 0, 0.1);
|
82
|
+
color: rgba(0, 0, 0, 0.1);
|
83
|
+
}
|
84
|
+
|
85
|
+
.t-tabbar__item {
|
86
|
+
display: block;
|
87
|
+
flex: 1;
|
88
|
+
padding: 8px 0 4px;
|
89
|
+
padding-bottom: calc(8px + constant(safe-area-inset-bottom));
|
90
|
+
padding-bottom: calc(8px + env(safe-area-inset-bottom));
|
91
|
+
font-size: 0;
|
92
|
+
color: rgba(0, 0, 0, 0.5);
|
93
|
+
text-align: center;
|
94
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
95
|
+
}
|
96
|
+
|
97
|
+
.t-tabbar__item:first-child {
|
98
|
+
padding-left: constant(safe-area-inset-left);
|
99
|
+
padding-left: env(safe-area-inset-left);
|
100
|
+
}
|
101
|
+
|
102
|
+
.t-tabbar__item:last-child {
|
103
|
+
padding-right: constant(safe-area-inset-right);
|
104
|
+
padding-right: env(safe-area-inset-right);
|
105
|
+
}
|
106
|
+
|
107
|
+
.t-tabbar__item.t-bar__item_on .t-tabbar__icon,
|
108
|
+
.t-tabbar__item.t-bar__item_on .t-tabbar__icon>i,
|
109
|
+
.t-tabbar__item.t-bar__item_on .t-tabbar__label {
|
110
|
+
color: #e80d19;
|
111
|
+
}
|
112
|
+
|
113
|
+
.t-tabbar__icon {
|
114
|
+
display: inline-block;
|
115
|
+
width: 28px;
|
116
|
+
height: 28px;
|
117
|
+
margin-bottom: 2px;
|
118
|
+
}
|
119
|
+
|
120
|
+
i.t-tabbar__icon,
|
121
|
+
.t-tabbar__icon>i {
|
122
|
+
font-size: 24px;
|
123
|
+
color: rgba(0, 0, 0, 0.5);
|
124
|
+
}
|
125
|
+
|
126
|
+
.t-tabbar__icon image {
|
127
|
+
width: 100%;
|
128
|
+
height: 100%;
|
129
|
+
}
|
130
|
+
|
131
|
+
.t-tabbar__label {
|
132
|
+
color: #bfbfbf;
|
133
|
+
font-size: 10px;
|
134
|
+
line-height: 1.4;
|
135
|
+
height: 14px;
|
136
|
+
}
|
137
|
+
</style>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-18 18:04:48
|
4
|
+
* @LastEditTime: 2023-07-19 16:49:58
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
withDefaults(defineProps<{
|
9
|
+
scrollY?: boolean;
|
10
|
+
bg?: string;
|
11
|
+
top?: number | string;
|
12
|
+
}>(), {
|
13
|
+
scrollY: true,
|
14
|
+
bg: 'transparent',
|
15
|
+
top: 0
|
16
|
+
});
|
17
|
+
const bottom = getNavbarHeihgt().safeBottom;
|
18
|
+
</script>
|
19
|
+
|
20
|
+
<template>
|
21
|
+
<div class="flex flex-col" :style="{ height: `calc(100vh - ${top}px - ${bottom}px - 44px)` }">
|
22
|
+
<scroll-view :scroll-y="scrollY" class="flex-1" :style="{ backgroundColor: bg }">
|
23
|
+
<slot></slot>
|
24
|
+
</scroll-view>
|
25
|
+
<young-tabbar :z="999" />
|
26
|
+
</div>
|
27
|
+
</template>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-18 14:51:02
|
4
|
+
* @LastEditTime: 2023-07-19 12:17:58
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
* 模板消息的枚举
|
10
|
+
* todo: 按需替换
|
11
|
+
*/
|
12
|
+
export enum SubscribeMessage {
|
13
|
+
模板消息1 = '消息1xxxxxxxxxxxxxxxxxx',
|
14
|
+
模板消息2 = '消息2xxxxxxxxxxxxxxxxxx',
|
15
|
+
}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* 授权定位相关
|
19
|
+
*/
|
20
|
+
export enum AuthLocationEvents {
|
21
|
+
同意授权 = 'sure_location',
|
22
|
+
启用授权 = 'enable_location',
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* 存储键名
|
27
|
+
*/
|
28
|
+
export enum YoungStorageKeys {
|
29
|
+
位置信息 = 'location',
|
30
|
+
唯一标识 = 'uuid',
|
31
|
+
导航栏高度 = 'navbarHeight',
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* 页面地址枚举
|
36
|
+
*/
|
37
|
+
export enum Pages {
|
38
|
+
首页 = '/pages/index',
|
39
|
+
个人中心 = '/pages/my',
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* tabbar 页面
|
43
|
+
*/
|
44
|
+
export const TabbarArr = [Pages.首页, Pages.个人中心] as const;
|
45
|
+
|
46
|
+
export enum UIEvents { }
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-18 14:54:11
|
4
|
+
* @LastEditTime: 2023-07-18 14:54:11
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* 获取地图 API Key
|
9
|
+
* todo: 秘钥替换
|
10
|
+
*/
|
11
|
+
export const getMapApiKey = () => {
|
12
|
+
const MAP_API_KEY = '我是腾讯地图秘钥';
|
13
|
+
|
14
|
+
return MAP_API_KEY;
|
15
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-19 08:41:05
|
4
|
+
* @LastEditTime: 2023-07-19 15:46:37
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
/// <reference types="vite/client" />
|
8
|
+
|
9
|
+
declare module '*.vue' {
|
10
|
+
import { DefineComponent } from 'vue'
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
12
|
+
const component: DefineComponent<{}, {}, any>
|
13
|
+
export default component
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
* import.meta.env.[]
|
18
|
+
* 变量语法提示
|
19
|
+
*/
|
20
|
+
declare interface ImportMetaEnv {
|
21
|
+
/**
|
22
|
+
* 公共配置
|
23
|
+
*/
|
24
|
+
VITE_COMMON: string;
|
25
|
+
|
26
|
+
/**
|
27
|
+
* 微信小程序 appid
|
28
|
+
*/
|
29
|
+
VITE_APPID: string;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* 接口请求地址
|
33
|
+
*/
|
34
|
+
VITE_API_BASE_URL: string;
|
35
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-18 11:21:31
|
4
|
+
* @LastEditTime: 2023-07-18 14:07:16
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { createSSRApp } from 'vue';
|
8
|
+
import App from './App.vue';
|
9
|
+
import { setupStore } from './store';
|
10
|
+
|
11
|
+
import 'uno.css';
|
12
|
+
|
13
|
+
export function createApp() {
|
14
|
+
const app = createSSRApp(App);
|
15
|
+
setupStore(app);
|
16
|
+
|
17
|
+
return {
|
18
|
+
app,
|
19
|
+
};
|
20
|
+
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
{
|
2
|
+
"name": "",
|
3
|
+
"appid": "",
|
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
|
+
"ignoreUploadUnusedFiles": false,
|
57
|
+
"ignoreDevUnusedFiles": false
|
58
|
+
},
|
59
|
+
"usingComponents": true,
|
60
|
+
"requiredPrivateInfos": [
|
61
|
+
"getLocation",
|
62
|
+
"chooseLocation"
|
63
|
+
],
|
64
|
+
"permission": {
|
65
|
+
"scope.userLocation": {
|
66
|
+
"desc": "你的位置信息将用于获取附近的门店信息"
|
67
|
+
}
|
68
|
+
}
|
69
|
+
},
|
70
|
+
"mp-alipay": {
|
71
|
+
"usingComponents": true
|
72
|
+
},
|
73
|
+
"mp-baidu": {
|
74
|
+
"usingComponents": true
|
75
|
+
},
|
76
|
+
"mp-toutiao": {
|
77
|
+
"usingComponents": true
|
78
|
+
},
|
79
|
+
"uniStatistics": {
|
80
|
+
"enable": false
|
81
|
+
},
|
82
|
+
"vueVersion": "3"
|
83
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-18 11:23:36
|
4
|
+
* @LastEditTime: 2023-07-19 16:50:03
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
const testGet = async () => {
|
9
|
+
const res = await apis.get.getByUserName('BluesYoung-web');
|
10
|
+
console.log("🚀 ~ file: index.vue:12 ~ test ~ res:", res);
|
11
|
+
};
|
12
|
+
|
13
|
+
const testPost = async () => {
|
14
|
+
await apis.post.createRepo('BluesYoung-web');
|
15
|
+
};
|
16
|
+
const navBar = getNavbarHeihgt();
|
17
|
+
|
18
|
+
const loadingEl = ref();
|
19
|
+
|
20
|
+
onLoad(() => {
|
21
|
+
uni.hideTabBar();
|
22
|
+
});
|
23
|
+
|
24
|
+
onMounted(() => {
|
25
|
+
setTimeout(() => {
|
26
|
+
loadingEl.value?.stop();
|
27
|
+
}, 3e3);
|
28
|
+
});
|
29
|
+
</script>
|
30
|
+
|
31
|
+
<template>
|
32
|
+
<div>
|
33
|
+
<young-navbar isback />
|
34
|
+
<young-tabbar-layout :top="navBar.customBarH" bg="#F0F0F0">
|
35
|
+
<h1 class="text-32">我是页面</h1>
|
36
|
+
<view class="uni-primary">主色</view>
|
37
|
+
<view class="uni-success">成功色</view>
|
38
|
+
<view class="uni-warning">警告色</view>
|
39
|
+
<view class="uni-error">错误色</view>
|
40
|
+
|
41
|
+
<button @click="testGet">点我测试 Get 请求</button>
|
42
|
+
<button @click="testPost">点我测试 Post 请求</button>
|
43
|
+
|
44
|
+
<uni-card title="基础卡片" sub-title="副标题" extra="额外信息"
|
45
|
+
thumbnail="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png">
|
46
|
+
<text>这是一个带头像和双标题的基础卡片,此示例展示了一个完整的卡片。</text>
|
47
|
+
</uni-card>
|
48
|
+
</young-tabbar-layout>
|
49
|
+
|
50
|
+
<young-loading ref="loadingEl" />"
|
51
|
+
</div>
|
52
|
+
</template>
|