create-young-proj 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/template-nuxt-admin/package.json +5 -5
- package/template-nuxt-admin/yarn.lock +706 -854
- package/template-uni-app/auto-imports.d.ts +9 -6
- package/template-uni-app/custom-plugins/index.ts +1 -2
- package/template-uni-app/dist/dev/mp-weixin/apis/index.js +5 -6
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +2 -2
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +4 -4
- package/template-uni-app/dist/dev/mp-weixin/app.js +4 -5
- package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +1448 -2471
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.js +7 -8
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +7 -8
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +1 -2
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +4 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/index.js +4 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/project.config.json +1 -2
- package/template-uni-app/dist/dev/mp-weixin/project.private.config.json +6 -0
- package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +3 -1
- package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +10 -14
- package/template-uni-app/dist/dev/mp-weixin/utils/route.js +4 -6
- package/template-uni-app/dist/dev/mp-weixin/utils/system.js +4 -4
- package/template-uni-app/package.json +2 -3
- package/template-uni-app/pnpm-lock.yaml +154 -105
- package/template-uni-app/src/apis/index.ts +2 -2
- package/template-uni-app/src/apis/requests/get.ts +5 -5
- package/template-uni-app/src/apis/requests/post.ts +5 -5
- package/template-uni-app/vite.config.ts +2 -3
- package/template-uni-app/custom-plugins/polyfill.ts +0 -32
- package/template-uni-app/dist/dev/mp-weixin/apis/lib/index.js +0 -90
- package/template-uni-app/src/apis/lib/index.ts +0 -235
@@ -36,13 +36,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
36
36
|
}
|
37
37
|
return res;
|
38
38
|
});
|
39
|
-
|
40
|
-
if (pagesCount.value === 1)
|
39
|
+
function handleLeftClick() {
|
40
|
+
if (pagesCount.value === 1)
|
41
41
|
utils_route.relaunch(config_enum.Pages.首页);
|
42
|
-
|
42
|
+
else
|
43
43
|
utils_route.back();
|
44
|
-
|
45
|
-
};
|
44
|
+
}
|
46
45
|
return (_ctx, _cache) => {
|
47
46
|
return common_vendor.e({
|
48
47
|
a: __props.ishow
|
@@ -66,14 +65,14 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
66
65
|
}, {
|
67
66
|
k: __props.custom ? 1 : "",
|
68
67
|
l: __props.fixed || __props.placeholder ? 1 : "",
|
69
|
-
m: common_vendor.unref(navHeight).customBarH
|
70
|
-
n: common_vendor.unref(navHeight).statusBarH
|
68
|
+
m: `${common_vendor.unref(navHeight).customBarH}px`,
|
69
|
+
n: `${common_vendor.unref(navHeight).statusBarH}px`,
|
71
70
|
o: __props.bgcolor,
|
72
71
|
p: __props.color,
|
73
72
|
q: __props.zIndex,
|
74
73
|
r: __props.placeholder
|
75
74
|
}, __props.placeholder ? {
|
76
|
-
s: common_vendor.unref(navHeight).customBarH
|
75
|
+
s: `${common_vendor.unref(navHeight).customBarH}px`
|
77
76
|
} : {}) : {});
|
78
77
|
};
|
79
78
|
}
|
@@ -1 +1 @@
|
|
1
|
-
<view wx:if="{{a}}" class="data-v-1047ead9"><view class="y__navbar data-v-1047ead9"><view class="{{['y__navbar-wrap', 'flex', 'items-center', 'relative', 'box-border', 'left-0', 'data-v-1047ead9', k && 'custom', l && 'fixed']}}" style="{{'height:' + m + ';' + ('padding-top:' + n) + ';' + ('background:' + o) + ';' + ('color:' + p) + ';' + ('z-index:' + q)}}"><view wx:if="{{b}}" class="action navbar-action__left data-v-1047ead9" bindtap="{{g}}"><block wx:if="{{c}}"><slot name="back"/></block><block wx:else class="v-else"><image wx:if="{{d}}" src="{{e}}" class="w20px h20px data-v-1047ead9"
|
1
|
+
<view wx:if="{{a}}" class="data-v-1047ead9"><view class="y__navbar data-v-1047ead9"><view class="{{['y__navbar-wrap', 'flex', 'items-center', 'relative', 'box-border', 'left-0', 'data-v-1047ead9', k && 'custom', l && 'fixed']}}" style="{{'height:' + m + ';' + ('padding-top:' + n) + ';' + ('background:' + o) + ';' + ('color:' + p) + ';' + ('z-index:' + q)}}"><view wx:if="{{b}}" class="action navbar-action__left data-v-1047ead9" bindtap="{{g}}"><block wx:if="{{c}}"><slot name="back"/></block><block wx:else class="v-else"><image wx:if="{{d}}" src="{{e}}" class="w20px h20px data-v-1047ead9"/><image wx:else src="{{f}}" class="w20px h20px v-else data-v-1047ead9"/></block><slot name="backText"/></view><slot name="left"/><view class="navbar-title absolute data-v-1047ead9"><block wx:if="{{h}}"><slot name="title"/></block><block wx:else class="v-else"><text class="data-v-1047ead9" style="{{'color:' + j}}">{{i}}</text></block></view><view class="action navbar-action__right data-v-1047ead9"><slot name="right"/></view></view></view><view wx:if="{{r}}" class="data-v-1047ead9" style="{{'height:' + s}}"/></view>
|
@@ -26,15 +26,14 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
26
26
|
const current = common_vendor.computed(() => {
|
27
27
|
const [page] = getCurrentPages();
|
28
28
|
const route = page.route;
|
29
|
-
const index = list.value.findIndex((path) => path.pagePath ===
|
29
|
+
const index = list.value.findIndex((path) => path.pagePath === `/${route}`);
|
30
30
|
return index;
|
31
31
|
});
|
32
|
-
|
33
|
-
if (index === current.value)
|
32
|
+
function tabChange(index) {
|
33
|
+
if (index === current.value)
|
34
34
|
return;
|
35
|
-
}
|
36
35
|
utils_route.tabbar(list.value[index].pagePath);
|
37
|
-
}
|
36
|
+
}
|
38
37
|
common_vendor.index.hideTabBar();
|
39
38
|
return (_ctx, _cache) => {
|
40
39
|
return {
|
@@ -42,9 +41,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
42
41
|
return {
|
43
42
|
a: common_vendor.unref(current) === index ? item.selectedIconPath : item.iconPath,
|
44
43
|
b: common_vendor.t(item.text),
|
45
|
-
c:
|
46
|
-
d: index,
|
47
|
-
e:
|
44
|
+
c: index,
|
45
|
+
d: index === common_vendor.unref(current) ? 1 : "",
|
46
|
+
e: common_vendor.o(($event) => tabChange(index), index)
|
48
47
|
};
|
49
48
|
}),
|
50
49
|
b: __props.z
|
@@ -1 +1 @@
|
|
1
|
-
<view class="t-tabbar data-v-4df9e9ce" style="{{'z-index:' + b}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="
|
1
|
+
<view class="t-tabbar data-v-4df9e9ce" style="{{'z-index:' + b}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="c" class="{{['t-tabbar__item', 'data-v-4df9e9ce', item.d && 't-bar__item_on']}}" bindtap="{{item.e}}"><view class="data-v-4df9e9ce" style="position:relative;display:inline-block"><image src="{{item.a}}" class="t-tabbar__icon data-v-4df9e9ce"/></view><view class="t-tabbar__label data-v-4df9e9ce">{{item.b}}</view></view></view>
|
@@ -17,9 +17,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
17
17
|
common_vendor.onLoad(() => {
|
18
18
|
const [page] = getCurrentPages();
|
19
19
|
const pageConf = pagesInfo.value.find((p) => p.path === page.route);
|
20
|
-
if (pageConf && pageConf.needLogin)
|
20
|
+
if (pageConf && pageConf.needLogin)
|
21
21
|
console.log("todo: 这个页面需要登录,进行登录条件判断");
|
22
|
-
}
|
23
22
|
});
|
24
23
|
return (_ctx, _cache) => {
|
25
24
|
return {};
|
@@ -1 +1 @@
|
|
1
|
-
<young-navbar wx:if="{{a}}" u-i="199e550e-0" bind:__l="__l" u-p="{{b}}"/><young-loading u-i="199e550e-1" bind:__l="__l"/><young-loading-mini u-i="199e550e-2" bind:__l="__l"/><scroll-view scroll-y class="flex flex-col bg-transparent scroll-y" style="{{'height:' + c}}"><slot
|
1
|
+
<young-navbar wx:if="{{a}}" u-i="199e550e-0" bind:__l="__l" u-p="{{b}}"/><young-loading u-i="199e550e-1" bind:__l="__l"/><young-loading-mini u-i="199e550e-2" bind:__l="__l"/><scroll-view scroll-y class="flex flex-col bg-transparent scroll-y" style="{{'height:' + c}}"><slot/></scroll-view><young-tabbar wx:if="{{d}}" u-i="199e550e-3" bind:__l="__l" u-p="{{d}}"/>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
const common_vendor = require("../../common/vendor.js");
|
3
3
|
const apis_index = require("../../apis/index.js");
|
4
|
-
require("../../apis/lib/index.js");
|
5
4
|
require("../../apis/requests/get.js");
|
6
5
|
require("../../apis/requests/post.js");
|
7
6
|
require("../../utils/modal.js");
|
@@ -19,13 +18,13 @@ if (!Math) {
|
|
19
18
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
20
19
|
__name: "index",
|
21
20
|
setup(__props) {
|
22
|
-
|
21
|
+
async function testGet() {
|
23
22
|
const res = await apis_index.apis.get.getByUserName("BluesYoung-web");
|
24
23
|
console.log("🚀 ~ file: index.vue:12 ~ test ~ res:", res);
|
25
|
-
}
|
26
|
-
|
24
|
+
}
|
25
|
+
async function testPost() {
|
27
26
|
await apis_index.apis.post.createRepo("BluesYoung-web");
|
28
|
-
}
|
27
|
+
}
|
29
28
|
return (_ctx, _cache) => {
|
30
29
|
return {
|
31
30
|
a: common_vendor.o(testGet),
|
@@ -1 +1 @@
|
|
1
|
-
<layout-default-uni u-s="{{['d']}}" u-i="8c384434-0" bind:__l="__l"><young-navbar u-i="8c384434-1,8c384434-0" bind:__l="__l"/><view class="text-32"
|
1
|
+
<layout-default-uni u-s="{{['d']}}" u-i="8c384434-0" bind:__l="__l"><young-navbar u-i="8c384434-1,8c384434-0" bind:__l="__l"/><view class="text-32"> 我是子页面 demo </view><button bindtap="{{a}}"> 点我测试 Get 请求 </button><button bindtap="{{b}}"> 点我测试 Post 请求 </button></layout-default-uni>
|
@@ -4,7 +4,6 @@ const config_enum = require("../config/enum.js");
|
|
4
4
|
const common_vendor = require("../common/vendor.js");
|
5
5
|
const apis_index = require("../apis/index.js");
|
6
6
|
const store_system = require("../store/system.js");
|
7
|
-
require("../apis/lib/index.js");
|
8
7
|
require("../apis/requests/get.js");
|
9
8
|
require("../apis/requests/post.js");
|
10
9
|
require("../utils/modal.js");
|
@@ -20,13 +19,13 @@ if (!Math) {
|
|
20
19
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
21
20
|
__name: "index",
|
22
21
|
setup(__props) {
|
23
|
-
|
22
|
+
async function testGet() {
|
24
23
|
const res = await apis_index.apis.get.getByUserName("BluesYoung-web");
|
25
24
|
console.log("🚀 ~ file: index.vue:12 ~ test ~ res:", res);
|
26
|
-
}
|
27
|
-
|
25
|
+
}
|
26
|
+
async function testPost() {
|
28
27
|
await apis_index.apis.post.createRepo("BluesYoung-web");
|
29
|
-
}
|
28
|
+
}
|
30
29
|
const { fullscreenLoading } = common_vendor.storeToRefs(store_system.useHttpLoading());
|
31
30
|
fullscreenLoading.value = true;
|
32
31
|
setTimeout(() => {
|
@@ -1 +1 @@
|
|
1
|
-
<layout-tabbar-uni u-s="{{['d']}}" u-i="1106be7c-0" bind:__l="__l"><view class="text-32"
|
1
|
+
<layout-tabbar-uni u-s="{{['d']}}" u-i="1106be7c-0" bind:__l="__l"><view class="text-32"> 我是页面 </view><view class="uni-primary"> 主色 </view><view class="uni-success"> 成功色 </view><view class="uni-warning"> 警告色 </view><view class="uni-error"> 错误色 </view><button bindtap="{{a}}"> 点我测试 Get 请求 </button><button bindtap="{{b}}"> 点我测试 Post 请求 </button><uni-card wx:if="{{d}}" u-s="{{['d']}}" bindclick="{{c}}" u-i="1106be7c-1,1106be7c-0" bind:__l="__l" u-p="{{d}}"><text>这是一个带头像和双标题的基础卡片,此示例展示了一个完整的卡片。</text></uni-card></layout-tabbar-uni>
|
@@ -1 +1 @@
|
|
1
|
-
<layout-tabbar-uni u-s="{{['d']}}" u-i="2d9e2a28-0" bind:__l="__l"><view class="text-32"
|
1
|
+
<layout-tabbar-uni u-s="{{['d']}}" u-i="2d9e2a28-0" bind:__l="__l"><view class="text-32"> 我是个人中心 </view></layout-tabbar-uni>
|
@@ -2,7 +2,9 @@
|
|
2
2
|
const common_vendor = require("../../common/vendor.js");
|
3
3
|
const config_enum = require("../../config/enum.js");
|
4
4
|
const getUuid = () => common_vendor.index.getStorageSync(config_enum.YoungStorageKeys.唯一标识);
|
5
|
-
|
5
|
+
function setUuid() {
|
6
|
+
return common_vendor.index.setStorageSync(config_enum.YoungStorageKeys.唯一标识, common_vendor.oe() + common_vendor.oe() + common_vendor.oe() + common_vendor.oe());
|
7
|
+
}
|
6
8
|
const setNavbarHeihgt = (v) => common_vendor.index.setStorageSync(config_enum.YoungStorageKeys.导航栏高度, v);
|
7
9
|
const getNavbarHeihgt = () => common_vendor.index.getStorageSync(config_enum.YoungStorageKeys.导航栏高度);
|
8
10
|
exports.getNavbarHeihgt = getNavbarHeihgt;
|
@@ -4,9 +4,8 @@ const store_system = require("../store/system.js");
|
|
4
4
|
let loadingCount = 0;
|
5
5
|
function showLoading(title = "加载中...", mask = true) {
|
6
6
|
const { fullscreenLoading, smallLoading } = common_vendor.storeToRefs(store_system.useHttpLoading());
|
7
|
-
if (fullscreenLoading.value)
|
7
|
+
if (fullscreenLoading.value)
|
8
8
|
return;
|
9
|
-
}
|
10
9
|
loadingCount++;
|
11
10
|
if ({}.VITE_CUSTOM_LOADING) {
|
12
11
|
smallLoading.value = true;
|
@@ -19,22 +18,21 @@ function showLoading(title = "加载中...", mask = true) {
|
|
19
18
|
}
|
20
19
|
function hideLoading() {
|
21
20
|
const { smallLoading, fullscreenLoading } = common_vendor.storeToRefs(store_system.useHttpLoading());
|
22
|
-
if (fullscreenLoading.value)
|
21
|
+
if (fullscreenLoading.value)
|
23
22
|
return;
|
24
|
-
}
|
25
23
|
if (--loadingCount === 0) {
|
26
|
-
if ({}.VITE_CUSTOM_LOADING)
|
24
|
+
if ({}.VITE_CUSTOM_LOADING)
|
27
25
|
smallLoading.value = false;
|
28
|
-
|
26
|
+
else
|
29
27
|
common_vendor.index.hideLoading();
|
30
|
-
}
|
31
28
|
}
|
32
29
|
}
|
33
30
|
let hasModel = false;
|
34
31
|
const modalPage = /* @__PURE__ */ new Set();
|
35
32
|
async function showModal(options) {
|
33
|
+
var _a;
|
36
34
|
const page = getCurrentPages();
|
37
|
-
const route = page[page.length - 1].route || "";
|
35
|
+
const route = ((_a = page[page.length - 1]) == null ? void 0 : _a.route) || "";
|
38
36
|
if (modalPage.has(route)) {
|
39
37
|
hasModel = true;
|
40
38
|
} else {
|
@@ -42,9 +40,8 @@ async function showModal(options) {
|
|
42
40
|
modalPage.add(route);
|
43
41
|
}
|
44
42
|
const { title = "提示", showCancel = true, complete } = options;
|
45
|
-
while (hasModel)
|
46
|
-
await common_vendor.
|
47
|
-
}
|
43
|
+
while (hasModel)
|
44
|
+
await common_vendor.ee(0.5);
|
48
45
|
return new Promise((resolve, reject) => {
|
49
46
|
hasModel = true;
|
50
47
|
common_vendor.index.showModal({
|
@@ -53,11 +50,10 @@ async function showModal(options) {
|
|
53
50
|
success(res) {
|
54
51
|
hasModel = false;
|
55
52
|
modalPage.delete(route);
|
56
|
-
if (res.confirm)
|
53
|
+
if (res.confirm)
|
57
54
|
resolve(res);
|
58
|
-
|
55
|
+
else if (res.cancel)
|
59
56
|
reject(res);
|
60
|
-
}
|
61
57
|
},
|
62
58
|
fail(err) {
|
63
59
|
hasModel = false;
|
@@ -1,17 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
const common_vendor = require("../common/vendor.js");
|
3
3
|
const config_enum = require("../config/enum.js");
|
4
|
-
|
4
|
+
function params2Url(params, encode = false) {
|
5
5
|
const arr = [];
|
6
|
-
for (const key in params)
|
6
|
+
for (const key in params)
|
7
7
|
arr.push(`${key}=${encode ? encodeURIComponent(params[key]) : params[key]}`);
|
8
|
-
}
|
9
8
|
return arr.join("&");
|
10
|
-
}
|
9
|
+
}
|
11
10
|
function route({ type, url, params, delta = 1, encode }) {
|
12
|
-
if (type !== "navigateBack" && params)
|
11
|
+
if (type !== "navigateBack" && params)
|
13
12
|
url = `${url}?${params2Url(params, encode)}`;
|
14
|
-
}
|
15
13
|
switch (type) {
|
16
14
|
case "navigateTo":
|
17
15
|
common_vendor.index.navigateTo({
|
@@ -2,16 +2,16 @@
|
|
2
2
|
const common_vendor = require("../common/vendor.js");
|
3
3
|
const store_system = require("../store/system.js");
|
4
4
|
const store_local_index = require("../store/local/index.js");
|
5
|
-
|
5
|
+
function getSystemInfo() {
|
6
6
|
const { systemInfo } = common_vendor.storeToRefs(store_system.useSystemInfo());
|
7
7
|
return new Promise((_resolve) => {
|
8
8
|
common_vendor.index.getSystemInfo({
|
9
9
|
success: (e) => {
|
10
10
|
console.log(e, "getSystemInfo");
|
11
11
|
systemInfo.value = e;
|
12
|
-
|
12
|
+
const statusBar = e.statusBarHeight || 0;
|
13
13
|
let customBar;
|
14
|
-
|
14
|
+
const menu = common_vendor.index.getMenuButtonBoundingClientRect();
|
15
15
|
customBar = menu.bottom + menu.top - statusBar;
|
16
16
|
const safeBottom = e.screenHeight - (e.safeArea ? e.safeArea.height + e.safeArea.top : 0);
|
17
17
|
store_local_index.setNavbarHeihgt({
|
@@ -23,5 +23,5 @@ const getSystemInfo = () => {
|
|
23
23
|
}
|
24
24
|
});
|
25
25
|
});
|
26
|
-
}
|
26
|
+
}
|
27
27
|
exports.getSystemInfo = getSystemInfo;
|
@@ -44,6 +44,7 @@
|
|
44
44
|
"build:quickapp-webview-union": "uni build -p quickapp-webview-union"
|
45
45
|
},
|
46
46
|
"dependencies": {
|
47
|
+
"@bluesyoung/http": "^1.0.1",
|
47
48
|
"@bluesyoung/utils": "^0.2.1",
|
48
49
|
"@dcloudio/uni-app": "3.0.0-3080720230703001",
|
49
50
|
"@dcloudio/uni-app-plus": "3.0.0-3080720230703001",
|
@@ -58,7 +59,6 @@
|
|
58
59
|
"@dcloudio/uni-mp-toutiao": "3.0.0-3080720230703001",
|
59
60
|
"@dcloudio/uni-mp-weixin": "3.0.0-3080720230703001",
|
60
61
|
"@dcloudio/uni-quickapp-webview": "3.0.0-3080720230703001",
|
61
|
-
"@uni-helper/axios-adapter": "^1.4.0",
|
62
62
|
"dayjs": "^1.11.9",
|
63
63
|
"js-base64": "^3.7.5",
|
64
64
|
"lodash": "^4.17.21",
|
@@ -73,7 +73,7 @@
|
|
73
73
|
"vue": "^3.2.45"
|
74
74
|
},
|
75
75
|
"devDependencies": {
|
76
|
-
"@antfu/eslint-config": "^0.
|
76
|
+
"@antfu/eslint-config": "^0.42.0",
|
77
77
|
"@dcloudio/types": "^3.3.2",
|
78
78
|
"@dcloudio/uni-automator": "3.0.0-3080720230703001",
|
79
79
|
"@dcloudio/uni-cli-shared": "3.0.0-3080720230703001",
|
@@ -89,7 +89,6 @@
|
|
89
89
|
"@uni-helper/vite-plugin-uni-pages": "^0.2.3",
|
90
90
|
"@uni-helper/volar-service-uni-pages": "^0.2.3",
|
91
91
|
"@vue/tsconfig": "^0.1.3",
|
92
|
-
"axios": "^1.4.0",
|
93
92
|
"eslint": "^8.48.0",
|
94
93
|
"lint-staged": "^14.0.1",
|
95
94
|
"simple-git-hooks": "^2.9.0",
|